-
Notifications
You must be signed in to change notification settings - Fork 2
/
unl_multisite.module
83 lines (71 loc) · 1.84 KB
/
unl_multisite.module
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
<?php
/**
* Implements hook_block_info()
*/
function unl_multisite_block_info() {
$blocks = array();
$blocks['my_sites'] = array(
'info' => 'My Sites',
'cache' => DRUPAL_CACHE_PER_USER,
);
return $blocks;
}
/**
* Implements hook_block_view()
*/
function unl_multisite_block_view($delta = '') {
switch ($delta) {
case 'my_sites':
return unl_multisite_block_view_my_sites();
break;
default:
return array();
}
}
/**
* Implements hook_block_view('my_sites').
* Displays the list of sites/roles for the current user.
*/
function unl_multisite_block_view_my_sites() {
if (\Drupal::currentUser()->isAnonymous()) {
return array();
}
require_once 'unl_site_creation.php';
$block = array();
$block['content'] = _unl_get_user_audit_content(\Drupal::currentUser()->name);
return $block;
}
/**
* Implements hook_help().
*/
function unl_multisite_help($path, $arg) {
switch ($path) {
case 'admin/sites/unl/aliases':
case 'admin/sites/unl/%/aliases':
return '<p>Be careful when deleting aliases. While long, ugly paths may not appear to be needed they may still be in use - for instance in a ProxyPass setup on another server.</p>';
}
}
/**
* Implements hook_element_info_alter().
*/
function unl_multisite_element_info_alter(array &$types) {
// Attach our extra CSS for toolbar icons.
if (isset($types['toolbar'])) {
$types['toolbar']['#attached']['library'][] = 'unl_multisite/toolbar';
}
}
/**
* Implementation of hook_theme().
*/
//function unl_multisite_theme() {
// return array(
// 'unl_site_details' => array(
// 'variables' => array('site_path' => NULL, 'uri' => NULL, 'db_prefix' => NULL),
// 'file' => 'unl_site_creation.php',
// ),
// 'unl_table' => array(
// 'render element' => 'form',
// 'file' => 'unl_site_creation.php',
// ),
// );
//}