Skip to content

Commit

Permalink
update adminer (db manager) to v4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Jan 20, 2018
1 parent a43e3c2 commit 26eecc2
Show file tree
Hide file tree
Showing 21 changed files with 1,043 additions and 102 deletions.
8 changes: 5 additions & 3 deletions external/ExtPrograms.csv
Expand Up @@ -29,7 +29,7 @@ Bootswatch2,2.3.2,bootswatch.com/,2.3.2,
Bootswatch3,3.3.7,bootswatch.com/,3.3.7,change 1st line variables.less comment to output to .css file
Font-Awesome3,3.2.1,fortawesome.github.com/Font-Awesome,3.2.1,updated FontAwesomePath in variables.less
Font-Awesome4,4.7.0,fortawesome.github.com/Font-Awesome,4.7.0,
Adminer,4.3.1,www.adminer.org,4.4.0,"customized plugins: tinymce, edit-textarea & edit-calendar"
Adminer,4.4.0exp,www.adminer.org,4.4.0,"customized plugins: tinymce, edit-textarea & edit-calendar; pre 4.4.1 tweaks"
SimpleAjaxUploader,2.6.2,github.com/LPology/Simple-Ajax-Uploader,2.6.2,also converted to yui module 2.5.3
normalize.css,7.0.0,necolas.github.com/normalize.css/,7.0.0,auto included in bootstrap 3
MediaElement.js,4.2.8,mediaelementjs.com/,4.2.8,
Expand All @@ -46,7 +46,7 @@ elFinder,2.1.31,elfinder.org,2.1.31,customized in /framework with Exponent php c
jQuery1,1.12.4,jquery.com,1.12.4,v1.11.3 still needed for old firefox
jQuery,2.2.4,jquery.com,2.2.4,
jQuery Migrate,1.4.1,jquery.com,1.4.1,renamed to migrate.js for easy loading as an addon
jQuery3,3.2.1,jquery.com,3.2.1,
jQuery3,3.2.1,jquery.com,3/3/2000,
jQuery3 Migrate,3.0.1,jquery.com,3.0.1,
jQueryUI,1.12.1,jqueryui.com,1.12.1,
stepy,1.1.0exp,wbotelhos.com/stepy,1.1.0,"added button class, jquery.validate option passing"
Expand Down Expand Up @@ -97,7 +97,9 @@ Kint,2.2.0,github.com/kint-php/kint,2.2.0,"optional, for formatted edebug output
Not included yet,,,,
Twitter-Bootstrap,,twitter.github.com/bootstrap,4.0.0,patched bootstrap.scss includes swatches & exp variables
Bootswatch,,bootswatch.com/,4.0.0,change 1st line variables.scss comment to output to .css file
Font-Awesome,,fontawesome.com,5.0.2,add 'fonts' to main sheet
Font-Awesome,,fontawesome.com,5.0.4,add 'fonts' to main sheet
DataTables Buttons,,www.datatables.net,1.5.1,
DataTables Responsive,,www.datatables.net,2.2.1,
,,,,
No longer included,,,,
pwstrength-bootstrap,2.0.0,github.com/ablanco/jquery.pwstrength.bootstrap,2.1.3,
Expand Down
11 changes: 8 additions & 3 deletions external/adminer/admin.php
Expand Up @@ -34,7 +34,12 @@ function adminer_object() {
// new AdminerDumpDate,
new AdminerDumpZip, // adds zip option to export
new AdminerEditCalendar(
"<script type='text/javascript' src='".JQUERY_SCRIPT."'></script>\n<script type='text/javascript' src='".JQUERYUI_SCRIPT."'></script>\n<script type='text/javascript' src='".JQUERY_RELATIVE."addons/js/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='".JQUERYUI_CSS."'>\n<link rel='stylesheet' type='text/css' href='".JQUERY_RELATIVE."addons/css/jquery-ui-timepicker-addon.css'>\n",
// "<script type='text/javascript' src='".JQUERY_SCRIPT."'></script>\n<script type='text/javascript' src='".JQUERYUI_SCRIPT."'></script>\n<script type='text/javascript' src='".JQUERY_RELATIVE."addons/js/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='".JQUERYUI_CSS."'>\n<link rel='stylesheet' type='text/css' href='".JQUERY_RELATIVE."addons/css/jquery-ui-timepicker-addon.css'>\n",
"<link rel='stylesheet' type='text/css' href='".JQUERYUI_CSS."'>\n"
. "<link rel='stylesheet' type='text/css' href='".JQUERY_RELATIVE."addons/css/jquery-ui-timepicker-addon.css'>\n"
. script_src(JQUERY_SCRIPT)
. script_src(JQUERYUI_SCRIPT)
. script_src(JQUERY_RELATIVE."addons/js/jquery-ui-timepicker-addon.js"),
JQUERY_RELATIVE."js/ui/i18n/datepicker-%s.js"
), // add calendar popup for date/time fileds
new AdminerEnumOption, // turns enum fields into select input
Expand Down Expand Up @@ -148,12 +153,12 @@ function loginForm() {
}

// include original Adminer or Adminer Editor
include "./adminer-4.3.1-mysql.php";
include "./adminer-4.4.0-mysql.php";
//include "./editor-4.3.1-mysql.php";

if (SITE_WYSIWYG_EDITOR != 'tinymce') {
?>
<script type='text/javascript'>
<script type='text/javascript' <?php echo nonce(); ?>>
CKEDITOR.disableAutoInline = true;
</script>
<?php
Expand Down
823 changes: 823 additions & 0 deletions external/adminer/adminer-4.4.0-mysql.php

Large diffs are not rendered by default.

114 changes: 104 additions & 10 deletions external/adminer/adminer.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion external/adminer/plugins/AdminerJsonPreview.php
Expand Up @@ -123,7 +123,7 @@ public function head()
}
</style>

<script>
<script <?php echo nonce(); ?>>
function toggleJson(button, counter) {
var obj = document.getElementById("json-code-" + counter);
if (!obj)
Expand Down
2 changes: 1 addition & 1 deletion external/adminer/plugins/AdminerSerializedPreview.php
Expand Up @@ -124,7 +124,7 @@ public function head()
}
</style>

<script>
<script <?php echo nonce(); ?>>
function toggleJson(button, counter) {
var obj = document.getElementById("json-code-" + counter);
if (!obj)
Expand Down
4 changes: 2 additions & 2 deletions external/adminer/plugins/AdminerTheme.php
Expand Up @@ -32,7 +32,7 @@ public function head()
?>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, target-densitydpi=medium-dpi"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>

<link rel="icon" type="image/ico" href="images/favicon.png">

Expand All @@ -57,7 +57,7 @@ public function head()

<link rel="stylesheet" type="text/css" href="css/<?php echo htmlspecialchars($this->themeName) ?>.css?3">

<script>
<script <?php echo nonce(); ?>>
(function(window) {
"use strict";

Expand Down
5 changes: 3 additions & 2 deletions external/adminer/plugins/ckeditor.php
Expand Up @@ -37,7 +37,8 @@ function __construct($scripts = array(null), $options = "") {

function head() {
foreach ($this->scripts as $script) {
echo "<script type='text/javascript' src='" . h($script) . "'></script>\n";
// echo "<script type='text/javascript' src='" . h($script) . "'></script>\n";
echo script_src($script);
}
}

Expand Down Expand Up @@ -70,7 +71,7 @@ function editInput($table, $field, $attrs, $value) {
$lang = get_lang();
$lang = ($lang == "zh" || $lang == "zh-tw" ? "zh_cn" : $lang);
}
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='6' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='6' cols='50'>" . h($value) . "</textarea><script type='text/javascript' " . nonce() . ">
CKEDITOR.replace('fields-" . js_escape($field["field"]) . "',{
height : '80',
toolbarCanCollapse : true,
Expand Down
12 changes: 6 additions & 6 deletions external/adminer/plugins/dump-bz2.php
Expand Up @@ -3,21 +3,21 @@
/** Dump to Bzip2 format
* @link https://www.adminer.org/plugins/#use
* @uses bzopen(), tempnam("")
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpBz2 {
/** @access protected */
var $filename, $fp;

function dumpOutput() {
if (!function_exists('bzopen')) {
return array();
}
return array('bz2' => 'bzip2');
}

function _bz2($string, $state) {
bzwrite($this->fp, $string);
if ($state & PHP_OUTPUT_HANDLER_END) {
Expand All @@ -28,7 +28,7 @@ function _bz2($string, $state) {
}
return "";
}

function dumpHeaders($identifier, $multi_table = false) {
if ($_POST["output"] == "bz2") {
$this->filename = tempnam("", "bz2");
Expand Down
6 changes: 3 additions & 3 deletions external/adminer/plugins/dump-zip.php
Expand Up @@ -3,9 +3,9 @@
/** Dump to ZIP format
* @link https://www.adminer.org/plugins/#use
* @uses ZipArchive, tempnam("")
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpZip {
/** @access protected */
Expand Down
41 changes: 26 additions & 15 deletions external/adminer/plugins/edit-calendar.php
Expand Up @@ -16,34 +16,45 @@
##################################################

/** Display jQuery UI Timepicker for each date and datetime field
* @link http://www.adminer.org/plugins/#use
* @link https://www.adminer.org/plugins/#use
* @uses jQuery-Timepicker, http://trentrichardson.com/examples/timepicker/
* @uses jQuery UI: core, widget, mouse, slider, datepicker
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditCalendar {
/** @access protected */
var $prepend, $langPath;

/**
* @param string text to append before first calendar usage
* @param string path to language file, %s stands for language code
*/
function __construct($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;
}
// /**
// * @param string text to append before first calendar usage
// * @param string path to language file, %s stands for language code
// */
// function __construct($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 __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"
. 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;
}

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";
printf("<script type='text/javascript' src='$this->langPath' ", $lang) . nonce() . "></script>\n";
echo "<script type='text/javascript' " . nonce() . ">jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
}
}
}
Expand Down Expand Up @@ -86,7 +97,7 @@ function editInput($table, $field, $attrs, $value) {
}";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . (+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . $attrs. ">".
"<input type=hidden id='fields-" . h($field["field"]) . "c' value='" . h($value) . "'" . (+$field["length"] ? " maxlength='" . (+$field["length"]) . "'" : "") . $attrs. ">".
"<script type='text/javascript'>jQuery('#fields-" . js_escape($field["field"]) . "c')."
"<script type='text/javascript' " . nonce() . ">jQuery('#fields-" . js_escape($field["field"]) . "c')."
. ((preg_match("~eventstart|eventend~", $field["field"])) ? "timepicker({ $timeFormat })" : "datetimepicker({ $datetimeFormat })"
// : (preg_match("~_at|publish|_accessed|posted|time~", $field["field"]) ? "datetimepicker({ $datetimeFormat })"
// : "datepicker({ $dateFormat })"
Expand Down
4 changes: 2 additions & 2 deletions external/adminer/plugins/edit-foreign.php
Expand Up @@ -3,8 +3,8 @@
/** Select foreign key in edit form
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditForeign {
var $_limit;
Expand Down
6 changes: 3 additions & 3 deletions external/adminer/plugins/edit-textarea.php
Expand Up @@ -2,9 +2,9 @@

/** Use <textarea> for char and varchar
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditTextarea {

Expand Down
10 changes: 5 additions & 5 deletions external/adminer/plugins/enum-option.php
Expand Up @@ -2,12 +2,12 @@

/** Use <select><option> for enum edit instead of <input type="radio">
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @author Jakub Vrana, https://www.vrana.cz/
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEnumOption {

function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
$options = array("" => array());
Expand All @@ -33,5 +33,5 @@ function editInput($table, $field, $attrs, $value) {
return "<select$attrs>" . optionlist($options, (string) $selected, 1) . "</select>"; // 1 - use keys
}
}

}
4 changes: 2 additions & 2 deletions external/adminer/plugins/plugin.php
Expand Up @@ -3,8 +3,8 @@
/** Adminer customization allowing usage of plugins
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerPlugin extends Adminer {
/** @access protected */
Expand Down
4 changes: 2 additions & 2 deletions external/adminer/plugins/struct-comments.php
Expand Up @@ -3,8 +3,8 @@
/** Show comments of sql structure in more places (mainly where you edit things)
* @link https://www.adminer.org/plugins/#use
* @author Adam Kuśmierz, http://kusmierz.be/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerStructComments {

Expand Down
4 changes: 2 additions & 2 deletions external/adminer/plugins/table-indexes-structure.php
Expand Up @@ -3,8 +3,8 @@
/** Expanded table indexes structure output
* @link https://www.adminer.org/plugins/#use
* @author Matthew Gamble, https://www.matthewgamble.net/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTableIndexesStructure {

Expand Down
4 changes: 2 additions & 2 deletions external/adminer/plugins/table-structure.php
Expand Up @@ -3,8 +3,8 @@
/** Expanded table structure output
* @link https://www.adminer.org/plugins/#use
* @author Matthew Gamble, https://www.matthewgamble.net/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTableStructure {

Expand Down

0 comments on commit 26eecc2

Please sign in to comment.