theme-settings.php

  1. cis7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  2. cis7 sites/all/themes/local_contrib/zurb-foundation/theme-settings.php
  3. cis7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  4. cis7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  5. cis7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  6. cis7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  7. cis7 sites/all/themes/local_contrib/zurb-foundation/STARTER/theme-settings.php
  8. cis7 sites/all/themes/ulmus/rubik/theme-settings.php
  9. cis7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  10. cis7 sites/all/themes/ulmus/aurora/theme-settings.php
  11. cis7 sites/all/themes/ulmus/ember/theme-settings.php
  12. cis7 sites/all/themes/ulmus/corolla/theme-settings.php
  13. cis7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  14. cis7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  15. cis7 themes/garland/theme-settings.php
  16. cle7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  17. cle7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  18. cle7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  19. cle7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  20. cle7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  21. cle7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  22. cle7 sites/all/themes/ulmus/rubik/theme-settings.php
  23. cle7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  24. cle7 sites/all/themes/ulmus/aurora/theme-settings.php
  25. cle7 sites/all/themes/ulmus/ember/theme-settings.php
  26. cle7 sites/all/themes/ulmus/corolla/theme-settings.php
  27. cle7 sites/all/themes/local_contrib/bootstrap/theme-settings.php
  28. cle7 themes/garland/theme-settings.php
  29. cle7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  30. cle7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  31. cle7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  32. cle7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  33. ecd7 sites/all/themes/ulmus/ember/theme-settings.php
  34. ecd7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  35. ecd7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  36. ecd7 sites/all/themes/ulmus/rubik/theme-settings.php
  37. ecd7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  38. ecd7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  39. ecd7 sites/all/themes/ulmus/aurora/theme-settings.php
  40. ecd7 sites/all/themes/ulmus/corolla/theme-settings.php
  41. ecd7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  42. ecd7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  43. ecd7 themes/garland/theme-settings.php
  44. ecd7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  45. ecd7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  46. ecd7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  47. ecd7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  48. elmsmedia7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  49. elmsmedia7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  50. elmsmedia7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  51. elmsmedia7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  52. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  53. elmsmedia7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  54. elmsmedia7 themes/garland/theme-settings.php
  55. elmsmedia7 sites/all/themes/ulmus/corolla/theme-settings.php
  56. elmsmedia7 sites/all/themes/ulmus/ember/theme-settings.php
  57. elmsmedia7 sites/all/themes/ulmus/aurora/theme-settings.php
  58. elmsmedia7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  59. elmsmedia7 sites/all/themes/ulmus/rubik/theme-settings.php
  60. elmsmedia7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  61. elmsmedia7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  62. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  63. harmony7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  64. harmony7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  65. harmony7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  66. harmony7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  67. harmony7 sites/all/themes/local_contrib/bootstrap/theme-settings.php
  68. harmony7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  69. harmony7 sites/all/themes/ulmus/corolla/theme-settings.php
  70. harmony7 sites/all/themes/ulmus/ember/theme-settings.php
  71. harmony7 sites/all/themes/ulmus/aurora/theme-settings.php
  72. harmony7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  73. harmony7 sites/all/themes/ulmus/rubik/theme-settings.php
  74. harmony7 themes/garland/theme-settings.php
  75. harmony7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  76. harmony7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  77. harmony7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  78. harmony7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  79. icor7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  80. icor7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  81. icor7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  82. icor7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  83. icor7 themes/garland/theme-settings.php
  84. icor7 sites/all/themes/ulmus/rubik/theme-settings.php
  85. icor7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  86. icor7 sites/all/themes/ulmus/corolla/theme-settings.php
  87. icor7 sites/all/themes/ulmus/ember/theme-settings.php
  88. icor7 sites/all/themes/ulmus/aurora/theme-settings.php
  89. icor7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  90. icor7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  91. icor7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  92. icor7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  93. icor7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  94. meedjum_blog7 themes/garland/theme-settings.php
  95. meedjum_blog7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  96. meedjum_blog7 sites/all/themes/ulmus/aurora/theme-settings.php
  97. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  98. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  99. meedjum_blog7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  100. meedjum_blog7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  101. meedjum_blog7 sites/all/themes/ulmus/rubik/theme-settings.php
  102. meedjum_blog7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  103. meedjum_blog7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  104. meedjum_blog7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  105. meedjum_blog7 sites/all/themes/local_contrib/meedjum/theme-settings.php
  106. meedjum_blog7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  107. meedjum_blog7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  108. meedjum_blog7 sites/all/themes/ulmus/ember/theme-settings.php
  109. meedjum_blog7 sites/all/themes/ulmus/corolla/theme-settings.php
  110. mooc7 sites/all/themes/elmsln_contrib/chamfer/theme-settings.php
  111. mooc7 themes/garland/theme-settings.php
  112. mooc7 sites/all/themes/local_contrib/zurb_foundation/STARTER/theme-settings.php
  113. mooc7 sites/all/themes/ulmus/corolla/theme-settings.php
  114. mooc7 sites/all/themes/ulmus/ember/theme-settings.php
  115. mooc7 sites/all/themes/ulmus/skeletontheme/theme-settings.php
  116. mooc7 sites/all/themes/ulmus/fontfolio/theme-settings.php
  117. mooc7 sites/all/themes/ulmus/rubik/theme-settings.php
  118. mooc7 sites/all/themes/ulmus/omega/alpha/theme-settings.php
  119. mooc7 sites/all/themes/ulmus/omega/omega/theme-settings.php
  120. mooc7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/theme-settings.php
  121. mooc7 sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
  122. mooc7 sites/all/themes/elmsln_contrib/foundation_access/theme-settings.php
  123. mooc7 sites/all/themes/local_contrib/zurb_foundation/theme-settings.php
  124. mooc7 sites/all/themes/ulmus/aurora/theme-settings.php

Implimentation of hook_form_system_theme_settings_alter()

Functions

File

sites/all/themes/ulmus/adaptivetheme/at_core/theme-settings.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Implimentation of hook_form_system_theme_settings_alter()
  5. *
  6. * @param $form: Nested array of form elements that comprise the form.
  7. * @param $form_state: A keyed array containing the current state of the form.
  8. */
  9. function adaptivetheme_form_system_theme_settings_alter(&$form, &$form_state, $form_id = NULL) {
  10. // Get our plugin system functions.
  11. require_once(drupal_get_path('theme', 'adaptivetheme') . '/inc/plugins.inc');
  12. // We need some getters.
  13. require_once(drupal_get_path('theme', 'adaptivetheme') . '/inc/get.inc');
  14. $path_to_at_core = drupal_get_path('theme', 'adaptivetheme');
  15. // General "alters" use a form id. Settings should not be set here. The only
  16. // thing useful about this is if you need to alter the form for the running
  17. // theme and *not* the theme setting.
  18. // @see http://drupal.org/node/943212
  19. if (isset($form_id)) {
  20. return;
  21. }
  22. // Get the active theme name, we need it at some stage.
  23. $theme_name = $form_state['build_info']['args'][0];
  24. // Get the active themes info array
  25. $info_array = at_get_info($theme_name);
  26. // Set up variables for legacy and non-legacy themes
  27. $legacy_theme = FALSE;
  28. if (!isset($info_array['release']) || $info_array['release'] === '7.x-2.x') {
  29. $legacy_theme = TRUE;
  30. }
  31. elseif (isset($legacy_info['release']) && $legacy_info['release'] === '7.x-3.x') {
  32. $legacy_theme = FALSE;
  33. }
  34. // Version messages
  35. $version_message = '';
  36. if (at_get_setting('atcore_version_test', $theme_name) === 1) {
  37. if ($legacy_theme == TRUE) {
  38. $version_message = t('<p>The version of your theme (@theme) is not designed to run on <a href="!link_project" target="_blank">Adaptivetheme 7.x.3.x</a>. It will probably run, but your experience will not be optimal. You have three courses of action to choose from:</p>', array('!link_project' => 'http://drupal.org/project/adaptivetheme', '@theme' => $theme_name));
  39. $version_message .= t('<ol><li>Downgrade Adaptivetheme to 7.x-2.x</li><li>Upgrade your theme to the 7.x-3.x branch&thinsp;&mdash;&thinsp;you will need to check if an upgrade exists.</li><li>Add the line <code>"release = 7.x-3.x"</code> (less quotes) to your sub-themes info file and clear the cache to make this message go away.</li></ol>');
  40. $version_message .= t('<p>You can turn off this message in the Debug settings, look for "Sub-theme compatibility test".</p>');
  41. drupal_set_message(filter_xss_admin($version_message), 'warning');
  42. }
  43. elseif ($legacy_theme == FALSE) {
  44. $version_message = t('<p>This theme (@theme) is compatible with <a href="!link_project" target="_blank">Adaptivetheme 7.x.3.x</a>. You are good to go! You can turn off this message in the Debug settings, look for "Sub-theme compatibility test".</p>', array('!link_project' => 'http://drupal.org/project/adaptivetheme', '@theme' => $theme_name));
  45. drupal_set_message(filter_xss_admin($version_message), 'status');
  46. }
  47. }
  48. // Get the admin theme so we can set a class for styling this form,
  49. // variable_get() returns 0 if the admin theme is the default theme.
  50. $admin_theme = variable_get('admin_theme') ? variable_get('admin_theme') : $theme_name;
  51. $admin_theme_class = 'admin-theme-' . drupal_html_class($admin_theme);
  52. // LAYOUT SETTINGS
  53. // Build a custom header for the layout settings form.
  54. $logo = file_create_url(drupal_get_path('theme', 'adaptivetheme') . '/logo.png');
  55. $layout_header = '<div class="at-settings-form layout-settings-form ' . $admin_theme_class . '"><div class="layout-header theme-settings-header clearfix">';
  56. $layout_header .= '<h1>' . t('Layout &amp; General Settings') . '</h1>';
  57. $layout_header .= '<p class="docs-link"><a href="http://adaptivethemes.com/documentation/adaptivetheme-7x-3x" title="View online documentation" target="_blank">View online documentation</a></p>';
  58. $layout_header .= '<p class="logo-link"><a href="http://adaptivethemes.com" title="Adaptivethemes.com - Rocking the hardest since 2006" target="_blank"><img class="at-logo" src="' . $logo . '" /></a></p>';
  59. $layout_header .= '</div>';
  60. // INCLUDES
  61. $includes_array = array(
  62. 'pagelayout',
  63. 'responsivepanels',
  64. 'global',
  65. 'filemanagement',
  66. 'css',
  67. 'polyfills',
  68. 'metatags',
  69. 'debug',
  70. 'extensions',
  71. );
  72. foreach ($includes_array as $include_file) {
  73. require_once($path_to_at_core . '/inc/forms/settings.' . $include_file . '.inc');
  74. }
  75. $form['at-settings'] = array(
  76. '#type' => 'vertical_tabs',
  77. '#description' => t('Layout'),
  78. '#prefix' => $layout_header,
  79. '#suffix' => '</div>',
  80. '#weight' => -10,
  81. '#attached' => array(
  82. 'css' => array(drupal_get_path('theme', 'adaptivetheme') . '/css/at.settings.form.css'),
  83. ),
  84. );
  85. // Call all the default settings forms.
  86. at_core_page_layout_form($form, $theme_name);
  87. at_core_responsive_panels_form($form, $theme_name, $info_array);
  88. at_core_global_form($form, $theme_name);
  89. at_core_filemanagement_form($form, $theme_name);
  90. at_core_css_form($form, $theme_name);
  91. at_core_polyfills_form($form, $theme_name);
  92. at_core_metatags_form($form);
  93. at_core_debug_form($form);
  94. at_core_extensions_form($form);
  95. // EXTENSIONS
  96. $enable_extensions = isset($form_state['values']['enable_extensions']);
  97. if (($enable_extensions && $form_state['values']['enable_extensions'] == 1) || (!$enable_extensions && $form['at-settings']['extend']['enable_extensions']['#default_value'] == 1)) {
  98. // Build a custom header for the Extensions settings form.
  99. $styles_header = '<div class="at-settings-form style-settings-form ' . $admin_theme_class . '"><div class="styles-header theme-settings-header clearfix">';
  100. $styles_header .= '<h1>' . t('Extensions') . '</h1>';
  101. $styles_header .= '<p class="docs-link"><a href="http://adaptivethemes.com/documentation/extensions" title="View online documentation for Extensions" target="_blank">View online documentation</a></p>';
  102. $styles_header .= '</div>';
  103. $form['at'] = array('#type' => 'vertical_tabs',
  104. '#weight' => -9,
  105. '#prefix' => $styles_header,
  106. '#suffix' => '</div>',
  107. );
  108. // Include fonts.inc by default, the conditional logic to wrap around this is
  109. // too hairy to even comtemplate.
  110. require_once($path_to_at_core . '/inc/fonts.inc');
  111. // Fonts
  112. $enable_font_settings = isset($form_state['values']['enable_font_settings']);
  113. if (($enable_font_settings && $form_state['values']['enable_font_settings'] == 1) || (!$enable_font_settings && $form['at-settings']['extend']['enable']['enable_font_settings']['#default_value'] == 1)) {
  114. require_once($path_to_at_core . '/inc/forms/settings.fonts.inc');
  115. at_core_fonts_form($form);
  116. }
  117. // Heading styles
  118. $enable_heading_settings = isset($form_state['values']['enable_heading_settings']);
  119. if (($enable_heading_settings && $form_state['values']['enable_heading_settings'] == 1) || (!$enable_heading_settings && $form['at-settings']['extend']['enable']['enable_heading_settings']['#default_value'] == 1)) {
  120. require_once($path_to_at_core . '/inc/forms/settings.headings.inc');
  121. at_core_headings_form($form);
  122. }
  123. // Image alignment
  124. $enable_image_settings = isset($form_state['values']['enable_image_settings']);
  125. if (($enable_image_settings && $form_state['values']['enable_image_settings'] == 1) || (!$enable_image_settings && $form['at-settings']['extend']['enable']['enable_image_settings']['#default_value'] == 1)) {
  126. require_once($path_to_at_core . '/inc/forms/settings.images.inc');
  127. at_core_images_form($form);
  128. }
  129. // Exclude CSS
  130. $enable_exclude_css = isset($form_state['values']['enable_exclude_css']);
  131. if (($enable_exclude_css && $form_state['values']['enable_exclude_css'] == 1) || (!$enable_exclude_css && $form['at-settings']['extend']['enable']['enable_exclude_css']['#default_value'] == 1)) {
  132. require_once($path_to_at_core . '/inc/forms/settings.cssexclude.inc');
  133. at_core_css_exclude_form($form, $theme_name);
  134. }
  135. // Touch icons
  136. $enable_apple_touch_icons = isset($form_state['values']['enable_apple_touch_icons']);
  137. if (($enable_apple_touch_icons && $form_state['values']['enable_apple_touch_icons'] == 1) || (!$enable_apple_touch_icons && $form['at-settings']['extend']['enable']['enable_apple_touch_icons']['#default_value'] == 1)) {
  138. require_once($path_to_at_core . '/inc/forms/settings.touchicons.inc');
  139. at_core_touch_icons_form($form, $theme_name);
  140. }
  141. // Custom CSS
  142. $enable_custom_css = isset($form_state['values']['enable_custom_css']);
  143. if (($enable_custom_css && $form_state['values']['enable_custom_css'] == 1) || (!$enable_custom_css && $form['at-settings']['extend']['enable']['enable_custom_css']['#default_value'] == 1)) {
  144. require_once($path_to_at_core . '/inc/forms/settings.customcss.inc');
  145. at_core_custom_css_form($form);
  146. }
  147. // Mobile regions and blocks (context regions)
  148. $enable_context_regions = isset($form_state['values']['enable_context_regions']);
  149. if (($enable_context_regions && $form_state['values']['enable_context_regions'] == 1) || (!$enable_context_regions && $form['at-settings']['extend']['enable']['enable_context_regions']['#default_value'] == 1)) {
  150. require_once($path_to_at_core . '/inc/forms/settings.contextregions.inc');
  151. at_core_context_regions_form($form, $info_array);
  152. }
  153. // Menu toggle
  154. $enable_menu_toggle = isset($form_state['values']['enable_menu_toggle']);
  155. if (($enable_menu_toggle && $form_state['values']['enable_menu_toggle'] == 1) || (!$enable_context_regions && $form['at-settings']['extend']['enable']['enable_menu_toggle']['#default_value'] == 1)) {
  156. require_once($path_to_at_core . '/inc/forms/settings.menutoggle.inc');
  157. at_core_menu_toggle_form($form);
  158. }
  159. // Float Region blocks
  160. $enable_float_region_blocks = isset($form_state['values']['enable_float_region_blocks']);
  161. if (($enable_float_region_blocks && $form_state['values']['enable_float_region_blocks'] == 1) || (!$enable_float_region_blocks && $form['at-settings']['extend']['enable']['enable_float_region_blocks']['#default_value'] == 1)) {
  162. require_once($path_to_at_core . '/inc/forms/settings.floatregionblocks.inc');
  163. at_core_float_region_blocks_form($form, $info_array);
  164. }
  165. // Modify output
  166. $enable_markup_overides = isset($form_state['values']['enable_markup_overides']);
  167. if (($enable_markup_overides && $form_state['values']['enable_markup_overides'] == 1) || (!$enable_markup_overides && $form['at-settings']['extend']['enable']['enable_markup_overides']['#default_value'] == 1)) {
  168. require_once($path_to_at_core . '/inc/forms/settings.modifyoutput.inc');
  169. at_core_modify_output_form($form);
  170. }
  171. // Print a message if no extensions are enbabled, this is quite hard to detect
  172. // so we hack it by counting the elements in the array, if there are 4 or less
  173. // we assume no extensions are enabled.
  174. $count = count($form['at']);
  175. if ($count <= 4) {
  176. $form['at']['no_extensions_enabled'] = array(
  177. '#type' => 'markup',
  178. '#markup' => t('No extensions are currently active. Enable Extensions by clicking the Extensions tab above and checking the required extensions, then save the configuration.'),
  179. '#prefix' => '<div class="no-extensions-enabled">',
  180. '#suffix' => '</div>',
  181. );
  182. }
  183. }
  184. // Include a hidden form field with the current release information
  185. $form['at-release']['at_core'] = array(
  186. '#type' => 'hidden',
  187. '#default_value' => '7.x-3.x',
  188. );
  189. // Collapse annoying forms
  190. $form['theme_settings']['#collapsible'] = TRUE;
  191. $form['theme_settings']['#collapsed'] = TRUE;
  192. $form['logo']['#collapsible'] = TRUE;
  193. $form['logo']['#collapsed'] = TRUE;
  194. $form['favicon']['#collapsible'] = TRUE;
  195. $form['favicon']['#collapsed'] = TRUE;
  196. /**
  197. * Originally posted by dvessel (http://drupal.org/user/56782).
  198. * The following will be processed even if the theme is inactive.
  199. * If you are on a theme specific settings page but it is not an active
  200. * theme (example.com/admin/apearance/settings/THEME_NAME), it will
  201. * still be processed.
  202. *
  203. * Build a list of themes related to the theme specific form. If the form
  204. * is specific to a sub-theme, all parent themes leading to it will have
  205. * hook_form_theme_settings invoked. For example, if a theme named
  206. * 'grandchild' has its settings form in focus, the following will be invoked.
  207. * - parent_form_theme_settings()
  208. * - child_form_theme_settings()
  209. * - grandchild_form_theme_settings()
  210. *
  211. * If 'child' was in focus it will invoke:
  212. * - parent_form_theme_settings()
  213. * - child_form_theme_settings()
  214. *
  215. * @see http://drupal.org/node/943212
  216. */
  217. $form_themes = array();
  218. $themes = list_themes();
  219. $_theme = $GLOBALS['theme_key'];
  220. while (isset($_theme)) {
  221. $form_themes[$_theme] = $_theme;
  222. $_theme = isset($themes[$_theme]->base_theme) ? $themes[$_theme]->base_theme : NULL;
  223. }
  224. $form_themes = array_reverse($form_themes);
  225. foreach ($form_themes as $theme_key) {
  226. if (function_exists($form_settings = "{$theme_key}_form_theme_settings")) {
  227. $form_settings($form, $form_state);
  228. }
  229. }
  230. // Include custom form validation and submit functions
  231. require_once(drupal_get_path('theme', 'adaptivetheme') . '/inc/forms/at_core.validate.inc');
  232. require_once(drupal_get_path('theme', 'adaptivetheme') . '/inc/forms/at_core.submit.inc');
  233. // Custom validate and submit functions
  234. $form['#validate'][] = 'at_core_settings_validate';
  235. $form['#submit'][] = 'at_core_settings_submit';
  236. }