forked from linnovate/socrates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.php
executable file
·73 lines (65 loc) · 1.94 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
<?php
/**
* @file
* template.php
*/
/**
* Implements hook_theme().
*/
function socrates_theme() {
$items = array();
$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'socrates') . '/templates',
'template' => 'user-login',
'preprocess functions' => array(
'socrates_preprocess_user_login'
),
);
$items['user_register_form'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'socrates') . '/templates',
'template' => 'user-register-form',
'preprocess functions' => array(
'socrates_preprocess_user_register_form'
),
);
$items['user_pass'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'socrates') . '/templates',
'template' => 'user-pass',
'preprocess functions' => array(
'socrates_preprocess_user_pass'
),
);
return $items;
}
/**
* Implements hook_preprocess_user_login().
*/
function socrates_preprocess_user_login(&$variables) {
global $language;
$prefix = (count(language_list()) == '1') ? '' : '/' . $language->language;
$variables['intro_text'] = t('Welcome to the ')
. variable_get('site_name', 'Default');
$variables['user_pass_url'] = $prefix . '/user/password';
$variables['user_create_url'] = $prefix . '/user/register';
}
/**
* Implements hook_preprocess_user_register_form().
*/
function socrates_preprocess_user_register_form(&$variables) {
global $language;
$prefix = (count(language_list()) == '1') ? '' : '/' . $language->language;
$variables['intro_text'] = t('Welcome to the ')
. variable_get('site_name', 'Default');
$variables['user_pass_url'] = $prefix . '/user/password';
$variables['user_login_url'] = $prefix . '/user/login';
}
/**
* Implements hook_preprocess_user_pass().
*/
function socrates_preprocess_user_pass(&$variables) {
$variables['intro_text'] = t('Welcome to the ')
. variable_get('site_name', 'Default');
}