2 /* vim: set expandtab sw=4 ts=4 sts=4: */
12 require_once './libraries/common.inc.php';
14 $pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
17 * functions implementation for this script
19 require_once 'libraries/operations.lib.php';
24 require './libraries/tbl_common.inc.php';
25 $url_query .= '&goto=view_operations.php&back=view_operations.php';
26 $url_params['goto'] = $url_params['back'] = 'view_operations.php';
29 * Gets tables informations
32 require './libraries/tbl_info.inc.php';
38 if (isset($_REQUEST['submitoptions'])) {
40 $warning_messages = array();
42 if (isset($_REQUEST['new_name'])) {
43 if ($pma_table->rename($_REQUEST['new_name'])) {
44 $_message .= $pma_table->getLastMessage();
46 $GLOBALS['table'] = $pma_table->getName();
50 $_message .= $pma_table->getLastError();
57 // set to success by default, because result set could be empty
58 // (for example, a table rename)
60 if (empty($_message)) {
62 ?
__('Your SQL query has been executed successfully.')
64 // $result should exist, regardless of $_message
65 $_type = $result ?
'success' : 'error';
67 if (! empty($warning_messages)) {
68 $_message = new PMA_Message
;
69 $_message->addMessages($warning_messages);
70 $_message->isError(true);
71 unset($warning_messages);
73 echo PMA_Util
::getMessage(
74 $_message, $sql_query, $_type, $is_view = true
76 unset($_message, $_type);
79 $url_params['goto'] = 'view_operations.php';
80 $url_params['back'] = 'view_operations.php';
86 <!-- Table operations
-->
87 <div
class="operations_half_width">
88 <form method
="post" action
="view_operations.php">
89 <?php
echo PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); ?
>
90 <input type
="hidden" name
="reload" value
="1" />
92 <legend
><?php
echo __('Operations'); ?
></legend
>
95 <!-- Change view name
-->
96 <tr
><td
><?php
echo __('Rename view to'); ?
></td
>
97 <td
><input type
="text" size
="20" name
="new_name" onfocus
="this.select()"
98 value
="<?php echo htmlspecialchars($GLOBALS['table']); ?>"
104 <fieldset
class="tblFooters">
105 <input type
="hidden" name
="submitoptions" value
="1" />
106 <input type
="submit" value
="<?php echo __('Go'); ?>" />
111 $drop_view_url_params = array_merge(
114 'sql_query' => 'DROP VIEW ' . PMA_Util
::backquote($GLOBALS['table']),
115 'goto' => 'tbl_structure.php',
118 'message_to_show' => sprintf(
119 __('View %s has been dropped.'),
120 htmlspecialchars($GLOBALS['table'])
122 'table' => $GLOBALS['table']
125 echo '<div class="operations_half_width">';
126 echo '<fieldset class="caution">';
127 echo '<legend>' . __('Delete data or table') . '</legend>';
130 echo PMA_getDeleteDataOrTableLink(
131 $drop_view_url_params,
133 __('Delete the view (DROP)'),