2 /* vim: set expandtab sw=4 ts=4 sts=4: */
7 if (! defined('PHPMYADMIN')) {
11 $events = PMA_DBI_fetch_result('SELECT EVENT_NAME, EVENT_TYPE FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';');
14 PMA_generate_slider_effect('events', __('Events'));
15 echo '<fieldset>' . "\n";
16 echo ' <legend>' . __('Events') . '</legend>' . "\n";
17 echo '<table border="0">';
28 if ($GLOBALS['cfg']['AjaxEnable']) {
29 $conditional_class = 'class="drop_event_anchor"';
31 $conditional_class = '';
33 foreach ($events as $event) {
35 // information_schema (at least in MySQL 5.1.22) does not return
36 // the full CREATE EVENT statement in a way that could be useful for us
37 // so we rely on PMA_DBI_get_definition() which uses SHOW CREATE EVENT
39 $definition = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']) . $delimiter . "\n"
40 . PMA_DBI_get_definition($db, 'EVENT', $event['EVENT_NAME'])
43 $sqlDrop = 'DROP EVENT ' . PMA_backquote($event['EVENT_NAME']);
44 echo sprintf('<tr class="%s">
45 <td><strong>%s</strong></td>
50 ($ct%2
== 0) ?
'even' : 'odd',
52 ! empty($definition) ?
PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&db_query_force=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ',
53 '<a ' . $conditional_class . ' href="sql.php?' . $url_query . '&sql_query=' . urlencode($sqlDrop) . '" >' . $titles['Drop'] . '</a>',
54 $event['EVENT_TYPE']);
58 echo '</fieldset>' . "\n";