From 87ca3d5bf014f0dbe5467c397f028cea2ce619e3 Mon Sep 17 00:00:00 2001 From: vanilla thunder Date: Fri, 26 Feb 2016 01:05:21 +0100 Subject: [PATCH] v1.6.0 --- README.md | 12 +- copy_this/modules/bla/bla-tinymce/README.md | 12 +- .../views/admin/de/module_options.php | 8 +- .../views/admin/en/module_options.php | 8 +- .../core/blatinymceoxviewconfig.php | 242 ------------------ .../extend/blatinymceoxviewconfig.php | 8 +- .../modules/bla/bla-tinymce/metadata.php | 16 +- .../views/admin/cs/module_options.php | 2 - .../views/admin/da/module_options.php | 2 - .../views/admin/de/module_options.php | 35 --- .../views/admin/en/module_options.php | 36 --- .../views/admin/fr/module_options.php | 2 - .../views/admin/it/module_options.php | 2 - .../views/admin/nl/module_options.php | 2 - .../views/admin/ru/module_options.php | 2 - .../bottomnaviitem_admin_bottomnaviitem.tpl | 17 -- 16 files changed, 32 insertions(+), 374 deletions(-) delete mode 100644 copy_this/modules/bla/bla-tinymce/core/blatinymceoxviewconfig.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/cs/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/da/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/de/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/en/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/fr/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/it/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/nl/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/admin/ru/module_options.php delete mode 100644 copy_this/modules/bla/bla-tinymce/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl diff --git a/README.md b/README.md index 7fabae0..287f03e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -## ###_MODULE_### -by ###_AUTHOR_###, ###_EMAIL_### <###_EMAIL_###> -###_URL_### +## TinyMCE Editor for OXID eShop CE +by Marat Bedoev, oxid@bestlife.ag +https://github.com/vanilla-thunder/bla-tinymce ### module version ###_VERSION_### TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. @@ -20,9 +20,9 @@ and here: https://github.com/tinymce ## more info here: [http:/marat.ws/bla-tinymce/](http:/marat.ws/bla-tinymce/) ### LICENSE AGREEMENT - ###_MODULE_### - Copyright (C) ###_YEAR_### ###_EMAIL_### - info: ###_EMAIL_### + TinyMCE Editor for OXID eShop CE + Copyright (C) 2016 oxid@bestlife.ag + info: oxid@bestlife.ag This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; diff --git a/copy_this/modules/bla/bla-tinymce/README.md b/copy_this/modules/bla/bla-tinymce/README.md index 7fabae0..287f03e 100644 --- a/copy_this/modules/bla/bla-tinymce/README.md +++ b/copy_this/modules/bla/bla-tinymce/README.md @@ -1,6 +1,6 @@ -## ###_MODULE_### -by ###_AUTHOR_###, ###_EMAIL_### <###_EMAIL_###> -###_URL_### +## TinyMCE Editor for OXID eShop CE +by Marat Bedoev, oxid@bestlife.ag +https://github.com/vanilla-thunder/bla-tinymce ### module version ###_VERSION_### TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. @@ -20,9 +20,9 @@ and here: https://github.com/tinymce ## more info here: [http:/marat.ws/bla-tinymce/](http:/marat.ws/bla-tinymce/) ### LICENSE AGREEMENT - ###_MODULE_### - Copyright (C) ###_YEAR_### ###_EMAIL_### - info: ###_EMAIL_### + TinyMCE Editor for OXID eShop CE + Copyright (C) 2016 oxid@bestlife.ag + info: oxid@bestlife.ag This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php b/copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php index d03eb97..996c473 100644 --- a/copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php +++ b/copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php @@ -1,9 +1,9 @@ * - * ###_AUTHOR_### + * Marat Bedoev */ $sLangName = 'Deutsch'; diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php b/copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php index 49d2928..3bddc7c 100644 --- a/copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php +++ b/copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php @@ -1,9 +1,9 @@ * - * ###_AUTHOR_### + * Marat Bedoev */ $sLangName = 'English'; diff --git a/copy_this/modules/bla/bla-tinymce/core/blatinymceoxviewconfig.php b/copy_this/modules/bla/bla-tinymce/core/blatinymceoxviewconfig.php deleted file mode 100644 index 6a35180..0000000 --- a/copy_this/modules/bla/bla-tinymce/core/blatinymceoxviewconfig.php +++ /dev/null @@ -1,242 +0,0 @@ - - */ - - -class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent -{ - public function loadTinyMce() - { - $cfg = oxRegistry::getConfig(); - $blEnabled = in_array($this->getActiveClassName(), $cfg->getConfigParam("aTinyMCE_classes")); - $blPlainCms = in_array($cfg->getActiveView()->getViewDataElement("edit")->oxcontents__oxloadid->value, - $cfg->getConfigParam("aTinyMCE_plaincms")); - - if (!$blEnabled) - { - return; - } - if ($blPlainCms) - { - return oxRegistry::getLang()->translateString("hdi_tinymce_plaincms"); - } - - // processind editor config & other stuff - $sLang = oxRegistry::getLang()->getLanguageAbbr(oxRegistry::getLang()->getTplLanguage()); - // array to assign shops lang abbreviations to lang file names of tinymce: shopLangAbbreviation => fileName (without .js ) - $aLang = array( - "cs" => "cs", - "da" => "da", - "de" => "de", - "fr" => "fr_FR", - "it" => "it", - "nl" => "nl", - "ru" => "ru" - ); - - - // default config - $aDefaultConfig = array( - 'selector' => '"textarea:not(.mceNoEditor)"', - 'language' => '"' . (in_array($sLang, $aLang) ? $aLang[$sLang] : 'en') . '"', - //'spellchecker_language' => '"' . (in_array($sLang, $aLang) ? $aLang[$sLang] : 'en') . '"', - 'nowrap' => 'true', - 'entity_encoding' => '"raw"', - // http://www.tinymce.com/wiki.php/Configuration:entity_encoding - 'height' => 300, - 'menubar' => 'false', - 'document_base_url' => '"' . $this->getBaseDir() . '"', - // http://www.tinymce.com/wiki.php/Configuration:document_base_url - 'relative_urls' => 'false', - // http://www.tinymce.com/wiki.php/Configuration:relative_urls - - 'plugin_preview_width' => 'window.innerWidth', - 'plugin_preview_height' => 'window.innerHeight-90', - 'code_dialog_width' => 'window.innerWidth-50', - 'code_dialog_height' => 'window.innerHeight-130', - 'image_advtab' => 'true', - 'imagetools_toolbar' => '"rotateleft rotateright | flipv fliph | editimage imageoptions"', - 'moxiemanager_fullscreen' => 'true', - 'insertdatetime_formats' => '[ "%d.%m.%Y", "%H:%M" ]', - 'nonbreaking_force_tab' => 'true', - // http://www.tinymce.com/wiki.php/Plugin:nonbreaking - 'autoresize_max_height' => '400' - ); - //merging with custom config - $aConfig = ($aCustomCfg = $this->_getTinyCustConfig()) ? array_merge($aDefaultConfig, - $aCustomCfg) : $aDefaultConfig; - - - // default plugins and their buttons - $aPluginsControls = array( - 'advlist' => false, - 'anchor' => 'anchor', - 'autolink' => false, - 'autoresize' => false, - 'charmap' => 'charmap', - 'code' => 'code', - 'colorpicker' => false, - //'emoticons' => 'emoticons', - 'fullscreen' => 'fullscreen', - 'hr' => 'hr', - 'image' => 'image', - 'imagetools' => false, - 'insertdatetime' => 'insertdatetime', - 'link' => 'link unlink', - 'lists' => false, - 'media' => 'media', - 'nonbreaking' => false, - 'pagebreak' => 'pagebreak', - 'paste' => 'pastetext', - 'preview' => 'preview', - 'searchreplace' => 'searchreplace', - //'spellchecker' => 'spellchecker', - 'table' => 'table', - 'textcolor' => 'forecolor backcolor', - 'visualblocks' => false, - //'visualchars' => 'visualchars', - 'wordcount' => false - ); - - $aPlugins = $cfg->getConfigParam("aTinyMCE_plugins"); - if (empty($aPlugins) || !is_array($aPlugins)) $aPlugins = array_keys($aPluginsControls); - if ($this->getActiveClassName() == "newsletter_main") - { - $aPlugins["legacyoutput"] = false; - $aPlugins["fullpage"] = "fullpage"; - } - - $aConfig['plugins'] = '"' . implode(' ', $aPlugins) . '"'; - - // external plugins - if ($aExtPlugins = $this->_getTinyExtPlugins()) - { - $aConfig['external_plugins'] = '{ '; - foreach ($aExtPlugins AS $plugin => $file) - { - $aConfig['external_plugins'] .= '"' . $plugin . '": "' . $file . '", '; - } - $aConfig['external_plugins'] .= ' }'; - } - - // default tollbar buttons - $aDefaultButtons = array( - "undo redo", - "bold italic underline strikethrough", - "alignleft aligncenter alignright alignjustify", - "bullist numlist", - "outdent indent", - "blockquote", - "removeformat", - "subscript", - "superscript", - "formatselect", - "fontselect", - "fontsizeselect", - "subscript superscript" - ); - $aButtons = $this->_getTinyToolbarControls(); - if (!is_array($aButtons) || empty($aButtons)) $aButtons = $aDefaultButtons; - - // buttons for plugins, enable only if plugin is active - $aPluginButtons = array_values(array_intersect_key($aPluginsControls, array_flip($aPlugins))); - - $aButtons = array_merge($aButtons, $aPluginButtons); - - $aConfig['toolbar'] = '"' . implode(" | ", $aButtons) . '"'; - - - // compile the whole config stuff - $sConfig = ''; - foreach ($aConfig AS $param => $value) - { - $sConfig .= "$param: $value, "; - } - - // add init script - $sInit = 'tinymce.init({ ' . $sConfig . ' });'; - - $sCopyLongDescFromTinyMCE = 'function copyLongDescFromTinyMCE(sIdent) -{ - var editor = tinymce.get("editor_"+sIdent); - if (editor && editor.isHidden() !== true) - { - console.log("copy content from tinymce"); - var content = editor.getContent().replace(/\[{([^\]]*?)}\]/g, function(m) { return m.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&") }); - document.getElementsByName("editval[" + sIdent + "]").item(0).value = content; - return true; - } - return false; -} - -var origCopyLongDesc = copyLongDesc; -copyLongDesc = function(sIdent) -{ - if ( copyLongDescFromTinyMCE( sIdent ) ) return; - console.log("tinymce disabled, copy content from regular textarea"); - origCopyLongDesc( sIdent ); -}'; - - // adding scripts to template - $smarty = oxRegistry::get("oxUtilsView")->getSmarty(); - $sSufix = ($smarty->_tpl_vars["__oxid_include_dynamic"]) ? '_dynamic' : ''; - - $aScript = (array)$cfg->getGlobalParameter('scripts' . $sSufix); - $aScript[] = $sCopyLongDescFromTinyMCE; - $aScript[] = $sInit; - $cfg->setGlobalParameter('scripts' . $sSufix, $aScript); - - $aInclude = (array)$cfg->getGlobalParameter('includes' . $sSufix); - $aInclude[3][] = $this->getModuleUrl('bla-tinymce', 'tinymce/tinymce.min.js'); - $cfg->setGlobalParameter('includes' . $sSufix, $aInclude); - - return '
  • - -
  • '; - // javascript:tinymce.execCommand(\'mceToggleEditor\',false,\'editor1\'); - } - - protected function _getTinyToolbarControls() - { - $aControls = oxRegistry::getConfig()->getConfigParam("aTinyMCE_buttons"); - if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) - { - $aControls = array_merge($aControls, parent::_getTinyToolbarControls()); - } - return $aControls; - } - - protected function _getTinyExtPlugins() - { - $aPlugins = oxRegistry::getConfig()->getConfigParam("aTinyMCE_external_plugins"); - if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) - { - $aPlugins = array_merge(parent::_getTinyExtPlugins(), $aPlugins); - } - return $aPlugins; - } - - protected function _getTinyCustConfig() - { - $aConfig = oxRegistry::getConfig()->getConfigParam("aTinyMCE_config_override"); - if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) - { - $aConfig = array_merge(parent::_getTinyCustConfig(), $aConfig); - } - return $aConfig; - } -} diff --git a/copy_this/modules/bla/bla-tinymce/extend/blatinymceoxviewconfig.php b/copy_this/modules/bla/bla-tinymce/extend/blatinymceoxviewconfig.php index 2041ee3..a4dd0fd 100644 --- a/copy_this/modules/bla/bla-tinymce/extend/blatinymceoxviewconfig.php +++ b/copy_this/modules/bla/bla-tinymce/extend/blatinymceoxviewconfig.php @@ -1,9 +1,9 @@ * - * ###_AUTHOR_### + * Marat Bedoev */ class blaTinyMceOxViewConfig extends blaTinyMceOxViewConfig_parent diff --git a/copy_this/modules/bla/bla-tinymce/metadata.php b/copy_this/modules/bla/bla-tinymce/metadata.php index fa87717..592c18b 100644 --- a/copy_this/modules/bla/bla-tinymce/metadata.php +++ b/copy_this/modules/bla/bla-tinymce/metadata.php @@ -1,9 +1,9 @@ * - * ###_AUTHOR_### + * Marat Bedoev */ $v = "https://raw.githubusercontent.com/vanilla-thunder/bla-tinymce/master/copy_this/modules/bla/bla-tinymce/version.jpg"; @@ -22,12 +22,12 @@ $sMetadataVersion = '1.1'; $aModule = array( 'id' => 'bla-tinymce', 'title' => 'bestlife TinyMCE', - 'description' => '###_MODULE_### 4.7 - 4.9
    newest version:
    (no need to update if you already have this version)', + 'description' => 'TinyMCE Editor for OXID eShop CE 4.7 - 4.9
    newest version:
    (no need to update if you already have this version)', 'thumbnail' => 'tinymce.png', 'version' => '###_VERSION_###', - 'author' => '###_AUTHOR_###, ###_COMPANY_###', - 'email' => '###_EMAIL_###', - 'url' => '###_URL_###', + 'author' => 'Marat Bedoev, bestlife AG', + 'email' => 'oxid@bestlife.ag', + 'url' => 'https://github.com/vanilla-thunder/bla-tinymce', 'extend' => array( 'oxviewconfig' => 'bla/bla-tinymce/extend/blatinymceoxviewconfig' ), diff --git a/copy_this/modules/bla/bla-tinymce/views/admin/cs/module_options.php b/copy_this/modules/bla/bla-tinymce/views/admin/cs/module_options.php deleted file mode 100644 index df5140d..0000000 --- a/copy_this/modules/bla/bla-tinymce/views/admin/cs/module_options.php +++ /dev/null @@ -1,2 +0,0 @@ - - */ - -$sLangName = 'Deutsch'; -$aLang = array( - 'charset' => 'UTF-8', - 'SHOP_MODULE_GROUP_tinyMceMain' => 'Moduleinstellungen', - 'SHOP_MODULE_aTinyMCE_classes' => '

    Liste der Backend-Klassen, wo TinyMCE angezeigt werden soll

    • article_main (Artikelbeschreibung)
    • content_main (CMS Seiten)
    • category_text (Kategorienbeschreibung)
    • newsletter_main (Newsletter)
    • news_text (Nachrichten-Text)
    ', - 'HELP_SHOP_MODULE_aTinyMCE_classes' => 'für die Benutzung von TinyMCE in eigenen Admin Views muss hier die entsprechende View Klasse eingetragen werden, dann werden für jedes textarea je ein Editor erzeugt', - 'SHOP_MODULE_aTinyMCE_plaincms' => '

    plaintext CMS Seiten

    bei CMS Seiten mit diesen Idents wird kein Editor geladen. Z.B: Plaintext Emails, Email Betreffzeilen, etc', - - 'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Einstellungen & Plugins', - 'SHOP_MODULE_aTinyMCE_config_override' => '

    eigene Editor Konfiguration (?)

    z.B. für externe Plugins oder um standard Parameter zu überschreiben
    parameter => "wert" (mit Anführungszeichen, falls erforderlich!)', - 'SHOP_MODULE_aTinyMCE_buttons' => '

    Toolbar Buttons (?)

    es betrifft nur die Buttons (Toolbar controls) unter dem ersten Punkt: "core" und buttons für eigene / externe plugins.
    Buttons von standard Plugins werden über Plugins-Konfiguration automatisch hinzugefügt bzw. entfernt.
    Standardwerte finden Sie in dem Hilfe-Popup', - 'HELP_SHOP_MODULE_aTinyMCE_buttons' => "", - 'SHOP_MODULE_aTinyMCE_plugins' => '

    aktive Editor Plugins (?)

    jeweils ein Plugin pro Zeile.
    Standardwerte finden Sie in dem Hilfe-Popup', - 'HELP_SHOP_MODULE_aTinyMCE_plugins' => "", - - 'SHOP_MODULE_aTinyMCE_external_plugins' => '

    externe Plugins (?)


    Eingabeformat:
    Pluginname => Pfad/zur/Datei.js', - 'hdi_tinymce_plaincms' => 'TinyMCE ist für diese Seite deaktiviert, weil sie keine HTML Formatierung enthalten darf ' - -); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/views/admin/en/module_options.php b/copy_this/modules/bla/bla-tinymce/views/admin/en/module_options.php deleted file mode 100644 index e42ac36..0000000 --- a/copy_this/modules/bla/bla-tinymce/views/admin/en/module_options.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - -$sLangName = 'English'; -$aLang = array( - 'charset' => 'UTF-8', - 'SHOP_MODULE_GROUP_tinyMceMain' => 'module settings', - 'SHOP_MODULE_aTinyMCE_classes' => '

    Enable TinyMCE For This Backend Views

    • article_main (product description)
    • content_main (CMS pages)
    • category_text (category description)
    • newsletter_main (Newsletter)
    • news_text (news text)
    ', - 'HELP_SHOP_MODULE_aTinyMCE_classes' => 'if you want to use TinyMCE for your custom views, add here the view\'s class name, then textareas should become editor instances', - 'SHOP_MODULE_aTinyMCE_plaincms' => '

    Plain Text CMS pages

    TinyMCE will not apper for this cms pages. e.g: Plaintext Emails, Email subjects, etc', - - 'SHOP_MODULE_GROUP_tinyMceSettings' => 'TinyMCE Settings & Plugins', - 'SHOP_MODULE_aTinyMCE_config_override' => '

    Custom Editor Configuration (?)

    e.g. for external plugins or to overwrite default configuration
    parameter => "value" (with quotes, if required!)', - 'SHOP_MODULE_aTinyMCE_buttons' => '

    Toolbar Buttons (?)

    '. - 'only for core toolbar controls and buttons for custom and external plugins!
    Buttons for standard plugins will be displayd if the plugin is active.
    See the help popup for the default value of this setting', - 'HELP_SHOP_MODULE_aTinyMCE_buttons' => "", - 'SHOP_MODULE_aTinyMCE_plugins' => '

    Active Editor Plugins (?)

    enter here the default plugins you want to be enabled
    See the help popup for the default value of this setting', - 'HELP_SHOP_MODULE_aTinyMCE_plugins' => "", - - 'SHOP_MODULE_aTinyMCE_external_plugins' => '

    External Plugins (?)

    pluginname => plugin_path/or/url/plugin.js', - - 'hdi_tinymce_plaincms' => 'TinyMCE was deactivated from this page because it may not contain HTML code' -); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/views/admin/fr/module_options.php b/copy_this/modules/bla/bla-tinymce/views/admin/fr/module_options.php deleted file mode 100644 index df5140d..0000000 --- a/copy_this/modules/bla/bla-tinymce/views/admin/fr/module_options.php +++ /dev/null @@ -1,2 +0,0 @@ - -*}] - -[{$smarty.block.parent}] - -[{if method_exists($oViewConf,'loadTinyMce') }][{ $oViewConf->loadTinyMce() }][{/if}] \ No newline at end of file