-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathextension.driver.php
61 lines (50 loc) · 1.47 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
56
57
58
59
60
61
<?php
Class extension_association_ui_selector extends Extension
{
protected static $provides = array();
public static function registerProviders()
{
self::$provides = array(
'association-ui' => array(
'aui-selector' => 'Selector: Search',
'aui-selector-sortable' => 'Selector: Search (sortable)',
)
);
return true;
}
public static function providerOf($type = null)
{
self::registerProviders();
if (is_null($type)) {
return self::$provides;
}
if (!isset(self::$provides[$type])) {
return array();
}
return self::$provides[$type];
}
/**
* {@inheritDoc}
*/
public function getSubscribedDelegates()
{
return array(
array(
'page' => '/backend/',
'delegate' => 'InitaliseAdminPageHead',
'callback' => 'appendAssets'
)
);
}
/**
* Append assets
*/
public function appendAssets()
{
$callback = Symphony::Engine()->getPageCallback();
if ($callback['driver'] == 'publish') {
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/association_ui_selector/assets/aui.selector.publish.css');
Administration::instance()->Page->addScriptToHead(URL . '/extensions/association_ui_selector/assets/aui.selector.publish.js');
}
}
}