diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index d0db5644..aed9e0e3 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -890,15 +890,13 @@ class Adminer { $connection->select_db(DB); $tables = table_status('', true); } - ?> - - - - - - - + + head()) { ?> diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0768c56b..6cfc0108 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -90,6 +90,14 @@ function script($source, $trailing = "\n") { return "$trailing"; } +/** Return \n"; +} + /** Escape for HTML * @param string * @return string diff --git a/adminer/plugin.php b/adminer/plugin.php index 7b241973..3fb1b549 100644 --- a/adminer/plugin.php +++ b/adminer/plugin.php @@ -17,7 +17,7 @@ function adminer_object() { new AdminerDumpXml, new AdminerDumpAlter, //~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"), - //~ new AdminerEditCalendar("\n\n\n\n\n\n\n\n\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"), + //~ new AdminerEditCalendar(script_src("../externals/jquery-ui/jquery-1.4.4.js") . script_src("../externals/jquery-ui/ui/jquery.ui.core.js") . script_src("../externals/jquery-ui/ui/jquery.ui.widget.js") . script_src("../externals/jquery-ui/ui/jquery.ui.datepicker.js") . script_src("../externals/jquery-ui/ui/jquery.ui.mouse.js") . script_src("../externals/jquery-ui/ui/jquery.ui.slider.js") . script_src("../externals/jquery-timepicker/jquery-ui-timepicker-addon.js") . "\n\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"), //~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"), //~ new AdminerWymeditor(array("../externals/wymeditor/src/jquery/jquery.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.explorer.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.mozilla.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.opera.js", "../externals/wymeditor/src/wymeditor/jquery.wymeditor.safari.js")), new AdminerFileUpload(""), diff --git a/compile.php b/compile.php index 5e635ec9..a28b9462 100755 --- a/compile.php +++ b/compile.php @@ -393,17 +393,15 @@ if ($_SESSION["lang"]) { $file = str_replace("\n", "", $file); $file = str_replace('', $_SESSION["lang"], $file); } -$file = str_replace('' . "\n", "", $file); -$file = str_replace('' . "\n", "", $file); -$file = str_replace('' . "\n", "", $file); -$file = str_replace('' . "\n", "", $file); -$file = str_replace('' . "\n", "", $file); +$file = str_replace('' . "\n", "", $file); +$file = preg_replace('~\\s+echo script_src\\("\\.\\./externals/jush/modules/jush-(textarea|txt|js|\\$jush)\\.js"\\);~', '', $file); $file = str_replace('' . "\n", "", $file); $file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files -$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&version=' . $VERSION . ($driver ? '&driver=' . $driver : ''); -$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '', $file); -$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file); -$file = preg_replace('~\\.\\./externals/jush/modules/(jush\\.js)~', '', $file); +$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\\1&version=' . $VERSION . ($driver ? '&driver=' . $driver : '') . '"'; +$file = preg_replace('~\\.\\./adminer/static/(default\\.css|favicon\\.ico)~', '', $file); +$file = preg_replace('~"\\.\\./adminer/static/(functions\\.js)"~', $replace, $file); +$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file); +$file = preg_replace('~"\\.\\./externals/jush/modules/(jush\\.js)"~', $replace, $file); $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file); $file = php_shrink($file); diff --git a/plugins/edit-calendar.php b/plugins/edit-calendar.php index 745dd8e4..11fec866 100644 --- a/plugins/edit-calendar.php +++ b/plugins/edit-calendar.php @@ -16,7 +16,14 @@ class AdminerEditCalendar { * @param string text to append before first calendar usage * @param string path to language file, %s stands for language code */ - function __construct($prepend = "\n\n\n\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { + function __construct($prepend = null, $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { + if ($prepend === null) { + $prepend = "\n" + . script_src("jquery-ui/jquery.js") + . script_src("jquery-ui/jquery-ui.js") + . script_src("jquery-ui/jquery-ui-timepicker-addon.js") + ; + } $this->prepend = $prepend; $this->langPath = $langPath; } @@ -27,7 +34,7 @@ class AdminerEditCalendar { $lang = get_lang(); $lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang)); if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) { - printf("\n", $lang); + echo script_src(sprintf($this->langPath, $lang)); echo script("jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });"); } } diff --git a/plugins/tinymce.php b/plugins/tinymce.php index 1425b045..59620a01 100644 --- a/plugins/tinymce.php +++ b/plugins/tinymce.php @@ -27,8 +27,8 @@ class AdminerTinymce { $lang = "en"; } } + echo script_src($this->path); ?> - \n"; + echo script_src($script); } }