-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextension.driver.php
More file actions
40 lines (33 loc) · 1.11 KB
/
extension.driver.php
File metadata and controls
40 lines (33 loc) · 1.11 KB
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
<?php
class extension_fancy_box extends Extension {
public function about(){
return array(
'name' => 'FancyBox Plugin',
'version' => '1.0',
'release-date' => '2009-12-04',
'author' => array(
'name' => 'Rainer Borene',
'website' => 'http://rainerborene.com/',
'email' => 'rainerborene@gmail.com'
)
);
}
public function getSubscribedDelegates(){
return array(
array(
'page' => '/backend/',
'delegate' => 'AdminPagePreGenerate',
'callback' => 'appendAssets'
)
);
}
public function appendAssets($context){
$callback = Administration::instance()->getPageCallback();
if ($callback['driver'] == 'publish' && ($callback['context']['page'] == 'index' || $callback['context']['page'] == 'edit')) {
$page = Administration::instance()->Page;
$page->addStylesheetToHead(URL . '/extensions/fancy_box/assets/jquery.fancybox-1.2.6.css', 'screen', 40);
$page->addScriptToHead(URL . '/extensions/fancy_box/assets/jquery.fancybox-1.2.6.pack.js', 100);
$page->addScriptToHead(URL . '/extensions/fancy_box/assets/fancybox.js', 101);
}
}
}