PluginProbe
CSS & JavaScript Toolbox / 6.0.9
CSS & JavaScript Toolbox v6.0.9
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 / views / tinymce / shortcodes / view.php

view.php in CSS & JavaScript Toolbox 6.0.9, at views/tinymce/shortcodes/view.php

77 lines 1.6 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 // No direct access.
7 defined('ABSPATH') or die('Access denied');
8
9 /**
10 *
11 */
12 class CJTTinymceShortcodesView extends CJTView {
13
14 /**
15 * put your comment there...
16 *
17 * @param mixed $info
18 * @return CJTTinymceShortcodesView
19 */
20 public function __construct($info) {
21 // Initialize parent!
22 parent::__construct($info);
23 // Register TinyMCE Plugin with Wordpress!
24 add_filter('mce_external_plugins', array($this, 'registerPlugin'), 1, 11);
25 // Add TinyMCE button for adding shortcode!
26 add_filter('mce_buttons', array($this, 'addButton'));
27 // Enqueue dependencies scripts.
28 self::enqueueScripts();
29 }
30
31 /**
32 * put your comment there...
33 *
34 * @param mixed $buttons
35 */
36 public function addButton($buttons) {
37 // Add Blocks Shortcode button!
38 array_push($buttons, 'separator', 'CJTBlockShortcode');
39 return $buttons;
40 }
41
42 /**
43 * put your comment there...
44 *
45 * @param mixed $tpl
46 */
47 public function display($tpl = null) {
48 // Push vars into view!
49
50 // Output view!
51 echo $this->getTemplate($tpl);
52 }
53
54 /**
55 * put your comment there...
56 *
57 */
58 public function enqueueScripts() {
59 // Please thos scripts below should be already loaded
60 // by the metabox views If the tinymce is loaded inside the editbox
61 // IN OTHER CASES!!! what is the other cases! we load it!
62 self::useScripts(__CLASS__, 'framework:js:ajax:{CJT-}cjt-server');
63 }
64
65 /**
66 * put your comment there...
67 *
68 * @param mixed $plugins
69 */
70 public function registerPlugin($plugins) {
71 // Register shortcode TinyMCE button Plugin.
72 $plugins['CJTShortcodes'] = $this->getURI('plugins/shortcode/shortcode.js');
73 return $plugins;
74 }
75
76 } // End class.
77