Translation update done using Pootle.
[phpmyadmin/crack.git] / view_operations.php
blob08c26d6e138fabce8d0336b2fde11ea0e93d910b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
8 /**
11 require_once './libraries/common.inc.php';
12 require_once './libraries/Table.class.php';
14 $pma_table = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
16 /**
17 * Runs common work
19 require './libraries/tbl_common.php';
20 $url_query .= '&amp;goto=view_operations.php&amp;back=view_operations.php';
21 $url_params['goto'] = $url_params['back'] = 'view_operations.php';
23 /**
24 * Gets tables informations
27 require './libraries/tbl_info.inc.php';
28 $reread_info = false;
30 /**
31 * Updates if required
33 if (isset($_REQUEST['submitoptions'])) {
34 $_message = '';
35 $warning_messages = array();
37 if (isset($_REQUEST['new_name'])) {
38 if ($pma_table->rename($_REQUEST['new_name'], null, $is_view = true)) {
39 $_message .= $pma_table->getLastMessage();
40 $result = true;
41 $GLOBALS['table'] = $pma_table->getName();
42 $reread_info = true;
43 $reload = true;
44 } else {
45 $_message .= $pma_table->getLastError();
46 $result = false;
51 /**
52 * Displays top menu links
54 require_once './libraries/tbl_links.inc.php';
56 if (isset($result)) {
57 // set to success by default, because result set could be empty
58 // (for example, a table rename)
59 $_type = 'success';
60 if (empty($_message)) {
61 $_message = $result ? __('Your SQL query has been executed successfully') : __('Error');
62 // $result should exist, regardless of $_message
63 $_type = $result ? 'success' : 'error';
65 if (! empty($warning_messages)) {
66 $_message = new PMA_Message;
67 $_message->addMessages($warning_messages);
68 $_message->isWarning(true);
69 unset($warning_messages);
71 PMA_showMessage($_message, $sql_query, $_type, $is_view = true);
72 unset($_message, $_type);
75 $url_params['goto'] = 'view_operations.php';
76 $url_params['back'] = 'view_operations.php';
78 /**
79 * Displays the page
82 <!-- Table operations -->
83 <div id="div_table_options">
84 <form method="post" action="view_operations.php">
85 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
86 <input type="hidden" name="reload" value="1" />
87 <fieldset>
88 <legend><?php echo __('Operations'); ?></legend>
90 <table>
91 <!-- Change view name -->
92 <tr><td><?php echo __('Rename view to'); ?></td>
93 <td><input type="text" size="20" name="new_name" onfocus="this.select()"
94 value="<?php echo htmlspecialchars($GLOBALS['table']); ?>" />
95 </td>
96 </tr>
97 </table>
98 </fieldset>
99 <fieldset class="tblFooters">
100 <input type="submit" name="submitoptions" value="<?php echo __('Go'); ?>" />
101 </fieldset>
102 </form>
103 </div>
105 <?php
107 * Displays the footer
109 require_once './libraries/footer.inc.php';