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 1
/
template.php
56 lines (49 loc) · 1.67 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
<?php
/**
* Implementation of hook_preprocess_page.
*/
function cph_mobile_preprocess_page(&$vars) {
// Don't display empty help from node_help().
if ($vars['help'] == "<div class=\"help\"> \n</div>") {
$vars['help'] = '';
}
// Set variables for the logo and site_name.
if (isset($vars['logo'])) {
// Return the site_name even when site_name is disabled in theme settings.
$vars['logo_alt_text'] = (!isset($vars['logo_alt_text']) ? variable_get('site_name', '') : $vars['logo_alt_text']);
$vars['site_logo'] = '<a class="site-logo" href="'. $vars['front_page'] .'" title="'. t('Home page') .'" rel="home"><img src="'. $vars['logo'] .'" alt="'. $vars['logo_alt_text'] .'" /></a>';
}
}
/**
* Implementation of hook_theme.
*/
function cph_mobile_theme() {
return array(
'user_login' => array(
'arguments' => array('form' => NULL),
),
'ting_search_form' => array(
'arguments' => array('form' => NULL),
),
);
}
/**
* Theme function used to change the login box.
*
* Alternator hiddes some information, that we do not... so we overwrite it here.
*/
function cph_mobile_user_login($form) {
return drupal_render($form);
}
/**
* Theme function that can be used to remove stuff form the search form. The
* h2 headline can be disabled on the block for current theme.
*/
function cph_mobile_ting_search_form($form){
// remove example text
unset($form['example_text']);
// Change submit button from input[type=submit] to submit[type=image]
$form['submit']['#type'] = 'image_button';
$form['submit']['#attributes']['src'] = "/" . drupal_get_path('theme', 'cph_mobile') . "/images/button-search.png";
return drupal_render($form);
}