Ejemplo n.º 1
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     $lang = JFactory::getLanguage();
     $lang->load('plg_system_jcemediabox');
     $client = JRequest::getWord('client', 'site');
     $model = $this->getModel();
     $plugin = JPluginHelper::getPlugin('system', 'jcemediabox');
     $params = $this->getParams($plugin->params);
     $this->assignRef('params', $params);
     $this->assignRef('client', $client);
     $this->addScript(JURI::root(true) . '/components/com_jce/editor/libraries/js/colorpicker.js?version=' . $model->getVersion());
     $this->addStyleSheet('components/com_jce/media/css/colorpicker.css?version=' . $model->getVersion());
     $options = array('template_colors' => WFToolsHelper::getTemplateColors(), 'custom_colors' => '', 'labels' => array('picker' => WFText::_('WF_COLORPICKER_PICKER'), 'palette' => WFText::_('WF_COLORPICKER_PALETTE'), 'named' => WFText::_('WF_COLORPICKER_NAMED'), 'template' => WFText::_('WF_COLORPICKER_TEMPLATE'), 'custom' => WFText::_('WF_COLORPICKER_CUSTOM'), 'color' => WFText::_('WF_COLORPICKER_COLOR'), 'apply' => WFText::_('WF_COLORPICKER_APPLY'), 'name' => WFText::_('WF_COLORPICKER_NAME')));
     $this->addScriptDeclaration('jQuery(document).ready(function($){$("input.color").colorpicker(' . json_encode($options) . ');});');
     WFToolbarHelper::apply();
     WFToolbarHelper::save();
     WFToolbarHelper::help('mediabox.config');
     parent::display($tpl);
 }
Ejemplo n.º 2
0
 /**
  * Show the theme dialog
  * @access private
  */
 private function display()
 {
     jimport('joomla.filesystem.folder');
     $document = WFDocument::getInstance();
     // get UI Theme
     $uitheme = $this->getParam('editor.dialog_theme', 'jce');
     $document->addScript(array('tiny_mce_popup'), 'tiny_mce');
     // jquery versions
     $jquery = array('jquery/jquery-' . WF_JQUERY . '.min.js', 'jquery/jquery-ui-' . WF_JQUERYUI . '.custom.min.js');
     $document->addScript($jquery, 'libraries');
     $ui = JFolder::files(WF_EDITOR_LIBRARIES . DS . 'css' . DS . 'jquery' . DS . $uitheme, '\\.css$');
     $document->addStyleSheet(array('jquery/' . $uitheme . '/' . basename($ui[0], '.css'), 'plugin'), 'libraries');
     $document->addStyleSheet(array('themes/' . $this->get('theme') . '/css/' . $this->get('dialog')), 'tiny_mce');
     if ($this->get('dialog') == 'colorpicker') {
         $document->addScript(array('colorpicker'), 'libraries');
         require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'tools.php';
         $settings = array('template_colors' => WFToolsHelper::getTemplateColors(), 'custom_colors' => $this->getParam('editor.custom_colors'));
         $document->addScriptDeclaration('ColorPicker.settings=' . json_encode($settings));
     }
     $document->addScript(array('themes/' . $this->get('theme') . '/js/' . $this->get('dialog')), 'tiny_mce');
     $tabs = WFTabs::getInstance(array('base_path' => WF_EDITOR_THEMES . DS . $this->get('theme')));
     $tabs->addPanel($this->get('dialog'), 1);
 }
Ejemplo n.º 3
0
 public function getSettings()
 {
     wfimport('admin.helpers.tools');
     $settings = array('template_colors' => WFToolsHelper::getTemplateColors(), 'custom_colors' => $this->getParam('editor.custom_colors', ''));
     return parent::getSettings($settings);
 }
Ejemplo n.º 4
0
 /**
  * Display plugin
  * @access private
  */
 public function display()
 {
     jimport('joomla.filesystem.folder');
     $document = WFDocument::getInstance();
     if ($document->get('standalone') == 0) {
         $document->addScript(array('tiny_mce_popup'), 'tiny_mce');
         $document->addScript(array('tiny_mce_utils'), 'libraries');
     }
     $document->addScript(array('jquery-' . WF_JQUERY . '.min', 'jquery-ui-' . WF_JQUERYUI . '.custom.min', 'jquery.ui.touch-punch.min'), 'jquery');
     // add colorpicker
     if ($this->get('colorpicker')) {
         wfimport('admin.helpers.tools');
         $document->addScript(array('colorpicker'), 'libraries');
         $document->addScriptDeclaration('ColorPicker.settings=' . json_encode(array('template_colors' => WFToolsHelper::getTemplateColors(), 'custom_colors' => $this->getParam('editor.custom_colors', ''))) . ';');
     }
     $document->addScript(array('html5', 'select', 'tips', 'plugin'), 'libraries');
     // load plugin dialog language file if necessary
     if ($this->getParam('editor.compress_javascript', 0)) {
         $file = "/langs/" . WFLanguage::getCode() . "_dlg.js";
         if (!JFile::exists(WF_EDITOR_PLUGIN . $file)) {
             $file = "/langs/en_dlg.js";
         }
         if (JFile::exists(WF_EDITOR_PLUGIN . $file)) {
             $document->addScript(array('plugins/' . $this->getName() . $file), 'tiny_mce');
         }
     }
     $document->addStyleSheet(array('plugin'), 'libraries');
     // MediaElement in the future perhaps?
     /*if ($this->get('mediaplayer')) {
           $document->addScript(array('mediaelement-and-player.min'), 'mediaelement');
           $document->addStyleSheet(array('mediaelementplayer.min'), 'mediaelement');
       }*/
     // add custom plugin.css if exists
     if (is_file(JPATH_SITE . '/media/jce/css/plugin.css')) {
         $document->addStyleSheet(array('media/jce/css/plugin.css'), 'joomla');
     }
 }