Translation update done using Pootle.
[phpmyadmin-themes.git] / libraries / db_events.inc.php
blob82ef51f3e1a8e360ca378846c970862f49c778ce
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
7 if (! defined('PHPMYADMIN')) {
8 exit;
11 $events = PMA_DBI_fetch_result('SELECT EVENT_NAME, EVENT_TYPE FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');
13 if ($events) {
14 PMA_generate_slider_effect('events', __('Events'));
15 echo '<fieldset>' . "\n";
16 echo ' <legend>' . __('Events') . '</legend>' . "\n";
17 echo '<table border="0">';
18 echo sprintf('<tr>
19 <th>%s</th>
20 <th>&nbsp;</th>
21 <th>&nbsp;</th>
22 <th>%s</th>
23 </tr>',
24 __('Name'),
25 __('Type'));
26 $ct=0;
27 $delimiter = '//';
28 foreach ($events as $event) {
30 // information_schema (at least in MySQL 5.1.22) does not return
31 // the full CREATE EVENT statement in a way that could be useful for us
32 // so we rely on PMA_DBI_get_definition() which uses SHOW CREATE EVENT
34 $definition = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']) . $delimiter . "\n"
35 . PMA_DBI_get_definition($db, 'EVENT', $event['EVENT_NAME'])
36 . "\n";
38 $sqlDrop = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']);
39 echo sprintf('<tr class="%s">
40 <td><strong>%s</strong></td>
41 <td>%s</td>
42 <td>%s</td>
43 <td>%s</td>
44 </tr>',
45 ($ct%2 == 0) ? 'even' : 'odd',
46 $event['EVENT_NAME'],
47 ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&amp;sql_query=' . urlencode($definition) . '&amp;show_query=1&amp;db_query_force=1&amp;delimiter=' . urlencode($delimiter), $titles['Structure']) : '&nbsp;',
48 '<a class="drop_event_anchor" href="sql.php?' . $url_query . '&amp;sql_query=' . urlencode($sqlDrop) . '" >' . $titles['Drop'] . '</a>',
49 $event['EVENT_TYPE']);
50 $ct++;
52 echo '</table>';
53 echo '</fieldset>' . "\n";
54 echo '</div>' . "\n";