diff --git a/oss/joomla/trunk/plugins/editors/jce.php b/oss/joomla/trunk/plugins/editors/jce.php new file mode 100644 index 00000000..ae13abc1 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/jce.php @@ -0,0 +1,392 @@ + + * @package Editor - JCE + * @since 1.5 + */ +class plgEditorJCE extends JPlugin +{ + /** + * Constructor + * + * For php4 compatability we must not use the __constructor as a constructor for plugins + * because func_get_args (void) returns a copy of all passed arguments NOT references. + * This causes problems with cross-referencing necessary for the observer design pattern. + * + * @vars object $subject The object to observe + * @vars array $config An array that holds the plugin configuration + * @since 1.5 + */ + function plgEditorJCE( & $subject, $config) + { + parent::__construct($subject, $config); + } + /** + * Method to handle the onInit event. + * - Initializes the JCE WYSIWYG Editor + * + * @access public + * @return string JavaScript Initialization string + * @since 1.5 + */ + function onInit() + { + global $mainframe; + + // Editor gets loaded twice in Legacy mode??? + if (JPluginHelper::isEnabled('system', 'legacy')) { + if (defined('_JCE_ISLOADED')) { + return false; + } + define('_JCE_ISLOADED', 1); + } + // Check for existence of Admin Component + if (!is_dir(JPATH_SITE.DS.'components'.DS.'com_jce') || !is_dir(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jce')) { + JError::raiseWarning('404', 'The JCE Administration Component is not installed! The Editor cannot function without it!'); + } + // Load base Editor class + require_once (dirname( __FILE__ ).DS.'jce'.DS.'libraries'.DS.'classes'.DS.'editor.php'); + + // Create instance + $jce = & JContentEditor::getInstance(); + $jce->addPlugins( array ('code', 'cleanup', 'tabfocus')); + + $document = & JFactory::getDocument(); + $params = $jce->getEditorParams(); + $gzip = $jce->getParam($params, 'editor_gzip', '0', '0')?'_gzip':''; + + $version = $jce->getVersion(); + $stamp = preg_match('/\d/', $version) ? '?version='. $version : ''; + // TinyMCE url must be absolute! + $document->addScript(JURI::root().'plugins/editors/jce/tiny_mce/tiny_mce'.$gzip.'.js'.$stamp); + // Utility functions for saving + $document->addScript(JURI::root(true).'/plugins/editors/jce/libraries/js/editor.js'.$stamp); + + // Set parameter array + $vars = array (); + + $vars['doctype'] = ''; + $vars['mode'] = 'textareas'; + $vars['editor_selector'] = 'mceEditor'; + + //Languages + $vars['language'] = $jce->getLanguage(); + $vars['directionality'] = $jce->getLanguageDir(); + + $settings = ''; + + // Defaults + $vars['theme'] = 'none'; + $vars['invalid_elements'] = 'applet,iframe,object,embed,script,style'; + $vars['plugins'] = ''; + + if ($jce->checkUser()) { + $vars['theme'] = 'advanced'; + // Url + $vars['document_base_url'] = JURI::root(); + $vars['site_url'] = JURI::base(true).'/'; + + // Theme + $vars['theme_advanced_toolbar_location'] = $jce->getParam($params, 'editor_theme_advanced_toolbar_location', 'top', 'bottom'); + $vars['theme_advanced_toolbar_align'] = $jce->getParam($params, 'editor_theme_advanced_toolbar_align', 'left', 'center'); + $vars['theme_advanced_path'] = '1'; + $vars['theme_advanced_statusbar_location'] = $jce->getParam($params, 'editor_theme_advanced_statusbar_location', 'bottom', 'none'); + + $vars['theme_advanced_resizing'] = $jce->getParam($params, 'editor_theme_advanced_resizing', '1', '0'); + $vars['theme_advanced_resize_horizontal'] = $jce->getParam($params, 'editor_theme_advanced_resize_horizontal', '1', '0'); + $vars['theme_advanced_resizing_use_cookie'] = $jce->getParam($params, 'editor_theme_advanced_resizing_use_cookie', '1', '0'); + + $vars['theme_advanced_disable'] = $jce->getRemovePlugins(); + $vars['theme_advanced_blockformats'] = $jce->getParam($params, 'editor_theme_advanced_blockformats', 'p,div,h1,h2,h3,h4,h5,h6,blockquote,dt,dd,code,samp,pre', 'p,address,pre,h1,h2,h3,h4,h5,h6'); + $vars['removeformat_selector'] = '*'; + + // Fonts + $vars['theme_advanced_fonts'] = $jce->getEditorFonts($jce->getParam($params, 'editor_theme_advanced_fonts_add', ''), $jce->getParam($params, 'editor_theme_advanced_fonts_remove', '')); + $vars['theme_advanced_font_sizes'] = $jce->getParam($params, 'editor_theme_advanced_font_sizes', '8pt,10pt,12pt,14pt,18pt,24pt,36pt'); + + // Defaults + $vars['theme_advanced_buttons1'] = ''; + $vars['theme_advanced_buttons2'] = ''; + $vars['theme_advanced_buttons3'] = ''; + + // Cleanup + $vars['verify_html'] = $jce->getParam($params, 'editor_verify_html', '0', '1'); + $vars['event_elements'] = $jce->getParam($params, 'editor_event_elements', 'a,img', 'a,img'); + + // Editor Dimensions + $vars['width'] = $jce->getParam($params, 'editor_width', ''); + $vars['height'] = $jce->getParam($params, 'editor_height', ''); + + // Preview + $vars['plugin_preview_width'] = $jce->getParam($params, 'preview_width', '750', '550'); + $vars['plugin_preview_height'] = $jce->getParam($params, 'preview_height', '550', '600'); + + $vars['custom_colors'] = $jce->getParam($params, 'custom_colors', '', ''); + + // Tables & Lists + $vars['table_inline_editing'] = '1'; + $vars['fix_list_elements'] = '1'; + $vars['fix_table_elements'] = '1'; + + // Encoding + $vars['entity_encoding'] = $jce->getParam($params, 'editor_entity_encoding', 'raw', 'named'); + + // Template CSS + $template_path = JPATH_SITE.DS.'templates'.DS.$jce->getSiteTemplate().DS.'css'; + $template_url = JURI::root(true)."/templates/".$jce->getSiteTemplate()."/css/"; + // Joomla! 1.5 standard + $template_file = 'template.css'; + // check for legacy template + if (file_exists($template_path.DS.'template_css.css')) { + $template_file = 'template_css.css'; + } + $vars['content_css'] = $template_url.$template_file; + + //Custom template url + if ($params->get('editor_content_css', '1') == '0') { + $custom = $params->get('editor_content_css_custom', ''); + $vars['content_css'] = JURI::root(true).'/'.str_replace('$template', $jce->getSiteTemplate(), $custom); + } + // Get Extended elements + $vars['extended_valid_elements'] = $jce->getParam($params, 'editor_extended_elements', '', ''); + // Configuration list of invalid elements as array + $vars['invalid_elements'] = explode(',', $jce->getParam($params, 'editor_invalid_elements', '', '')); + + // Add elements to invalid list (removed by plugin) + $jce->addKeys($vars['invalid_elements'], array ('applet', 'iframe', 'object', 'param', 'embed', 'script', 'style')); + + /* End Plugin functions */ + + // Paragraph handling + $vars['forced_root_block'] = $jce->getParam($params, 'editor_forced_root_block', '0', 'p'); + + if ($params->get('editor_newlines', '0') == '1') { + $vars['force_br_newlines'] = '1'; + $vars['force_p_newlines'] = '0'; + } + else { + $vars['force_br_newlines'] = '0'; + $vars['force_p_newlines'] = '1'; + } + + // 'Look & Feel' + $vars['skin'] = $jce->getParam($params, 'editor_skin', 'default', 'default'); + $vars['skin_variant'] = $jce->getParam($params, 'editor_skin_variant', 'default', 'default'); + $vars['inlinepopups_skin'] = $jce->getParam($params, 'editor_inlinepopups_skin', 'clearlooks2'); + $vars['body_class'] = $jce->getParam($params, 'editor_body_class_type', 'custom') == 'contrast'?'mceForceColors':$jce->getParam($params, 'editor_body_class_custom', ''); + + //Other - user specified + $userParams = $params->get('editor_custom_config', ''); + $baseParams = array ( + 'mode', + 'cleanup_callback', + 'save_callback', + 'file_browser_callback', + 'onpageload', + 'editor_selector' + ); + if ($userParams) { + $userParams = explode(';', $userParams); + foreach ($userParams as $userParam) { + $keys = explode(':', $userParam); + if (!in_array(trim($keys[0]), $baseParams)) { + $vars[trim($keys[0])] = count($keys) > 1?trim($keys[1]):''; + } + } + } + $callbackFile = $params->get('editor_callback_file', ''); + // Relative urls? + $vars['relative_urls'] = $jce->getParam($params, 'editor_relative_urls', '1', '1'); + if ($vars['relative_urls'] == '0') { + $vars['remove_script_host'] = '0'; + } + // Get rows + $rows = $jce->getRows(); + for ($i = 1; $i <= count($rows); $i++) { + $vars['theme_advanced_buttons'.$i] = $rows[$i]; + } + // Add Paste plugin if clipboard loaded. TODO Remove in 1.6 + if ($jce->isLoaded('clipboard') && !$jce->isLoaded('paste')) { + $jce->addPlugins('paste'); + } + // Plugins + $vars['plugins'] = $jce->getPlugins(); + // Get all optional plugin configuration options + $jce->getPluginConfig($vars); + } + $i = 1; + foreach ($vars as $k=>$v) { + // If the value is an array, implode! + if (is_array($v)) { + $v = implode(',', $v); + if ($v[0] == ',') { + $v = substr($v, 1); + } + } + // Value must be set + if ($v != '') { + // objects or arrays or functions or regular expression + if (preg_match('/(\[[^\]*]\]|\{[^\}]*\}|function\([^\}]*\}|^#(.*)#$)/', $v)) { + // replace hash delimiters with / for javascript regular expression + $v = preg_replace('@^#(.*)#$@', '/$1/', $v); + } + // anything that is not solely an integer + else if (!is_numeric($v)) { + $v = '"'.$v.'"'; + } + // 1 or 0 become true/false + else if ($v == '1' || $v == '0') { + $v = intval($v)?'true':'false'; + } + $settings .= "\t\t\t".$k.": ".$v.""; + if ($i < count($vars)) { + $settings .= ",\n"; + } + } + if (preg_match('/theme_advanced_buttons([1-3])/', $k) && $v == '') { + $settings .= "\t\t\t".$k.": \"\""; + if ($i < count($vars)) { + $settings .= ",\n"; + } + } + $i++; + } + $init = " + tinyMCE.init({\n"; + $init .= preg_replace('/,?\n?$/', '', $settings)." + });"; + if ($gzip) { + $plugins = is_array($vars['plugins'])?implode(',', $vars['plugins']):$vars['plugins']; + $gz = " + tinyMCE_GZ.init({ + plugins : '".$plugins."', + themes : 'none,advanced', + languages : '".$vars['language']."', + disk_cache : false + });"; + $document->addScriptDeclaration($gz); + } + $document->addScriptDeclaration($init); + if ($params->get('editor_callback_file')) { + $document->addScript(JURI::root(true).'/'.$callbackFile); + } + } + /** + * JCE WYSIWYG Editor - get the editor content + * + * @vars string The name of the editor + */ + function onGetContent($editor) + { + return "JContentEditor.getContent('".$editor."');"; + } + /** + * JCE WYSIWYG Editor - set the editor content + * + * @vars string The name of the editor + */ + function onSetContent($editor, $html) + { + return "JContentEditor.setContent('".$editor."','".$html."');"; + } + /** + * JCE WYSIWYG Editor - copy editor content to form field + * + * @vars string The name of the editor + */ + function onSave($editor) + { + return "JContentEditor.save('".$editor."');"; + } + /** + * JCE WYSIWYG Editor - display the editor + * + * @vars string The name of the editor area + * @vars string The content of the field + * @vars string The width of the editor area + * @vars string The height of the editor area + * @vars int The number of columns for the editor area + * @vars int The number of rows for the editor area + * @vars mixed Can be boolean or array. + */ + function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true) + { + // Only add "px" to width and height if they are not given as a percentage + if (is_numeric($width)) { + $width .= 'px'; + } + if (is_numeric($height)) { + $height .= 'px'; + } + + $buttons = $this->_displayButtons($name, $buttons); + + $editor = "\n" . $buttons; + return $editor; + } + function onGetInsertMethod($name) + { + $doc =& JFactory::getDocument(); + + $js = "function jInsertEditorText(text,editor){JContentEditor.insert(editor,text);}"; + $doc->addScriptDeclaration($js); + + return true; + } + function _displayButtons($name, $buttons) + { + // Load modal popup behavior + JHTML::_('behavior.modal', 'a.modal-button'); + + $args['name'] = $name; + $args['event'] = 'onGetInsertMethod'; + + $return = ''; + $results[] = $this->update($args); + foreach ($results as $result) { + if (is_string($result) && trim($result)) { + $return .= $result; + } + } + if (! empty($buttons)) { + $results = $this->_subject->getButtons($name, $buttons); + /* + * This will allow plugins to attach buttons or change the behavior on the fly using AJAX + */ + $return .= "\n
\n"; + foreach ($results as $button) { + /* + * Results should be an object + */ + if ($button->get('name')) { + $modal = ($button->get('modal'))?'class="modal-button"':null; + $href = ($button->get('link'))?'href="'.JURI::base().$button->get('link').'"':null; + $onclick = ($button->get('onclick'))?'onclick="'.$button->get('onclick').'"':null; + $return .= "
\n"; + } + } + $return .= "
\n"; + } + return $return; + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/jce.xml b/oss/joomla/trunk/plugins/editors/jce.xml new file mode 100644 index 00000000..8c54b0b8 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/jce.xml @@ -0,0 +1,508 @@ + + + Editor - JCE 1.5.6 + 1.5.6 + 14 November 2009 + Ryan Demmer + ryandemmer@gmail.com + http://www.joomlacontenteditor.net + 2006-2009 Ryan Demmer + GNU/GPL + JCE EDITOR DESC + + jce/index.html + jce/libraries/classes/editor.php + jce/libraries/classes/index.html + jce/libraries/classes/json/index.html + jce/libraries/classes/json/json.php + jce/libraries/classes/json/licence.txt + jce/libraries/classes/manager.php + jce/libraries/classes/plugin.php + jce/libraries/classes/utils.php + jce/libraries/css/help.css + jce/libraries/css/index.html + jce/libraries/css/manager.css + jce/libraries/css/manager_ie6.css + jce/libraries/css/manager_ie7.css + jce/libraries/css/plugin.css + jce/libraries/css/tree.css + jce/libraries/css/tree_ie.css + jce/libraries/css/tree_ie6.css + jce/libraries/css/upload.css + jce/libraries/img/empty.gif + jce/libraries/img/ext.gif + jce/libraries/img/icons.gif + jce/libraries/img/index.html + jce/libraries/img/load.gif + jce/libraries/img/spacer.gif + jce/libraries/index.html + jce/libraries/js/editor.js + jce/libraries/js/index.html + jce/libraries/js/jce.js + jce/libraries/js/listsorter.js + jce/libraries/js/manager.js + jce/libraries/js/mootools.js + jce/libraries/js/plugin.js + jce/libraries/js/searchables.js + jce/libraries/js/sortables.js + jce/libraries/js/tiny_mce_utils.js + jce/libraries/js/tree.js + jce/libraries/js/upload.js + jce/libraries/js/window.js + jce/libraries/views/index.html + jce/libraries/views/tmpl/browser.php + jce/libraries/views/tmpl/help.php + jce/libraries/views/tmpl/index.html + jce/libraries/xml/config/config.xml + jce/libraries/xml/help/index.html + jce/libraries/xml/help/manager.xml + jce/libraries/xml/index.html + jce/tiny_mce/index.html + jce/tiny_mce/langs/en.js + jce/tiny_mce/langs/en_dlg.js + jce/tiny_mce/langs/index.html + jce/tiny_mce/license.txt + jce/tiny_mce/plugins/advcode/advcode.html + jce/tiny_mce/plugins/advcode/advcode.xml + jce/tiny_mce/plugins/advcode/classes/config.php + jce/tiny_mce/plugins/advcode/classes/index.html + jce/tiny_mce/plugins/advcode/css/advcode.css + jce/tiny_mce/plugins/advcode/css/csscolors.css + jce/tiny_mce/plugins/advcode/css/index.html + jce/tiny_mce/plugins/advcode/css/jscolors.css + jce/tiny_mce/plugins/advcode/css/phpcolors.css + jce/tiny_mce/plugins/advcode/css/xmlcolors.css + jce/tiny_mce/plugins/advcode/editor_plugin.js + jce/tiny_mce/plugins/advcode/img/advcode.gif + jce/tiny_mce/plugins/advcode/img/index.html + jce/tiny_mce/plugins/advcode/img/numbers.png + jce/tiny_mce/plugins/advcode/index.html + jce/tiny_mce/plugins/advcode/js/advcode.js + jce/tiny_mce/plugins/advcode/js/codemirror.js + jce/tiny_mce/plugins/advcode/js/editor.js + jce/tiny_mce/plugins/advcode/js/index.html + jce/tiny_mce/plugins/advcode/js/parsecss.js + jce/tiny_mce/plugins/advcode/js/parsejavascript.js + jce/tiny_mce/plugins/advcode/js/parsephp.js + jce/tiny_mce/plugins/advcode/js/parsephphtmlmixed.js + jce/tiny_mce/plugins/advcode/js/parsexml.js + jce/tiny_mce/plugins/advcode/js/select.js + jce/tiny_mce/plugins/advcode/js/stringstream.js + jce/tiny_mce/plugins/advcode/js/toggle.js + jce/tiny_mce/plugins/advcode/js/tokenize.js + jce/tiny_mce/plugins/advcode/js/tokenizejavascript.js + jce/tiny_mce/plugins/advcode/js/tokenizephp.js + jce/tiny_mce/plugins/advcode/js/undo.js + jce/tiny_mce/plugins/advcode/js/util.js + jce/tiny_mce/plugins/advcode/langs/en.js + jce/tiny_mce/plugins/advcode/langs/en_dlg.js + jce/tiny_mce/plugins/advcode/langs/index.html + jce/tiny_mce/plugins/advcode/license.txt + jce/tiny_mce/plugins/advlink/advlink.php + jce/tiny_mce/plugins/advlink/advlink.xml + jce/tiny_mce/plugins/advlink/classes/advlink.php + jce/tiny_mce/plugins/advlink/classes/index.html + jce/tiny_mce/plugins/advlink/css/advlink.css + jce/tiny_mce/plugins/advlink/css/index.html + jce/tiny_mce/plugins/advlink/editor_plugin.js + jce/tiny_mce/plugins/advlink/extensions/index.html + jce/tiny_mce/plugins/advlink/extensions/links/index.html + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/contact.php + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/content.php + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/css/index.html + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/css/joomlalinks.css + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/index.html + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/menu.php + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks/weblinks.php + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks.php + jce/tiny_mce/plugins/advlink/extensions/links/joomlalinks.xml + jce/tiny_mce/plugins/advlink/img/advlink.gif + jce/tiny_mce/plugins/advlink/img/icons.gif + jce/tiny_mce/plugins/advlink/img/index.html + jce/tiny_mce/plugins/advlink/img/preview.jpg + jce/tiny_mce/plugins/advlink/index.html + jce/tiny_mce/plugins/advlink/js/advlink.js + jce/tiny_mce/plugins/advlink/js/index.html + jce/tiny_mce/plugins/advlink/langs/en_dlg.js + jce/tiny_mce/plugins/advlink/langs/index.html + jce/tiny_mce/plugins/article/css/content.css + jce/tiny_mce/plugins/article/css/index.html + jce/tiny_mce/plugins/article/css/pagebreak.css + jce/tiny_mce/plugins/article/editor_plugin.js + jce/tiny_mce/plugins/article/img/article.gif + jce/tiny_mce/plugins/article/img/index.html + jce/tiny_mce/plugins/article/img/pagebreak.gif + jce/tiny_mce/plugins/article/img/readmore.gif + jce/tiny_mce/plugins/article/img/trans.gif + jce/tiny_mce/plugins/article/index.html + jce/tiny_mce/plugins/article/js/index.html + jce/tiny_mce/plugins/article/js/pagebreak.js + jce/tiny_mce/plugins/article/langs/en.js + jce/tiny_mce/plugins/article/langs/en_dlg.js + jce/tiny_mce/plugins/article/langs/index.html + jce/tiny_mce/plugins/article/pagebreak.htm + jce/tiny_mce/plugins/browser/browser.php + jce/tiny_mce/plugins/browser/browser.xml + jce/tiny_mce/plugins/browser/classes/browser.php + jce/tiny_mce/plugins/browser/classes/config.php + jce/tiny_mce/plugins/browser/classes/index.html + jce/tiny_mce/plugins/browser/css/browser.css + jce/tiny_mce/plugins/browser/css/index.html + jce/tiny_mce/plugins/browser/editor_plugin.js + jce/tiny_mce/plugins/browser/index.html + jce/tiny_mce/plugins/browser/js/browser.js + jce/tiny_mce/plugins/browser/js/index.html + jce/tiny_mce/plugins/browser/langs/en_dlg.js + jce/tiny_mce/plugins/browser/langs/index.html + jce/tiny_mce/plugins/cleanup/classes/config.php + jce/tiny_mce/plugins/cleanup/classes/index.html + jce/tiny_mce/plugins/cleanup/editor_plugin.js + jce/tiny_mce/plugins/cleanup/index.html + jce/tiny_mce/plugins/code/classes/config.php + jce/tiny_mce/plugins/code/classes/index.html + jce/tiny_mce/plugins/code/css/content.css + jce/tiny_mce/plugins/code/css/index.html + jce/tiny_mce/plugins/code/editor_plugin.js + jce/tiny_mce/plugins/code/img/icons.gif + jce/tiny_mce/plugins/code/img/index.html + jce/tiny_mce/plugins/code/index.html + jce/tiny_mce/plugins/contextmenu/editor_plugin.js + jce/tiny_mce/plugins/contextmenu/index.html + jce/tiny_mce/plugins/directionality/editor_plugin.js + jce/tiny_mce/plugins/directionality/img/directionality.gif + jce/tiny_mce/plugins/directionality/img/index.html + jce/tiny_mce/plugins/directionality/index.html + jce/tiny_mce/plugins/emotions/editor_plugin.js + jce/tiny_mce/plugins/emotions/emotions.htm + jce/tiny_mce/plugins/emotions/img/emotions.gif + jce/tiny_mce/plugins/emotions/img/index.html + jce/tiny_mce/plugins/emotions/img/smiley-cool.gif + jce/tiny_mce/plugins/emotions/img/smiley-cry.gif + jce/tiny_mce/plugins/emotions/img/smiley-embarassed.gif + jce/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif + jce/tiny_mce/plugins/emotions/img/smiley-frown.gif + jce/tiny_mce/plugins/emotions/img/smiley-innocent.gif + jce/tiny_mce/plugins/emotions/img/smiley-kiss.gif + jce/tiny_mce/plugins/emotions/img/smiley-laughing.gif + jce/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif + jce/tiny_mce/plugins/emotions/img/smiley-sealed.gif + jce/tiny_mce/plugins/emotions/img/smiley-smile.gif + jce/tiny_mce/plugins/emotions/img/smiley-surprised.gif + jce/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif + jce/tiny_mce/plugins/emotions/img/smiley-undecided.gif + jce/tiny_mce/plugins/emotions/img/smiley-wink.gif + jce/tiny_mce/plugins/emotions/img/smiley-yell.gif + jce/tiny_mce/plugins/emotions/js/emotions.js + jce/tiny_mce/plugins/emotions/js/index.html + jce/tiny_mce/plugins/emotions/langs/en_dlg.js + jce/tiny_mce/plugins/emotions/langs/index.html + jce/tiny_mce/plugins/fullscreen/editor_plugin.js + jce/tiny_mce/plugins/fullscreen/fullscreen.htm + jce/tiny_mce/plugins/fullscreen/img/fullscreen.gif + jce/tiny_mce/plugins/fullscreen/img/index.html + jce/tiny_mce/plugins/fullscreen/index.html + jce/tiny_mce/plugins/help/editor_plugin.js + jce/tiny_mce/plugins/help/help.xml + jce/tiny_mce/plugins/help/img/help.gif + jce/tiny_mce/plugins/help/img/index.html + jce/tiny_mce/plugins/help/index.html + jce/tiny_mce/plugins/imgmanager/classes/imgmanager.php + jce/tiny_mce/plugins/imgmanager/classes/index.html + jce/tiny_mce/plugins/imgmanager/css/imgmanager.css + jce/tiny_mce/plugins/imgmanager/css/index.html + jce/tiny_mce/plugins/imgmanager/editor_plugin.js + jce/tiny_mce/plugins/imgmanager/img/imgmanager.gif + jce/tiny_mce/plugins/imgmanager/img/index.html + jce/tiny_mce/plugins/imgmanager/img/preview.jpg + jce/tiny_mce/plugins/imgmanager/img/sample.jpg + jce/tiny_mce/plugins/imgmanager/imgmanager.php + jce/tiny_mce/plugins/imgmanager/imgmanager.xml + jce/tiny_mce/plugins/imgmanager/index.html + jce/tiny_mce/plugins/imgmanager/js/imgmanager.js + jce/tiny_mce/plugins/imgmanager/js/index.html + jce/tiny_mce/plugins/imgmanager/langs/en_dlg.js + jce/tiny_mce/plugins/imgmanager/langs/index.html + jce/tiny_mce/plugins/index.html + jce/tiny_mce/plugins/inlinepopups/editor_plugin.js + jce/tiny_mce/plugins/inlinepopups/index.html + jce/tiny_mce/plugins/layer/editor_plugin.js + jce/tiny_mce/plugins/layer/img/index.html + jce/tiny_mce/plugins/layer/img/layer.gif + jce/tiny_mce/plugins/layer/index.html + jce/tiny_mce/plugins/media/classes/config.php + jce/tiny_mce/plugins/media/classes/index.html + jce/tiny_mce/plugins/media/css/content.css + jce/tiny_mce/plugins/media/css/index.html + jce/tiny_mce/plugins/media/editor_plugin.js + jce/tiny_mce/plugins/media/img/divx.gif + jce/tiny_mce/plugins/media/img/flash.gif + jce/tiny_mce/plugins/media/img/generic.gif + jce/tiny_mce/plugins/media/img/index.html + jce/tiny_mce/plugins/media/img/pdf.gif + jce/tiny_mce/plugins/media/img/quicktime.gif + jce/tiny_mce/plugins/media/img/realmedia.gif + jce/tiny_mce/plugins/media/img/shockwave.gif + jce/tiny_mce/plugins/media/img/trans.gif + jce/tiny_mce/plugins/media/img/windowsmedia.gif + jce/tiny_mce/plugins/media/index.html + jce/tiny_mce/plugins/media/media.xml + jce/tiny_mce/plugins/nonbreaking/editor_plugin.js + jce/tiny_mce/plugins/nonbreaking/img/index.html + jce/tiny_mce/plugins/nonbreaking/img/nonbreaking.gif + jce/tiny_mce/plugins/nonbreaking/index.html + jce/tiny_mce/plugins/paste/blank.htm + jce/tiny_mce/plugins/paste/classes/config.php + jce/tiny_mce/plugins/paste/classes/index.html + jce/tiny_mce/plugins/paste/css/blank.css + jce/tiny_mce/plugins/paste/css/index.html + jce/tiny_mce/plugins/paste/css/paste.css + jce/tiny_mce/plugins/paste/editor_plugin.js + jce/tiny_mce/plugins/paste/img/index.html + jce/tiny_mce/plugins/paste/img/paste.gif + jce/tiny_mce/plugins/paste/img/pastetext.gif + jce/tiny_mce/plugins/paste/img/pasteword.gif + jce/tiny_mce/plugins/paste/index.html + jce/tiny_mce/plugins/paste/js/index.html + jce/tiny_mce/plugins/paste/js/paste.js + jce/tiny_mce/plugins/paste/paste.htm + jce/tiny_mce/plugins/paste/paste.xml + jce/tiny_mce/plugins/preview/editor_plugin.js + jce/tiny_mce/plugins/preview/img/index.html + jce/tiny_mce/plugins/preview/img/preview.gif + jce/tiny_mce/plugins/preview/index.html + jce/tiny_mce/plugins/preview/js/index.html + jce/tiny_mce/plugins/preview/js/mediaobject.js + jce/tiny_mce/plugins/preview/preview.html + jce/tiny_mce/plugins/print/editor_plugin.js + jce/tiny_mce/plugins/print/img/index.html + jce/tiny_mce/plugins/print/img/print.gif + jce/tiny_mce/plugins/print/index.html + jce/tiny_mce/plugins/safari/blank.htm + jce/tiny_mce/plugins/safari/editor_plugin.js + jce/tiny_mce/plugins/safari/index.html + jce/tiny_mce/plugins/searchreplace/css/index.html + jce/tiny_mce/plugins/searchreplace/css/searchreplace.css + jce/tiny_mce/plugins/searchreplace/editor_plugin.js + jce/tiny_mce/plugins/searchreplace/img/index.html + jce/tiny_mce/plugins/searchreplace/img/searchreplace.gif + jce/tiny_mce/plugins/searchreplace/index.html + jce/tiny_mce/plugins/searchreplace/js/index.html + jce/tiny_mce/plugins/searchreplace/js/searchreplace.js + jce/tiny_mce/plugins/searchreplace/langs/en_dlg.js + jce/tiny_mce/plugins/searchreplace/langs/index.html + jce/tiny_mce/plugins/searchreplace/searchreplace.htm + jce/tiny_mce/plugins/spellchecker/classes/config.php + jce/tiny_mce/plugins/spellchecker/classes/enchantspell.php + jce/tiny_mce/plugins/spellchecker/classes/googlespell.php + jce/tiny_mce/plugins/spellchecker/classes/index.html + jce/tiny_mce/plugins/spellchecker/classes/pspell.php + jce/tiny_mce/plugins/spellchecker/classes/pspellshell.php + jce/tiny_mce/plugins/spellchecker/classes/spellchecker.php + jce/tiny_mce/plugins/spellchecker/classes/utils/index.html + jce/tiny_mce/plugins/spellchecker/classes/utils/json.php + jce/tiny_mce/plugins/spellchecker/classes/utils/logger.php + jce/tiny_mce/plugins/spellchecker/css/content.css + jce/tiny_mce/plugins/spellchecker/editor_plugin.js + jce/tiny_mce/plugins/spellchecker/img/index.html + jce/tiny_mce/plugins/spellchecker/img/spellchecker.gif + jce/tiny_mce/plugins/spellchecker/img/wline.gif + jce/tiny_mce/plugins/spellchecker/includes/general.php + jce/tiny_mce/plugins/spellchecker/includes/index.html + jce/tiny_mce/plugins/spellchecker/index.html + jce/tiny_mce/plugins/spellchecker/rpc.php + jce/tiny_mce/plugins/spellchecker/spellchecker.xml + jce/tiny_mce/plugins/style/css/index.html + jce/tiny_mce/plugins/style/css/props.css + jce/tiny_mce/plugins/style/editor_plugin.js + jce/tiny_mce/plugins/style/img/index.html + jce/tiny_mce/plugins/style/img/style.gif + jce/tiny_mce/plugins/style/index.html + jce/tiny_mce/plugins/style/js/index.html + jce/tiny_mce/plugins/style/js/props.js + jce/tiny_mce/plugins/style/langs/en_dlg.js + jce/tiny_mce/plugins/style/langs/index.html + jce/tiny_mce/plugins/style/props.htm + jce/tiny_mce/plugins/tabfocus/classes/config.php + jce/tiny_mce/plugins/tabfocus/classes/index.html + jce/tiny_mce/plugins/tabfocus/editor_plugin.js + jce/tiny_mce/plugins/tabfocus/index.html + jce/tiny_mce/plugins/table/cell.htm + jce/tiny_mce/plugins/table/css/cell.css + jce/tiny_mce/plugins/table/css/index.html + jce/tiny_mce/plugins/table/css/row.css + jce/tiny_mce/plugins/table/css/table.css + jce/tiny_mce/plugins/table/editor_plugin.js + jce/tiny_mce/plugins/table/img/buttons.gif + jce/tiny_mce/plugins/table/img/index.html + jce/tiny_mce/plugins/table/index.html + jce/tiny_mce/plugins/table/js/cell.js + jce/tiny_mce/plugins/table/js/index.html + jce/tiny_mce/plugins/table/js/merge_cells.js + jce/tiny_mce/plugins/table/js/row.js + jce/tiny_mce/plugins/table/js/table.js + jce/tiny_mce/plugins/table/langs/en_dlg.js + jce/tiny_mce/plugins/table/langs/index.html + jce/tiny_mce/plugins/table/merge_cells.htm + jce/tiny_mce/plugins/table/row.htm + jce/tiny_mce/plugins/table/table.htm + jce/tiny_mce/plugins/visualchars/editor_plugin.js + jce/tiny_mce/plugins/visualchars/img/index.html + jce/tiny_mce/plugins/visualchars/img/visualchars.gif + jce/tiny_mce/plugins/visualchars/index.html + jce/tiny_mce/plugins/xhtmlxtras/abbr.htm + jce/tiny_mce/plugins/xhtmlxtras/acronym.htm + jce/tiny_mce/plugins/xhtmlxtras/attributes.htm + jce/tiny_mce/plugins/xhtmlxtras/cite.htm + jce/tiny_mce/plugins/xhtmlxtras/css/attributes.css + jce/tiny_mce/plugins/xhtmlxtras/css/index.html + jce/tiny_mce/plugins/xhtmlxtras/css/popup.css + jce/tiny_mce/plugins/xhtmlxtras/css/xhtmlxtras.css + jce/tiny_mce/plugins/xhtmlxtras/del.htm + jce/tiny_mce/plugins/xhtmlxtras/editor_plugin.js + jce/tiny_mce/plugins/xhtmlxtras/img/index.html + jce/tiny_mce/plugins/xhtmlxtras/img/xhtmlxtras.gif + jce/tiny_mce/plugins/xhtmlxtras/index.html + jce/tiny_mce/plugins/xhtmlxtras/ins.htm + jce/tiny_mce/plugins/xhtmlxtras/js/abbr.js + jce/tiny_mce/plugins/xhtmlxtras/js/acronym.js + jce/tiny_mce/plugins/xhtmlxtras/js/attributes.js + jce/tiny_mce/plugins/xhtmlxtras/js/cite.js + jce/tiny_mce/plugins/xhtmlxtras/js/del.js + jce/tiny_mce/plugins/xhtmlxtras/js/element_common.js + jce/tiny_mce/plugins/xhtmlxtras/js/index.html + jce/tiny_mce/plugins/xhtmlxtras/js/ins.js + jce/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js + jce/tiny_mce/plugins/xhtmlxtras/langs/index.html + jce/tiny_mce/popupImage.php + jce/tiny_mce/themes/advanced/about.htm + jce/tiny_mce/themes/advanced/anchor.htm + jce/tiny_mce/themes/advanced/charmap.htm + jce/tiny_mce/themes/advanced/color_picker.htm + jce/tiny_mce/themes/advanced/editor_template.js + jce/tiny_mce/themes/advanced/image.htm + jce/tiny_mce/themes/advanced/img/anchor.gif + jce/tiny_mce/themes/advanced/img/backcolor.gif + jce/tiny_mce/themes/advanced/img/bold.gif + jce/tiny_mce/themes/advanced/img/bullist.gif + jce/tiny_mce/themes/advanced/img/charmap.gif + jce/tiny_mce/themes/advanced/img/cleanup.gif + jce/tiny_mce/themes/advanced/img/clipboard.gif + jce/tiny_mce/themes/advanced/img/code.gif + jce/tiny_mce/themes/advanced/img/colorpicker.jpg + jce/tiny_mce/themes/advanced/img/copy.gif + jce/tiny_mce/themes/advanced/img/cut.gif + jce/tiny_mce/themes/advanced/img/fontselect.gif + jce/tiny_mce/themes/advanced/img/fontsizeselect.gif + jce/tiny_mce/themes/advanced/img/forecolor.gif + jce/tiny_mce/themes/advanced/img/formatselect.gif + jce/tiny_mce/themes/advanced/img/help.gif + jce/tiny_mce/themes/advanced/img/hr.gif + jce/tiny_mce/themes/advanced/img/icons.gif + jce/tiny_mce/themes/advanced/img/image.gif + jce/tiny_mce/themes/advanced/img/indent.gif + jce/tiny_mce/themes/advanced/img/index.html + jce/tiny_mce/themes/advanced/img/italic.gif + jce/tiny_mce/themes/advanced/img/justifycenter.gif + jce/tiny_mce/themes/advanced/img/justifyfull.gif + jce/tiny_mce/themes/advanced/img/justifyleft.gif + jce/tiny_mce/themes/advanced/img/justifyright.gif + jce/tiny_mce/themes/advanced/img/link.gif + jce/tiny_mce/themes/advanced/img/newdocument.gif + jce/tiny_mce/themes/advanced/img/numlist.gif + jce/tiny_mce/themes/advanced/img/outdent.gif + jce/tiny_mce/themes/advanced/img/paste.gif + jce/tiny_mce/themes/advanced/img/redo.gif + jce/tiny_mce/themes/advanced/img/removeformat.gif + jce/tiny_mce/themes/advanced/img/spacer.gif + jce/tiny_mce/themes/advanced/img/strikethrough.gif + jce/tiny_mce/themes/advanced/img/styleselect.gif + jce/tiny_mce/themes/advanced/img/sub.gif + jce/tiny_mce/themes/advanced/img/sup.gif + jce/tiny_mce/themes/advanced/img/underline.gif + jce/tiny_mce/themes/advanced/img/undo.gif + jce/tiny_mce/themes/advanced/img/unlink.gif + jce/tiny_mce/themes/advanced/img/visualaid.gif + jce/tiny_mce/themes/advanced/index.html + jce/tiny_mce/themes/advanced/js/about.js + jce/tiny_mce/themes/advanced/js/anchor.js + jce/tiny_mce/themes/advanced/js/charmap.js + jce/tiny_mce/themes/advanced/js/color_picker.js + jce/tiny_mce/themes/advanced/js/image.js + jce/tiny_mce/themes/advanced/js/index.html + jce/tiny_mce/themes/advanced/js/link.js + jce/tiny_mce/themes/advanced/js/source_editor.js + jce/tiny_mce/themes/advanced/langs/en.js + jce/tiny_mce/themes/advanced/langs/en_dlg.js + jce/tiny_mce/themes/advanced/langs/index.html + jce/tiny_mce/themes/advanced/link.htm + jce/tiny_mce/themes/advanced/skins/default/content.css + jce/tiny_mce/themes/advanced/skins/default/dialog.css + jce/tiny_mce/themes/advanced/skins/default/img/buttons.png + jce/tiny_mce/themes/advanced/skins/default/img/items.gif + jce/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif + jce/tiny_mce/themes/advanced/skins/default/img/menu_check.gif + jce/tiny_mce/themes/advanced/skins/default/img/progress.gif + jce/tiny_mce/themes/advanced/skins/default/img/tabs.gif + jce/tiny_mce/themes/advanced/skins/default/index.html + jce/tiny_mce/themes/advanced/skins/default/ui.css + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/css/dialog.css + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/css/index.html + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/css/window.css + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/alert.png + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/button.gif + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/buttons.gif + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/confirm.png + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/corners.gif + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/horizontal.gif + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/index.html + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/img/vertical.gif + jce/tiny_mce/themes/advanced/skins/dialog/classicblue/index.html + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/css/dialog.css + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/css/index.html + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/css/window.css + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/alert.png + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/button.gif + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/buttons.gif + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/confirm.png + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/corners.gif + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/horizontal.gif + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/index.html + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/img/vertical.gif + jce/tiny_mce/themes/advanced/skins/dialog/clearlooks2/index.html + jce/tiny_mce/themes/advanced/skins/dialog/index.html + jce/tiny_mce/themes/advanced/skins/index.html + jce/tiny_mce/themes/advanced/skins/o2k7/content.css + jce/tiny_mce/themes/advanced/skins/o2k7/dialog.css + jce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png + jce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png + jce/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png + jce/tiny_mce/themes/advanced/skins/o2k7/index.html + jce/tiny_mce/themes/advanced/skins/o2k7/ui.css + jce/tiny_mce/themes/advanced/skins/o2k7/ui_black.css + jce/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css + jce/tiny_mce/themes/advanced/source_editor.htm + jce/tiny_mce/themes/index.html + jce/tiny_mce/themes/none/editor_template.js + jce/tiny_mce/themes/none/index.html + jce/tiny_mce/themes/none/skins/default/content.css + jce/tiny_mce/themes/none/skins/default/index.html + jce/tiny_mce/themes/none/skins/default/ui.css + jce/tiny_mce/themes/none/skins/index.html + jce/tiny_mce/tiny_mce.js + jce/tiny_mce/tiny_mce_gzip.js + jce/tiny_mce/tiny_mce_gzip.php + jce/tiny_mce/tiny_mce_popup.js + jce/tiny_mce/utils/editable_selects.js + jce/tiny_mce/utils/form_utils.js + jce/tiny_mce/utils/index.html + jce/tiny_mce/utils/mctabs.js + jce/tiny_mce/utils/validate.js + jce.php + + + + + + en-GB.plg_editors_jce.ini + + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/none.php b/oss/joomla/trunk/plugins/editors/none.php new file mode 100644 index 00000000..cc5e3a13 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/none.php @@ -0,0 +1,183 @@ + + function insertAtCursor(myField, myValue) { + if (document.selection) { + // IE support + myField.focus(); + sel = document.selection.createRange(); + sel.text = myValue; + } else if (myField.selectionStart || myField.selectionStart == '0') { + // MOZILLA/NETSCAPE support + var startPos = myField.selectionStart; + var endPos = myField.selectionEnd; + myField.value = myField.value.substring(0, startPos) + + myValue + + myField.value.substring(endPos, myField.value.length); + } else { + myField.value += myValue; + } + } + "; + return $txt; + } + + /** + * No WYSIWYG Editor - copy editor content to form field + * + * @param string The name of the editor + */ + function onSave( $editor ) { + return; + } + + /** + * No WYSIWYG Editor - get the editor content + * + * @param string The name of the editor + */ + function onGetContent( $editor ) { + return "document.getElementById( '$editor' ).value;\n"; + } + + /** + * No WYSIWYG Editor - set the editor content + * + * @param string The name of the editor + */ + function onSetContent( $editor, $html ) { + return "document.getElementById( '$editor' ).value = $html;\n"; + } + + /** + * No WYSIWYG Editor - display the editor + * + * @param string The name of the editor area + * @param string The content of the field + * @param string The name of the form field + * @param string The width of the editor area + * @param string The height of the editor area + * @param int The number of columns for the editor area + * @param int The number of rows for the editor area + */ + function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true ) + { + // Only add "px" to width and height if they are not given as a percentage + if (is_numeric( $width )) { + $width .= 'px'; + } + if (is_numeric( $height )) { + $height .= 'px'; + } + + $buttons = $this->_displayButtons($name, $buttons); + $editor = "" . $buttons; + + return $editor; + } + + function onGetInsertMethod($name) + { + $doc = & JFactory::getDocument(); + + $js= "\tfunction jInsertEditorText( text, editor ) { + insertAtCursor( document.getElementById(editor), text ); + }"; + $doc->addScriptDeclaration($js); + + return true; + } + + function _displayButtons($name, $buttons) + { + // Load modal popup behavior + JHTML::_('behavior.modal', 'a.modal-button'); + + $args['name'] = $name; + $args['event'] = 'onGetInsertMethod'; + + $return = ''; + $results[] = $this->update($args); + foreach ($results as $result) { + if (is_string($result) && trim($result)) { + $return .= $result; + } + } + + if(!empty($buttons)) + { + $results = $this->_subject->getButtons($name, $buttons); + + /* + * This will allow plugins to attach buttons or change the behavior on the fly using AJAX + */ + $return .= "\n
\n"; + foreach ($results as $button) + { + /* + * Results should be an object + */ + if ( $button->get('name') ) + { + $modal = ($button->get('modal')) ? 'class="modal-button"' : null; + $href = ($button->get('link')) ? 'href="'.$button->get('link').'"' : null; + $onclick = ($button->get('onclick')) ? 'onclick="'.$button->get('onclick').'"' : null; + $return .= "
\n"; + } + } + $return .= "
\n"; + } + + return $return; + } +} \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/none.xml b/oss/joomla/trunk/plugins/editors/none.xml new file mode 100644 index 00000000..0f05f9d0 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/none.xml @@ -0,0 +1,16 @@ + + + Editor - None + 1.0 + August 2004 + + N/A + + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + LGPL + This loads a basic text entry field + + none.php + + + \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/tinymce.php b/oss/joomla/trunk/plugins/editors/tinymce.php new file mode 100644 index 00000000..340dd41b --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce.php @@ -0,0 +1,652 @@ +params->get('mode','advanced'); + $theme = array('simple' => 'simple','advanced' => 'advanced','extended' => 'advanced'); + $skin = $this->params->get( 'skin', '0' ); + switch ($skin) + { + case '3': + $skin = "skin : \"o2k7\", skin_variant : \"black\","; + break; + case '2': + $skin = "skin : \"o2k7\", skin_variant : \"silver\","; + break; + case '1': + $skin = "skin : \"o2k7\","; + break; + case '0': + default: + $skin = "skin : \"default\","; + } + $compressed = $this->params->def( 'compressed', 0 ); + + $cleanup_startup = $this->params->def( 'cleanup_startup', 0 ); + $cleanup_save = $this->params->def( 'cleanup_save', 2 ); + $entity_encoding = $this->params->def( 'entity_encoding', 'raw' ); + if ( $cleanup_startup ) { + $cleanup_startup = 'true'; + } else { + $cleanup_startup = 'false'; + } + switch ( $cleanup_save ) { + case '0': /* Never clean up on save */ + $cleanup = 'false'; + break; + case '1': /* Clean up front end edits only */ + if ($mainframe->isadmin()) + $cleanup = 'false'; + else + $cleanup = 'true'; + break; + default: /* Always clean up on save */ + $cleanup = 'true'; + break; + } + + $langMode = $this->params->def( 'lang_mode', 0 ); + $langPrefix = $this->params->def( 'lang_code', 'en' ); + if ($langMode) { + $langPrefix = substr( $language->getTag(), 0, strpos( $language->getTag(), '-' ) ); + } + if ($language->isRTL()) { + $text_direction = 'rtl'; + } else { + $text_direction = 'ltr'; + } + + $content_css = $this->params->def( 'content_css', 1 ); + $content_css_custom = $this->params->def( 'content_css_custom', '' ); + // loading of css file for `styles` dropdown + if ( $content_css_custom ) { + $content_css = 'content_css : "'. $content_css_custom .'", '; + } + else { + /* + * Lets get the default template for the site application + */ + $db =& JFactory::getDBO(); + $query = 'SELECT template' + . ' FROM #__templates_menu' + . ' WHERE client_id = 0' + . ' AND menuid = 0' + ; + $db->setQuery( $query ); + $template = $db->loadResult(); + + if($content_css) + { + $file_path = JPATH_SITE .'/templates/'. $template .'/css/'; + // Try for site css + $file_name = "template"; + + if ($language->isRTL()) { + $file_name .= "_rtl.css"; + } else { + $file_name .= ".css"; + } + + if ( file_exists( $file_path .DS. $file_name ) ) { + $content_css = 'content_css : "' . JURI::root() .'templates/'. $template . '/css/'.$file_name.', ' . JURI::root() .'templates/system/css/editor.css"'; + } else { + $content_css = 'content_css : "' . JURI::root() .'templates/system/css/editor.css"'; + } + } else { + $content_css = ''; + } + } + + $relative_urls = $this->params->def( 'relative_urls', '1' ); + if ( $relative_urls ) { // relative + $relative_urls = "true"; + } else { // absolute + $relative_urls = "false"; + } + + $newlines = $this->params->def( 'newlines', 0 ); + if ( $newlines ) { // br + $forcenewline = "force_br_newlines : \"true\", force_p_newlines : \"false\", forced_root_block : '',"; + } else { // p + $forcenewline = "force_br_newlines : \"false\", force_p_newlines : \"true\", forced_root_block : 'p',"; + } + $invalid_elements = $this->params->def( 'invalid_elements', 'script,applet,iframe' ); + $extended_elements = $this->params->def( 'extended_elements', '' ); + + + // theme_advanced_* settings + $toolbar = $this->params->def( 'toolbar', 'top' ); + $toolbar_align = $this->params->def( 'toolbar_align', 'left' ); + $html_height = $this->params->def( 'html_height', '550' ); + $html_width = $this->params->def( 'html_width', '750' ); + $element_path = ''; + if ($this->params->get('element_path', 1)) { + $element_path = "theme_advanced_statusbar_location : \"bottom\", theme_advanced_path : true"; + } else { + $element_path = "theme_advanced_statusbar_location : \"none\", theme_advanced_path : false"; + } + + $buttons1_add_before = $buttons1_add = array(); + $buttons2_add_before = $buttons2_add = array(); + $buttons3_add_before = $buttons3_add = array(); + $buttons4 = array(); + $plugins = array(); + if( $extended_elements != "" ) $elements = explode( ',', $extended_elements ); + + //Initial values for buttons + array_push($buttons2_add_before,'cut','copy','paste'); + array_push($buttons2_add,'|'); + + // Plugins + + // fonts + $fonts = $this->params->def( 'fonts', 1 ); + if ( $fonts ) { + $buttons1_add[] = 'fontselect,fontsizeselect'; + } + + // paste + $paste = $this->params->def( 'paste', 1 ); + if ( $paste ) { + $plugins[] = 'paste'; + $buttons2_add_before[] = 'pastetext,pasteword,selectall'; + } + + // search & replace + $searchreplace = $this->params->def( 'searchreplace', 1 ); + if ( $searchreplace ) { + $plugins[] = 'searchreplace'; + $buttons2_add_before[] = '|,search,replace,|'; + } + + // insert date and/or time plugin + $insertdate = $this->params->def( 'insertdate', 1 ); + $format_date = $this->params->def( 'format_date', '%Y-%m-%d' ); + $inserttime = $this->params->def( 'inserttime', 1 ); + $format_time = $this->params->def( 'format_time', '%H:%M:%S' ); + if ( $insertdate or $inserttime ) { + $plugins[] = 'insertdatetime'; + if ( $insertdate ) { + $buttons2_add[] = 'insertdate'; + } + if ( $inserttime ) { + $buttons2_add[] = 'inserttime'; + } + } + + // colors + $colors = $this->params->def( 'colors', 1 ); + if ( $colors ) { + $buttons2_add[] = 'forecolor,backcolor'; + } + + // table + $table = $this->params->def( 'table', 1 ); + if ( $table ) { + $plugins[] = 'table'; + $buttons3_add_before[] = 'tablecontrols'; + } + + // emotions + $smilies = $this->params->def( 'smilies', 1 ); + if ( $smilies ) { + $plugins[] = 'emotions'; + $buttons3_add[] = 'emotions'; + } + + //media plugin + $media = $this->params->def( 'media', 1 ); + if ( $media ) { + $plugins[] = 'media'; + $buttons3_add[] = 'media'; + } + + // horizontal line + $hr = $this->params->def( 'hr', 1 ); + if ( $hr ) { + $plugins[] = 'advhr'; + $elements[] = 'hr[id|title|alt|class|width|size|noshade]'; + $buttons3_add[] = 'advhr'; + } else { + $elements[] = 'hr[id|class|title|alt]'; + } + + // rtl/ltr buttons + $directionality = $this->params->def( 'directionality', 1 ); + if ( $directionality ) { + $plugins[] = 'directionality'; + $buttons3_add[] = 'ltr,rtl'; + } + + // fullscreen + $fullscreen = $this->params->def( 'fullscreen', 1 ); + if ( $fullscreen ) { + $plugins[] = 'fullscreen'; + $buttons3_add[] = 'fullscreen'; + } + + // layer + $layer = $this->params->def( 'layer', 1 ); + if ( $layer ) { + $plugins[] = 'layer'; + $buttons4[] = 'insertlayer'; + $buttons4[] = 'moveforward'; + $buttons4[] = 'movebackward'; + $buttons4[] = 'absolute'; + } + + // style + $style = $this->params->def( 'style', 1 ); + if ( $style ) { + $plugins[] = 'style'; + $buttons4[] = 'styleprops'; + } + + // XHTMLxtras + $xhtmlxtras = $this->params->def( 'xhtmlxtras', 1 ); + if ( $xhtmlxtras ) { + $plugins[] = 'xhtmlxtras'; + $buttons4[] = 'cite,abbr,acronym,ins,del,attribs'; + } + + // visualchars + $visualchars = $this->params->def( 'visualchars', 1 ); + if ( $template ) { + $plugins[] = 'visualchars'; + $buttons4[] = 'visualchars'; + } + + // visualchars + $nonbreaking = $this->params->def( 'nonbreaking', 1 ); + if ( $template ) { + $plugins[] = 'nonbreaking'; + $buttons4[] = 'nonbreaking'; + } + + // template + $template = $this->params->def( 'template', 1 ); + if ( $template ) { + $plugins[] = 'template'; + $buttons4[] = 'template'; + } + + // advimage + $advimage = $this->params->def( 'advimage', 1 ); + if ( $advimage ) { + $plugins[] = 'advimage'; + $elements[] = 'img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]'; + } + + // advlink + $advlink = $this->params->def( 'advlink', 1 ); + if ( $advlink ) { + $plugins[] = 'advlink'; + $elements[] = 'a[class|name|href|target|title|onclick|rel]'; + } + + // autosave + $autosave = $this->params->def( 'autosave', 1 ); + if ( $autosave ) { + $plugins[] = 'autosave'; + } + + // context menu + $contextmenu = $this->params->def( 'contextmenu', 1 ); + if ( $contextmenu ) { + $plugins[] = 'contextmenu'; + } + + // inline popups + $inlinepopups = $this->params->def( 'inlinepopups', 1 ); + if ( $inlinepopups ) { + $plugins[] = 'inlinepopups'; + $dialog_type = "dialog_type : \"modal\","; + } else { + $dialog_type = ""; + } + + // Safari compatibility + $safari = $this->params->def( 'safari', 0 ); + if ( $safari ) { + $plugins[] = 'safari'; + } + + $custom_plugin = $this->params->def( 'custom_plugin', '' ); + if ($custom_plugin != "") { + $plugins[] = $custom_plugin; + } + + $custom_button = $this->params->def( 'custom_button', '' ); + if ($custom_button != "") { + $buttons4[] = $custom_button; + } + + // Prepare config variables + $buttons1_add_before = implode( ',', $buttons1_add_before ); + $buttons2_add_before = implode( ',', $buttons2_add_before ); + $buttons3_add_before = implode( ',', $buttons3_add_before ); + $buttons1_add = implode( ',', $buttons1_add ); + $buttons2_add = implode( ',', $buttons2_add ); + $buttons3_add = implode( ',', $buttons3_add ); + $buttons4 = implode( ',', $buttons4 ); + $plugins = implode( ',', $plugins ); + $elements = implode( ',', $elements ); + + switch($mode) { + case 'simple': /* Simple mode*/ + if ($compressed) { + $load = "\t\n"; + $load .= "\t"; + } else { + $load = "\t\n"; + } + $return = $load . + "\t"; + break; + + case 'advanced': /* Advanced mode*/ + if ($compressed) { + $load = "\t\n"; + $load .= "\t"; + } else { + $load = "\t\n"; + } + $return = $load . + "\t"; + break; + + case 'extended': /* Extended mode*/ + if ($compressed) { + $load = "\t\n"; + $load .= "\t"; + } else { + $load = "\t\n"; + } + $return = $load . + "\t"; + break; + } + + return $return; + } + + /** + * TinyMCE WYSIWYG Editor - get the editor content + * + * @param string The name of the editor + */ + function onGetContent( $editor ) { + return "tinyMCE.activeEditor.getContent();"; + } + + /** + * TinyMCE WYSIWYG Editor - set the editor content + * + * @param string The name of the editor + */ + function onSetContent( $editor, $html ) { + return "tinyMCE.activeEditor.setContent(".$html.");"; + } + + /** + * TinyMCE WYSIWYG Editor - copy editor content to form field + * + * @param string The name of the editor + */ + function onSave( $editor ) { + return "tinyMCE.triggerSave();"; + } + + /** + * TinyMCE WYSIWYG Editor - display the editor + * + * @param string The name of the editor area + * @param string The content of the field + * @param string The width of the editor area + * @param string The height of the editor area + * @param int The number of columns for the editor area + * @param int The number of rows for the editor area + * @param mixed Can be boolean or array. + */ + function onDisplay( $name, $content, $width, $height, $col, $row, $buttons = true) + { + // Only add "px" to width and height if they are not given as a percentage + if (is_numeric( $width )) { + $width .= 'px'; + } + if (is_numeric( $height )) { + $height .= 'px'; + } + + $editor = "\n" . + $this->_displayButtons($name, $buttons) . + $this->_toogleButton($name); + + return $editor; + } + + function onGetInsertMethod($name) + { + $doc = & JFactory::getDocument(); + + $js= "function jInsertEditorText( text, editor ) { + tinyMCE.execInstanceCommand(editor, 'mceInsertContent',false,text); + }"; + $doc->addScriptDeclaration($js); + + return true; + } + + function _displayButtons($name, $buttons) + { + // Load modal popup behavior + JHTML::_('behavior.modal', 'a.modal-button'); + + $args['name'] = $name; + $args['event'] = 'onGetInsertMethod'; + + $return = ''; + $results[] = $this->update($args); + foreach ($results as $result) { + if (is_string($result) && trim($result)) { + $return .= $result; + } + } + + if(!empty($buttons)) + { + $results = $this->_subject->getButtons($name, $buttons); + + /* + * This will allow plugins to attach buttons or change the behavior on the fly using AJAX + */ + $return .= "\n
\n"; + foreach ($results as $button) + { + /* + * Results should be an object + */ + if ( $button->get('name') ) + { + $modal = ($button->get('modal')) ? 'class="modal-button"' : null; + $href = ($button->get('link')) ? 'href="'.JURI::base().$button->get('link').'"' : null; + $onclick = ($button->get('onclick')) ? 'onclick="'.$button->get('onclick').'"' : null; + $return .= "
\n"; + } + } + $return .= "
\n"; + } + + return $return; + } + + function _toogleButton($name) + { + $return = ''; + $return .= "\n
\n"; + $return .= "
"; + $return .= "
\n"; + return $return; + } +} diff --git a/oss/joomla/trunk/plugins/editors/tinymce.xml b/oss/joomla/trunk/plugins/editors/tinymce.xml new file mode 100644 index 00000000..c2c6c474 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/tinymce.xml @@ -0,0 +1,198 @@ + + + Editor - TinyMCE 3 + 3.2.4.1 + 2005-2009 + Moxiecode Systems AB + N/A + tinymce.moxiecode.com/ + Moxiecode Systems AB + LGPL + DESCTINYMCE + + tinymce3.php + tinymce3 + + + en-GB.plg_editors_tinymce3.ini + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oss/joomla/trunk/plugins/editors/xstandard.php b/oss/joomla/trunk/plugins/editors/xstandard.php new file mode 100644 index 00000000..a48cfdb2 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/xstandard.php @@ -0,0 +1,286 @@ + + + getTag(), 0, strpos( $language->getTag(), '-' ) ); + + if ($language->isRTL()) { + $direction = 'rtl'; + } else { + $direction = 'ltr'; + } + + /* + * Lets get the default template for the site application + */ + $query = 'SELECT template' + . ' FROM #__templates_menu' + . ' WHERE client_id = 0' + . ' AND menuid = 0' + ; + $db->setQuery( $query ); + $template = $db->loadResult(); + + $file_path = JPATH_SITE .'/templates/'. $template .'/css/'; + if ( !file_exists( $file_path .DS. 'editor.css' ) ) { + $template = 'system'; + } + + $css = JURI::root() .'/templates/'. $template . '/css/editor.css'; + + $html = ''; + ob_start(); + ?> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ _displayButtons($name, $buttons); + + return $html; + } + + function onGetInsertMethod($name) + { + $doc = & JFactory::getDocument(); + + $js= "function jInsertEditorText( text ) { + var editor = document.getElementById('xstandard'); + editor.InsertXML(text); + }"; + $doc->addScriptDeclaration($js); + + return true; + } + + function _getTemplateCss() + { + $db =& JFactory::getDBO(); + + /* + * Lets get the default template for the site application + */ + $query = 'SELECT template' + . ' FROM #__templates_menu' + . ' WHERE client_id = 0' + . ' AND menuid = 0' + ; + $db->setQuery( $query ); + $template = $db->loadResult(); + + $content_css = JURI::root() .'/templates/'. $template .'/css/'; + + $file_path = JPATH_SITE .'/templates/'. $template .'/css/'; + if ( file_exists( $file_path .DS. 'editor.css' ) ) { + $content_css = $content_css . 'editor.css' .'", '; + } else { + $content_css = $content_css . 'template_css.css", '; + } + + return $content_css; + } + + function _displayButtons($name, $buttons) + { + // Load modal popup behavior + JHTML::_('behavior.modal', 'a.modal-button'); + + $args['name'] = $name; + $args['event'] = 'onGetInsertMethod'; + + $return = ''; + $results[] = $this->update($args); + foreach ($results as $result) { + if (is_string($result) && trim($result)) { + $return .= $result; + } + } + + if(!empty($buttons)) + { + $results = $this->_subject->getButtons($name, $buttons); + + /* + * This will allow plugins to attach buttons or change the behavior on the fly using AJAX + */ + $return .= "\n
\n"; + foreach ($results as $button) + { + /* + * Results should be an object + */ + if ( $button->get('name') ) + { + $modal = ($button->get('modal')) ? 'class="modal-button"' : null; + $href = ($button->get('link')) ? 'href="'.$button->get('link').'"' : null; + $onclick = ($button->get('onclick')) ? 'onclick="'.$button->get('onclick').'"' : null; + $return .= "
\n"; + } + } + $return .= "
\n"; + } + + return $return; + } +} \ No newline at end of file diff --git a/oss/joomla/trunk/plugins/editors/xstandard.xml b/oss/joomla/trunk/plugins/editors/xstandard.xml new file mode 100644 index 00000000..b3f72652 --- /dev/null +++ b/oss/joomla/trunk/plugins/editors/xstandard.xml @@ -0,0 +1,27 @@ + + + Editor - XStandard Lite for Joomla! + 1.0 + Aug 2007 + Joomla! Project + admin@joomla.org + www.joomla.org + Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved. + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + DESCXSTANDARD + + xstandard_lite/xstandard.js + xstandard.php + + + + + + + + + + + + +