From 8f2a829b2ee5f11b80c63873ca8efb7e72000d4f Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 27 Mar 2025 07:13:17 +0100 Subject: [PATCH] WYMeditor not updated since 2014 --- plugins/wymeditor.php | 61 ------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 plugins/wymeditor.php diff --git a/plugins/wymeditor.php b/plugins/wymeditor.php deleted file mode 100644 index 3cc524ea..00000000 --- a/plugins/wymeditor.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @param string in format "skin: 'custom', preInit: function () { }" - */ - function __construct($scripts = array("jquery/jquery.js", "wymeditor/jquery.wymeditor.min.js"), $options = "") { - $this->scripts = $scripts; - $this->options = $options; - } - - function head($dark = null) { - foreach ($this->scripts as $script) { - echo Adminer\script_src($script); - } - } - - function selectVal(&$val, $link, $field, $original) { - // copied from tinymce.php - if (preg_match("~_html~", $field["field"]) && $val != '') { - $ellipsis = ""; - $length = strlen($ellipsis); - $shortened = (substr($val, -$length) == $ellipsis); - if ($shortened) { - $val = substr($val, 0, -$length); - } - //! shorten with regard to HTML tags - http://php.vrana.cz/zkraceni-textu-s-xhtml-znackami.php - $val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); // remove ending incomplete tag (text can be shortened) - if ($shortened) { - $val .= $ellipsis; - } - if (class_exists('DOMDocument')) { // close all opened tags - $dom = new DOMDocument; - if (@$dom->loadHTML("$val")) { // @ - $val can contain errors - $val = preg_replace('~.*]*>(.*).*~is', '\1', $dom->saveHTML()); - } - } - } - } - - function editInput($table, $field, $attrs, $value) { - static $lang = ""; - if (!$lang && preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) { - $lang = Adminer\get_lang(); - $lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang); - return "" . Adminer\h($value) . "" . Adminer\script(" -jQuery('#fields-" . Adminer\js_escape($field["field"]) . "').wymeditor({ updateSelector: '#form [type=\"submit\"]', lang: '$lang'" . ($this->options ? ", $this->options" : "") . " }); -"); - } - } -}