# css-javascript-toolbox/6.0.13/views/tinymce/shortcodes/view.php

CSS &amp; JavaScript Toolbox, version 6.0.13. 77 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.13/code/views/tinymce/shortcodes/view.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.13/raw/views/tinymce/shortcodes/view.php
- Modified: 2013-03-17T20:09:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/6.0.13/code/views/tinymce/shortcodes/view.php#L10-L20`.

```php
<?php
/**
* 
*/

// No direct access.
defined('ABSPATH') or die('Access denied');

/**
* 
*/
class CJTTinymceShortcodesView extends CJTView {
	
	/**
	* put your comment there...
	* 
	* @param mixed $info
	* @return CJTTinymceShortcodesView
	*/
	public function __construct($info) {
		// Initialize parent!
		parent::__construct($info);
		// Register TinyMCE Plugin with Wordpress!
		add_filter('mce_external_plugins', array($this, 'registerPlugin'), 1, 11);
		// Add TinyMCE button for adding shortcode!
		add_filter('mce_buttons', array($this, 'addButton'));
		// Enqueue dependencies scripts.
		self::enqueueScripts();
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $buttons
	*/
	public function addButton($buttons) {
		// Add Blocks Shortcode button!
		array_push($buttons, 'separator', 'CJTBlockShortcode');
		return $buttons;	
	}
	
	/**
	* put your comment there...
	* 
	* @param mixed $tpl
	*/
	public function display($tpl = null) {
		// Push vars into view!
		
		// Output view!
		echo $this->getTemplate($tpl);
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function enqueueScripts() {
		// Please thos scripts below should be already loaded
		// by the metabox views If the tinymce is loaded inside the editbox
		// IN OTHER CASES!!! what is the other cases! we load it!
		self::useScripts(__CLASS__,  'framework:js:ajax:{CJT-}cjt-server');
	}

	/**
	* put your comment there...
	* 
	* @param mixed $plugins
	*/
	public function registerPlugin($plugins) {
		// Register shortcode TinyMCE button Plugin.
		$plugins['CJTShortcodes'] =  $this->getURI('plugins/shortcode/shortcode.js');
		return $plugins;
	}
	
} // End class.

```
