Translation update done using Pootle.
[phpmyadmin/crack.git] / tbl_row_action.php
blob356ad57d94a9773df5648aeb4d62b5e72729502d
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * handle row specifc actions like edit, delete, export
6 * @package phpMyAdmin
7 */
10 /**
11 * do not globalize/import request variables
12 * can only be enabled if all included files are switched superglobals too
13 * but leave this here to show that this file is 'superglobalized'
14 define('PMA_NO_VARIABLES_IMPORT', true);
17 /**
20 require_once './libraries/common.inc.php';
21 require_once './libraries/mysql_charsets.lib.php';
23 /**
24 * No rows were selected => show again the query and tell that user.
26 if (! PMA_isValid($_REQUEST['rows_to_delete'], 'array')
27 && ! isset($_REQUEST['mult_btn'])) {
28 $disp_message = __('No rows selected');
29 $disp_query = '';
30 require './sql.php';
31 require_once './libraries/footer.inc.php';
34 if (isset($_REQUEST['submit_mult'])) {
35 $submit_mult = $_REQUEST['submit_mult'];
36 // workaround for IE problem:
37 } elseif (isset($_REQUEST['submit_mult_delete_x'])) {
38 $submit_mult = 'row_delete';
39 } elseif (isset($_REQUEST['submit_mult_change_x'])) {
40 $submit_mult = 'row_edit';
41 } elseif (isset($_REQUEST['submit_mult_export_x'])) {
42 $submit_mult = 'row_export';
45 // If the 'Ask for confirmation' button was pressed, this can only come
46 // from 'delete' mode, so we set it straight away.
47 if (isset($_REQUEST['mult_btn'])) {
48 $submit_mult = 'row_delete';
51 switch($submit_mult) {
52 case 'row_delete':
53 case 'row_edit':
54 case 'row_export':
55 // leave as is
56 break;
58 case __('Export'):
59 $submit_mult = 'row_export';
60 break;
62 case __('Delete'):
63 case __('Kill'):
64 $submit_mult = 'row_delete';
65 break;
67 default:
68 case __('Edit'):
69 $submit_mult = 'row_edit';
70 break;
73 $GLOBALS['js_include'][] = 'tbl_change.js';
74 $GLOBALS['js_include'][] = 'functions.js';
76 require_once './libraries/header.inc.php';
78 if (!empty($submit_mult)) {
79 switch($submit_mult) {
80 case 'row_edit':
81 // As we got the fields to be edited from the
82 // 'rows_to_delete' checkbox, we use the index of it as the
83 // indicating WHERE clause. Then we build the array which is used
84 // for the tbl_change.php script.
85 $where_clause = array();
86 foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
87 $where_clause[] = urldecode($i_where_clause);
90 $active_page = 'tbl_change.php';
91 include './tbl_change.php';
92 break;
94 case 'row_export':
95 // Needed to allow SQL export
96 $single_table = TRUE;
98 // As we got the fields to be edited from the
99 // 'rows_to_delete' checkbox, we use the index of it as the
100 // indicating WHERE clause. Then we build the array which is used
101 // for the tbl_change.php script.
102 $where_clause = array();
103 foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) {
104 $where_clause[] = urldecode($i_where_clause);
107 $active_page = 'tbl_export.php';
108 include './tbl_export.php';
109 break;
111 case 'row_delete':
112 default:
113 $action = 'tbl_row_action.php';
114 $err_url = 'tbl_row_action.php' . PMA_generate_common_url($GLOBALS['url_params']);
115 if (! isset($_REQUEST['mult_btn'])) {
116 $original_sql_query = $sql_query;
117 $original_url_query = $url_query;
119 require './libraries/mult_submits.inc.php';
120 $_url_params = $GLOBALS['url_params'];
121 $_url_params['goto'] = 'tbl_sql.php';
122 $url_query = PMA_generate_common_url($_url_params);
126 * Show result of multi submit operation
128 // sql_query is not set when user does not confirm multi-delete
129 if ((!empty($submit_mult) || isset($_REQUEST['mult_btn'])) && ! empty($sql_query)) {
130 $disp_message = __('Your SQL query has been executed successfully');
131 $disp_query = $sql_query;
134 if (isset($original_sql_query)) {
135 $sql_query = $original_sql_query;
138 if (isset($original_url_query)) {
139 $url_query = $original_url_query;
142 // this is because sql.php could call tbl_structure
143 // which would think it needs to call mult_submits.inc.php:
144 unset($submit_mult, $_REQUEST['mult_btn']);
146 $active_page = 'sql.php';
147 require './sql.php';
150 * Displays the footer
152 require_once './libraries/footer.inc.php';
153 break;