/** * Listener for 'bootstrap_loaded' hook. * Adds in required JS files for the editor to display * * @return array */ public function hookBootstrapLoaded() { if ($this->loadEditor === true && Registry::has('theme')) { foreach (new DirectoryIterator($this->_zula->getDir('js') . '/tinymce/plugins') as $file) { if (substr($file, 0, 1) != '.' && $file->isDir()) { $tinyMcePlugins[] = $file->getFileName(); } } $tinyMcePlugins = implode(',', $tinyMcePlugins); $this->_theme->addHead('js', array(), 'var tcmEditor = {defaultFormat: "' . Editor::defaultFormat() . '", tinymcePlugins: "' . $tinyMcePlugins . '"};'); $this->_theme->addJsFile('tinymce/jquery.tinymce.js'); $this->_theme->addJsFile('js/init.js', true, 'editor'); } return true; }