2 /* vim: set expandtab sw=4 ts=4 sts=4: */
11 require_once './libraries/common.inc.php';
13 $pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
16 * functions implementation for this script
18 require_once 'libraries/operations.lib.php';
23 require './libraries/tbl_common.inc.php';
24 $url_query .= '&goto=view_operations.php&back=view_operations.php';
25 $url_params['goto'] = $url_params['back'] = 'view_operations.php';
28 * Gets tables informations
31 require './libraries/tbl_info.inc.php';
37 if (isset($_REQUEST['submitoptions'])) {
39 $warning_messages = array();
41 if (isset($_REQUEST['new_name'])) {
42 if ($pma_table->rename($_REQUEST['new_name'])) {
43 $_message .= $pma_table->getLastMessage();
45 $GLOBALS['table'] = $pma_table->getName();
49 $_message .= $pma_table->getLastError();
56 // set to success by default, because result set could be empty
57 // (for example, a table rename)
59 if (empty($_message)) {
61 ?
__('Your SQL query has been executed successfully')
63 // $result should exist, regardless of $_message
64 $_type = $result ?
'success' : 'error';
66 if (! empty($warning_messages)) {
67 $_message = new PMA_Message
;
68 $_message->addMessages($warning_messages);
69 $_message->isError(true);
70 unset($warning_messages);
72 echo PMA_Util
::getMessage(
73 $_message, $sql_query, $_type, $is_view = true
75 unset($_message, $_type);
78 $url_params['goto'] = 'view_operations.php';
79 $url_params['back'] = 'view_operations.php';
85 <!-- Table operations
-->
86 <div
class="operations_half_width">
87 <form method
="post" action
="view_operations.php">
88 <?php
echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?
>
89 <input type
="hidden" name
="reload" value
="1" />
91 <legend
><?php
echo __('Operations'); ?
></legend
>
94 <!-- Change view name
-->
95 <tr
><td
><?php
echo __('Rename view to'); ?
></td
>
96 <td
><input type
="text" size
="20" name
="new_name" onfocus
="this.select()"
97 value
="<?php echo htmlspecialchars($GLOBALS['table']); ?>" />
102 <fieldset
class="tblFooters">
103 <input type
="hidden" name
="submitoptions" value
="1" />
104 <input type
="submit" value
="<?php echo __('Go'); ?>" />
109 $drop_view_url_params = array_merge(
112 'sql_query' => 'DROP VIEW ' . PMA_Util
::backquote($GLOBALS['table']),
113 'goto' => 'tbl_structure.php',
116 'message_to_show' => sprintf(
117 __('View %s has been dropped'),
118 htmlspecialchars($GLOBALS['table'])
120 'table' => $GLOBALS['table']
123 echo '<div class="operations_half_width">';
124 echo '<fieldset class="caution">';
125 echo '<legend>' . __('Delete data or table') . '</legend>';
128 echo PMA_getDeleteDataOrTableLink(
129 $drop_view_url_params,
131 __('Delete the view (DROP)'),