2 /* vim: set expandtab sw=4 ts=4 sts=4: */
8 use PMA\libraries\Table
;
13 require_once './libraries/common.inc.php';
15 $pma_table = new Table($GLOBALS['table'], $GLOBALS['db']);
18 * functions implementation for this script
20 require_once 'libraries/operations.lib.php';
25 require './libraries/tbl_common.inc.php';
26 $url_query .= '&goto=view_operations.php&back=view_operations.php';
27 $url_params['goto'] = $url_params['back'] = 'view_operations.php';
30 * Gets tables information
33 require './libraries/tbl_info.inc.php';
39 if (isset($_REQUEST['submitoptions'])) {
41 $warning_messages = array();
43 if (isset($_REQUEST['new_name'])) {
44 if ($pma_table->rename($_REQUEST['new_name'])) {
45 $_message .= $pma_table->getLastMessage();
47 $GLOBALS['table'] = $pma_table->getName();
51 $_message .= $pma_table->getLastError();
58 // set to success by default, because result set could be empty
59 // (for example, a table rename)
61 if (empty($_message)) {
63 ?
__('Your SQL query has been executed successfully.')
65 // $result should exist, regardless of $_message
66 $_type = $result ?
'success' : 'error';
68 if (! empty($warning_messages)) {
69 $_message = new PMA\libraries\Message
;
70 $_message->addMessages($warning_messages);
71 $_message->isError(true);
72 unset($warning_messages);
74 echo PMA\libraries\Util
::getMessage(
75 $_message, $sql_query, $_type
77 unset($_message, $_type);
80 $url_params['goto'] = 'view_operations.php';
81 $url_params['back'] = 'view_operations.php';
87 <!-- Table operations
-->
88 <div
class="operations_half_width">
89 <form method
="post" action
="view_operations.php">
90 <?php
echo PMA_URL_getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); ?
>
91 <input type
="hidden" name
="reload" value
="1" />
93 <legend
><?php
echo __('Operations'); ?
></legend
>
96 <!-- Change view name
-->
97 <tr
><td
><?php
echo __('Rename view to'); ?
></td
>
98 <td
><input type
="text" size
="20" name
="new_name" onfocus
="this.select()"
99 value
="<?php echo htmlspecialchars($GLOBALS['table']); ?>"
105 <fieldset
class="tblFooters">
106 <input type
="hidden" name
="submitoptions" value
="1" />
107 <input type
="submit" value
="<?php echo __('Go'); ?>" />
112 $drop_view_url_params = array_merge(
115 'sql_query' => 'DROP VIEW ' . PMA\libraries\Util
::backquote(
118 'goto' => 'tbl_structure.php',
121 'message_to_show' => sprintf(
122 __('View %s has been dropped.'),
123 htmlspecialchars($GLOBALS['table'])
125 'table' => $GLOBALS['table']
128 echo '<div class="operations_half_width">';
129 echo '<fieldset class="caution">';
130 echo '<legend>' , __('Delete data or table') , '</legend>';
133 echo PMA_getDeleteDataOrTableLink(
134 $drop_view_url_params,
136 __('Delete the view (DROP)'),