mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
AdminerEditCalendar: Avoid work in constructor
This commit is contained in:
@@ -48,8 +48,7 @@ if (
|
||||
echo "<p>" . lang('Loaded plugins') . ":\n<ul>\n";
|
||||
foreach ($adminer->plugins as $plugin) {
|
||||
$reflection = new \ReflectionObject($plugin);
|
||||
preg_match('~^/[\s*]+(.+)\n~', $reflection->getDocComment(), $match);
|
||||
echo "<li><b>" . get_class($plugin) . "</b>" . h($match ? ": $match[1]" : "") . "\n";
|
||||
echo "<li><b>" . get_class($plugin) . "</b>" . h(preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match) ? ": $match[1]" : "") . "\n";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
@@ -16,19 +16,17 @@ class AdminerEditCalendar {
|
||||
* @param string path to language file, %s stands for language code
|
||||
*/
|
||||
function __construct($prepend = null, $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
|
||||
if ($prepend === null) {
|
||||
$prepend = "<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n"
|
||||
. Adminer\script_src("jquery-ui/jquery.js")
|
||||
. Adminer\script_src("jquery-ui/jquery-ui.js")
|
||||
. Adminer\script_src("jquery-ui/jquery-ui-timepicker-addon.js")
|
||||
;
|
||||
}
|
||||
$this->prepend = $prepend;
|
||||
$this->langPath = $langPath;
|
||||
}
|
||||
|
||||
function head($dark = null) {
|
||||
echo $this->prepend;
|
||||
echo ($this->prepend !== null ? $this->prepend :
|
||||
"<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n"
|
||||
. Adminer\script_src("jquery-ui/jquery.js")
|
||||
. Adminer\script_src("jquery-ui/jquery-ui.js")
|
||||
. Adminer\script_src("jquery-ui/jquery-ui-timepicker-addon.js")
|
||||
);
|
||||
if ($this->langPath) {
|
||||
$lang = Adminer\get_lang();
|
||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||
|
Reference in New Issue
Block a user