sync ckeditor, needs @todo for backend_plugins_update to do a proper rework

This commit is contained in:
Garvin Hicking 2016-09-23 10:13:56 +02:00
parent 4d751f1515
commit 3f60fa9b21
11 changed files with 173 additions and 78 deletions

View file

@ -1,18 +1,52 @@
4.5.10.5:
---------
* Fix encoding issue in cheatsheet help plugin
* Rename plugin title to CKEditor Plus
4.5.10.4:
---------
* Fix and add lang of Scayt and wsc (web spell checker) option,
since the old Serendipity lang WYSIWYG_LANG defines did not work here.
4.5.10.3:
---------
* Fixed UPGRADE fallback issue. To simplify this approach, we now
force the script to redirect directly into the config on each
CKEditor upgrade request.
In case of using the Serendipity UPDATE ALL 1-click ajax-upgrader,
this redirection is disabled and you have to force the extraction
yourself in the config.
* Disabled the temporary runtime solution to downgrade version for
the harmonization of plugin and lib versions, which came in March
2016 with this plugins "old" 5.7.0.x version (see below).
4.5.10.2:
---------
* Unset serendipity_event_plugup cookies if plugup class exists
4.5.10.1:
---------
* Update lang constants and really force a halt for the upgrade config fallback!
4.5.10.0:
---------
* Upgrade to CKEDITOR 4.5. Series, update 10 (http://ckeditor.com/whatsnew).
4.5.9.0:
-----
--------
* Changed upgrade hint for lang files lang_<en> and lang_<de>
* Upgrade to CKEDITOR 4.5. Series, update 9 (http://ckeditor.com/whatsnew).
4.5.8.1:
-----
--------
* Remove accidently added Thumbs.db file
4.5.8.0:
-----
--------
* Upgrade to CKEDITOR 4.5. Series, update 8 (http://ckeditor.com/whatsnew).
4.5.7.3:
-----
--------
* Bugfix: Fix prior version 4.5.7.1 not being set one up
4.5.7.2:

View file

@ -9,9 +9,9 @@
* @revisionDate 2013/10/26
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Používá CKEditor jako výchozí WYSIWYG editor. Tento editor je aktuálním state-of-art. Použití: Doporučeno! Po instalaci přejděte na stránku s nastavením tohoto pluginu a čtěte další instrukce.');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
/*@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
<ol style="line-height: 1.6">
<li>V nastavení pluginu zadejte relativní HTTP cestu k adresáři <em>"ckeditor"</em>.
<div><strong>Poznámka:</strong> ve většině instalací je tato cesta <em>"plugins/serendipity_event_ckeditor/ckeditor/"</em></div>
@ -30,7 +30,7 @@ Pokud vůbec někdy budete potřebovat ručně aktualizovat dodané CKEditor bal
<li><a href="http://ckeditor.com/download" target="_blank">stáhněte CKEditor</a></li>
<li>Rozbalte jej do: <em>' . dirname(__FILE__) . '</em> (měl by být vytvořen podadresář <em>"ckeditor"</em>)</li>
</ol>
</p>');
</p>');*/
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL_PLUGPATH', 'HTTP cesta do serendipity dresáře s pluginy');
@define('PLUGIN_EVENT_CKEDITOR_CKEACF_OPTION', 'Vypnout "Pokročilé fitrlování obsahu" (tzv. ACF = Advanced-Content-Filter)');

View file

@ -9,9 +9,9 @@
* @revisionDate 2013/10/26
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Používá CKEditor jako výchozí WYSIWYG editor. Tento editor je aktuálním state-of-art. Použití: Doporučeno! Po instalaci přejděte na stránku s nastavením tohoto pluginu a čtěte další instrukce.');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
/*@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
<ol style="line-height: 1.6">
<li>V nastavení pluginu zadejte relativní HTTP cestu k adresáři <em>"ckeditor"</em>.
<div><strong>Poznámka:</strong> ve většině instalací je tato cesta <em>"plugins/serendipity_event_ckeditor/ckeditor/"</em></div>
@ -30,7 +30,7 @@ Pokud vůbec někdy budete potřebovat ručně aktualizovat dodané CKEditor bal
<li><a href="http://ckeditor.com/download" target="_blank">stáhněte CKEditor</a></li>
<li>Rozbalte jej do: <em>' . dirname(__FILE__) . '</em> (měl by být vytvořen podadresář <em>"ckeditor"</em>)</li>
</ol>
</p>');
</p>');*/
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL_PLUGPATH', 'HTTP cesta do serendipity dresáře s pluginy');
@define('PLUGIN_EVENT_CKEDITOR_CKEACF_OPTION', 'Vypnout "Pokročilé fitrlování obsahu" (tzv. ACF = Advanced-Content-Filter)');

View file

@ -1,13 +1,13 @@
<?php
/**
* @file UTF-8/lang_de.inc.php 1.4.14 2016-05-11 Ian
* @version 1.4.14
* @file UTF-8/lang_de.inc.php 1.4.17 2016-08-15 Ian
* @version 1.4.17
* @author Translator Name <yourmail@example.com>
* DE-Revision: Revision of UTF-8/lang_de.inc.php
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Nutzt CKEditor als Standard WYSIWYG Editor. Benutzung für JS-Editoren: Empfohlen! Nach der Installation, lies die Plugin Konfigurations Seite für weitere Informationen.');
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
@ -27,7 +27,7 @@
<h3>Upgrading</h3>
<p>Dieses Plugin wird zeitnah selber Updates via Spartacus bereitstellen.</p>
<p>Bitte nutzen Sie keinen automatischen Bulk Updater, sofern in ihrer S9y Version schon vorhanden, sondern führen Sie das Upgrade des CKEditors einzeln durch, um für die internen ZIP-Installer Operationen in diese Konfiguration weiter geleitet zu werden.</p>
<p><strong>Achtung</strong>: Bitte nutzen Sie nicht den automatisierten Spartacus Updater Button für alle Plugins, sofern in ihrer S9y Version schon vorhanden, sondern führen Sie das Upgrade des CKEditors einzeln durch, um für die internen ZIP-Installer Operationen in diese Konfiguration weiter geleitet zu werden. Ansonsten müssen Sie nach jedem CKEditor Upgrade selber die "Entpacke Zip Datei (im Notfall)" Option ausführen.</p>
<p>Es ist generell abzuraten, ein eigenes "customized" CKEDITOR release zu erstellen und herunterzuladen, da dies zu unerwünschten Nebenwirkungen in der Einbindung führt.</p>
</div>');
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');

View file

@ -3,7 +3,7 @@
*/
/**
* @fileOverview A Serendipity serendipity_event_ckeditor CKEDITOR custom config file: cke_config.js, v. 2.5, 2016-01-01
* @fileOverview A Serendipity serendipity_event_ckeditor CKEDITOR custom config file: cke_config.js, v. 2.6, 2016-07-31
*/
/**
@ -12,7 +12,7 @@
CKEDITOR.editorConfig = function( config ) {
// set Serendipity default lang
config.language = CKECONFIG_LANG;
config.language = CKECONFIG_LANG; // IETF standard unicode language 4-letter tag, using a dash
/** SECTION: ACF
Advanced Content Filter works in two modes:
@ -142,6 +142,7 @@ CKEDITOR.editorConfig = function( config ) {
PLEASE NOTE: If having used the prettify output already in your entries, your need to set the new compat mode option to allow both.
*/
/** SECTION: Custom Config Content Styles
We can not use templates/xxx/admin/ as a path here, since we would need template and userTemplate path parts as dynamic vars
*/
@ -149,19 +150,36 @@ CKEDITOR.editorConfig = function( config ) {
config.contentsCss = CKEDITOR_PLUGPATH + 'serendipity_event_ckeditor/wysiwyg-style.css';
/** SECTION: Custom Plugin and Button behaviour configurations **/
/**
/** SECTION: Web-Spellchecker (wsc) and SCAYT plug-in for CKEditor
// evaluate SCAYT on startup
// config.scayt_autoStartup = true;
// Native spell check functionality is by default disabled in the editor, use this to enable it.
// Do not wonder if this is not working on demand, since Browsers need to match spell checker settings, etc., you need to hit the correct place/word, and so on.
//config.disableNativeSpellChecker = false;
// See full list of supported languages here: http://docs.ckeditor.com/#!/guide/dev_howtos_scayt
*/
config.wsc_lang = CKECONFIG_SLANG; // The default wsc (spell checker language), eg. "de_DE", or "fr_FR", using POSIX underscore. Defaults to: 'en_US'.
config.scayt_sLang = CKECONFIG_SLANG; // The default SCAYT language, eg. "de_DE", or "fr_FR", using POSIX underscore. Defaults to: 'en_US'.
// enable/disable the "More Suggestions" sub-menu in the context menu.
// The possible values are "on" or "off".
config.scayt_moreSuggestions = 'off';
// set the visibility of the SCAYT tabs in the settings dialog and toolbar
// button. The value must contain a "1" (enabled) or "0" (disabled) number for
// each of the following entries, in this precise order, separated by a
// comma (","): "Options", "Languages" and "Dictionary".
// As long as not purchased a license, the "languages"-options wont work. You may only use the online spell checker from the Scayt-button last select option. Which isn't really fun to use.
// Visit http://wiki.webspellchecker.net/doku.php?id=installationandconfiguration:hostedscayt for more
config.scayt_uiTabs = '1,0,1'; // we disable the language tab option, since it does not work in this context, getting a list of languages and this breaking the popup-layer!
/** SECTION: Custom Plugin and Button behaviour configurations
// [CRTL + right mouse click] gives access to Browsers contextmenu, else you need to disable and set these
// The general idea is that you would need to remove all plugins that depend on the "contextmenu" one for removing the "contextmenu" one itself to work. But this has other sideeffects!
//config.removePlugins = 'wsc,scayt,menubutton,liststyle,tabletools,contextmenu';
//config.browserContextMenuOnCtrl = true;
//config.wsc_lang = 'de_DE'; //Defaults to: 'en_US'
//config.scayt_sLang = 'de_DE'; //Defaults to: 'en_US'
*/
/**
// Allow certain font sizes, eg.
//config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;15/15px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px' ;

File diff suppressed because one or more lines are too long

View file

@ -9,9 +9,9 @@
* @revisionDate 2013/10/26
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Používá CKEditor jako výchozí WYSIWYG editor. Tento editor je aktuálním state-of-art. Použití: Doporučeno! Po instalaci přejděte na stránku s nastavením tohoto pluginu a čtěte další instrukce.');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
/*@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
<ol style="line-height: 1.6">
<li>V nastavení pluginu zadejte relativní HTTP cestu k adresáři <em>"ckeditor"</em>.
<div><strong>Poznámka:</strong> ve většině instalací je tato cesta <em>"plugins/serendipity_event_ckeditor/ckeditor/"</em></div>
@ -30,7 +30,7 @@ Pokud v
<li><a href="http://ckeditor.com/download" target="_blank">stáhněte CKEditor</a></li>
<li>Rozbalte jej do: <em>' . dirname(__FILE__) . '</em> (měl by být vytvořen podadresář <em>"ckeditor"</em>)</li>
</ol>
</p>');
</p>');*/
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL_PLUGPATH', 'HTTP cesta do serendipity dresáře s pluginy');
@define('PLUGIN_EVENT_CKEDITOR_CKEACF_OPTION', 'Vypnout "Pokročilé fitrlování obsahu" (tzv. ACF = Advanced-Content-Filter)');

View file

@ -9,9 +9,9 @@
* @revisionDate 2013/10/26
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Používá CKEditor jako výchozí WYSIWYG editor. Tento editor je aktuálním state-of-art. Použití: Doporučeno! Po instalaci přejděte na stránku s nastavením tohoto pluginu a čtěte další instrukce.');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
/*@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Instalace</h2>
<ol style="line-height: 1.6">
<li>V nastavení pluginu zadejte relativní HTTP cestu k adresáři <em>"ckeditor"</em>.
<div><strong>Poznámka:</strong> ve většině instalací je tato cesta <em>"plugins/serendipity_event_ckeditor/ckeditor/"</em></div>
@ -30,7 +30,7 @@ Pokud v
<li><a href="http://ckeditor.com/download" target="_blank">stáhněte CKEditor</a></li>
<li>Rozbalte jej do: <em>' . dirname(__FILE__) . '</em> (měl by být vytvořen podadresář <em>"ckeditor"</em>)</li>
</ol>
</p>');
</p>');*/
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL_PLUGPATH', 'HTTP cesta do serendipity dresáře s pluginy');
@define('PLUGIN_EVENT_CKEDITOR_CKEACF_OPTION', 'Vypnout "Pokročilé fitrlování obsahu" (tzv. ACF = Advanced-Content-Filter)');

View file

@ -1,13 +1,13 @@
<?php
/**
* @file lang_de.inc.php 1.4.14 2016-05-11 Ian
* @version 1.4.14
* @file lang_de.inc.php 1.4.17 2016-08-15 Ian
* @version 1.4.17
* @author Translator Name <yourmail@example.com>
* DE-Revision: Revision of lang_de.inc.php
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Nutzt CKEditor als Standard WYSIWYG Editor. Benutzung für JS-Editoren: Empfohlen! Nach der Installation, lies die Plugin Konfigurations Seite für weitere Informationen.');
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
@ -27,7 +27,7 @@
<h3>Upgrading</h3>
<p>Dieses Plugin wird zeitnah selber Updates via Spartacus bereitstellen.</p>
<p>Bitte nutzen Sie keinen automatischen Bulk Updater, sofern in ihrer S9y Version schon vorhanden, sondern führen Sie das Upgrade des CKEditors einzeln durch, um für die internen ZIP-Installer Operationen in diese Konfiguration weiter geleitet zu werden.</p>
<p><strong>Achtung</strong>: Bitte nutzen Sie nicht den automatisierten Spartacus Updater Button für alle Plugins, sofern in ihrer S9y Version schon vorhanden, sondern führen Sie das Upgrade des CKEditors einzeln durch, um für die internen ZIP-Installer Operationen in diese Konfiguration weiter geleitet zu werden. Ansonsten müssen Sie nach jedem CKEditor Upgrade selber die "Entpacke Zip Datei (im Notfall)" Option ausführen.</p>
<p>Es ist generell abzuraten, ein eigenes "customized" CKEDITOR release zu erstellen und herunterzuladen, da dies zu unerwünschten Nebenwirkungen in der Einbindung führt.</p>
</div>');
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');

View file

@ -1,18 +1,18 @@
<?php
/**
* @file lang_en.inc.php 1.4.14 2016-05-11 Ian
* @version 1.4.14
* @file lang_en.inc.php 1.4.18 2016-08-28 Ian
* @version 1.4.18
* @author Translator Name <yourmail@example.com>
* EN-Revision: Revision of lang_en.inc.php
*/
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor');
@define('PLUGIN_EVENT_CKEDITOR_NAME', 'CKEditor Plus');
@define('PLUGIN_EVENT_CKEDITOR_DESC', 'Uses CKEditor as the default WYSIWYG editor. For any JS-Editor usage: Recommended! After installation, go to the configuration screen of this plugin for further instructions.');
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>This Plugin includes:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
<p class="msg_notice">
<span class="icon-attention"></span> <strong>Dependencies:</strong> Disable global body, extended and nugget parsing in the <strong>NL2BR</strong> plugin, <strong>OR</strong> by entry with entryproperties event plugin <strong>and/or</strong> for staticpages by entry "Perform Markup Transformations" option! Since Serendipity 2.0-rc1 the entryproperties plugin should detect CKEditor automatically as to that.
<span class="icon-attention"></span> <strong>Dependencies:</strong> Disable global body, extended and nugget parsing in the <strong>NL2BR</strong> plugin, <strong>OR</strong> by entry with entryproperties event plugin <strong>and/or</strong> for staticpages by entry "Perform Markup Transformations" option!<br><strong>Since Serendipity 2.0</strong> the entryproperties plugin detects CKEditor automatically as to that!
</p>
<ol style="line-height: 1.6">
<li>To allow other plugins to use or hook into the editor, place this (CKEditor) plugin near the end of your plugin list.</li>
@ -27,7 +27,7 @@
<h3>Upgrading</h3>
<p>This Plugin will provide Updates via Spartacus close to new CKEDITOR releases.</p>
<p>Please do not use any automatic plugin bulk update, if already available with your S9y version. Upgrade the CKEditor plugin singulary in list, to allow the internal routines to immediately fall back into this configuration, to run and deflate the ZIP-installer operations.</p>
<p><strong>PLEASE NOTE</strong>: Do <strong>not</strong> use the Spartacus automatic plugin "Update All" button, if already available with your S9y version. Upgrade the CKEditor plugin singulary in list, to allow the internal routines to immediately fall back into this configuration, to run and deflate the ZIP-installer operations. Else you will have to force the deflation yourself after each CKEditor (library) upgrade by this plugins "Force install process (in emergencies)" option.</p>
<p>It is generally not advised to use or install any "customized" CKEDITOR releases, since this will lead to undesirable side effects with this Plugins configuration.</p>
</div>');
@define('PLUGIN_EVENT_CKEDITOR_CONFIG', '');
@ -50,3 +50,8 @@
@define('PLUGIN_EVENT_CKEDITOR_CKEIBN_OPTION', 'Disable toolbars default image button?');
@define('PLUGIN_EVENT_CKEDITOR_CKEIBN_OPTION_DESC', 'The toolbar built-in image button follows its own rules for stylings and markup! Since we recommend to use the Serendipity Media Library Button only, this is disabled by default. Allow with "No" here and use at own risk.');
@define('PLUGIN_EVENT_CKEDITOR_SCAYT', '<h2>Scayt/wsc</h2>
<p class="msg_notice">
<span class="icon-attention"></span> As long as not purchased a license, you may only use the "SpellCheckAsYouType" (SCAYT-plugin) [ABC]-Button over the free online service "Check Spelling" dialog option, or define a custom dictionary, which first is stored to a cookie, later to the browsers localStorage and start from scratch.
</p>');

View file

@ -9,7 +9,7 @@ if (IN_serendipity !== true) {
/**
* Class member instance attribute values
* Members must be initialized with a constant expression (like a string constant, numeric literal, etc), not a dynamic expression!
**/
*/
if (!defined('CKEDITOR_DIRNAME_PLUGIN_PATH')) define('CKEDITOR_DIRNAME_PLUGIN_PATH', dirname(__FILE__));
if (!defined('CKEDITOR_DIRNAME_CKEDITOR_PATH')) define('CKEDITOR_DIRNAME_CKEDITOR_PATH', dirname(__FILE__) . '/ckeditor');
@ -49,28 +49,29 @@ class serendipity_event_ckeditor extends serendipity_event
* @access protected
* @var string
*/
protected $cke_zipfile = 'ckeditor_4.5.9.0-plus.zip';
protected $cke_zipfile = 'ckeditor_4.5.10.3-plus.zip';
/**
* Access property checkUpdateVersion
* Is zip file version and is independent from plugin version string
* Verify release package versions - do update on upgrades!
* @var array
*/
protected $checkUpdateVersion = array('ckeditor:4.5.9.0');
protected $checkUpdateVersion = array('ckeditor:4.5.10.3');
/**
* Access property revisionPackage
* Note revisions of ckeditor and plugin additions to lang files
* @var array
*/
protected $revisionPackage = array('CKEditor 4.5.9 (revision a35abfe, full package, 2016-05-13)',
protected $revisionPackage = array('CKEditor 4.5.10 (revision b47abaf, full package, 2016-07-13)',
'CKEditor-Plugin: mediaembed, v. 0.6+ (https://github.com/frozeman/MediaEmbed, 2014-03-13)',
'CKEditor-Plugin: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2016-05-13)',
'CKEditor-Plugin: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2016-07-20)',
'CKEditor-Plugin: procurator, v. 1.6 (Serendipity placeholder Plugin, 2016-01-01)',
'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2015-01-28)',
'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2016-08-15)',
'CKEditor-S9yCustomConfig, cke_config.js, v. 2.5, 2016-01-01',
'CKEditor-S9yCustomPlugins, cke_plugin.js, v. 1.10, 2015-12-19',
'CKEditor-S9yAddOn, fresh highlight.pack.js file v. 9.2.0 and github styles in highlight.css, (https://highlightjs.org/) 2016-03-12',
'CKEditor-S9yAddOn, fresh highlight.pack.js file v. 9.5.0 and github styles in highlight.css, (https://highlightjs.org/) 2016-06-28',
'Prettify: JS & CSS files, v. "current", (http://code.google.com/p/google-code-prettify/, 2013-03-04)');
@ -86,14 +87,15 @@ class serendipity_event_ckeditor extends serendipity_event
// this is running while getting a new Plugin version
if ($this->checkUpdate()) {
$this->set_config('installer', '4-'.date('Ymd-H:i:s')); // this is a faked debug notice, since falldown is extract true with case 0, 1 or 2
// continue
} else {
$this->set_config('installer', '3-'.date('Ymd-H:i:s')); // this will happen, if no further extract is necessary in case of an update
return;
$this->set_config('installer', '3-'.date('Ymd-H:i:s')); // this will happen, if no further extract is necessary in case of an update - follow install or upgrade routines
return false;
}
}
if (!extension_loaded('zip')) {
trigger_error(' ZIP extension has not been compiled or loaded in php.', E_USER_WARNING);
trigger_error(' ZIP extension has not been compiled or loaded in PHP.', E_USER_WARNING);
return;
}
@ -103,9 +105,9 @@ class serendipity_event_ckeditor extends serendipity_event
$zip->extractTo($this->cke_path);
$zip->close();
$this->set_config('installer', '2-'.date('Ymd-H:i:s')); // returned by string[0], which is better than substr in this case
// Check to remove every old ckeditor_(*)-plus.zip files
foreach (glob($this->cke_path . '/*.zip') as $filename) {
if($this->cke_path . '/' . $this->cke_zipfile != $filename) {
// Check to remove every old ckeditor_(*)-plus.zip files - checked by partial string "-plus"
foreach (glob($this->cke_path . '/*.zip') AS $filename) {
if ($this->cke_path . '/' . $this->cke_zipfile != $filename && (false !== strpos($filename, '-plus')) ) {
@unlink($filename);
$is_update = true;
}
@ -155,6 +157,7 @@ class serendipity_event_ckeditor extends serendipity_event
unset($_COOKIE['KCFINDER_orderDesc']);
unset($_COOKIE['KCFINDER_view']);
}
// extracted, continue to set this version into config
} else {
$this->set_config('installer', '1-'.date('Ymd-H:i:s'));
return false;
@ -163,8 +166,8 @@ class serendipity_event_ckeditor extends serendipity_event
$this->set_config('installer', '0-'.date('Ymd-H:i:s')); // do it again, Sam
return false;
}
// make sure the new versions are set to last_ckeditor_version
$this->updateTableZip();
// Extraction found true, add the new version string to configs last_ckeditor_version
$this->updateConfig();
return true;
}
@ -181,7 +184,7 @@ class serendipity_event_ckeditor extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_CKEDITOR_DESC);
$propbag->add('stackable', false);
$propbag->add('author', 'Rustam Abdullaev, Ian');
$propbag->add('version', '4.5.9.0'); // is CKEDITOR Series 4.5.9 - and appended plugin revision .0
$propbag->add('version', '4.5.10.5'); // is CKEDITOR Series 4.5.10 - and appended plugin revision .5
$propbag->add('copyright', 'GPL or LGPL License');
$propbag->add('requirements', array(
'serendipity' => '1.7',
@ -303,7 +306,7 @@ class serendipity_event_ckeditor extends serendipity_event
$this->forceZipInstall = false;
$this->set_config('force_install', 'false');
// forceZipInstall forces to surround the checkUpdate function, thus we set config database table to keep track
$this->updateTableZip();
$this->updateConfig();
$s .= '<p class="msg_success"><span class="icon-ok"></span><strong>Force deflate done:</strong> Please reload this page <a href="'.$serendipity['baseURL'] . 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]='.urlencode($this->instance).'" target="_self">here</a>!</p>';
}
@ -318,7 +321,7 @@ class serendipity_event_ckeditor extends serendipity_event
}
$s .= "</ul>\n\n";
if( isset($installer) && !empty($installer) ) {
if (!empty($installer)) {
switch ($installer[0]) {
case '4': // this won't happen, since case 2 is true - just a fake
$s .= '<p class="msg_notice"><span class="icon-attention"></span> <strong>Check Plugin Update Message:</strong> NO CONFIG SET OR NO MATCH -> config_set: "last_'.$parts[0].'_version:'. $parts[1].'"</p>';
@ -341,42 +344,48 @@ class serendipity_event_ckeditor extends serendipity_event
#echo $installer[0] . ' - ' . $this->instance; // this debug message on the other hand will do well, if all went through w/o install() returning false
$s .= PLUGIN_EVENT_CKEDITOR_INSTALL;
$s .= PLUGIN_EVENT_CKEDITOR_CONFIG;
$s .= PLUGIN_EVENT_CKEDITOR_SCAYT;
return $s;
}
/**
* Downgrade of version to keep plugin version track with CKE versioning for upcoming next major upgrades!
* This method is temporary only!
* @see updateTableZip()
* @see updateConfig()
* @see checkUpdate()
*/
private function temporaryDowngrade($newVersion, $oldVersion)
{
global $serendipity;
$thisclass = serendipity_db_escape_string('serendipity_event_ckeditor');
$row = serendipity_db_query("SELECT version FROM {$serendipity['dbPrefix']}pluginlist
WHERE plugin_class = '" . serendipity_db_escape_string('serendipity_event_ckeditor') . "'
WHERE plugin_class = '" . $thisclass . "'
AND pluginlocation = 'local'
LIMIT 1", true, 'assoc');
$versions = array($oldVersion, $newVersion); // keep prior and current versions false check
if (in_array($row['version'], $versions)) return false;
if (in_array($row['version'], $versions)) {
return false;
}
serendipity_db_query("UPDATE {$serendipity['dbPrefix']}pluginlist
SET version = '" . serendipity_db_escape_string($oldVersion) . "'
WHERE plugin_class = '" . serendipity_db_escape_string('serendipity_event_ckeditor') . "'");
WHERE plugin_class = '" . $thisclass . "'
AND pluginlocation = 'local'");
serendipity_db_query("UPDATE {$serendipity['dbPrefix']}pluginlist
SET upgrade_version = '" . serendipity_db_escape_string($newVersion) . "'
WHERE plugin_class = '" . serendipity_db_escape_string('serendipity_event_ckeditor') . "'");
WHERE plugin_class = '" . $thisclass . "'
AND pluginlocation = 'local'");
}
/**
* Set config database table to keep track to zip updates
* Set config database table to keep track to zip update versions
* @access private
*/
private function updateTableZip()
private function updateConfig()
{
$this->temporaryDowngrade('4.5.9.0', '4.5.8.1'); // temporary
#$this->temporaryDowngrade('4.5.10.3', '4.5.10.2'); // was temporary used for the harmonization of plugin and lib versions
foreach(array_values($this->checkUpdateVersion) AS $package) {
$match = explode(':', $package);
$this->set_config('last_'.$match[0].'_version', $match[1]);
@ -390,7 +399,7 @@ class serendipity_event_ckeditor extends serendipity_event
*/
private function checkUpdate()
{
$this->temporaryDowngrade('4.5.9.0', '4.5.8.1'); // temporary
#$this->temporaryDowngrade('4.5.10.3', '4.5.10.2'); // was temporary used for the harmonization of plugin and lib versions
$doupdate = false;
foreach(array_values($this->checkUpdateVersion) AS $package) {
$match = explode(':', $package);
@ -398,12 +407,11 @@ class serendipity_event_ckeditor extends serendipity_event
if ($this->get_config('last_'.$match[0].'_version') == $match[1]) {
$doupdate = false;
} else {
$this->set_config('last_'.$match[0].'_version', $match[1]); // redundant, since now done for both in updateTableZip, but leave here until new is proofed
$doupdate = true;
break; // this is possibly needed to force install upgrade routines
break; // this is probably needed to force install upgrade routines
}
}
return $doupdate ? true : false;
return $doupdate;
}
/**
@ -421,8 +429,7 @@ class serendipity_event_ckeditor extends serendipity_event
return;
}
$iterator = new RecursiveIteratorIterator($_dir, RecursiveIteratorIterator::CHILD_FIRST);
//$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);
foreach ($iterator as $file) {
foreach ($iterator AS $file) {
if ($file->isFile()) {
@unlink($file->__toString());
} else {
@ -485,6 +492,24 @@ if ($headcss) {
case 'backend_header':
if (isset($serendipity['wysiwyg']) && $serendipity['wysiwyg'] && isset($eventData) && !isset($_GET['serendipity']['iframe_mode'])) {
// Check, if Serendipity 2.1 changed WYSIWYG_LANG constant already is defined,
// which changed 2-letter or "**-utf" marked langs eg. "en" to "en_US", using the POSIX underscore standard,
// else workaround using DATE_LOCALES.
if (defined('DATE_LOCALES') && (false !== strpos('_', WYSIWYG_LANG))) {
// scayt available langs are ('en_US', 'en_GB', 'pt_BR', 'da_DK', 'nl_NL', 'en_CA', 'fi_FI', 'fr_FR', 'fr_CA', 'de_DE', 'el_GR', 'it_IT', 'la_VA', 'nb_NO', 'pt_PT', 'es_ES', 'sv_SE');
$locale = explode(',', DATE_LOCALES); // get the current defined locales as array
$special = array('Arabic', 'bulgarian', 'pl.UTF-8', 'tw'); // special lang exceptions which have them at last position
if (in_array($locale[0], $special)) {
$slocale = @strtok(end($locale), "."); // strtok dot fixes 'ar_SA.windows-1256'
@reset($locale);
}
$_locale = trim(isset($slocale) ? $slocale : $locale[0]); // set the current lang locale as string
if (!empty($_locale)) {
$flocale = explode('.', $_locale); // $flocale array is the first defined 4-letter lang locale, eg "de_DE".
if ($flocale[0] == 'nl_BE') $flocale[0] = 'nl_NL'; // case locale Nederlands / België set back to Dutch (Netherlands)
if ($flocale[0] == 'sv_SV') $flocale[0] = 'sv_SE'; // case Swedish set back to Swedish (Sweden)
}
}
$relpath = function_exists('serendipity_specialchars') ? serendipity_specialchars($this->get_config('path')) : htmlspecialchars($this->get_config('path'), ENT_COMPAT, LANG_CHARSET);
$plgpath = function_exists('serendipity_specialchars') ? serendipity_specialchars($this->get_config('plugpath')) : htmlspecialchars($this->get_config('plugpath'), ENT_COMPAT, LANG_CHARSET);
$acf_off = serendipity_db_bool($this->get_config('acf_off', 'false')) ? 'true' : 'false'; // need this, to be passed correctly as boolean true/false to custom cke_config.js
@ -492,6 +517,9 @@ if ($headcss) {
$uats_on = $serendipity['use_autosave'] ? 'true' : 'false'; // dito
$toolbar = $this->get_config('toolbar', 'Standard');
$time = $this->get_config('timestamp', time());
$slang = (isset($flocale) && !empty($flocale[0]) ? $flocale[0] : WYSIWYG_LANG); // set scayt locales 4-letter POSIX lang or fall back
$lang = $slang ? $slang : 'en_US'; // use new WYSIWYG_LANG, or the workaround locale, or fall back to default
$lang = str_replace('_', '-', $lang); // change to IETF standard unicode language tag, using a dash
/*
Define some global CKEDITOR plugin startup vars
Include the ckeditor
@ -506,12 +534,12 @@ if ($headcss) {
S9Y_VERSION_NEW = <?php echo $serendipity['version'][0] < 2 ? 'false' : 'true'; ?>;
CKECONFIG_ACF_OFF = <?php echo $acf_off; ?>;
CKECONFIG_CODE_ON = <?php echo $code_on; ?>;
CKECONFIG_LANG = '<?php echo WYSIWYG_LANG; ?>';
CKECONFIG_LANG = '<?php echo $lang; ?>'; // as IETF
CKECONFIG_SLANG = '<?php echo $slang; ?>'; // as POSIX
CKECONFIG_TOOLBAR = '<?php echo $toolbar; ?>';
CKECONFIG_TOOLBAR_BREAK = <?php echo serendipity_db_bool($this->get_config('toolbar_break', 'false')) ? "'/'" : "''"; ?>;
CKECONFIG_FORCE_LOAD = <?php echo $time; ?>;
CKECONFIG_USEAUTOSAVE = <?php echo $uats_on; ?>;
</script>
<script type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath'] . $relpath; ?>ckeditor.js"></script>
<script type="text/javascript" src="<?php echo $plgpath . 'serendipity_event_ckeditor/'; ?>cke_plugin.js"></script>
@ -619,21 +647,31 @@ ol.linenums li {
if ($this->install()) {
header('Location: ' . $serendipity['baseURL'] . 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]='.urlencode($this->instance));
} else {
header('Location: ' . $serendipity['baseURL'] . 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[adminAction]=addnew&serendipity[only_group]=UPGRADE&serendipity[type]=event');
header('Location: ' . $serendipity['baseURL'] . 'serendipity_admin.php?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]='.urlencode($this->instance));
}
}
break;
case 'backend_plugins_update':
// Make sure a Spartacus update really falls down to plugins config, for the need to deflate the zip, if necessary.
// This needs a *real* new HTTP request! Using plugin_to_conf:instance (see above) would not do here!!
// A request to ...&serendipity[install_plugin]=serendipity_event_ckeditor would force a deflate, but would install another plugin instance!
header('Location: ' . $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/triggerckeinstall');
if ($eventData == 'serendipity_event_ckeditor' && !$serendipity['ajax']) {
// @TODO: This is is really messed up. Probably much better to perform a HTTP_Request to perform an action. Text below needs to be reworked, that all makes no sense to me.
// Make sure a Spartacus update really falls down into this plugins config.
// In case of using the UPDATE ALL 1-click ajax-upgrader, this redirection is disabled and you have to force the extraction yourself in the config.
// This needs a *REAL* new HTTP request! Using plugin_to_conf:instance (see above) would not do here!!
// A request to ...&serendipity[install_plugin]=serendipity_event_ckeditor would force a deflate, but would install another plugin instance!
header('Location: ' . $serendipity['baseURL'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'plugin/triggerckeinstall');
// This runtime breakage will reset all other plugins waiting to UPGRADE back to their current version in table pluginlist.
// After this, the updater has to wait for a new read of the xml file(s) and to set pending plugins with setPluginInfo() method for versions and timestamp again.
// This is not what we want here! So we nuke the blog-servers xml file in templates_c to later on continue with pending plugin updates.
// Spartacus has to be prepared to set this global var. All other users probably have to wait up to 12h+.
//#@unlink($serendipity['spartacus_cachedXMLfile']);
//#die(); // now exit the runtime UPGRADE task executor, which forces to really halt into this->install() check redirector!
}
break;
case 'backend_media_path_exclude_directories':
$eventData[".thumbs"] = true;
break;
case 'backend_wysiwyg':