root / htmltest / sites / all / themes / sky / template.php @ 6c38d829
1 |
<?php
|
---|---|
2 |
// Sky by Adaptivethemes.com
|
3 |
|
4 |
/**
|
5 |
* Override or insert variables into the html template.
|
6 |
*/
|
7 |
function sky_preprocess_html(&$vars) { |
8 |
global $theme_key; |
9 |
$theme_name = $theme_key; |
10 |
|
11 |
// Add a class for the active color scheme
|
12 |
if (module_exists('color')) { |
13 |
$class = check_plain(get_color_scheme_name($theme_name)); |
14 |
$vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class); |
15 |
} |
16 |
|
17 |
// Add class for the active theme
|
18 |
$vars['classes_array'][] = drupal_html_class($theme_name); |
19 |
|
20 |
// Browser sniff and add a class, unreliable but quite useful
|
21 |
// $vars['classes_array'][] = css_browser_selector();
|
22 |
|
23 |
// Add theme settings classes
|
24 |
$settings_array = array( |
25 |
'box_shadows',
|
26 |
'body_background',
|
27 |
'menu_bullets',
|
28 |
'menu_bar_position',
|
29 |
'content_corner_radius',
|
30 |
'tabs_corner_radius',
|
31 |
); |
32 |
foreach ($settings_array as $setting) { |
33 |
$vars['classes_array'][] = at_get_setting($setting); |
34 |
} |
35 |
} |
36 |
|
37 |
/**
|
38 |
* Override or insert variables into the html template.
|
39 |
*/
|
40 |
function sky_process_html(&$vars) { |
41 |
// Hook into the color module.
|
42 |
if (module_exists('color')) { |
43 |
_color_html_alter($vars);
|
44 |
} |
45 |
} |
46 |
|
47 |
/**
|
48 |
* Override or insert variables into the page template.
|
49 |
*/
|
50 |
function sky_preprocess_page(&$vars) { |
51 |
if ($vars['page']['footer'] || $vars['page']['four_first']|| $vars['page']['four_second'] || $vars['page']['four_third'] || $vars['page']['four_fourth']) { |
52 |
$vars['classes_array'][] = 'with-footer'; |
53 |
} |
54 |
} |
55 |
|
56 |
/**
|
57 |
* Override or insert variables into the page template.
|
58 |
*/
|
59 |
function sky_process_page(&$vars) { |
60 |
// Hook into the color module.
|
61 |
if (module_exists('color')) { |
62 |
_color_page_alter($vars);
|
63 |
} |
64 |
} |
65 |
|
66 |
/**
|
67 |
* Override or insert variables into the block template.
|
68 |
*/
|
69 |
function sky_preprocess_block(&$vars) { |
70 |
if ($vars['block']->module == 'superfish' || $vars['block']->module == 'nice_menu') { |
71 |
$vars['content_attributes_array']['class'][] = 'clearfix'; |
72 |
} |
73 |
if (!$vars['block']->subject) { |
74 |
$vars['content_attributes_array']['class'][] = 'no-title'; |
75 |
} |
76 |
if ($vars['block']->region == 'menu_bar' || $vars['block']->region == 'top_menu') { |
77 |
$vars['title_attributes_array']['class'][] = 'element-invisible'; |
78 |
} |
79 |
} |
80 |
|
81 |
/**
|
82 |
* Override or insert variables into the node template.
|
83 |
*/
|
84 |
function sky_preprocess_node(&$vars) { |
85 |
// Add class if user picture exists
|
86 |
if ($vars['user_picture']) { |
87 |
$vars['header_attributes_array']['class'][] = 'with-picture'; |
88 |
} |
89 |
} |
90 |
|
91 |
/**
|
92 |
* Override or insert variables into the comment template.
|
93 |
*/
|
94 |
function sky_preprocess_comment(&$vars) { |
95 |
// Add class if user picture exists
|
96 |
if ($vars['picture']) { |
97 |
$vars['header_attributes_array']['class'][] = 'with-user-picture'; |
98 |
} |
99 |
} |
100 |
|
101 |
|
102 |
/**
|
103 |
* Process variables for region.tpl.php
|
104 |
*/
|
105 |
function sky_process_region(&$vars) { |
106 |
// Add the click handle inside region menu bar
|
107 |
if ($vars['region'] === 'menu_bar') { |
108 |
$vars['inner_prefix'] = '<h2 class="menu-toggle"><a href="#">' . t('Menu') . '</a></h2>'; |
109 |
} |
110 |
} |
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|