From b0091537dd8b224b148cb37450624dc11db34754 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 26 Oct 2009 19:57:23 -0600 Subject: [PATCH] Remove xinha driver --- framework/Editor/lib/Horde/Editor/Xinha.php | 151 ---------------------------- framework/Editor/package.xml | 5 +- 2 files changed, 2 insertions(+), 154 deletions(-) delete mode 100644 framework/Editor/lib/Horde/Editor/Xinha.php diff --git a/framework/Editor/lib/Horde/Editor/Xinha.php b/framework/Editor/lib/Horde/Editor/Xinha.php deleted file mode 100644 index 3ae8c5684..000000000 --- a/framework/Editor/lib/Horde/Editor/Xinha.php +++ /dev/null @@ -1,151 +0,0 @@ - - * @author Jan Schneider - * @author Roel Gloudemans - * @author Michael Slusarz - * @package Horde_Editor - */ -class Horde_Editor_Xinha extends Horde_Editor -{ - /** - * Constructor. - * - * @param array $params The following configuration parameters: - *
-     * 'config' - An array of additional config items. Values will be quoted
-     *            unless they begin with the string '@raw@' in which case
-     *            they will be output as-is.
-     * 'hidebuttons' - A list of buttons to hide.
-     * 'id' - The ID of the text area to turn into an editor.
-     * 'lang' - The language to use. (Default: en)
-     * 'loadnotify' - Display notification graphic when loading (Default: no)
-     * 'no_autoload' - Don't load xinha by default on pageload.
-     * 'no_notify' - Don't output JS code automatically. Code will
-     *               be stored for access via getJS().
-     * 'noplugins' - A list of plugins to specifically never load.
-     * 'plugins' - Any plugins to load in addition to the plugins_stored in
-     *             'editor_plugins'.
-     * 'relativelinks' - TODO
-     * 'textarea' - Turn all textareas on page into editors? (Default: no)
-     * 
- */ - public function __construct($params = array()) - { - $language = 'en'; - if (!empty($params['lang'])) { - $language = $params['lang']; - } elseif (isset($GLOBALS['language'])) { - $language = explode('_', $GLOBALS['language']); - if (count($language) > 1) { - $country = Horde_String::lower($language[1]); - if ($country == $language[0]) { - $language = $language[0]; - } else { - $language = $language[0] . '_' . $country; - } - } else { - $language = $language[0]; - } - } - - if (($language != 'pt_br') && - ($pos = strpos($language, '_'))) { - $language = substr($language, 0, $pos); - } - - $xinha_path = $GLOBALS['registry']->get('webroot', 'horde') . '/services/editor/xinha/'; - - $js = 'var _editor_url = \'' . $xinha_path . '\',' . - '_editor_lang = \'' . $language . '\',' . - '_editors,' . - 'xinha_init = function() { '; - - // Loading plugins. - $plugins = @unserialize($GLOBALS['prefs']->getValue('editor_plugins')); - if (!$plugins) { - $plugins = array(); - } - $key = array_search('AnselImage', $plugins); - if (($key !== false) && - !$GLOBALS['registry']->hasMethod('images/listGalleries')) { - unset($plugins[$key]); - } - if (!empty($params['plugins'])) { - $plugins += $params['plugins']; - } - if (!empty($params['noplugins'])) { - $plugins = array_diff($plugins, $params['noplugins']); - } - - $js .= 'var xinha_plugins = '; - if (empty($plugins)) { - $js .= '[];'; - } else { - $js .= '[\'' . implode('\',\'', array_keys(array_flip($plugins))) . '\'];'; - } - - $js .= 'if (!Xinha.loadPlugins(xinha_plugins, xinha_init)) return; '; - - $js .= 'var xinha_editors = '; - if (!empty($params['id'])) { - $js .= '[\'' . $params['id'] . '\'];'; - } elseif (!empty($params['textarea'])) { - $js .= 'document.getElementsByTagName(\'TEXTAREA\');'; - } else { - $js .= '[];'; - } - - $js .= 'var xinha_config = new Xinha.Config();' . - 'xinha_config.debug = false;'; - - if (!empty($params['hidebuttons'])) { - $js .= 'xinha_config.hideSomeButtons(\' ' . implode(' ', $params['hidebuttons']) . ' \');'; - } - - if (!empty($params['loadnotify'])) { - $params['config']['showLoading'] = true; - } - - if (!empty($params['relativelinks'])) { - $myserver = Horde::url('', true); - $params['config'] = array_merge($params['config'], array('stripBaseHref' => true, 'stripSelfNamedAnchors' => true, 'baseHref' => substr($myserver, 0, strpos($myserver, '/', 8)))); - } - - if (!empty($params['config'])) { - foreach ($params['config'] as $config => $value) { - $js .= 'xinha_config.' . $config . ' = '; - if (is_bool($value)) { - $js .= ($value) ? 'true;' : 'false;'; - } elseif (strpos($value, '@raw@') === 0) { - $js .= substr($value, 5) . ';'; - } else { - $js .= '\'' . addslashes($value) . '\';'; - } - } - } - - $js .= '_editors = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);' . - 'Xinha.startEditors(_editors); };'; - - if (!empty($params['no_notify'])) { - $js .= 'Event.observe(window, \'load\', xinha_init);'; - $this->_js = ''; - } else { - Horde::addScriptFile($xinha_path . 'XinhaCore.js', null, array('external' => true)); - Horde::addInlineScript($js); - Horde::addInlineScript('xinha_init()', 'load'); - } - } - -} diff --git a/framework/Editor/package.xml b/framework/Editor/package.xml index acd722251..3d5c8f89c 100644 --- a/framework/Editor/package.xml +++ b/framework/Editor/package.xml @@ -30,7 +30,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Added CKEditor driver. + * Removed Xinha driver. + * Added CKEditor driver. * Initial Horde 4 package. @@ -40,7 +41,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - @@ -69,7 +69,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - -- 2.11.0