mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +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";
|
echo "<p>" . lang('Loaded plugins') . ":\n<ul>\n";
|
||||||
foreach ($adminer->plugins as $plugin) {
|
foreach ($adminer->plugins as $plugin) {
|
||||||
$reflection = new \ReflectionObject($plugin);
|
$reflection = new \ReflectionObject($plugin);
|
||||||
preg_match('~^/[\s*]+(.+)\n~', $reflection->getDocComment(), $match);
|
echo "<li><b>" . get_class($plugin) . "</b>" . h(preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match) ? ": $match[1]" : "") . "\n";
|
||||||
echo "<li><b>" . get_class($plugin) . "</b>" . h($match ? ": $match[1]" : "") . "\n";
|
|
||||||
}
|
}
|
||||||
echo "</ul>\n";
|
echo "</ul>\n";
|
||||||
}
|
}
|
||||||
|
@@ -16,19 +16,17 @@ class AdminerEditCalendar {
|
|||||||
* @param string path to language file, %s stands for language code
|
* @param string path to language file, %s stands for language code
|
||||||
*/
|
*/
|
||||||
function __construct($prepend = null, $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 = "<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->prepend = $prepend;
|
||||||
$this->langPath = $langPath;
|
$this->langPath = $langPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
function head($dark = null) {
|
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) {
|
if ($this->langPath) {
|
||||||
$lang = Adminer\get_lang();
|
$lang = Adminer\get_lang();
|
||||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||||
|
Reference in New Issue
Block a user