PluginProbe
CSS & JavaScript Toolbox / 7.1
CSS & JavaScript Toolbox v7.1
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / access.points / tinymce.accesspoint.php

tinymce.accesspoint.php in CSS & JavaScript Toolbox 7.1, at access.points/tinymce.accesspoint.php

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJTTinymceAccessPoint extends CJTAccessPoint {
10
11 /**
12 * put your comment there...
13 *
14 */
15 public function __construct() {
16 // initialize base!
17 parent::__construct();
18 // Set name!
19 $this->name = 'tinymce';
20 }
21
22 /**
23 * put your comment there...
24 *
25 */
26 protected function doListen() {
27 // Only if installed!
28 if (CJTPlugin::getInstance()->isInstalled()) {
29 // Don't bother doing this stuff if the current user lacks permissions
30 if ((current_user_can('edit_posts') || current_user_can('edit_pages')) && (get_user_option('rich_editing') == 'true')) {
31 add_filter('mce_external_plugins', array($this, 'registerButton'));
32 }
33 }
34 }
35
36 /**
37 * put your comment there...
38 *
39 * @param mixed $plugins
40 */
41 public function registerButton($plugins) {
42 // Load tinymce/shortcodes view through default controller!
43 $this->controllerName = 'default';
44 $this->route(null, array('view' => 'tinymce/shortcodes'))
45 // Display
46 ->setAction('display')
47 ->_doAction();
48 // Don't register anything, we just use this filter as Action.
49 return $plugins;
50 }
51
52 } // End class