Revision 582db59d
Added by Assos Assos almost 9 years ago
drupal7/themes/garland/template.php | ||
---|---|---|
19 | 19 |
/** |
20 | 20 |
* Override or insert variables into the maintenance page template. |
21 | 21 |
*/ |
22 |
function garland_preprocess_maintenance_page(&$vars) { |
|
22 |
function garland_preprocess_maintenance_page(&$variables) {
|
|
23 | 23 |
// While markup for normal pages is split into page.tpl.php and html.tpl.php, |
24 | 24 |
// the markup for the maintenance page is all in the single |
25 | 25 |
// maintenance-page.tpl.php template. So, to have what's done in |
26 | 26 |
// garland_preprocess_html() also happen on the maintenance page, it has to be |
27 | 27 |
// called here. |
28 |
garland_preprocess_html($vars); |
|
28 |
garland_preprocess_html($variables);
|
|
29 | 29 |
} |
30 | 30 |
|
31 | 31 |
/** |
32 | 32 |
* Override or insert variables into the html template. |
33 | 33 |
*/ |
34 |
function garland_preprocess_html(&$vars) { |
|
34 |
function garland_preprocess_html(&$variables) {
|
|
35 | 35 |
// Toggle fixed or fluid width. |
36 | 36 |
if (theme_get_setting('garland_width') == 'fluid') { |
37 |
$vars['classes_array'][] = 'fluid-width'; |
|
37 |
$variables['classes_array'][] = 'fluid-width';
|
|
38 | 38 |
} |
39 | 39 |
// Add conditional CSS for IE6. |
40 | 40 |
drupal_add_css(path_to_theme() . '/fix-ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE)); |
... | ... | |
43 | 43 |
/** |
44 | 44 |
* Override or insert variables into the html template. |
45 | 45 |
*/ |
46 |
function garland_process_html(&$vars) { |
|
46 |
function garland_process_html(&$variables) {
|
|
47 | 47 |
// Hook into color.module |
48 | 48 |
if (module_exists('color')) { |
49 |
_color_html_alter($vars); |
|
49 |
_color_html_alter($variables);
|
|
50 | 50 |
} |
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
/** |
54 | 54 |
* Override or insert variables into the page template. |
55 | 55 |
*/ |
56 |
function garland_preprocess_page(&$vars) { |
|
56 |
function garland_preprocess_page(&$variables) {
|
|
57 | 57 |
// Move secondary tabs into a separate variable. |
58 |
$vars['tabs2'] = array( |
|
58 |
$variables['tabs2'] = array(
|
|
59 | 59 |
'#theme' => 'menu_local_tasks', |
60 |
'#secondary' => $vars['tabs']['#secondary'], |
|
60 |
'#secondary' => $variables['tabs']['#secondary'],
|
|
61 | 61 |
); |
62 |
unset($vars['tabs']['#secondary']); |
|
62 |
unset($variables['tabs']['#secondary']);
|
|
63 | 63 |
|
64 |
if (isset($vars['main_menu'])) { |
|
65 |
$vars['primary_nav'] = theme('links__system_main_menu', array( |
|
66 |
'links' => $vars['main_menu'], |
|
64 |
if (isset($variables['main_menu'])) {
|
|
65 |
$variables['primary_nav'] = theme('links__system_main_menu', array(
|
|
66 |
'links' => $variables['main_menu'],
|
|
67 | 67 |
'attributes' => array( |
68 | 68 |
'class' => array('links', 'inline', 'main-menu'), |
69 | 69 |
), |
... | ... | |
75 | 75 |
)); |
76 | 76 |
} |
77 | 77 |
else { |
78 |
$vars['primary_nav'] = FALSE; |
|
78 |
$variables['primary_nav'] = FALSE;
|
|
79 | 79 |
} |
80 |
if (isset($vars['secondary_menu'])) { |
|
81 |
$vars['secondary_nav'] = theme('links__system_secondary_menu', array( |
|
82 |
'links' => $vars['secondary_menu'], |
|
80 |
if (isset($variables['secondary_menu'])) {
|
|
81 |
$variables['secondary_nav'] = theme('links__system_secondary_menu', array(
|
|
82 |
'links' => $variables['secondary_menu'],
|
|
83 | 83 |
'attributes' => array( |
84 | 84 |
'class' => array('links', 'inline', 'secondary-menu'), |
85 | 85 |
), |
... | ... | |
91 | 91 |
)); |
92 | 92 |
} |
93 | 93 |
else { |
94 |
$vars['secondary_nav'] = FALSE; |
|
94 |
$variables['secondary_nav'] = FALSE;
|
|
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
// Prepare header. |
98 | 98 |
$site_fields = array(); |
99 |
if (!empty($vars['site_name'])) { |
|
100 |
$site_fields[] = $vars['site_name']; |
|
99 |
if (!empty($variables['site_name'])) {
|
|
100 |
$site_fields[] = $variables['site_name'];
|
|
101 | 101 |
} |
102 |
if (!empty($vars['site_slogan'])) { |
|
103 |
$site_fields[] = $vars['site_slogan']; |
|
102 |
if (!empty($variables['site_slogan'])) {
|
|
103 |
$site_fields[] = $variables['site_slogan'];
|
|
104 | 104 |
} |
105 |
$vars['site_title'] = implode(' ', $site_fields); |
|
105 |
$variables['site_title'] = implode(' ', $site_fields);
|
|
106 | 106 |
if (!empty($site_fields)) { |
107 | 107 |
$site_fields[0] = '<span>' . $site_fields[0] . '</span>'; |
108 | 108 |
} |
109 |
$vars['site_html'] = implode(' ', $site_fields); |
|
109 |
$variables['site_html'] = implode(' ', $site_fields);
|
|
110 | 110 |
|
111 | 111 |
// Set a variable for the site name title and logo alt attributes text. |
112 |
$slogan_text = $vars['site_slogan']; |
|
113 |
$site_name_text = $vars['site_name']; |
|
114 |
$vars['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text; |
|
112 |
$slogan_text = $variables['site_slogan'];
|
|
113 |
$site_name_text = $variables['site_name'];
|
|
114 |
$variables['site_name_and_slogan'] = $site_name_text . ' ' . $slogan_text;
|
|
115 | 115 |
} |
116 | 116 |
|
117 | 117 |
/** |
118 | 118 |
* Override or insert variables into the node template. |
119 | 119 |
*/ |
120 |
function garland_preprocess_node(&$vars) { |
|
121 |
$vars['submitted'] = $vars['date'] . ' — ' . $vars['name'];
|
|
120 |
function garland_preprocess_node(&$variables) {
|
|
121 |
$variables['submitted'] = $variables['date'] . ' — ' . $variables['name'];
|
|
122 | 122 |
} |
123 | 123 |
|
124 | 124 |
/** |
125 | 125 |
* Override or insert variables into the comment template. |
126 | 126 |
*/ |
127 |
function garland_preprocess_comment(&$vars) { |
|
128 |
$vars['submitted'] = $vars['created'] . ' — ' . $vars['author'];
|
|
127 |
function garland_preprocess_comment(&$variables) {
|
|
128 |
$variables['submitted'] = $variables['created'] . ' — ' . $variables['author'];
|
|
129 | 129 |
} |
130 | 130 |
|
131 | 131 |
/** |
132 | 132 |
* Override or insert variables into the block template. |
133 | 133 |
*/ |
134 |
function garland_preprocess_block(&$vars) { |
|
135 |
$vars['title_attributes_array']['class'][] = 'title'; |
|
136 |
$vars['classes_array'][] = 'clearfix'; |
|
134 |
function garland_preprocess_block(&$variables) {
|
|
135 |
$variables['title_attributes_array']['class'][] = 'title';
|
|
136 |
$variables['classes_array'][] = 'clearfix';
|
|
137 | 137 |
} |
138 | 138 |
|
139 | 139 |
/** |
140 | 140 |
* Override or insert variables into the page template. |
141 | 141 |
*/ |
142 |
function garland_process_page(&$vars) { |
|
142 |
function garland_process_page(&$variables) {
|
|
143 | 143 |
// Hook into color.module |
144 | 144 |
if (module_exists('color')) { |
145 |
_color_page_alter($vars); |
|
145 |
_color_page_alter($variables);
|
|
146 | 146 |
} |
147 | 147 |
} |
148 | 148 |
|
149 | 149 |
/** |
150 | 150 |
* Override or insert variables into the region template. |
151 | 151 |
*/ |
152 |
function garland_preprocess_region(&$vars) { |
|
153 |
if ($vars['region'] == 'header') { |
|
154 |
$vars['classes_array'][] = 'clearfix'; |
|
152 |
function garland_preprocess_region(&$variables) {
|
|
153 |
if ($variables['region'] == 'header') {
|
|
154 |
$variables['classes_array'][] = 'clearfix';
|
|
155 | 155 |
} |
156 | 156 |
} |
Also available in: Unified diff
Update Drupal core to version 7.40