summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2008-04-01 20:05:15 (GMT)
committerDries Buytaert2008-04-01 20:05:15 (GMT)
commit59211a9cb5220e898ec360ae5131792bb12deda2 (patch)
tree7af9966d4b183d7e696e709d522bca6466a7f182
parentc3d113aa90ed74237373061e119beeb04873f64d (diff)
- Patch #241369 by kkaefer: code style improvements for easier patching later.
-rw-r--r--modules/system/system.module169
1 files changed, 143 insertions, 26 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index b499b46..82d74a4 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -171,32 +171,149 @@ function system_perm() {
*/
function system_elements() {
// Top level form
- $type['form'] = array('#method' => 'post', '#action' => request_uri());
-
- // Inputs
- $type['submit'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#executes_submit_callback' => TRUE, '#process' => array('form_expand_ahah'));
- $type['button'] = array('#input' => TRUE, '#name' => 'op', '#button_type' => 'submit', '#executes_submit_callback' => FALSE, '#process' => array('form_expand_ahah'));
- $type['image_button'] = array('#input' => TRUE, '#button_type' => 'submit', '#executes_submit_callback' => TRUE, '#process' => array('form_expand_ahah'), '#return_value' => TRUE, '#has_garbage_value' => TRUE, '#src' => NULL);
- $type['textfield'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#autocomplete_path' => FALSE, '#process' => array('form_expand_ahah'));
- $type['password'] = array('#input' => TRUE, '#size' => 60, '#maxlength' => 128, '#process' => array('form_expand_ahah'));
- $type['password_confirm'] = array('#input' => TRUE, '#process' => array('expand_password_confirm'));
- $type['textarea'] = array('#input' => TRUE, '#cols' => 60, '#rows' => 5, '#resizable' => TRUE, '#process' => array('form_expand_ahah'));
- $type['radios'] = array('#input' => TRUE, '#process' => array('expand_radios'));
- $type['radio'] = array('#input' => TRUE, '#default_value' => NULL, '#process' => array('form_expand_ahah'));
- $type['checkboxes'] = array('#input' => TRUE, '#process' => array('expand_checkboxes'), '#tree' => TRUE);
- $type['checkbox'] = array('#input' => TRUE, '#return_value' => 1, '#process' => array('form_expand_ahah'));
- $type['select'] = array('#input' => TRUE, '#size' => 0, '#multiple' => FALSE, '#process' => array('form_expand_ahah'));
- $type['weight'] = array('#input' => TRUE, '#delta' => 10, '#default_value' => 0, '#process' => array('process_weight', 'form_expand_ahah'));
- $type['date'] = array('#input' => TRUE, '#process' => array('expand_date'), '#element_validate' => array('date_validate'));
- $type['file'] = array('#input' => TRUE, '#size' => 60);
-
- // Form structure
- $type['item'] = array('#value' => '');
- $type['hidden'] = array('#input' => TRUE, '#process' => array('form_expand_ahah'));
- $type['value'] = array('#input' => TRUE);
- $type['markup'] = array('#prefix' => '', '#suffix' => '');
- $type['fieldset'] = array('#collapsible' => FALSE, '#collapsed' => FALSE, '#value' => NULL, '#process' => array('form_expand_ahah'));
- $type['token'] = array('#input' => TRUE);
+ $type['form'] = array(
+ '#method' => 'post',
+ '#action' => request_uri(),
+ );
+
+ /**
+ * Input elements.
+ */
+ $type['submit'] = array(
+ '#input' => TRUE,
+ '#name' => 'op',
+ '#button_type' => 'submit',
+ '#executes_submit_callback' => TRUE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['button'] = array(
+ '#input' => TRUE,
+ '#name' => 'op',
+ '#button_type' => 'submit',
+ '#executes_submit_callback' => FALSE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['image_button'] = array(
+ '#input' => TRUE,
+ '#button_type' => 'submit',
+ '#executes_submit_callback' => TRUE,
+ '#process' => array('form_expand_ahah'),
+ '#return_value' => TRUE,
+ '#has_garbage_value' => TRUE,
+ '#src' => NULL,
+ );
+
+ $type['textfield'] = array(
+ '#input' => TRUE,
+ '#size' => 60,
+ '#maxlength' => 128,
+ '#autocomplete_path' => FALSE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['password'] = array(
+ '#input' => TRUE,
+ '#size' => 60,
+ '#maxlength' => 128,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['password_confirm'] = array(
+ '#input' => TRUE,
+ '#process' => array('expand_password_confirm'),
+ );
+
+ $type['textarea'] = array(
+ '#input' => TRUE,
+ '#cols' => 60,
+ '#rows' => 5,
+ '#resizable' => TRUE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['radios'] = array(
+ '#input' => TRUE,
+ '#process' => array('expand_radios'),
+ );
+
+ $type['radio'] = array(
+ '#input' => TRUE,
+ '#default_value' => NULL,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['checkboxes'] = array(
+ '#input' => TRUE,
+ '#tree' => TRUE,
+ '#process' => array('expand_checkboxes'),
+ );
+
+ $type['checkbox'] = array(
+ '#input' => TRUE,
+ '#return_value' => 1,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['select'] = array(
+ '#input' => TRUE,
+ '#size' => 0,
+ '#multiple' => FALSE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['weight'] = array(
+ '#input' => TRUE,
+ '#delta' => 10,
+ '#default_value' => 0,
+ '#process' => array('process_weight', 'form_expand_ahah'),
+ );
+
+ $type['date'] = array(
+ '#input' => TRUE,
+ '#element_validate' => array('date_validate'),
+ '#process' => array('expand_date'),
+ );
+
+ $type['file'] = array(
+ '#input' => TRUE,
+ '#size' => 60,
+ );
+
+
+ /**
+ * Form structure.
+ */
+ $type['item'] = array(
+ '#value' => '',
+ );
+
+ $type['hidden'] = array(
+ '#input' => TRUE,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['value'] = array(
+ '#input' => TRUE,
+ );
+
+ $type['markup'] = array(
+ '#prefix' => '',
+ '#suffix' => '',
+ );
+
+ $type['fieldset'] = array(
+ '#collapsible' => FALSE,
+ '#collapsed' => FALSE,
+ '#value' => NULL,
+ '#process' => array('form_expand_ahah'),
+ );
+
+ $type['token'] = array(
+ '#input' => TRUE,
+ );
+
return $type;
}