-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
55 lines (49 loc) · 1.3 KB
/
extension.driver.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
<?php
class Extension_QuickDS extends Extension {
public function about() {
return array(
'name' => 'QuickDS',
'version' => '1.2',
'release-date' => '2010-04-05',
'author' => array(
'name' => 'Nathan Martin',
'website' => 'http://knupska.com',
'email' => '[email protected]'
),
'description' => 'Quickly add & remove datasources from pages.'
);
}
public function getSubscribedDelegates() {
return array(
array(
'page' => '/system/preferences/',
'delegate' => 'AddCustomPreferenceFieldsets',
'callback' => 'edit'
),
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'initaliseAdminPageHead'
)
);
}
public function fetchNavigation() {
return array(
array(
'location' => 'Blueprints',
'name' => 'QuickDS',
'link' => '/edit/'
)
);
}
public function initaliseAdminPageHead($context) {
$page = $context['parent']->Page;
if ($page instanceof contentExtensionQuickDSEdit) {
$page->addScriptToHead(URL . '/extensions/quickds/assets/collapse_quickds.js', 100000);
}
if ($page instanceof contentBlueprintsDatasources) {
$page->addScriptToHead(URL . '/extensions/quickds/assets/shortcut_quickds.js', 100000);
}
}
}
?>