-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.php
57 lines (47 loc) · 1.92 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
<?php
function metropol_ting_search_form($form){
$form['keys']['#prefix'] = '<div id="search">';
$form['keys']['#suffix'] = '</div>';
$form['submit']['#type'] = "image_button" ;
$form['submit']['#src'] = drupal_get_path('theme','metropol')."/images/magnifier.png";
$form['submit']['#attributes']['class'] = '';
// Override example links.
$links = array(
l(t('Feltsøgning'), 'http://integrabib.dk/phmetropol/sogning.php', array('absolute' => true)),
);
$form['example_text']['#value'] = '<div class="example">'. theme('item_list', $links).'</div>';
return drupal_render($form);
}
function metropol_user_login_block($form){
$form['submit']['#type'] = "image_button" ;
$form['submit']['#src'] = drupal_get_path('theme','metropol')."/images/login-btn.png";
$form['submit']['#attributes']['class'] = '';
$title = '<p class="login-label">Log ind</p>';
$name = drupal_render($form['name']);
$pass = drupal_render($form['pass']);
$submit = drupal_render($form['submit']);
$remember = drupal_render($form['remember_me']);
return $title . $name . $pass . $submit . $remember . drupal_render($form);
}
function metropol_feed_icon($url,$title){
if ($image = theme('image', drupal_get_path('theme', 'metropol').'/images/rss.png', t('RSS feed'), t('RSS feed'))) {
// Transform view expose query string in to drupal style arguments -- ?library=1 <-> /1
if ($pos = strpos($url, '?')) {
$base = substr($url, 0, $pos);
$parm = '';
foreach ($_GET as $key => $value) {
if ($key != 'q') {
$parm .= '/' . strtolower($value);
}
}
// Extra fix for event arrangementer?library=x, as it wants taks. id/lib. id
if (isset($_GET['library'])) {
if (arg(1) == '') {
$parm = '/all'.$parm;
}
}
$url = $base.$parm;
}
return '<a href="'. check_url($url) .'" class="feed-icon">'. $image .'<span>'. t('RSS') .'</span></a>';
}
}