block.vars.php 1023 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Stub file for "block" theme hook [pre]process functions.
  5. */
  6. /**
  7. * Pre-processes variables for the "block" theme hook.
  8. *
  9. * See template for list of available variables.
  10. *
  11. * @see block.tpl.php
  12. *
  13. * @ingroup theme_preprocess
  14. */
  15. function bootstrap_preprocess_block(&$variables) {
  16. // Use a bare template for the page's main content.
  17. if ($variables['block_html_id'] == 'block-system-main') {
  18. $variables['theme_hook_suggestions'][] = 'block__no_wrapper';
  19. }
  20. $variables['title_attributes_array']['class'][] = 'block-title';
  21. }
  22. /**
  23. * Processes variables for the "block" theme hook.
  24. *
  25. * See template for list of available variables.
  26. *
  27. * @see block.tpl.php
  28. *
  29. * @ingroup theme_process
  30. */
  31. function bootstrap_process_block(&$variables) {
  32. // Drupal 7 should use a $title variable instead of $block->subject.
  33. // Don't override an existing "title" variable, some modules may already it.
  34. if (!isset($variables['title'])) {
  35. $variables['title'] = $variables['block']->subject;
  36. }
  37. }