1
|
<?php
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
function urbansolice_preprocess_page (&$vars) {
|
7
|
$vars['preface'] = count(array_filter(array($vars['page']['preface_one'], $vars['page']['preface_two'], $vars['page']['preface_three'])));
|
8
|
$vars['bottom'] = count(array_filter(array($vars['page']['bottom_one'], $vars['page']['bottom_two'], $vars['page']['bottom_three'], $vars['page']['bottom_four'])));
|
9
|
|
10
|
$vars['user_links'] = _urbansolice_user_links();
|
11
|
|
12
|
}
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
function _urbansolice_user_links() {
|
18
|
|
19
|
global $user;
|
20
|
$user_links = array();
|
21
|
if (empty($user->uid)) {
|
22
|
$user_links['login'] = array('title' => t('Login'), 'href' => 'user');
|
23
|
|
24
|
if (variable_get('user_register', 1)) {
|
25
|
$user_links['register'] = array('title' => t('Register'), 'href' => 'user/register');
|
26
|
}
|
27
|
}
|
28
|
else {
|
29
|
$user_links['account'] = array('title' => t('Hello @username', array('@username' => $user->name)), 'href' => 'user', 'html' => TRUE);
|
30
|
$user_links['logout'] = array('title' => t('Logout'), 'href' => "logout");
|
31
|
}
|
32
|
return $user_links;
|
33
|
}
|