Merge remote branch 'origin/master'
[phpmyadmin-themes.git] / libraries / tbl_triggers.lib.php
blob15f07b2af2d3af3c224b72010f513eca13491aa8
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 $url_query .= '&amp;goto=tbl_structure.php';
13 $triggers = PMA_DBI_get_triggers($db, $table);
15 if ($triggers) {
16 echo '<div id="tabletriggers">' . "\n";
17 echo '<table class="data">' . "\n";
18 echo ' <caption class="tblHeaders">' . __('Triggers') . '</caption>' . "\n";
19 echo sprintf('<tr>
20 <th>%s</th>
21 <th>&nbsp;</th>
22 <th>&nbsp;</th>
23 <th>%s</th>
24 <th>%s</th>
25 </tr>',
26 __('Name'),
27 __('Time'),
28 __('Event'));
29 $ct=0;
30 $delimiter = '//';
31 if ($GLOBALS['cfg']['AjaxEnable']) {
32 $conditional_class = 'class="drop_trigger_anchor"';
33 } else {
34 $conditional_class = '';
37 foreach ($triggers as $trigger) {
38 $drop_and_create = $trigger['drop'] . $delimiter . "\n" . $trigger['create'] . "\n";
40 echo sprintf('<tr class="%s">
41 <td><strong>%s</strong></td>
42 <td>%s</td>
43 <td>%s</td>
44 <td>%s</td>
45 <td>%s</td>
46 </tr>',
47 ($ct%2 == 0) ? 'even' : 'odd',
48 $trigger['name'],
49 PMA_linkOrButton('tbl_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($drop_and_create) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Change']),
50 '<a ' . $conditional_class . ' href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" >' . $titles['Drop'] . '</a>',
51 $trigger['action_timing'],
52 $trigger['event_manipulation']);
53 $ct++;
55 echo '</table>';
56 echo '</div>' . "\n";