1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 16:44:17 +02:00

Support triggers on views

This commit is contained in:
Jakub Vrana
2013-12-20 16:30:22 -08:00
parent 7d330a2d4b
commit 64af68a30b
6 changed files with 17 additions and 16 deletions

View File

@@ -71,18 +71,18 @@ if ($fields) {
echo '<p class="links"><a href="' . h(ME) . 'foreign=' . urlencode($TABLE) . '">' . lang('Add foreign key') . "</a>\n";
}
if (support("trigger")) {
echo "<h3 id='triggers'>" . lang('Triggers') . "</h3>\n";
$triggers = triggers($TABLE);
if ($triggers) {
echo "<table cellspacing='0'>\n";
foreach ($triggers as $key => $val) {
echo "<tr valign='top'><td>$val[0]<td>$val[1]<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
}
echo "</table>\n";
}
if (support(is_view($table_status) ? "view_trigger" : "trigger")) {
echo "<h3 id='triggers'>" . lang('Triggers') . "</h3>\n";
$triggers = triggers($TABLE);
if ($triggers) {
echo "<table cellspacing='0'>\n";
foreach ($triggers as $key => $val) {
echo "<tr valign='top'><td>$val[0]<td>$val[1]<th>" . h($key) . "<td><a href='" . h(ME . 'trigger=' . urlencode($TABLE) . '&name=' . urlencode($key)) . "'>" . lang('Alter') . "</a>\n";
}
echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
echo "</table>\n";
}
echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
}
}