-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.php
96 lines (82 loc) · 2.86 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
94
95
<?php
// $Id$
/**
* Override of theme_ting_search_form().
*/
function elsinore_ting_search_form($form){
$form['submit']['#type'] = "submit" ;
$form['submit']['#src'] = drupal_get_path('theme','elsinore')."/images/searchbutton.png";
$form['submit']['#attributes']['class'] = "";
return drupal_render($form);
}
/**
* Override of theme_user_login_block().
*/
function elsinore_user_login_block($form){
$form['submit']['#type'] = "image_button" ;
$form['submit']['#src'] = drupal_get_path('theme','elsinore')."/images/accountlogin.png";
$form['submit']['#attributes']['class'] = "";
$name = drupal_render($form['name']);
$pass = drupal_render($form['pass']);
$submit = drupal_render($form['submit']);
$remember = drupal_render($form['remember_me']);
return $name . $pass .$submit . $remember . drupal_render($form);
}
/**
* Override of theme_menu_item_link().
*/
function elsinore_menu_item_link($link) {
if ($link['href'] == 'http://nolink') {
return '<span class="nolink">' . check_plain($link['title']) . '</span>';
}
else {
return theme_menu_item_link($link);
}
}
/**
* Preprocess page template variables.
*/
function elsinore_preprocess_page(&$variables) {
// Add KPI index noscript to the closure.
$variables['closure'] .= <<<HTML
<noscript>
<img alt="" border="0" name="DCSIMG" width="1" height="1" src="https://visionize10.visionize.dk/dcsc6jmhht3uwyqgqs2ngnzic_2h8s/njs.gif?dcsuri=/nojavascript&WT.js=No&WT.tv=8.0.2"/>
</noscript>
HTML;
}
/**
* Preprocess node template variables.
*/
function elsinore_preprocess_node(&$variables) {
if ($variables['type'] == 'page' && isset($variables['field_page_type'][0]['safe'])) {
$page_type = $variables['field_page_type'][0]['safe'];
if (!empty($page_type)) {
$variables['classes'] .= ' page-type-' . $page_type;
}
}
}
/**
* Preprocess library location pane template variables.
*/
function elsinore_preprocess_ding_panels_content_library_location(&$variables) {
$node = $variables['node'];
// Add a static Google map to the location information.
if (function_exists('location_has_coordinates') && location_has_coordinates($node->location)) {
$map_url = url('http://maps.google.com/maps/api/staticmap', array('query' => array(
'zoom' => 14,
'size' => '210x210',
'markers' => $node->location['latitude'] . ',' . $node->location['longitude'],
'sensor' => 'false',
)));
$variables['library_map'] = theme('image', $map_url, '', '', NULL, FALSE);
}
}
/**
* Preprocess library title pane template variables.
*/
function elsinore_preprocess_ding_panels_content_library_title(&$variables) {
if (isset($variables['library_links'])) {
$variables['library_links']['events'] = l('Det sker', $variables['base_url'] . '/arrangementer');
$variables['library_navigation'] = theme('item_list', $variables['library_links']);
}
}