diff --git a/libraries/rte/rte_events.lib.php b/libraries/rte/rte_events.lib.php
index e3122f4e19..b23fe662f8 100644
--- a/libraries/rte/rte_events.lib.php
+++ b/libraries/rte/rte_events.lib.php
@@ -102,30 +102,47 @@ function PMA_EVN_handleEditor()
'EVENT',
$_REQUEST['item_original_name']
);
- $drop_item = "DROP EVENT " . PMA_Util::backquote($_REQUEST['item_original_name']) . ";\n";
+ $drop_item = "DROP EVENT "
+ . PMA_Util::backquote($_REQUEST['item_original_name']) . ";\n";
$result = PMA_DBI_try_query($drop_item);
if (! $result) {
- $errors[] = sprintf(__('The following query has failed: "%s"'), $drop_item) . '
'
- . __('MySQL said: ') . PMA_DBI_getError(null);
+ $errors[] = sprintf(
+ __('The following query has failed: "%s"'),
+ $drop_item
+ )
+ . '
'
+ . __('MySQL said: ') . PMA_DBI_getError(null);
} else {
$result = PMA_DBI_try_query($item_query);
if (! $result) {
- $errors[] = sprintf(__('The following query has failed: "%s"'), $item_query) . '
'
- . __('MySQL said: ') . PMA_DBI_getError(null);
- // We dropped the old item, but were unable to create the new one
+ $errors[] = sprintf(
+ __('The following query has failed: "%s"'),
+ $item_query
+ )
+ . '
'
+ . __('MySQL said: ') . PMA_DBI_getError(null);
+ // We dropped the old item,
+ // but were unable to create the new one
// Try to restore the backup query
$result = PMA_DBI_try_query($create_item);
if (! $result) {
- // OMG, this is really bad! We dropped the query, failed to create a new one
- // and now even the backup query does not execute!
- // This should not happen, but we better handle this just in case.
- $errors[] = __('Sorry, we failed to restore the dropped event.') . '
'
- . __('The backed up query was:') . "\"$create_item\"" . '
'
- . __('MySQL said: ') . PMA_DBI_getError(null);
+ // OMG, this is really bad! We dropped the query,
+ // failed to create a new one and now even the backup
+ // query does not execute! This should not happen,
+ // but we better handle this just in case.
+ $errors[] = __('Sorry, we failed to restore the dropped event.')
+ . '
'
+ . __('The backed up query was:') . "\"$create_item\""
+ . '
'
+ . __('MySQL said: ') . PMA_DBI_getError(null);
}
} else {
- $message = PMA_Message::success(__('Event %1$s has been modified.'));
- $message->addParam(PMA_Util::backquote($_REQUEST['item_name']));
+ $message = PMA_Message::success(
+ __('Event %1$s has been modified.')
+ );
+ $message->addParam(
+ PMA_Util::backquote($_REQUEST['item_name'])
+ );
$sql_query = $drop_item . $item_query;
}
}
@@ -133,11 +150,19 @@ function PMA_EVN_handleEditor()
// 'Add a new item' mode
$result = PMA_DBI_try_query($item_query);
if (! $result) {
- $errors[] = sprintf(__('The following query has failed: "%s"'), $item_query) . '
'
- . __('MySQL said: ') . PMA_DBI_getError(null);
+ $errors[] = sprintf(
+ __('The following query has failed: "%s"'),
+ $item_query
+ )
+ . '
'
+ . __('MySQL said: ') . PMA_DBI_getError(null);
} else {
- $message = PMA_Message::success(__('Event %1$s has been created.'));
- $message->addParam(PMA_Util::backquote($_REQUEST['item_name']));
+ $message = PMA_Message::success(
+ __('Event %1$s has been created.')
+ );
+ $message->addParam(
+ PMA_Util::backquote($_REQUEST['item_name'])
+ );
$sql_query = $item_query;
}
}
@@ -158,10 +183,15 @@ function PMA_EVN_handleEditor()
if ($message->isSuccess()) {
$columns = "`EVENT_NAME`, `EVENT_TYPE`, `STATUS`";
$where = "EVENT_SCHEMA='" . PMA_Util::sqlAddSlashes($db) . "' "
- . "AND EVENT_NAME='" . PMA_Util::sqlAddSlashes($_REQUEST['item_name']) . "'";
- $query = "SELECT $columns FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE $where;";
+ . "AND EVENT_NAME='"
+ . PMA_Util::sqlAddSlashes($_REQUEST['item_name']) . "'";
+ $query = "SELECT " . $columns
+ . " FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE " . $where. ";";
$event = PMA_DBI_fetch_single_row($query);
- $response->addJSON('name', htmlspecialchars(strtoupper($_REQUEST['item_name'])));
+ $response->addJSON(
+ 'name',
+ htmlspecialchars(strtoupper($_REQUEST['item_name']))
+ );
$response->addJSON('new_row', PMA_EVN_getRowForList($event));
$response->addJSON('insert', ! empty($event));
$response->addJSON('message', $output);
@@ -175,8 +205,11 @@ function PMA_EVN_handleEditor()
/**
* Display a form used to add/edit a trigger, if necessary
*/
- if (count($errors) || ( empty($_REQUEST['editor_process_add']) && empty($_REQUEST['editor_process_edit'])
- && (! empty($_REQUEST['add_item']) || ! empty($_REQUEST['edit_item'])
+ if (count($errors)
+ || (empty($_REQUEST['editor_process_add'])
+ && empty($_REQUEST['editor_process_edit'])
+ && (! empty($_REQUEST['add_item'])
+ || ! empty($_REQUEST['edit_item'])
|| ! empty($_REQUEST['item_changetype'])))
) { // FIXME: this must be simpler than that
$operation = '';
@@ -417,7 +450,8 @@ function PMA_EVN_getEditorForm($mode, $operation, $item)
} else {
$retval .= " \n";
$retval .= " {$item['item_type']}\n";
$retval .= " \n";
$retval .= " \n";
+ $retval .= "