-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathextension.driver.php
60 lines (50 loc) · 1.56 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
<?php
/**
* @package sym_requirejs
* @author thomas appel <[email protected]>
* Displays <a href="http://opensource.org/licenses/gpl-3.0.html">GNU Public License</a>
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License
*/
Class extension_sym_requirejs extends Extension {
public function about() {
return array(
'name' => 'requirejs',
'type' => 'script',
'version' => '1.3',
'release-date' => '2012-04-17',
'author' => array(
'name' => 'Thomas Appel',
'email' => '[email protected]',
'website' => 'http://thomas-appel.com'
),
'description' => 'adds requirejs amd library to the backend',
'compatibility' => array(
'2.2' => true
)
);
}
public function __construct(Array $args) {
parent::__construct($args);
$reqirepath = EXTENSION . '/requirejs/assets/requirejs/require.js';
//if(!is_file($path)) {
//throw new SymphonyErrorPage(__('Please make sure to include submodules as well. Try <code>git submodule update --init</code> from within the extensions/requirejs path'));
//}
}
public function getSubscribedDelegates() {
return array(
// Subsection Manager
array(
'page' => '/backend/',
'delegate' => 'AdminPagePreGenerate',
'callback' => '__appendAssets'
),
);
}
public function __appendAssets($context) {
$callback = Symphony::Engine()->getPageCallback();
// Append Script for publish area
if($callback['driver'] == 'publish') {
Administration::instance()->Page->addScriptToHead(URL . '/extensions/sym_requirejs/assets/require.js', 111, false);
}
}
}