Add callback before edit form (bug #759)
This commit is contained in:
parent
2dd3bd0e1a
commit
a8c218f192
|
@ -480,7 +480,7 @@ class Adminer {
|
|||
echo "</script>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
||||
|
||||
/** Print command box in select
|
||||
* @return bool whether to print default commands
|
||||
*/
|
||||
|
@ -659,6 +659,16 @@ class Adminer {
|
|||
;
|
||||
}
|
||||
|
||||
/** Print before edit form
|
||||
* @param string
|
||||
* @param array
|
||||
* @param mixed
|
||||
* @param bool
|
||||
* @return null
|
||||
*/
|
||||
function editRowPrint($table, $fields, $row, $update) {
|
||||
}
|
||||
|
||||
/** Functions displayed in edit form
|
||||
* @param array single field from fields()
|
||||
* @return array
|
||||
|
|
|
@ -1411,15 +1411,16 @@ function on_help($command, $side = 0) {
|
|||
* @param bool
|
||||
* @return null
|
||||
*/
|
||||
function edit_form($TABLE, $fields, $row, $update) {
|
||||
function edit_form($table, $fields, $row, $update) {
|
||||
global $adminer, $jush, $token, $error;
|
||||
$table_name = $adminer->tableName(table_status1($TABLE, true));
|
||||
$table_name = $adminer->tableName(table_status1($table, true));
|
||||
page_header(
|
||||
($update ? lang('Edit') : lang('Insert')),
|
||||
$error,
|
||||
array("select" => array($TABLE, $table_name)),
|
||||
array("select" => array($table, $table_name)),
|
||||
$table_name
|
||||
);
|
||||
$adminer->editRowPrint($table, $fields, $row, $update);
|
||||
if ($row === false) {
|
||||
echo "<p class='error'>" . lang('No rows.') . "\n";
|
||||
}
|
||||
|
|
|
@ -452,6 +452,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
|||
return " <span class='time'>" . @date("H:i:s") . "</span><!--\n" . str_replace("--", "--><!-- ", $query) . "\n" . ($time ? "($time)\n" : "") . "-->";
|
||||
}
|
||||
|
||||
function editRowPrint($table, $fields, $row, $update) {
|
||||
}
|
||||
|
||||
function editFunctions($field) {
|
||||
$return = array();
|
||||
if ($field["null"] && preg_match('~blob~', $field["type"])) {
|
||||
|
|
|
@ -83,6 +83,9 @@ class AdminerPlugin extends Adminer {
|
|||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
}
|
||||
|
||||
function editRowPrint($table, $fields, $row, $update) {
|
||||
}
|
||||
|
||||
function editFunctions($field) {
|
||||
$args = func_get_args();
|
||||
return $this->_appendPlugin(__FUNCTION__, $args);
|
||||
|
|
Loading…
Reference in a new issue