3.3.6-rc1
[phpmyadmin/dkf.git] / libraries / tbl_triggers.lib.php
blob92ad582733e5e86a537c1aefcef1dd7165cf1e23
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 * @package phpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 $url_query .= '&amp;goto=tbl_structure.php';
14 $triggers = PMA_DBI_get_triggers($db, $table);
16 if ($triggers) {
17 echo '<div id="tabletriggers">' . "\n";
18 echo '<table class="data">' . "\n";
19 echo ' <caption class="tblHeaders">' . $strTriggers . '</caption>' . "\n";
20 echo sprintf('<tr>
21 <th>%s</th>
22 <th>&nbsp;</th>
23 <th>&nbsp;</th>
24 <th>%s</th>
25 <th>%s</th>
26 </tr>',
27 $strName,
28 $strTime,
29 $strEvent);
30 $ct=0;
31 $delimiter = '//';
32 foreach ($triggers as $trigger) {
33 $drop_and_create = $trigger['drop'] . $delimiter . "\n" . $trigger['create'] . "\n";
35 echo sprintf('<tr class="%s">
36 <td><strong>%s</strong></td>
37 <td>%s</td>
38 <td>%s</td>
39 <td>%s</td>
40 <td>%s</td>
41 </tr>',
42 ($ct%2 == 0) ? 'even' : 'odd',
43 $trigger['name'],
44 PMA_linkOrButton('tbl_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($drop_and_create) . '&amp;show_query=1&amp;delimiter=' . urlencode($delimiter), $titles['Change']),
45 '<a href="sql.php?' . $url_query . '&sql_query=' . urlencode($trigger['drop']) . '" onclick="return confirmLink(this, \'' . PMA_jsFormat($trigger['drop'], false) . '\')">' . $titles['Drop'] . '</a>',
46 $trigger['action_timing'],
47 $trigger['event_manipulation']);
48 $ct++;
50 echo '</table>';
51 echo '</div>' . "\n";