summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-05-04 09:57:14 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-05-04 09:57:14 +0000
commit133617cb13c22e0b16119d69b257cd62602e0138 (patch)
tree9841efa581b849f912dc51dc06409a88e3a47260
parenta65886720475301b29e817997044a3778a8365f4 (diff)
downloadbrdo-133617cb13c22e0b16119d69b257cd62602e0138.tar.gz
brdo-133617cb13c22e0b16119d69b257cd62602e0138.tar.bz2
#57834 by chx, Replace theme_weight with more appropriate process_weight
-rw-r--r--includes/form.inc14
-rw-r--r--modules/system.module2
-rw-r--r--modules/system/system.module2
3 files changed, 6 insertions, 12 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 16c49f265..92d25f4cc 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1071,22 +1071,16 @@ function theme_password($element) {
}
/**
- * Format a weight selection menu.
- *
- * @param $element
- * An associative array containing the properties of the element.
- * Properties used: title, delta, description
- * @return
- * A themed HTML string representing the form.
+ * Expand weight elements into selects.
*/
-function theme_weight($element) {
+function process_weight($element) {
for ($n = (-1 * $element['#delta']); $n <= $element['#delta']; $n++) {
$weights[$n] = $n;
}
$element['#options'] = $weights;
$element['#type'] = 'select';
-
- return form_render($element);
+ $element['#is_weight'] = TRUE;
+ return $element;
}
/**
diff --git a/modules/system.module b/modules/system.module
index b243d01fd..5a6a2e3f4 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -72,7 +72,7 @@ function system_elements() {
$type['radio'] = array('#input' => TRUE);
$type['checkboxes'] = array('#input' => TRUE, '#process' => array('expand_checkboxes' => array()), '#tree' => TRUE);
$type['select'] = array('#input' => TRUE);
- $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0);
+ $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0, '#process' => array('process_weight' => array()));
$type['date'] = array('#input' => TRUE, '#process' => array('expand_date' => array()));
$type['file'] = array('#input' => TRUE, '#size' => 60);
diff --git a/modules/system/system.module b/modules/system/system.module
index b243d01fd..5a6a2e3f4 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -72,7 +72,7 @@ function system_elements() {
$type['radio'] = array('#input' => TRUE);
$type['checkboxes'] = array('#input' => TRUE, '#process' => array('expand_checkboxes' => array()), '#tree' => TRUE);
$type['select'] = array('#input' => TRUE);
- $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0);
+ $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0, '#process' => array('process_weight' => array()));
$type['date'] = array('#input' => TRUE, '#process' => array('expand_date' => array()));
$type['file'] = array('#input' => TRUE, '#size' => 60);