Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.472 diff -u -p -r1.472 system.module --- modules/system/system.module 30 Apr 2007 17:03:28 -0000 1.472 +++ modules/system/system.module 3 May 2007 09:14:49 -0000 @@ -2142,14 +2142,18 @@ function system_theme_settings($key = '' if (function_exists($function)) { if ($themes[$key]->template) { // file is a template or a style of a template - $form['specific'] = array('#type' => 'fieldset', '#title' => t('Engine-specific settings'), '#description' => t('These settings only exist for all the templates and styles based on the %engine theme engine.', array('%engine' => $themes[$key]->prefix))); + $group = $function(); + if (!empty($group)) { + $form['engine_specific'] = array('#type' => 'fieldset', '#title' => t('Engine-specific settings'), '#description' => t('These settings only exist for all the templates and styles based on the %engine theme engine.', array('%engine' => $themes[$key]->prefix))); + $form['engine_specific'] = array_merge($form['engine_specific'], $group); + } } - else { - // file is a theme or a style of a theme - $form['specific'] = array('#type' => 'fieldset', '#title' => t('Theme-specific settings'), '#description' => t('These settings only exist for the %theme theme and all the styles based on it.', array('%theme' => $themes[$key]->prefix))); + // file is a theme or a style of a theme + $group = $function($key); + if (!empty($group)) { + $form['theme_specific'] = array('#type' => 'fieldset', '#title' => t('Theme-specific settings'), '#description' => t('These settings only exist for the %theme theme and all the styles based on it.', array('%theme' => ($themes[$key]->template) ? $key : $themes[$key]->prefix))); + $form['theme_specific'] = array_merge($form['theme_specific'], $group); } - $group = $function(); - $form['specific'] = array_merge($form['specific'], (is_array($group) ? $group : array())); } } $form['#attributes'] = array('enctype' => 'multipart/form-data'); Index: themes/engines/phptemplate/phptemplate.engine =================================================================== RCS file: /cvs/drupal/drupal/themes/engines/phptemplate/phptemplate.engine,v retrieving revision 1.64 diff -u -p -r1.64 phptemplate.engine --- themes/engines/phptemplate/phptemplate.engine 27 Apr 2007 07:42:54 -0000 1.64 +++ themes/engines/phptemplate/phptemplate.engine 3 May 2007 09:14:49 -0000 @@ -80,3 +80,20 @@ function phptemplate_engine_preprocess(& $variables['directory'] = path_to_theme(); $variables['is_front'] = drupal_is_front_page(); } + +/** + * Adds additional form elements to theme settings page. + * + * @param $key + * The name of the theme. + */ +function phptemplate_settings($key = NULL) { + if (!empty($key)) { + $form = array(); + $file = drupal_system_listing($key.'\/settings\.php$', 'themes'); + if (file_exists($file[0])) { + include_once "./{$file[0]}"; + } + return $form; + } +}