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

Functions

Namesort descending Description
alpha_column_options A helper function to return a proper options array for a form.
alpha_container_options A helper function to return a proper options array for a form.
alpha_css_options A helper function to return a proper options array for a form.
alpha_exclude_options A helper function to return a proper options array for a form.
alpha_form_system_theme_settings_alter Implements hook_form_system_theme_settings_alter()
alpha_grid_layouts_options A helper function to return a proper options array for a form.
alpha_grid_options A helper function to return a proper options array for a form.
alpha_library_options A helper function to return a proper options array for a form.
alpha_region_options A helper function to return a proper options array for a form.
alpha_scale_options A helper function to return a proper options array for a form.
alpha_theme_settings_form_submit Clears the cache for the theme settings upon form submission.
alpha_theme_settings_form_validate Removes the vertical tab active tab from the values. It really doesn't belong there!
alpha_theme_settings_validate_not_empty Form element validation handler for replacing the value "_none" with NULL.
alpha_theme_settings_validate_order Form element validation handler for validating the region order manipulation setting for zones.
alpha_theme_settings_validate_primary Form element validation handler for validating the primary region setting for zones.
alpha_zone_options A helper function to return a proper options array for a form.
alpha_zone_regions A helper function to return a proper options array for a form.

File

sites/all/themes/ulmus/omega/alpha/theme-settings.php
View source
  1. <?php
  2. require_once dirname(__FILE__) . '/includes/alpha.inc';
  3. require_once dirname(__FILE__) . '/includes/base.inc';
  4. require_once dirname(__FILE__) . '/includes/theme-settings-general.inc';
  5. require_once dirname(__FILE__) . '/includes/theme-settings-structure.inc';
  6. /**
  7. * Implements hook_form_system_theme_settings_alter()
  8. */
  9. function alpha_form_system_theme_settings_alter(&$form, &$form_state) {
  10. drupal_add_css(drupal_get_path('theme', 'alpha') . '/css/alpha-theme-settings.css', array('group' => CSS_THEME, 'weight' => 100));
  11. $theme = alpha_get_theme();
  12. $form_state['theme'] = $theme->theme;
  13. $form_state['regions'] = $theme->regions;
  14. $form_state['zones'] = $theme->zones;
  15. $form['alpha_settings'] = array(
  16. '#type' => 'vertical_tabs',
  17. '#weight' => -10,
  18. '#prefix' => t('<h3>Layout configuration</h3>'),
  19. );
  20. alpha_theme_settings_general($form, $form_state);
  21. alpha_theme_settings_structure($form, $form_state);
  22. $form['#validate'][] = 'alpha_theme_settings_form_validate';
  23. $form['#submit'][] = 'alpha_theme_settings_form_submit';
  24. }
  25. /**
  26. * Form element validation handler for replacing the value "_none" with NULL.
  27. */
  28. function alpha_theme_settings_validate_not_empty(&$element, &$form_state) {
  29. if ($element['#value'] == '_none') {
  30. form_set_value($element, NULL, $form_state);
  31. }
  32. }
  33. /**
  34. * Form element validation handler for validating the primary region setting for zones.
  35. */
  36. function alpha_theme_settings_validate_primary(&$element, &$form_state) {
  37. if ($element['#value'] != '_none') {
  38. $values = $form_state['values'];
  39. if ($values['alpha_region_' . $element['#value'] . '_zone'] != $element['#zone']) {
  40. form_set_value($element, NULL, $form_state);
  41. }
  42. else {
  43. $sum = 0;
  44. foreach ($form_state['regions'] as $region => $item) {
  45. if ($values['alpha_region_' . $region . '_zone'] == $element['#zone']) {
  46. $sum += $values['alpha_region_' . $region . '_columns'];
  47. $sum += $values['alpha_region_' . $region . '_prefix'];
  48. $sum += $values['alpha_region_' . $region . '_suffix'];
  49. }
  50. }
  51. if ($sum > $values['alpha_zone_' . $element['#zone'] . '_columns']) {
  52. form_error($element, t('You have specified the %region region as the primary region for the %zone zone but the summed region width is greater than the number of available columns for that zone.', array('%region' => $form_state['regions'][$element['#value']]['name'], '%zone' => $form_state['zones'][$element['#zone']]['name'])));
  53. }
  54. }
  55. }
  56. }
  57. /**
  58. * Form element validation handler for validating the region order manipulation setting for zones.
  59. */
  60. function alpha_theme_settings_validate_order(&$element, &$form_state) {
  61. if ($element['#value']) {
  62. $values = $form_state['values'];
  63. $sum = 0;
  64. foreach ($form_state['regions'] as $region => $item) {
  65. if ($values['alpha_region_' . $region . '_zone'] == $element['#zone']) {
  66. $sum += $values['alpha_region_' . $region . '_columns'];
  67. $sum += $values['alpha_region_' . $region . '_prefix'];
  68. $sum += $values['alpha_region_' . $region . '_suffix'];
  69. }
  70. }
  71. if ($sum > $values['alpha_zone_' . $element['#zone'] . '_columns']) {
  72. form_error($element, t('You have chosen to manipulate the region positioning of the %zone zone but the summed region width is greater than the number of available columns for that zone.', array('%zone' => $form_state['zones'][$element['#zone']]['name'])));
  73. }
  74. }
  75. }
  76. /**
  77. * Removes the vertical tab active tab from the values. It really doesn't
  78. * belong there!
  79. */
  80. function alpha_theme_settings_form_validate($form, &$form_state) {
  81. unset($form_state['values']['alpha_settings__active_tab']);
  82. }
  83. /**
  84. * Clears the cache for the theme settings upon form submission.
  85. */
  86. function alpha_theme_settings_form_submit($form, &$form_state) {
  87. alpha_cache_clear($form_state['theme'], (isset($form_state['delta']) ? $form_state['delta'] : NULL));
  88. }
  89. /**
  90. * A helper function to return a proper options array for a form.
  91. *
  92. * @param $start
  93. * The number to start with.
  94. *
  95. * @param $end
  96. * The number to end with.
  97. *
  98. * @param $step
  99. * The size of a step.
  100. *
  101. * @return
  102. * An array of scale options.
  103. */
  104. function alpha_scale_options($start, $end, $step) {
  105. $options = array();
  106. foreach (range($start, $end, $step) as $number) {
  107. // Format the value to display with one decimal.
  108. $options[(string) $number] = number_format($number, 1);
  109. }
  110. return $options;
  111. }
  112. /**
  113. * A helper function to return a proper options array for a form.
  114. *
  115. * @return
  116. * An array of optional or responsive stylesheet options.
  117. */
  118. function alpha_css_options($css) {
  119. $output = array();
  120. foreach ($css as $key => $info) {
  121. $output[$key] = '<strong>' . check_plain($info['name']) . '</strong> (' . (isset($info['options']['media']) ? $info['options']['media'] : 'all') . ') - ' . $info['file'] . '<div class="description">' . $info['description'] . '</div>';
  122. }
  123. return $output;
  124. }
  125. /**
  126. * A helper function to return a proper options array for a form.
  127. *
  128. * @param $theme
  129. * The key (machin-readable name) of a theme.
  130. *
  131. * @see
  132. * hook_css_alter().
  133. *
  134. * @return
  135. * An array of stylesheets that can be disabled / excluded with
  136. * hook_css_alter().
  137. */
  138. function alpha_exclude_options($theme) {
  139. $output = array();
  140. foreach (alpha_retrieve_excludes($theme) as $key => $info) {
  141. if ($info['type'] == 'exclude') {
  142. $output[$key] = '<strong>' . basename($key) . '</strong> - ' . t('Defined by') . ' ' . $info['name'] . '<div class="description">' . $info['description'] . '</div>';
  143. }
  144. else {
  145. $output[$key] = '<strong>' . basename($key) . '</strong> (' . $info['media'] . ') - ' . t('Belongs to') . ' ' . $info['name'] . '<div class="description">' . $info['description'] . '</div>';
  146. }
  147. }
  148. return $output;
  149. }
  150. /**
  151. * A helper function to return a proper options array for a form.
  152. *
  153. * @return
  154. * An array of available grids.
  155. */
  156. function alpha_grid_options($grids) {
  157. $output = array();
  158. foreach ($grids as $key => $info) {
  159. $output[$key] = check_plain($info['name']);
  160. }
  161. return $output;
  162. }
  163. /**
  164. * A helper function to return a proper options array for a form.
  165. *
  166. * @param $grid
  167. * The name of a grid.
  168. *
  169. * @return
  170. * An array of available layouts.
  171. */
  172. function alpha_grid_layouts_options($grid) {
  173. $output = array();
  174. if (!empty($grid['layouts'])) {
  175. foreach ($grid['layouts'] as $key => $info) {
  176. $output[$key] = check_plain($info['name']);
  177. }
  178. }
  179. return $output;
  180. }
  181. /**
  182. * A helper function to return a proper options array for a form.
  183. *
  184. * @return
  185. * An array of available libraries.
  186. */
  187. function alpha_library_options($libraries) {
  188. $output = array();
  189. foreach ($libraries as $key => $info) {
  190. $output[$key] = check_plain($info['name']) . '<div class="description">' . $info['description'] . '</div>';
  191. }
  192. return $output;
  193. }
  194. /**
  195. * A helper function to return a proper options array for a form.
  196. *
  197. * @param $grid
  198. * The grid that you want to fetch the available containers for.
  199. *
  200. * @return
  201. * An array of available containers.
  202. */
  203. function alpha_container_options($grid) {
  204. $output = array();
  205. if (!empty($grid['columns'])) {
  206. foreach ($grid['columns'] as $count => $title) {
  207. $output[$count] = t('@count Columns', array('@count' => $count));
  208. }
  209. }
  210. return $output;
  211. }
  212. /**
  213. * A helper function to return a proper options array for a form.
  214. *
  215. * @param $max
  216. * The maximum number of columns that you want to cover.
  217. *
  218. * @return
  219. * An array of available columns counts.
  220. */
  221. function alpha_column_options($max = NULL) {
  222. $output = array();
  223. if (isset($max)) {
  224. foreach (range(0, $max) as $width) {
  225. $output[$width] = t('@width Columns', array('@width' => $width));
  226. }
  227. }
  228. return $output;
  229. }
  230. /**
  231. * A helper function to return a proper options array for a form.
  232. *
  233. * @return
  234. * An array of available zones.
  235. */
  236. function alpha_zone_options($zones) {
  237. $output = array();
  238. foreach ($zones as $key => $info) {
  239. $output[$key] = check_plain($info['name']);
  240. }
  241. return $output;
  242. }
  243. /**
  244. * A helper function to return a proper options array for a form.
  245. *
  246. * @return
  247. * An array of available regions.
  248. */
  249. function alpha_region_options($regions) {
  250. $output = array();
  251. foreach ($regions as $region => $item) {
  252. $output[$region] = $item['name'];
  253. }
  254. return $output;
  255. }
  256. /**
  257. * A helper function to return a proper options array for a form.
  258. *
  259. * @return
  260. * An array of available regions for a zone.
  261. */
  262. function alpha_zone_regions($zone, $regions) {
  263. $matches = array();
  264. foreach ($regions as $region => $info) {
  265. if ($zone == $info['zone']) {
  266. $matches[$region] = $info;
  267. }
  268. }
  269. return alpha_region_options($matches);
  270. }
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.