mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 18:14:07 +02:00
Function now in Editor
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@961 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -287,7 +287,11 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
|||||||
}
|
}
|
||||||
|
|
||||||
function editFunctions($field) {
|
function editFunctions($field) {
|
||||||
return array($field["null"] || $field["auto_increment"] ? "" : "*");
|
$return = array($field["null"] || $field["auto_increment"] ? "" : "*");
|
||||||
|
if (ereg('date|time', $field["type"])) {
|
||||||
|
$return[] = "now";
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function editInput($table, $field, $attrs, $value) {
|
function editInput($table, $field, $attrs, $value) {
|
||||||
@@ -316,6 +320,9 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
|||||||
|
|
||||||
function processInput($field, $value, $function = "") {
|
function processInput($field, $value, $function = "") {
|
||||||
global $dbh;
|
global $dbh;
|
||||||
|
if ($function == "now") {
|
||||||
|
return "$function()";
|
||||||
|
}
|
||||||
$return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . preg_replace('~(\\\\\\$([0-9]))~', '(?P<p\\2>[0-9]+)', preg_quote(lang('$1-$3-$5'))) . '(.*))', $value, $match)
|
$return = $dbh->quote(ereg('date|timestamp', $field["type"]) && preg_match('(^' . preg_replace('~(\\\\\\$([0-9]))~', '(?P<p\\2>[0-9]+)', preg_quote(lang('$1-$3-$5'))) . '(.*))', $value, $match)
|
||||||
? ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match)
|
? ($match["p1"] ? $match["p1"] : ($match["p2"] < 70 ? 20 : 19) . $match["p2"]) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match)
|
||||||
: $value
|
: $value
|
||||||
|
Reference in New Issue
Block a user