-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.php
More file actions
80 lines (65 loc) · 2.55 KB
/
Copy pathtemplate.php
File metadata and controls
80 lines (65 loc) · 2.55 KB
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
<?php
// $Id: template.php,v 1.1 2010/09/11 20:26:56 atelier Exp $
/**
* Breadcrumb modification
*/
function grunge_breadcrumb($breadcrumb) {
if (!empty($breadcrumb['breadcrumb'])) {
return '<div class="breadcrumb"><span class="sep">' . t('You are here »') . '</span>' . implode(' » ', $breadcrumb['breadcrumb']) . '</div>';
}
}
function grunge_preprocess_page(&$vars) {
static $grid;
// add in the background override
$header_background = theme_get_setting('header_background_file', 'grunge');
if ( $header_background ) {
$data = "body, .footer-wrapper { background-image: url($header_background) ! important; }";
drupal_add_css($data, array("type"=>"inline"));
}
// Initialize grid info once per page
if (!isset($grid)) {
$grid = fusion_core_grid_info();
}
// reinstate d6 fusion variables
$vars['sidebar_first_width'] = $grid['name'] . $grid['sidebar_first_width'];
$vars['sidebar_second_width'] = $grid['name'] . $grid['sidebar_second_width'];
}
function grunge_preprocess_region(&$vars) {
static $grid;
// Initialize grid info once per page
if (!isset($grid)) {
$grid = fusion_core_grid_info();
}
// reinstate d6 fusion variables
$vars['sidebar_first_width'] = $grid['name'] . $grid['sidebar_first_width'];
$vars['sidebar_second_width'] = $grid['name'] . $grid['sidebar_second_width'];
}
function grunge_preprocess_block(&$vars) {
static $grid;
// Initialize grid info once per page
if (!isset($grid)) {
$grid = fusion_core_grid_info();
}
// reinstate d6 fusion variables
$vars['sidebar_first_width'] = $grid['name'] . $grid['sidebar_first_width'];
$vars['sidebar_second_width'] = $grid['name'] . $grid['sidebar_second_width'];
}
function grunge_preprocess_node(&$vars) {
// override the header background for this node
if ( $vars['page'] ){
if ( isset($vars['field_header_background']) ) {
$header_background = $vars['node']->field_header_background['und'][0]['filename'];
// url
$vars['masthead_raw'] = image_style_url('header-background', $header_background);
// html
// $vars['masthead'] = theme_image_style(array('style_name' => 'header-background', 'path' => $header_background, 'width'=>960, 'height'=>'auto'));
if ( $header_background ) {
$data = "body, .footer-wrapper { background-image: url(" . $vars['masthead_raw'] . ") ! important; }";
drupal_add_css($data, array("type"=>"inline"));
}
unset($vars['field_header_background']);
unset($vars['node']->field_header_background);
// krumo($vars);
}
}
}