This repository has been archived by the owner on May 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
92 lines (77 loc) · 2.63 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
<?php
/**
* @file
* Template code for the Copenhagen theme.
*/
/* forms */
/**
* Override from base theme to switch background image
*/
function copenhagen_user_login_block($form) {
$form['submit']['#type'] = "image_button" ;
$form['submit']['#src'] = drupal_get_path('theme', 'copenhagen') . "/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 from base theme to switch background image and set example text
*/
function copenhagen_ting_search_form($form) {
$form['submit']['#type'] = "image_button" ;
$form['submit']['#src'] = drupal_get_path('theme', 'copenhagen') . "/images/searchbutton.png";
$form['submit']['#attributes']['class'] = "";
$form['example_text']['#value'] = '<div class="example">' . theme('item_list', array(
l(t('Feltsøgning'), 'https://kbhweb.axielldrift.dk/sites/KBHXWW/ ', array('absolute' => TRUE)),
)) . '</div>';
return drupal_render($form);
}
/**
* Collapse groups of loans which are not overdue into one.
*
* Overrides the module behavior.
*/
function copenhagen_ding_library_user_loan_list_form($form) {
// Make sure we have somewhere to place our loans.
if (!isset($form['loan_data']['#grouped']['due'])) {
$form['loan_data']['#grouped']['due'] = array();
}
foreach ($form['loan_data']['#grouped'] as $date => $group) {
if (!in_array($date, array('overdue', 'due'))) {
// Merge date group contents into due group.
$form['loan_data']['#grouped']['due'] += $group;
// Remove date group.
unset($form['loan_data']['#grouped'][$date]);
}
}
return theme_ding_library_user_loan_list_form($form);
}
/**
* Preprocess variables for the page template.
*/
function copenhagen_preprocess_page(&$variables) {
$variables['navigation_en_flag'] = l(theme('image',
$variables['directory'] . '/images/flag-gb.png', 'Information in English'), 'english', array(
'attributes' => array('class' => 'navigation-en-flag'),
'html' => TRUE,
));
}
/**
* Preprocess variables for the block templates.
*/
function copenhagen_preprocess_block(&$variables) {
if ($variables['id_block'] == 'block-ding-library-user-account') {
$variables['classes'] .= ' clear-block';
}
}
/**
* Preprocess variables for the node templates.
*/
function copenhagen_preprocess_node(&$variables) {
if ($variables['type'] == 'profile') {
$variables['author'] = user_load($variables['uid']);
}
}