scripts = $scripts; $this->options = $options; } function head() { foreach ($this->scripts as $script) { echo "\n"; } } function selectVal(&$val, $link, $field) { // copied from tinymce.php if (ereg("_html", $field["field"]) && $val != ' ') { $shortened = (substr($val, -10) == "..."); if ($shortened) { $val = substr($val, 0, -10); } //! 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 .= "..."; } 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 && ereg("text", $field["type"]) && ereg("_html", $field["field"])) { $lang = "en"; if (function_exists('get_lang')) { // since Adminer 3.2.0 $lang = get_lang(); $lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang); } return "" . h($value) . ""; } } }