From 2353d1413a8c049cd6ce6aef4695d22c01d992d0 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 2 Nov 2009 23:22:23 +0000 Subject: #211015 follow-up by sun: Don't hard-code #theme for system_settings_form(). --- modules/system/system.module | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index 7398653ad..9ec9e942f 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -140,7 +140,6 @@ function system_theme() { ), 'system_settings_form' => array( 'render element' => 'form', - 'file' => 'system.admin.inc', ), 'confirm_form' => array( 'render element' => 'form', @@ -2455,7 +2454,10 @@ function system_settings_form($form, $automatic_defaults = TRUE) { drupal_set_message(t('The settings have not been saved because of the errors.'), 'error'); } $form['#submit'][] = 'system_settings_form_submit'; - $form['#theme'] = 'system_settings_form'; + // By default, render the form using theme_system_settings_form(). + if (!isset($form['#theme'])) { + $form['#theme'] = 'system_settings_form'; + } return $form; } @@ -3528,6 +3530,21 @@ function theme_confirm_form($variables) { return drupal_render_children($variables['form']); } +/** + * Theme function for the system settings form. + * + * By default this does not alter the appearance of a form at all, + * but is provided as a convenience for themers. + * + * @param $variables + * An associative array containing: + * - form: An associative array containing the structure of the form. + * @ingroup themeable + */ +function theme_system_settings_form($variables) { + return drupal_render_children($variables['form']); +} + /** * Template variable preprocessor for contextual links. */ -- cgit v1.2.3