Conditional Ajax for db Structure and Tracking
[phpmyadmin-themes.git] / libraries / tbl_triggers.lib.php
blob43ba18e15dd0a795b759c6bca59f41333c82b743
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 foreach ($triggers as $trigger) {
32 $drop_and_create = $trigger['drop'] . $delimiter . "\n" . $trigger['create'] . "\n";
34 echo sprintf('<tr class="%s">
35 <td><strong>%s</strong></td>
36 <td>%s</td>
37 <td>%s</td>
38 <td>%s</td>
39 <td>%s</td>
40 </tr>',
41 ($ct%2 == 0) ? 'even' : 'odd',
42 $trigger['name'],
43 PMA_linkOrButton('tbl_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($drop_and_create) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Change']),
44 '<a class="drop_trigger_anchor" href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" >' . $titles['Drop'] . '</a>',
45 $trigger['action_timing'],
46 $trigger['event_manipulation']);
47 $ct++;
49 echo '</table>';
50 echo '</div>' . "\n";