mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 15:16:44 +02:00
Move init to head
This commit is contained in:
@@ -15,26 +15,25 @@ class AdminerEditCalendar {
|
||||
* @param string text to append before first calendar usage
|
||||
* @param string path to language file, %s stands for language code
|
||||
*/
|
||||
function AdminerEditCalendar($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { //! insert <link> by JavaScript to achieve HTML validity
|
||||
function AdminerEditCalendar($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") {
|
||||
$this->prepend = $prepend;
|
||||
$this->langPath = $langPath;
|
||||
}
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
static $calendar = false;
|
||||
if (ereg("date|time", $field["type"])) {
|
||||
if (!$calendar) {
|
||||
$calendar = true;
|
||||
echo $this->prepend;
|
||||
if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
|
||||
$lang = get_lang();
|
||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
|
||||
printf("<script type='text/javascript' src='$this->langPath'></script>\n", $lang);
|
||||
echo "<script type='text/javascript'>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
|
||||
}
|
||||
}
|
||||
function head() {
|
||||
echo $this->prepend;
|
||||
if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
|
||||
$lang = get_lang();
|
||||
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
|
||||
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
|
||||
printf("<script type='text/javascript' src='$this->langPath'></script>\n", $lang);
|
||||
echo "<script type='text/javascript'>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
if (ereg("date|time", $field["type"])) {
|
||||
$dateFormat = "changeYear: true, dateFormat: 'yy-mm-dd'"; //! yy-mm-dd regional
|
||||
$timeFormat = "showSecond: true, timeFormat: 'hh:mm:ss'";
|
||||
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . "$attrs><script type='text/javascript'>jQuery(function () { jQuery('#fields-" . js_escape($field["field"]) . "')."
|
||||
|
@@ -43,7 +43,6 @@ tinyMCE.init({
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
return true;
|
||||
}
|
||||
|
||||
function selectVal(&$val, $link, $field) {
|
||||
|
Reference in New Issue
Block a user