1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

Updated Technical Wiki (markdown)

Ap.Muthu
2016-02-02 18:22:20 +08:00
parent 64e3282e02
commit 727ee113aa

@@ -76,7 +76,7 @@ $field = Array
}
````
Different number of records in listing and select choices:
* Different number of records in listing and select choices:
````
function selectLimitProcess() {
return (isset($_GET["limit"]) ? $_GET["limit"] : "20");
@@ -88,3 +88,67 @@ Different number of records in listing and select choices:
echo "</div></fieldset>\n";
}
````
* Enable Record View beside Edit link:
````
--- adminer/include/functions.inc.php Mon Jan 25 04:02:41 2016
+++ adminer/include/functions.inc.php Tue Feb 02 12:34:43 2016
@@ -864,6 +864,7 @@
}
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$attrs = " name='fields[$name]'";
+ $attrs .= isset($_GET['viewonly']) ? " disabled='true'" : "";
if ($field["type"] == "enum") {
echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
} else {
@@ -1369,20 +1370,22 @@
echo "</table>\n";
}
echo "<p>\n";
- if ($fields) {
- echo "<input type='submit' value='" . lang('Save') . "'>\n";
- if (!isset($_GET["select"])) {
- echo "<input type='submit' name='insert' value='" . ($update
- ? lang('Save and continue edit') . "' onclick='return !ajaxForm(this.form, \"" . lang('Saving') . '...", this)'
- : lang('Save and insert next')
- ) . "' title='Ctrl+Shift+Enter'>\n";
+ if (!isset($_GET['viewonly'])) {
+ if ($fields) {
+ echo "<input type='submit' value='" . lang('Save') . "'>\n";
+ if (!isset($_GET["select"])) {
+ echo "<input type='submit' name='insert' value='" . ($update
+ ? lang('Save and continue edit') . "' onclick='return !ajaxForm(this.form, \"" . lang('Saving') . '...", this)'
+ : lang('Save and insert next')
+ ) . "' title='Ctrl+Shift+Enter'>\n";
+ }
+ }
+ echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n"
+ : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n")
+ );
+ if (isset($_GET["select"])) {
+ hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
}
- }
- echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "'" . confirm() . ">\n"
- : ($_POST || !$fields ? "" : "<script type='text/javascript'>focus(document.getElementById('form').getElementsByTagName('td')[1].firstChild);</script>\n")
- );
- if (isset($_GET["select"])) {
- hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
}
?>
<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
--- adminer/select.inc.php Mon Jan 25 04:02:41 2016
+++ adminer/select.inc.php Tue Feb 02 14:17:32 2016
@@ -366,7 +366,10 @@
}
$unique_idf .= "&" . ($val !== null ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
}
- echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));
+ $edit_link_part = " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>";
+ $view_link_part = " | <a href='" . h(ME . "viewonly=&edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('view') . "</a>";
+
+ echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . ($is_group || information_schema(DB) ? "" : $edit_link_part . $view_link_part));
foreach ($row as $key => $val) {
if (isset($names[$key])) {
````