| Commit | Line | Data |
|---|---|---|
| 888457a5 | 1 | <?php |
| 888457a5 J |
2 | /** |
| 3 | * @file | |
| 60a6f9b5 J |
4 | * Contains the theme's functions to manipulate Drupal's default markup. |
| 5 | * | |
| 2e3547f0 J |
6 | * Complete documentation for this file is available online. |
| 7 | * @see http://drupal.org/node/1728096 | |
| 888457a5 J |
8 | */ |
| 9 | ||
| 10 | ||
| 888457a5 | 11 | /** |
| 500fee10 J |
12 | * Override or insert variables into the maintenance page template. |
| 13 | * | |
| 14 | * @param $variables | |
| 15 | * An array of variables to pass to the theme template. | |
| 16 | * @param $hook | |
| 17 | * The name of the template being rendered ("maintenance_page" in this case.) | |
| 18 | */ | |
| 19 | /* -- Delete this line if you want to use this function | |
| 20 | function STARTERKIT_preprocess_maintenance_page(&$variables, $hook) { | |
| 21 | // When a variable is manipulated or added in preprocess_html or | |
| 22 | // preprocess_page, that same work is probably needed for the maintenance page | |
| 23 | // as well, so we can just re-use those functions to do that work here. | |
| 24 | STARTERKIT_preprocess_html($variables, $hook); | |
| 25 | STARTERKIT_preprocess_page($variables, $hook); | |
| 26 | } | |
| 27 | // */ | |
| 28 | ||
| 29 | /** | |
| aaeb2b6f J |
30 | * Override or insert variables into the html templates. |
| 31 | * | |
| b6e4708e | 32 | * @param $variables |
| aaeb2b6f J |
33 | * An array of variables to pass to the theme template. |
| 34 | * @param $hook | |
| 35 | * The name of the template being rendered ("html" in this case.) | |
| 36 | */ | |
| 37 | /* -- Delete this line if you want to use this function | |
| b6e4708e J |
38 | function STARTERKIT_preprocess_html(&$variables, $hook) { |
| 39 | $variables['sample_variable'] = t('Lorem ipsum.'); | |
| aaeb2b6f J |
40 | |
| 41 | // The body tag's classes are controlled by the $classes_array variable. To | |
| 42 | // remove a class from $classes_array, use array_diff(). | |
| b6e4708e | 43 | //$variables['classes_array'] = array_diff($variables['classes_array'], array('class-to-remove')); |
| aaeb2b6f J |
44 | } |
| 45 | // */ | |
| 46 | ||
| 47 | /** | |
| 0b1037f4 | 48 | * Override or insert variables into the page templates. |
| 888457a5 | 49 | * |
| b6e4708e | 50 | * @param $variables |
| 0b1037f4 | 51 | * An array of variables to pass to the theme template. |
| e6f4a124 | 52 | * @param $hook |
| 0b1037f4 | 53 | * The name of the template being rendered ("page" in this case.) |
| 888457a5 J |
54 | */ |
| 55 | /* -- Delete this line if you want to use this function | |
| b6e4708e J |
56 | function STARTERKIT_preprocess_page(&$variables, $hook) { |
| 57 | $variables['sample_variable'] = t('Lorem ipsum.'); | |
| 888457a5 J |
58 | } |
| 59 | // */ | |
| 60 | ||
| 888457a5 | 61 | /** |
| 0b1037f4 | 62 | * Override or insert variables into the node templates. |
| 888457a5 | 63 | * |
| b6e4708e | 64 | * @param $variables |
| 0b1037f4 | 65 | * An array of variables to pass to the theme template. |
| e6f4a124 | 66 | * @param $hook |
| 0b1037f4 | 67 | * The name of the template being rendered ("node" in this case.) |
| 888457a5 J |
68 | */ |
| 69 | /* -- Delete this line if you want to use this function | |
| b6e4708e J |
70 | function STARTERKIT_preprocess_node(&$variables, $hook) { |
| 71 | $variables['sample_variable'] = t('Lorem ipsum.'); | |
| 8ff55fbf J |
72 | |
| 73 | // Optionally, run node-type-specific preprocess functions, like | |
| 74 | // STARTERKIT_preprocess_node_page() or STARTERKIT_preprocess_node_story(). | |
| b6e4708e | 75 | $function = __FUNCTION__ . '_' . $variables['node']->type; |
| 8ff55fbf | 76 | if (function_exists($function)) { |
| b6e4708e | 77 | $function($variables, $hook); |
| 8ff55fbf | 78 | } |
| 888457a5 J |
79 | } |
| 80 | // */ | |
| 81 | ||
| 82 | /** | |
| 0b1037f4 | 83 | * Override or insert variables into the comment templates. |
| 888457a5 | 84 | * |
| b6e4708e | 85 | * @param $variables |
| 0b1037f4 | 86 | * An array of variables to pass to the theme template. |
| e6f4a124 | 87 | * @param $hook |
| 0b1037f4 | 88 | * The name of the template being rendered ("comment" in this case.) |
| 888457a5 J |
89 | */ |
| 90 | /* -- Delete this line if you want to use this function | |
| b6e4708e J |
91 | function STARTERKIT_preprocess_comment(&$variables, $hook) { |
| 92 | $variables['sample_variable'] = t('Lorem ipsum.'); | |
| 888457a5 J |
93 | } |
| 94 | // */ | |
| 95 | ||
| 96 | /** | |
| 6953df8d J |
97 | * Override or insert variables into the region templates. |
| 98 | * | |
| 99 | * @param $variables | |
| 100 | * An array of variables to pass to the theme template. | |
| 101 | * @param $hook | |
| 102 | * The name of the template being rendered ("region" in this case.) | |
| 103 | */ | |
| 104 | /* -- Delete this line if you want to use this function | |
| 105 | function STARTERKIT_preprocess_region(&$variables, $hook) { | |
| 106 | // Don't use Zen's region--sidebar.tpl.php template for sidebars. | |
| 292aa476 J |
107 | //if (strpos($variables['region'], 'sidebar_') === 0) { |
| 108 | // $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('region__sidebar')); | |
| 109 | //} | |
| 6953df8d J |
110 | } |
| 111 | // */ | |
| 112 | ||
| 113 | /** | |
| 0b1037f4 | 114 | * Override or insert variables into the block templates. |
| 888457a5 | 115 | * |
| b6e4708e | 116 | * @param $variables |
| 0b1037f4 | 117 | * An array of variables to pass to the theme template. |
| e6f4a124 | 118 | * @param $hook |
| 0b1037f4 | 119 | * The name of the template being rendered ("block" in this case.) |
| 888457a5 J |
120 | */ |
| 121 | /* -- Delete this line if you want to use this function | |
| b6e4708e | 122 | function STARTERKIT_preprocess_block(&$variables, $hook) { |
| df15ab13 | 123 | // Add a count to all the blocks in the region. |
| 292aa476 | 124 | // $variables['classes_array'][] = 'count-' . $variables['block_id']; |
| d109b02f | 125 | |
| 67c4a567 J |
126 | // By default, Zen will use the block--no-wrapper.tpl.php for the main |
| 127 | // content. This optional bit of code undoes that: | |
| d109b02f | 128 | //if ($variables['block_html_id'] == 'block-system-main') { |
| 67c4a567 | 129 | // $variables['theme_hook_suggestions'] = array_diff($variables['theme_hook_suggestions'], array('block__no_wrapper')); |
| d109b02f | 130 | //} |
| 888457a5 J |
131 | } |
| 132 | // */ |