Projet

Général

Profil

Paste
Télécharger (2,96 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / sky / template.php @ 4b706e38

1 85ad3d82 Assos Assos
<?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 98c5df5c Assos Assos
  if(!empty($vars['submitted']) && $vars['display_submitted']) {
87
    if ($vars['user_picture']) {
88
      $vars['header_attributes_array']['class'][] = 'with-picture';
89
    }
90 85ad3d82 Assos Assos
  }
91
}
92
93
/**
94
 * Override or insert variables into the comment template.
95
 */
96
function sky_preprocess_comment(&$vars) {
97
  // Add class if user picture exists
98
  if ($vars['picture']) {
99
    $vars['header_attributes_array']['class'][] = 'with-user-picture';
100
  }
101
}
102
103
104
/**
105
 * Process variables for region.tpl.php
106
 */
107
function sky_process_region(&$vars) {
108
  // Add the click handle inside region menu bar
109
  if ($vars['region'] === 'menu_bar') {
110
    $vars['inner_prefix'] = '<h2 class="menu-toggle"><a href="#">' . t('Menu') . '</a></h2>';
111
  }
112
}