This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.php
93 lines (81 loc) · 2.41 KB
/
template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* Preprocesses the wrapping HTML.
*
* @param array &$variables
* Template variables.
*/
function pims_preprocess_html(&$vars) {
global $user ;
if($user->uid === 0)
{
drupal_add_css(
path_to_theme() . '/css/pims-anonymous.css',
array('group' => CSS_THEME, 'every_page' => FALSE
)
) ;
}
if($vars['is_front'])
{
drupal_add_css(
path_to_theme() . '/css/pims-front.css',
array('group' => CSS_THEME, 'every_page' => FALSE
)
) ;
}
// Setup IE meta tag to force IE rendering mode
$meta_viewport = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no',
)
);
// Add header meta tag for IE to head
drupal_add_html_head($meta_viewport, 'meta_viewport');
}
function pims_preprocess_maintenance_page(&$vars) {
drupal_add_css(
path_to_theme() . '/css/pims-maintenance.css',
array('group' => CSS_THEME, 'every_page' => FALSE
)
) ;
}
function pims_preprocess_page(&$vars) {
global $user ;
if($user->uid === 0)
{
$vars['theme_hook_suggestion'] = 'page__anonymous' ;
} elseif($vars['is_front'])
{
$vars['theme_hook_suggestion'] = 'page__front' ;
} else
{
$vars['theme_hook_suggestion'] = 'page__authenticated' ;
}
}
function pims_preprocess_region(&$vars) {
if($vars['is_front']) {
$vars['classes_array'][] = 'tile-group' ;
$vars['classes_array'][] = 'no-margin' ;
$vars['classes_array'][] = 'no-padding' ;
} elseif($vars['region'] == 'sidebar_first') {
$vars['classes_array'][] = 'place-left' ;
$vars['classes_array'][] = 'cell' ;
}
}
function pims_preprocess_block(&$vars) {
if($vars['is_front'] && $vars['block']->region == 'front') {
$vars['classes_array'][] = 'tile-large' ;
$vars['classes_array'][] = 'block-front' ;
}
}
/**
* Add line breaks to field
*/
//function pims_preprocess_field(&$vars, $hook) {
// if(($vars['element']['#field_type'] == 'text_long' || $vars['element']['#field_type'] == 'text_with_summary')) {
// $vars['items'][0]['#markup'] = "nl2br" . nl2br($vars['items'][0]['#markup']);
// }
//}