forked from tachyondecay/preview_textarea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.driver.php
29 lines (26 loc) · 1.06 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
<?php
Class Extension_Preview_Textarea extends Extension {
public function getSubscribedDelegates() {
return array(
array(
'page' => '/backend/',
'delegate' => 'AdminPagePreGenerate',
'callback' => '__appendAssets'
),
);
}
public function __appendAssets(&$context) {
if(class_exists('Administration')
&& Administration::instance() instanceof Administration
&& Administration::instance()->Page instanceof HTMLPage
) {
$callback = Administration::instance()->getPageCallback();
// Let the jQuery magic flow
if($context['oPage'] instanceof contentPublish) {
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/preview_textarea/assets/preview_textarea.publish.css', 'screen', 100, false);
Administration::instance()->Page->addStylesheetToHead(URL . '/extensions/preview_textarea/assets/preview_textarea.user.css', 'screen', 1000, false);
Administration::instance()->Page->addScriptToHead(URL . '/extensions/preview_textarea/assets/preview_textarea.publish.js', 100, false);
}
}
}
}