2 /* vim: set expandtab sw=4 ts=4 sts=4: */
12 require_once './libraries/common.inc.php';
13 require_once './libraries/Table.class.php';
15 $pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
20 require './libraries/tbl_common.php';
21 $url_query .= '&goto=view_operations.php&back=view_operations.php';
22 $url_params['goto'] = $url_params['back'] = 'view_operations.php';
25 * Gets tables informations
28 require './libraries/tbl_info.inc.php';
34 if (isset($_REQUEST['submitoptions'])) {
36 $warning_messages = array();
38 if (isset($_REQUEST['new_name'])) {
39 if ($pma_table->rename($_REQUEST['new_name'], null, $is_view = true)) {
40 $_message .= $pma_table->getLastMessage();
42 $GLOBALS['table'] = $pma_table->getName();
46 $_message .= $pma_table->getLastError();
53 * Displays top menu links
55 require_once './libraries/tbl_links.inc.php';
58 // set to success by default, because result set could be empty
59 // (for example, a table rename)
61 if (empty($_message)) {
62 $_message = $result ?
__('Your SQL query has been executed successfully') : __('Error');
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->isWarning(true);
70 unset($warning_messages);
72 PMA_showMessage($_message, $sql_query, $_type, $is_view = true);
73 unset($_message, $_type);
76 $url_params['goto'] = 'view_operations.php';
77 $url_params['back'] = 'view_operations.php';
83 <!-- Table operations
-->
84 <div id
="div_table_options">
85 <form method
="post" action
="view_operations.php">
86 <?php
echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?
>
87 <input type
="hidden" name
="reload" value
="1" />
89 <legend
><?php
echo __('Operations'); ?
></legend
>
92 <!-- Change view name
-->
93 <tr
><td
><?php
echo __('Rename view to'); ?
></td
>
94 <td
><input type
="text" size
="20" name
="new_name" onfocus
="this.select()"
95 value
="<?php echo htmlspecialchars($GLOBALS['table']); ?>" />
100 <fieldset
class="tblFooters">
101 <input type
="submit" name
="submitoptions" value
="<?php echo __('Go'); ?>" />
108 * Displays the footer
110 require_once './libraries/footer.inc.php';