-
Notifications
You must be signed in to change notification settings - Fork 12
/
extension.driver.php
executable file
·43 lines (30 loc) · 1.28 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
<?php
Class extension_richtext_tinymce extends Extension{
public function about(){
return array('name' => 'Formatter: Rich Text (TinyMCE)',
'version' => '1.01',
'release-date' => '2009-07-23',
'author' => array('name' => 'Symphony Team',
'website' => 'http://www.symphony21.com',
'email' => 'team@symphony21.com')
);
}
public function getSubscribedDelegates(){
return array(
array(
'page' => '/backend/',
'delegate' => 'ModifyTextareaFieldPublishWidget',
'callback' => 'modifyTextarea'
),
);
}
public function modifyTextarea($context){
if($context['field']->get('formatter') != 'tinymce') return;
if(!defined('__TINYMCE_SCRIPTS_IN_HEAD__') || !__TINYMCE_SCRIPTS_IN_HEAD__){
define_safe('__TINYMCE_SCRIPTS_IN_HEAD__', true);
Administration::instance()->Page->addScriptToHead(URL . '/extensions/richtext_tinymce/lib/tiny_mce.js', 200);
Administration::instance()->Page->addScriptToHead(URL . '/extensions/richtext_tinymce/assets/applyMCE.js', 210);
}
$context['textarea']->setAttribute('id', trim($context['textarea']->getAttribute('id') . ' ' . $context['field']->get('element_name')));
}
}