-
Notifications
You must be signed in to change notification settings - Fork 0
/
spaces.api.php
64 lines (60 loc) · 1.64 KB
/
spaces.api.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
<?php
// $Id: spaces.api.php,v 1.1.2.1 2009/12/14 23:19:35 yhahn Exp $
/**
* @file
* Hooks provided by Spaces.
*/
/**
* CTools plugin API hook for Spaces. Note that a proper entry in
* hook_ctools_plugin_api() must exist for this hook to be called.
*/
function hook_spaces_plugins() {
$plugins = array();
$plugins['space_foo'] = array(
'handler' => array(
'path' => drupal_get_path('module', 'foo') .'/plugins',
'file' => 'space_foo.inc',
'class' => 'space_foo',
'parent' => 'space_type',
),
);
return $plugins;
}
/**
* Registry hook for controllers, space types.
*
* Each entry associates a controller or space type with the CTools plugin to
* be used as its plugin class. For space types, a path may be provided where
* spaces-specific menu items can be automatically grafted in as local tasks.
*/
function hook_spaces_registry() {
return array(
'controllers' => array(
'object_type' => array(
'title' => t('Name of the object type'),
'plugin' => 'spaces_controller_object_type',
),
),
'types' => array(
'space_foo' => array(
'title' => t('Name of the space type'),
'plugin' => 'space_foo',
'path' => 'foo/%foo',
),
),
);
}
/**
* Alter the registry.
*
* Allows modules to alter the registry. Default plugins can be replaced by
* custom ones declared in hook_spaces_plugins().
*
* @param $registry
* The registry, passed by reference.
*/
function hook_spaces_registry_alter(&$registry) {
if (isset($registry['controllers']['variable'])) {
$registry['controllers']['variable']['plugin'] = 'custom_controller_plugin';
}
}