path = $path; } function head() { $lang = "en"; if (function_exists('get_lang')) { // since Adminer 3.2.0 $lang = get_lang(); $lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang)); if (!file_exists(dirname($this->path) . "/langs/$lang.js")) { $lang = "en"; } } echo script_src($this->path); ?> > tinyMCE.init({ entity_encoding: 'raw', language: '' }); // learn how to customize here: https://www.tinymce.com/docs/configure/ …"; $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) { if (preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) { return "" . h($value) . "" . script(" tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { }); tinyMCE.EditorManager.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "'); qs('#form').onsubmit = function () { tinyMCE.each(tinyMCE.editors, function (ed) { ed.remove(); }); }; "); } } }