PluginProbe
CSS & JavaScript Toolbox / 7.2
CSS & JavaScript Toolbox v7.2
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 7.2, at views/tinymce/shortcodes/view.php

87 lines 1.8 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 self::enqueueStyles();
30 }
31
32 /**
33 * put your comment there...
34 *
35 * @param mixed $buttons
36 */
37 public function addButton($buttons) {
38 // Add Blocks Shortcode button!
39 array_push($buttons, 'separator', 'CJTBlockShortcode');
40 return $buttons;
41 }
42
43 /**
44 * put your comment there...
45 *
46 * @param mixed $tpl
47 */
48 public function display($tpl = null) {
49 // Output view!
50 echo $this->getTemplate($tpl);
51 }
52
53 /**
54 * put your comment there...
55 *
56 */
57 public function enqueueScripts() {
58 // Please thos scripts below should be already loaded
59 // by the metabox views If the tinymce is loaded inside the editbox
60 // IN OTHER CASES!!! what is the other cases! we load it!
61 self::useScripts(__CLASS__,
62 'thickbox',
63 'framework:js:ajax:{CJT-}cjt-server'
64 );
65 }
66
67 /**
68 * put your comment there...
69 *
70 */
71 public function enqueueStyles() {
72 self::useStyles(__CLASS__, 'thickbox');
73 }
74
75 /**
76 * put your comment there...
77 *
78 * @param mixed $plugins
79 */
80 public function registerPlugin($plugins) {
81 // Register shortcode TinyMCE button Plugin.
82 $plugins['CJTShortcodes'] = $this->getURI('plugins/shortcode/shortcode.js');
83 return $plugins;
84 }
85
86 } // End class.
87