diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-18 00:12:48 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-09-18 00:12:48 +0000 |
commit | df02fa3ca46e16974192de77580762188ad47f49 (patch) | |
tree | 91b2354aae786d7b187028dbc61fb3893b04ae64 /modules/system | |
parent | e18feedfdb429e35173b85fc7182aadabee0a166 (diff) | |
download | brdo-df02fa3ca46e16974192de77580762188ad47f49.tar.gz brdo-df02fa3ca46e16974192de77580762188ad47f49.tar.bz2 |
#571086 by sun and merlinofchaos: Added a 'wrapper callback' that executes
before a form builder function, to facilitate common form elements. Clean-up
from form_builder changes from CTools patch. Has nice side-benefit of making
all form functions' signatures consistent.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/image.gd.inc | 1 | ||||
-rw-r--r-- | modules/system/system.admin.inc | 16 | ||||
-rw-r--r-- | modules/system/system.module | 8 | ||||
-rw-r--r-- | modules/system/system.test | 2 |
4 files changed, 9 insertions, 18 deletions
diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc index e6c70e76b..d1b888e41 100644 --- a/modules/system/image.gd.inc +++ b/modules/system/image.gd.inc @@ -16,7 +16,6 @@ */ function image_gd_settings() { if (image_gd_check_settings()) { - $form = array(); $form['status'] = array( '#markup' => t('The GD toolkit is installed and working properly.') ); diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index b4aa10446..d7c380f9d 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -378,7 +378,7 @@ function system_themes_form_submit($form, &$form_state) { * @ingroup forms * @see system_theme_settings_submit() */ -function system_theme_settings(&$form_state, $key = '') { +function system_theme_settings($form, &$form_state, $key = '') { $directory_path = file_directory_path(); if (!file_prepare_directory($directory_path, FILE_CREATE_DIRECTORY)) { drupal_set_message(t('The directory %directory does not exist or is not writable.', array('%directory' => $directory_path)), 'warning'); @@ -633,7 +633,7 @@ function _system_is_incompatible(&$incompatible, $files, $file) { * @return * The form array. */ -function system_modules($form_state = array()) { +function system_modules($form, $form_state = array()) { // Get current list of modules. $files = system_get_module_data(); @@ -834,7 +834,6 @@ function _system_modules_build_row($info, $extra) { * @ingroup forms */ function system_modules_confirm_form($modules, $storage) { - $form = array(); $items = array(); $form['validation_modules'] = array('#type' => 'value', '#value' => $modules); @@ -1034,7 +1033,7 @@ function system_modules_submit($form, &$form_state) { * @return * A form array representing the currently disabled modules. */ -function system_modules_uninstall($form_state = NULL) { +function system_modules_uninstall($form, $form_state = NULL) { // Make sure the install API is available. include_once DRUPAL_ROOT . '/includes/install.inc'; @@ -1043,12 +1042,9 @@ function system_modules_uninstall($form_state = NULL) { return $confirm_form; } - $form = array(); - // Pull all disabled modules from the system table. $disabled_modules = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 0 AND schema_version > :schema ORDER BY name", array(':schema' => SCHEMA_UNINSTALLED)); foreach ($disabled_modules as $module) { - // Grab the module info $info = unserialize($module->info); @@ -1186,7 +1182,7 @@ function system_ip_blocking() { * @see system_ip_blocking_form_validate() * @see system_ip_blocking_form_submit() */ -function system_ip_blocking_form($form_state) { +function system_ip_blocking_form($form, $form_state) { $form['ip'] = array( '#title' => t('IP address'), '#type' => 'textfield', @@ -1232,7 +1228,7 @@ function system_ip_blocking_form_submit($form, &$form_state) { * * @see system_ip_blocking_delete_submit() */ -function system_ip_blocking_delete(&$form_state, $iid) { +function system_ip_blocking_delete($form, &$form_state, $iid) { $form['blocked_ip'] = array( '#type' => 'value', '#value' => $iid, @@ -1826,7 +1822,7 @@ function system_site_maintenance_mode() { * @ingroup forms * @see system_settings_form() */ -function system_clean_url_settings() { +function system_clean_url_settings($form) { global $base_url; // When accessing this form using a non-clean URL, allow a re-check to make diff --git a/modules/system/system.module b/modules/system/system.module index 5204141c0..867ec7213 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1392,8 +1392,6 @@ function system_filetransfer_backend_form_ssh() { * Helper function because SSH and FTP backends share the same elements */ function _system_filetransfer_backend_form_common() { - $form = array(); - $form['hostname'] = array ( '#type' => 'textfield', '#title' => t('Host'), @@ -2536,7 +2534,7 @@ function system_actions_manage() { * @return * Form definition. */ -function system_actions_manage_form($form_state, $options = array()) { +function system_actions_manage_form($form, $form_state, $options = array()) { $form['parent'] = array( '#type' => 'fieldset', '#title' => t('Make a new advanced action available'), @@ -2582,7 +2580,7 @@ function system_actions_manage_form_submit($form, &$form_state) { * @return * Form definition. */ -function system_actions_configure($form_state, $action = NULL) { +function system_actions_configure($form, &$form_state, $action = NULL) { if ($action === NULL) { drupal_goto('admin/config/system/actions'); } @@ -2685,7 +2683,7 @@ function system_actions_configure_submit($form, &$form_state) { * @ingroup forms * @see system_actions_delete_form_submit() */ -function system_actions_delete_form($form_state, $action) { +function system_actions_delete_form($form, $form_state, $action) { $form['aid'] = array( '#type' => 'hidden', diff --git a/modules/system/system.test b/modules/system/system.test index 58d60b253..d6fd1a98e 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -966,8 +966,6 @@ class SystemSettingsForm extends DrupalWebTestCase { * Tests the handling of automatic defaults in systems_settings_form(). */ function testAutomaticDefaults() { - $form = array(); - $form['system_settings_form_test'] = array( '#type' => 'checkbox', '#default_value' => FALSE, |