Commit 1356c256 authored by alexpott's avatar alexpott
Browse files

Issue #1924990 by tim.plunkett:Remove system_config_form().

parent 356dc8ba
...@@ -3193,64 +3193,6 @@ function system_default_region($theme) { ...@@ -3193,64 +3193,6 @@ function system_default_region($theme) {
return isset($regions[0]) ? $regions[0] : ''; return isset($regions[0]) ? $regions[0] : '';
} }
/**
* Adds default behavior to a configuration form.
*
* This includes a consistent 'Save configuration' button, theme definition,
* and submit handler.
*
* @param array $form
* An associative array containing the structure of the form.
* @param array $form_state
* Reference to an associative array containing state of the form.
*
* @return array
* The form structure.
*
* @see system_config_form_submit()
* @ingroup forms
*/
function system_config_form($form, &$form_state) {
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
'#button_type' => 'primary',
);
// Add system_config_form_submit() to output a consistent confirmation
// message. Since this prevents drupal_prepare_form() from adding the form's
// primary submit handler, do that first, using the same logic.
if (!isset($form['#submit'])) {
$form['#submit'] = array();
if (isset($form_state['build_info']['callback_object'])) {
$form['#submit'][] = array($form_state['build_info']['callback_object'], 'submitForm');
}
elseif (function_exists($form_state['build_info']['form_id'] . '_submit')) {
$form['#submit'][] = $form_state['build_info']['form_id'] . '_submit';
}
elseif (isset($form_state['build_info']['base_form_id']) && function_exists($form_state['build_info']['base_form_id'] . '_submit')) {
$form['#submit'][] = $form_state['build_info']['base_form_id'] . '_submit';
}
}
$form['#submit'][] = 'system_config_form_submit';
// By default, render the form using theme_system_config_form().
if (!isset($form['#theme'])) {
$form['#theme'] = 'system_config_form';
}
return $form;
}
/**
* Form submission handler for system_config_form().
*
* @see system_config_form()
*/
function system_config_form_submit($form, &$form_state) {
drupal_set_message(t('The configuration options have been saved.'));
}
/** /**
* Generates a form array for a confirmation form. * Generates a form array for a confirmation form.
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment