region.vars.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * Stub file for "region" theme hook [pre]process functions.
  5. */
  6. /**
  7. * Pre-processes variables for the "region" theme hook.
  8. *
  9. * See template for list of available variables.
  10. *
  11. * @see region.tpl.php
  12. *
  13. * @ingroup theme_preprocess
  14. */
  15. function bootstrap_preprocess_region(&$variables) {
  16. global $theme;
  17. $region = $variables['region'];
  18. $classes = &$variables['classes_array'];
  19. // Content region.
  20. if ($region === 'content') {
  21. // @todo is this actually used properly?
  22. $variables['theme_hook_suggestions'][] = 'region__no_wrapper';
  23. }
  24. // Help region.
  25. elseif ($region === 'help' && !empty($variables['content'])) {
  26. $variables['content'] = _bootstrap_icon('question-sign') . $variables['content'];
  27. $classes[] = 'alert';
  28. $classes[] = 'alert-info';
  29. $classes[] = 'messages';
  30. $classes[] = 'info';
  31. }
  32. // Support for "well" classes in regions.
  33. static $wells;
  34. if (!isset($wells)) {
  35. foreach (system_region_list($theme) as $name => $title) {
  36. $wells[$name] = bootstrap_setting('region_well-' . $name);
  37. }
  38. }
  39. if (!empty($wells[$region])) {
  40. $classes[] = $wells[$region];
  41. }
  42. }