mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 17:44:07 +02:00
Highlight current link
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1251 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -68,20 +68,22 @@ class Adminer {
|
|||||||
|
|
||||||
/** Print links after select heading
|
/** Print links after select heading
|
||||||
* @param array result of SHOW TABLE STATUS
|
* @param array result of SHOW TABLE STATUS
|
||||||
* @param strin new item options, NULL for no new item
|
* @param string new item options, NULL for no new item
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function selectLinks($tableStatus, $set = "") {
|
function selectLinks($tableStatus, $set = "") {
|
||||||
$TABLE = $tableStatus["Name"];
|
echo '<p class="tabs">';
|
||||||
echo '<p class="tabs"><a href="' . h(ME) . 'select=' . urlencode($TABLE) . '">' . lang('Select table') . '</a>';
|
$links = array("select" => lang('Select table'), "table" => lang('Table structure'));
|
||||||
echo ' <a href="' . h(ME) . 'table=' . urlencode($TABLE) . '">' . lang('Table structure') . '</a>';
|
|
||||||
if (isset($tableStatus["Rows"])) {
|
if (isset($tableStatus["Rows"])) {
|
||||||
echo ' <a href="' . h(ME) . 'create=' . urlencode($TABLE) . '">' . lang('Alter table') . '</a>';
|
$links["create"] = lang('Alter table');
|
||||||
} else {
|
} else {
|
||||||
echo ' <a href="' . h(ME) . 'view=' . urlencode($TABLE) . '">' . lang('Alter view') . '</a>';
|
$links["view"] = lang('Alter view');
|
||||||
}
|
}
|
||||||
if (isset($set)) {
|
if (isset($set)) {
|
||||||
echo ' <a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . '</a>';
|
$links["edit"] = lang('New item');
|
||||||
|
}
|
||||||
|
foreach ($links as $key => $val) {
|
||||||
|
echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'>" . (isset($_GET[$key]) ? "<b>$val</b>" : $val) . "</a>";
|
||||||
}
|
}
|
||||||
echo "\n";
|
echo "\n";
|
||||||
}
|
}
|
||||||
|
@@ -5,10 +5,9 @@ if (!$fields) {
|
|||||||
$error = h($connection->error);
|
$error = h($connection->error);
|
||||||
}
|
}
|
||||||
$table_status = ($fields ? table_status($TABLE) : array());
|
$table_status = ($fields ? table_status($TABLE) : array());
|
||||||
$is_view = !isset($table_status["Rows"]);
|
|
||||||
|
|
||||||
page_header(($fields && $is_view ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
|
page_header(($fields && !isset($table_status["Rows"]) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
|
||||||
$adminer->selectLinks($table_status, $is_view ? null : "");
|
$adminer->selectLinks($table_status);
|
||||||
|
|
||||||
if ($fields) {
|
if ($fields) {
|
||||||
echo "<table cellspacing='0'>\n";
|
echo "<table cellspacing='0'>\n";
|
||||||
|
Reference in New Issue
Block a user