-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.php
More file actions
55 lines (46 loc) · 1.34 KB
/
controller.php
File metadata and controls
55 lines (46 loc) · 1.34 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Concrete\Package\EcRedactorPluginSample;
use AssetList;
use Concrete\Core\Editor\Plugin;
use Concrete\Core\Package\Package;
use Core;
class Controller extends Package
{
protected $pkgHandle = 'ec_redactor_plugin_sample';
protected $appVersionRequired = '5.7.4';
protected $pkgVersion = '0.9.0';
public function getPackageName()
{
return t('ExchangeCore Redactor Plugin Sample');
}
public function getPackageDescription()
{
return t('A super simple example of including a redactor plugin');
}
public function on_start()
{
$this->registerAssets();
$plugin = new Plugin();
$plugin->setKey('ec_redactor_plugin_sample_alert');
$plugin->setName(t('Alert'));
$plugin->requireAsset('editor/plugin/ec_alert');
Core::make('editor')->getPluginManager()->register($plugin);
}
public function registerAssets()
{
$assetList = AssetList::getInstance();
$assetList->register(
'javascript',
'editor/plugin/ec_alert',
'assets/js/redactor_alert.js',
array(),
$this->pkgHandle
);
$assetList->registerGroup(
'editor/plugin/ec_alert',
array(
array('javascript', 'editor/plugin/ec_alert')
)
);
}
}