]> git.joonet.de Git - adminer.git/commitdiff
Add callback before edit form (bug #759)
authorJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 08:23:57 +0000 (09:23 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 8 Feb 2021 09:57:53 +0000 (10:57 +0100)
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
editor/include/adminer.inc.php
plugins/plugin.php

index d931e07d156082f5ce9077cd2a55e4751e9ab62f..b77f365076e8168c60bef996596a5c9f5a25f76e 100644 (file)
@@ -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
index 2f681b1faa10d4f47b2814b6a600e59f0bbd9176..6030bc22f8224a800c6c3726fe6da95fdc1cf552 100644 (file)
@@ -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";
        }
index ae9b0843a303766e60315371440254ca1aacbf3c..96d27c47f3496fd621b7c996825e33ad289c72bb 100644 (file)
@@ -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"])) {
index a2f6b7805333ae1df046c21c705cc08e6f1bdd89..265f8fe63eff99e2318aee4f8071f0a2b895fe91 100644 (file)
@@ -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);