Ejemplo n.º 1
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     if (!$params->get('default_beez_template', '')) {
         // Only look for this file if this is a beez template
         return;
     }
     $javascript = new JCKJavascript();
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('template');
     $query->from('#__template_styles');
     $query->where('client_id=0 AND home=1');
     $db->setQuery($query);
     $template = $db->loadResult();
     $base = str_replace("/administrator", "", JURI::base()) . 'templates/' . $template . '/css/';
     $templates = array();
     if (file_exists($base . 'layout.css')) {
         $templates[] = $base . 'layout.css';
     }
     if (file_exists($base . 'personal.css')) {
         $templates[] = $base . 'personal.css';
     }
     if (empty($templates)) {
         return;
     }
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t\teditor.config.contentsCss.push('" . implode("','", $templates) . "');\n\t\t\t});");
     if ($params->get('styles_css', true)) {
         $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t\t{\n\t\t\t\t\tif(editor.config.stylesCss instanceof Array)\n\t\t\t\t\t\teditor.config.stylesCss.push('" . implode("','", $templates) . "');\n\t\t\t\t\telse if(editor.config.stylesCss) \n\t\t\t\t\t\teditor.config.stylesCss = [editor.config.stylesCss,'" . implode("','", $templates) . "'];\n\t\t\t\t\telse\n\t\t\t\t\t\teditor.config.stylesCss = ['" . implode("','", $templates) . "'];\n\t\t\t\t});");
     }
     return $javascript->toRaw();
 }
Ejemplo n.º 2
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(editor.config.extraPlugins)\n\t\t\t\t\teditor.config.extraPlugins += ',pastehtml,ie11selectionfix';\n\t\t\t\telse \t\n\t\t\t\t\teditor.config.extraPlugins += 'pastehtml,ie11selectionfix';\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 3
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(editor.config.extraPlugins)\n\t\t\t\t\teditor.config.extraPlugins += ',adddialogfieldexample,codemirrorresize,ietoolbarcollasperfix';\n\t\t\t\telse \t\n\t\t\t\t\teditor.config.extraPlugins += 'adddialogfieldexample,codemirrorresize,ietoolbarcollasperfix';\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 4
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(editor.config.extraPlugins)\r\n\t\t\t\t\teditor.config.extraPlugins += ',webkitdrag,autolaunchfilebrowser,magicline,backgrounds';\r\n\t\t\t\telse \t\r\n\t\t\t\t\teditor.config.extraPlugins += 'webkitdrag,autolaunchfilebrowser,magicline,backgrounds';\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 5
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t\tif(editor.config.removePlugins)\n\t\t\t\t\teditor.config.removePlugins += ',jroverride';\n\t\t\t\telse \t\n\t\t\t\t\teditor.config.removePlugins += 'jroverride';\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 6
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t{\r\n\t\t\t\tif(editor.config.extraPlugins)\r\n\t\t\t\t\teditor.config.extraPlugins += ',chromereadmorefix';\r\n\t\t\t\telse \t\r\n\t\t\t\t\teditor.config.extraPlugins += 'chromereadmorefix';\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 7
0
 function afterLoad(&$params)
 {
     $javascript = new JCKJavascript();
     $script = "for(var m in CKEDITOR.jckplugins)\n\t\t{  \n\t\t\tvar jckplugin = CKEDITOR.jckplugins[m];\n\n\t\t\tif(jckplugin.options)\n\t\t\t{\n                                \n                for(var n = 0; n < jckplugin.options.length;n++)\n\t\t\t\t{\n\t\t\t\t\teval('editor.config.' + CKEDITOR.tools.removeSlashes(jckplugin.options[n]));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}";
     $javascript->addScriptDeclaration($script);
     return $javascript->toRaw();
 }
Ejemplo n.º 8
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t{\r\n\t\t\t\teditor.config.dialog_backgroundCoverColor = '#000000';\r\n\t\t\t\teditor.config.dialog_backgroundCoverOpacity = 0.7;\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 9
0
 function beforeLoad(&$params)
 {
     $basePath = JPATH_CONFIGURATION . '/administrator/components/com_jckman/editor/lang';
     $languages = JFolder::files($basePath, '.js$', 1, true);
     $js = "";
     $default = $params->get("joomlaLang", "en");
     foreach ($languages as $language) {
         $content = file_get_contents($language);
         $content = preg_replace("/\\/\\*.*?\\*\\//s", "", $content);
         $content = str_replace('"', "'", $content);
         $language = str_replace("\\", "/", $language);
         $parts = explode("/", $language);
         $lang = preg_replace("/\\.js\$/", "", array_pop($parts));
         $plugin = array_pop($parts);
         if ($lang != $default && $lang != 'en' || $plugin == 'lang') {
             //make sure we always load in default english file
             continue;
         }
         $content = preg_replace("/\\)\$/", ");", trim($content));
         if ($plugin == 'jflash') {
             $plug = 'flash';
         } else {
             $plug = $plugin;
         }
         $js .= "CKEDITOR.on('" . $plugin . "PluginLoaded', function(evt)\r\n            {\r\n               editor.lang." . $plug . " = null;\r\n               evt.data.lang = ['" . $default . "'];             \r\n               " . $content . "           \r\n            });";
     }
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration($js);
     return $javascript->toRaw();
 }
Ejemplo n.º 10
0
    static function EditorTextArea($id, $name, $content, $buttons, $context, $arributes = array(), $asset = null, $author = null)
    {
        $html = JCKHtmlwriter::textarea($id, $name, $content, $arributes);
        //load CKEditor script
        $javascript = new JCKJavascript();
        $id = JCKOutput::fixId($id);
        $javascript->addScriptDeclaration('window.addDomReadyEvent.add(function()
				{	
					CKEDITOR.config.expandedToolbar = true;
					CKEDITOR.tools.callHashFunction("' . $id . '","' . $id . '");
				});');
        $javascript->addToHead();
        //set event handlers
        $args['name'] = $id;
        $args['event'] = 'onGetInsertMethod';
        $results[] = $context->update($args);
        foreach ($results as $result) {
            if (is_string($result) && trim($result)) {
                $html .= $result;
            }
        }
        //Get buttons
        if (!empty($buttons) || is_array($buttons) && !array_key_exists(0, $buttons)) {
            // Load modal popup behavior
            JHTML::_('behavior.modal', 'a.modal-button');
            $editor = JFactory::getEditor('jckeditor');
            $plugins = $editor->getButtons($id, $buttons, $asset, $author);
            $buttons = '';
            $container = '';
            if (version_compare(JVERSION, '3.0', 'ge')) {
                foreach ($plugins as $plugin) {
                    $className = $plugin->get('modal') ? "modal-button btn" : 'btn';
                    $url = $plugin->get('link') ? JURI::base() . $plugin->get('link') : '';
                    $click = $plugin->get('onclick') ? $plugin->get('onclick') : 'IeCursorFix(); return false;';
                    $options = $plugin->get('options');
                    $content = $plugin->get('text');
                    $buttonName = $plugin->get('name');
                    $content = '<i class="icon-' . $buttonName . '"></i>' . $content;
                    $linkAttributes = array("rel" => $options, 'onclick' => $click);
                    $buttons .= JCKHtmlwriter::link($url, $content, '', $className, $linkAttributes);
                }
                $innerContainer = JCKHtmlwriter::DivContainer($buttons, '', 'btn-toolbar');
                $container = JCKHtmlwriter::DivContainer($innerContainer, 'editor-xtd-buttons', 'btn-toolbar pull-left');
            } else {
                foreach ($plugins as $plugin) {
                    $className = $plugin->get('modal') ? "modal-button" : '';
                    $url = $plugin->get('link') ? JURI::base() . $plugin->get('link') : '';
                    $click = $plugin->get('onclick') ? $plugin->get('onclick') : '';
                    $options = $plugin->get('options');
                    $content = $plugin->get('text');
                    $buttonName = $plugin->get('name');
                    $buttons .= JCKHtmlwriter::buttonModalLink($url, $content, $options, $buttonName, $className, $click, array("class" => "button2-left"));
                }
                $container = JCKHtmlwriter::DivContainer($buttons, 'editor-xtd-buttons');
            }
            $html .= $container;
        }
        return $html;
    }
Ejemplo n.º 11
0
 /**
  * Method to handle the onInitEditor event.
  *  - Initializes the fckeditor Lite WYSIWYG Editor
  *
  * @access public
  * @return string JavaScript Initialization string
  * @since 1.5
  */
 function onInit()
 {
     jckimport('ckeditor.stylesheet.helper');
     JCKStylesheetHelper::addCKEDITORHeaderStyles();
     jckimport('ckeditor.htmlwriter.javascript');
     $javascript = new JCKJavascript(array(), array(JURI::root() . 'plugins/editors/jckeditor/ckeditor.js'));
     return $javascript->toString();
 }
Ejemplo n.º 12
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $script = "editor.on( 'configLoaded', function()\n\t\t{\n\t\t\tif(editor.config.extraPlugins)\n\t\t\t\teditor.config.extraPlugins += ',xml';\n\t\t\telse\n\t\t\t\teditor.config.extraPlugins += 'xml';\n\t\t});";
     $javascript->addScriptDeclaration($script);
     return $javascript->toRaw();
 }
Ejemplo n.º 13
0
 function beforeLoad(&$params)
 {
     $magicline_enabled = $params->get('magicline_enabled', 1);
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("CKEDITOR.config.magicline_enabled = " . (int) $magicline_enabled . ";");
     return $javascript->toRaw();
 }
Ejemplo n.º 14
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $EnableImageDragndrop = $params->get('EnableImageDragndrop', 1);
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t{\r\n\t\t\t\teditor.config.EnableImageDragndrop = " . (int) $EnableImageDragndrop . ";\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 15
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $toolbar = $params->get('jck_toolbar', '');
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function(evt)\r\n\t\t\t{\r\n\t\t\t\tvar editor = evt.editor;\r\n\t\t\t\tvar toolbarName = '" . $toolbar . " ';\r\n\t\t\t\tif(!toolbarName)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tvar toolbar =  editor.config.toolbar_" . $toolbar . ";\r\n\t           \t\t\t\r\n\t\t\t\tvar sortArray = []; \r\n\t\t\t\tvar element;\r\n\t\t\t\tvar removes = editor.config.removePlugins.split(',');\t\r\n\t\t    \r\n\t\t\t\tfor(var i= 0; i < toolbar.length;i++)\t\r\n\t\t\t\t{\t\r\n\t\t\t\t\telement = toolbar[i]\r\n\t\t\t\t     \r\n\t\t\t\t\tif(element instanceof Array)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar buttons = [];\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\tfor(var j = 0; j < element.length;j++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar button = element[j];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!button) \r\n\t\t\t\t\t\t\t  continue;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar title = button.toLowerCase() ;\r\n\t\t\t\t\t\t\tif(title == 'flash')\r\n\t\t\t\t\t\t\t\ttitle = 'jflash';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(title == 'about')\r\n\t\t\t\t\t\t\t\ttitle = 'jabout';\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(CKEDITOR.tools.indexOf(removes,title ) != -1)\r\n\t\t\t\t\t\t\t\tcontinue\r\n\t\t\t\t\t\t\tbuttons.push(button);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telement = buttons;\r\n\t\t\t\t\t\tif(element.length)\r\n\t\t\t\t\t\t\tsortArray.push(element);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\ttoolbar = sortArray;\r\n\t\t\t\t\r\n\t\t\t\t//cleanup\r\n\t\t\t\tif( typeof toolbar[toolbar.length] == 'string')\r\n\t\t\t\t\tdelete  toolbar[toolbar.length];\r\n\t\t\t\t\r\n\t\t\t\tif( typeof toolbar[0] == 'string')\r\n\t\t\t\t\tdelete  toolbar[0];\r\n\t\t\t\t\t\t\r\n\t\t\t\teditor.config.toolbar_" . $toolbar . " = toolbar;\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 16
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $forcesimpleAmpersand = $params->get('forcesimpleAmpersand', 0);
     $javascript->addScriptDeclaration("\r\n\t\t\teditor.config['forcesimpleAmpersand'] = " . (int) $forcesimpleAmpersand . ";");
     return $javascript->toRaw();
 }
Ejemplo n.º 17
0
 function afterLoad(&$params)
 {
     $mainframe = JFactory::getApplication();
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("\n\t\t\teditor.config['client'] = " . $mainframe->getClientId() . ";");
     return $javascript->toRaw();
 }
Ejemplo n.º 18
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $startupFocus = $params->get('startupFocus', 0);
     $javascript->addScriptDeclaration("\r\n\t\t\teditor.config['startupFocus'] = " . (int) $startupFocus . ";");
     return $javascript->toRaw();
 }
Ejemplo n.º 19
0
 function afterLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $imagePath = $params->get('imagePath', 'images');
     $imagePath = preg_replace('/(^\\/|\\/$)/', '', $imagePath);
     $javascript->addScriptDeclaration("\r\r\n\t\t\teditor.config['imagePath'] = '" . $imagePath . "';");
     return $javascript->toRaw();
 }
Ejemplo n.º 20
0
 function beforeLoad(&$params)
 {
     $css = $params->get('jcktypography', false);
     if (!$css) {
         return false;
     }
     //lets create JS object
     $javascript = new JCKJavascript();
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\r\n\t\t\t{\r\n\t\t\t\tvar styleDefinitions = editor.config.stylesSet;\r\n\t\t\t       styleDefinitions.push( { name : 'Caption Photo', element : 'img', attributes : { 'class' : 'caption photo' } });\r\n\t\t\t       styleDefinitions.push( { name : 'Caption PhotoBlack', element : 'img', attributes : { 'class' : 'caption photoblack' } });\r\n\t\t\t       styleDefinitions.push( { name : 'Caption PhotoBlue', element : 'img', attributes : { 'class' : 'caption photoblue' } });\r\n\t\t\t       styleDefinitions.push( { name : 'Caption PhotoGreen', element : 'img', attributes : { 'class' : 'caption photogreen' } });\r\n\t\t\t       styleDefinitions.push( { name : 'Caption PhotoRed', element : 'img', attributes : { 'class' : 'caption photored' } });\r\n\t\t\t       styleDefinitions.push( { name : 'Caption PhotoYellow', element : 'img', attributes : { 'class' : 'caption photoyellow' } });\r\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 21
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $script = "editor.on( 'configLoaded', function()\n\t\t{\n\t\t\tif(editor.config.extraPlugins)\n\t\t\t\teditor.config.extraPlugins += ',mobilefloatpanelfix,mobileviewport,mobilemodalfix';\n\t\t\telse\n\t\t\t\teditor.config.extraPlugins += 'mobilefloatpanelfix,mobileviewport,mobilemodalfix';\n\t\t});";
     if (defined('JCK_MOBILE')) {
         $script .= chr(13) . "editor.colorButton_enableMore = false;\n\t\t\t\n\t\t\teditor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t  editor.config.startupFocus = 1;\n\t\t\t  editor.config.resize_minWidth = 100;\n\t\t\t  if(editor.config.removePlugins)\n\t\t\t\t\teditor.config.removePlugins += ',jfilebrowser';\n\t\t\t\telse \t\n\t\t\t\t\teditor.config.removePlugins += 'jfilebrowser';\n\t\t\t});";
     }
     $javascript->addScriptDeclaration($script);
     return $javascript->toRaw();
 }
Ejemplo n.º 22
0
 /**
  * Method to handle the onInitEditor event.
  *  - Initializes the fckeditor Lite WYSIWYG Editor
  *
  * @access public
  * @return string JavaScript Initialization string
  * @since 1.5
  */
 function onInit()
 {
     jckimport('ckeditor.stylesheet.helper');
     JCKStylesheetHelper::addCKEDITORHeaderStyles();
     jckimport('ckeditor.htmlwriter.javascript');
     $javascript = new JCKJavascript(array(), array(JURI::root() . 'plugins/editors/jckeditor/ckeditor.js'));
     $minify = $this->params->get('minify', 1);
     $javascript->setMinify($minify);
     $javascript->addScriptDeclaration(JCKJavascriptHelper::addDomReadyEventHandler());
     return $javascript->toString();
 }
Ejemplo n.º 23
0
 function afterLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $imagePath = $params->get('imagePath', 'images');
     $imagePath = preg_replace('/(^\\/|\\/$)/', '', $imagePath);
     $ftfamily = $params->get('ftfamily', '');
     $ftsize = $params->get('ftsize', '');
     $bgcolor = $params->get('bgcolor', '#ffffff');
     $ftcolor = $params->get('ftcolor', '');
     $javascript->addScriptDeclaration("\n\t\t\teditor.config['imagePath'] = '" . $imagePath . "';" . ($ftfamily ? "editor.config['ftfamily'] = '" . $ftfamily . "';" : "") . ($ftsize ? "editor.config['ftsize'] = '" . $ftsize . "';" : "") . "\n\t\t\teditor.config['bgcolor'] = '" . $bgcolor . "';" . ($ftcolor ? "editor.config['ftcolor'] = '" . $ftcolor . "';" : ""));
     return $javascript->toRaw();
 }
Ejemplo n.º 24
0
 function afterLoad(&$params)
 {
     $mainframe = JFactory::getApplication();
     //lets create JS object
     $javascript = new JCKJavascript();
     $user = JFactory::getUser();
     $username = $user->get('username');
     $email = $user->get('email');
     $clientid = $mainframe->getClientId();
     $cacheKey = md5('jckeditor' . $username . $email . $clientid);
     $javascript->addScriptDeclaration("\r\r\n\t\t\teditor.config['client'] = '" . $cacheKey . "';");
     return $javascript->toRaw();
 }
 function afterLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $plugin = JPluginHelper::getPlugin('content', 'jw_allvideos');
     if (empty($plugin) && !isset($plugin->params)) {
         return;
     }
     $avParams = new JParameter($plugin->params);
     $allAudioPath = $avParams->get('afolder', 'images/stories/audio');
     $allVideoPath = $avParams->get('vfolder', 'images/stories/video');
     $javascript->addScriptDeclaration("\r\r\n\t\t\teditor.config['allAudioPath'] = '" . $allAudioPath . "';\r\r\n\t\t\teditor.config['allVideoPath'] = '" . $allVideoPath . "';");
     return $javascript->toRaw();
 }
Ejemplo n.º 26
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $defaultColor = $params->get('uicolor', '#D6E6F4');
     $user = JFactory::getUser();
     $color = $user->getParam('jckuicolor', $defaultColor);
     if ($color == $defaultColor) {
         //already set so just exit
         return;
     }
     $javascript->addScriptDeclaration("editor.on( 'configLoaded', function()\n\t\t\t{\n\t\t\t\teditor.config.uiColor = '" . $color . "';\n\t\t\t});");
     return $javascript->toRaw();
 }
Ejemplo n.º 27
0
 function beforeLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $ftfamily = $params->get('ftfamily', '');
     $ftsize = $params->get('ftsize', '');
     if ($ftsize) {
         $ftsize .= strpos($ftsize, 'px') || strpos($ftsize, 'pt') || strpos($ftsize, '%') ? '' : 'px';
     }
     $script = '';
     $script .= $ftfamily ? "editor.addCss( 'body { font-family: " . $ftfamily . "; }' );" : "";
     $script .= $ftsize ? "editor.addCss( 'body { font-size: " . $ftsize . "; }' );" : "";
     $javascript->addScriptDeclaration($script);
     return $javascript->toRaw();
 }
Ejemplo n.º 28
0
 function afterLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $imagePath = $params->get('imagePath', 'images');
     $imagePath = preg_replace('/(^\\/|\\/$)/', '', $imagePath);
     $ftfamily = $params->get('ftfamily', '');
     $ftsize = $params->get('ftsize', '');
     $bgcolor = $params->get('bgcolor', '#ffffff');
     $ftcolor = $params->get('ftcolor', '');
     $autolaunchFilebrowser = $params->get('autolaunchFilebrowser', 1);
     $magicline_enabled = $params->get('magicline_enabled', 1);
     $javascript->addScriptDeclaration("\r\n\t\t\teditor.config['imagePath'] = '" . $imagePath . "';" . ($autolaunchFilebrowser ? "editor.config['autolaunchFilebrowser'] = '" . $autolaunchFilebrowser . "';" : "") . ($magicline_enabled ? "CKEDITOR.config['magicline_enabled'] = '" . $magicline_enabled . "';" : "") . ($ftfamily ? "editor.config['ftfamily'] = '" . $ftfamily . "';" : "") . ($ftsize ? "editor.config['ftsize'] = '" . $ftsize . "';" : "") . "\r\n\t\t\teditor.config['bgcolor'] = '" . $bgcolor . "';" . ($ftcolor ? "editor.config['ftcolor'] = '" . $ftcolor . "';" : ""));
     return $javascript->toRaw();
 }
Ejemplo n.º 29
0
 function afterLoad(&$params)
 {
     //lets create JS object
     $javascript = new JCKJavascript();
     $plugin = JPluginHelper::getPlugin('content', 'jw_sigpro');
     if (empty($plugin)) {
         $plugin = JPluginHelper::getPlugin('content', 'jwsig');
     }
     if (empty($plugin) && !isset($plugin->params)) {
         return;
     }
     $sigParams = new JParameter($plugin->params);
     $sigPath = $sigParams->get('galleries_rootfolder', 'images/stories');
     $sigPath = preg_replace('/(^\\/|\\/$)/', '', $sigPath);
     $sigPath = preg_replace('/(^\\/|\\/$)/', '', $sigPath);
     $javascript->addScriptDeclaration("\r\n\t\t\teditor.config['sigPath'] = '" . $sigPath . "';");
     return $javascript->toRaw();
 }
Ejemplo n.º 30
0
    static function EditorTextArea($name, $content, $buttons, $context)
    {
        $html = JCKHtmlwriter::textarea($name, $content);
        //load CKEditor script
        $javascript = new JCKJavascript();
        $filtername = JCKOutput::cleanString($name);
        $name = JCKOutput::fixId($name);
        $javascript->addScriptDeclaration('window.addDomReadyEvent.add(function()
				{	
					CKEDITOR.config.expandedToolbar = true;
					CKEDITOR.tools.callHashFunction("' . $name . '","' . $name . '");
				});');
        $html .= $javascript->toString();
        //Get buttons
        if (!empty($buttons) || is_array($buttons) && !array_key_exists(0, $buttons)) {
            // Load modal popup behavior
            JHTML::_('behavior.modal', 'a.modal-button');
            $editor = JFactory::getEditor('jckeditor');
            //set event handlers
            $args['name'] = $name;
            $args['event'] = 'onGetInsertMethod';
            $results[] = $context->update($args);
            foreach ($results as $result) {
                if (is_string($result) && trim($result)) {
                    $html .= $result;
                }
            }
            $plugins = $editor->getButtons($name, $buttons);
            $buttons = '';
            foreach ($plugins as $plugin) {
                $className = $plugin->get('modal') ? "modal-button" : '';
                $url = $plugin->get('link') ? $plugin->get('link') : '';
                $click = $plugin->get('onclick') ? $plugin->get('onclick') : '';
                $options = $plugin->get('options');
                $content = $plugin->get('text');
                $buttonName = $plugin->get('name');
                $buttons .= JCKHtmlwriter::buttonModalLink($url, $content, $options, $buttonName, $className, $click, array("class" => "button2-left"));
            }
            $container = JCKHtmlwriter::DivContainer($buttons, 'editor-xtd-buttons');
            $html .= $container;
        }
        return $html;
    }