The branch, master has been updated via 13f919da6ad9217e5cc349d2501782fbf7291749 (commit) via ff80c4d7f1aac7086733a1b8d8afe6b3071ce0b8 (commit) via cb377c360c79790aefc2427c363c3ca60900503d (commit) via 95bc3c92aa9d3741110d64986ae0f64f2824bd0d (commit) via fc965daabdb1de08fdb346aef0e7d5030e60c4f3 (commit) from 65e53a8bb8afd76d4779b0d0e536d7ab2690b439 (commit)
- Log ----------------------------------------------------------------- commit 13f919da6ad9217e5cc349d2501782fbf7291749 Author: Michal Čihař mcihar@novell.com Date: Fri Mar 18 14:42:24 2011 +0100
Another replacement of translated strings by fixed ones
commit ff80c4d7f1aac7086733a1b8d8afe6b3071ce0b8 Author: Michal Čihař mcihar@novell.com Date: Fri Mar 18 14:42:07 2011 +0100
Whitespace cleanup
commit cb377c360c79790aefc2427c363c3ca60900503d Author: Michal Čihař mcihar@novell.com Date: Fri Mar 18 14:38:19 2011 +0100
Use non translated string for identification of submited value in table properties
commit 95bc3c92aa9d3741110d64986ae0f64f2824bd0d Author: Michal Čihař mcihar@novell.com Date: Fri Mar 18 14:35:30 2011 +0100
Allow to specify value parameter for PMA_buttonOrImage
commit fc965daabdb1de08fdb346aef0e7d5030e60c4f3 Author: Michal Čihař mcihar@novell.com Date: Fri Mar 18 14:32:36 2011 +0100
Do not pass translated strings as parameter.
This can cause problem for non ascii languages and breaks if user meanwhile switches language.
-----------------------------------------------------------------------
Summary of changes: db_structure.php | 14 +++++----- libraries/common.lib.php | 11 +++++--- libraries/display_tbl.lib.php | 6 ++-- libraries/mult_submits.inc.php | 48 +++++++++++++-------------------------- tbl_row_action.php | 15 +++++------ tbl_structure.php | 14 +++++----- 6 files changed, 47 insertions(+), 61 deletions(-)
diff --git a/db_structure.php b/db_structure.php index dcce45b..03a31be 100644 --- a/db_structure.php +++ b/db_structure.php @@ -499,23 +499,23 @@ $checkall_url = 'db_structure.php?' . PMA_generate_common_url($db); <?php echo ' <option value="' . __('With selected:') . '" selected="selected">' . __('With selected:') . '</option>' . "\n"; -echo ' <option value="' . __('Export') . '" >' +echo ' <option value="export" >' . __('Export') . '</option>' . "\n"; echo ' <option value="' . __('Print view') . '" >' . __('Print view') . '</option>' . "\n";
if (!$db_is_information_schema) { - echo ' <option value="' . __('Empty') . '" >' + echo ' <option value="empty_tbl" >' . __('Empty') . '</option>' . "\n"; - echo ' <option value="' . __('Drop') . '" >' + echo ' <option value="drop_tbl" >' . __('Drop') . '</option>' . "\n"; - echo ' <option value="' . __('Check table') . '" >' + echo ' <option value="check_tbl" >' . __('Check table') . '</option>' . "\n"; - echo ' <option value="' . __('Optimize table') . '" >' + echo ' <option value="optimize_tbl" >' . __('Optimize table') . '</option>' . "\n"; - echo ' <option value="' . __('Repair table') . '" >' + echo ' <option value="repair_tbl" >' . __('Repair table') . '</option>' . "\n"; - echo ' <option value="' . __('Analyze table') . '" >' + echo ' <option value="analyze_tbl" >' . __('Analyze table') . '</option>' . "\n"; } ?> diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 2b7f738..7451df4 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2180,11 +2180,14 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force * @access public */ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, - $image) + $image, $value = '') { + if ($value == '') { + $value = $text; + } if (false === $GLOBALS['cfg']['PropertiesIconic']) { echo ' <input type="submit" name="' . $button_name . '"' - .' value="' . htmlspecialchars($text) . '"' + .' value="' . htmlspecialchars($value) . '"' .' title="' . htmlspecialchars($text) . '" />' . "\n"; return; } @@ -2193,13 +2196,13 @@ function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, /* IE has trouble with <button> */ if (PMA_USR_BROWSER_AGENT != 'IE') { echo '<button class="' . $button_class . '" type="submit"' - .' name="' . $button_name . '" value="' . htmlspecialchars($text) . '"' + .' name="' . $button_name . '" value="' . htmlspecialchars($value) . '"' .' title="' . htmlspecialchars($text) . '">' . "\n" . PMA_getIcon($image, $text) .'</button>' . "\n"; } else { echo '<input type="image" name="' . $image_name . '" value="' - . htmlspecialchars($text) . '" title="' . htmlspecialchars($text) . '" src="' . $GLOBALS['pmaThemeImage'] + . htmlspecialchars($value) . '" title="' . htmlspecialchars($text) . '" src="' . $GLOBALS['pmaThemeImage'] . $image . '" />' . ($GLOBALS['cfg']['PropertiesIconic'] === 'both' ? ' ' . htmlspecialchars($text) : '') . "\n"; } diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index ef9e397..9c98f61 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -2161,13 +2161,13 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) .'<i>' . __('With selected:') . '</i>' . "\n";
PMA_buttonOrImage('submit_mult', 'mult_submit', - 'submit_mult_change', __('Change'), 'b_edit.png'); + 'submit_mult_change', __('Change'), 'b_edit.png', 'edit'); PMA_buttonOrImage('submit_mult', 'mult_submit', - 'submit_mult_delete', $delete_text, 'b_drop.png'); + 'submit_mult_delete', $delete_text, 'b_drop.png', 'delete'); if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') { PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_export', __('Export'), - 'b_tblexport.png'); + 'b_tblexport.png', 'export'); } echo "\n";
diff --git a/libraries/mult_submits.inc.php b/libraries/mult_submits.inc.php index e473192..e566576 100644 --- a/libraries/mult_submits.inc.php +++ b/libraries/mult_submits.inc.php @@ -30,35 +30,19 @@ if (! empty($submit_mult) $selected = $selected_tbl; switch ($submit_mult) { case 'drop_db': - $what = 'drop_db'; + case 'drop_tbl': + case 'empty_tbl': + $what = $submit_mult; break; - case __('Drop'): - $what = 'drop_tbl'; - break; - case __('Empty'): - $what = 'empty_tbl'; - break; - case __('Check table'): - unset($submit_mult); - $query_type = 'check_tbl'; - $mult_btn = __('Yes'); - break; - case __('Optimize table'): - unset($submit_mult); - $query_type = 'optimize_tbl'; - $mult_btn = __('Yes'); - break; - case __('Repair table'): - unset($submit_mult); - $query_type = 'repair_tbl'; - $mult_btn = __('Yes'); - break; - case __('Analyze table'): + case 'check_tbl': + case 'optimize_tbl': + case 'repair_tbl': + case 'analyze_tbl': + $query_type = $submit_mult; unset($submit_mult); - $query_type = 'analyze_tbl'; $mult_btn = __('Yes'); break; - case __('Export'): + case 'export': unset($submit_mult); require('db_export.php'); exit; @@ -69,10 +53,10 @@ if (! empty($submit_mult) // coming from table structure view - do something with selected columns/fileds $selected = $selected_fld; switch ($submit_mult) { - case __('Drop'): + case 'drop': $what = 'drop_fld'; break; - case __('Primary'): + case 'primary': // Gets table primary key PMA_DBI_select_db($db); $result = PMA_DBI_query('SHOW KEYS FROM ' . PMA_backquote($table) . ';'); @@ -94,25 +78,25 @@ if (! empty($submit_mult) $what = 'primary_fld'; } break; - case __('Index'): + case 'index': unset($submit_mult); $query_type = 'index_fld'; $mult_btn = __('Yes'); break; - case __('Unique'): + case 'unique': unset($submit_mult); $query_type = 'unique_fld'; $mult_btn = __('Yes'); break; - case __('Fulltext'): + case 'ftext': unset($submit_mult); $query_type = 'fulltext_fld'; $mult_btn = __('Yes'); break; - case __('Change'): + case 'change': require './tbl_alter.php'; break; - case __('Browse'): + case 'browse': // this should already be handled by tbl_structure.php } } else { diff --git a/tbl_row_action.php b/tbl_row_action.php index d44e808..e5217bf 100644 --- a/tbl_row_action.php +++ b/tbl_row_action.php @@ -55,17 +55,16 @@ switch($submit_mult) { // leave as is break;
- case __('Export'): + case 'export': $submit_mult = 'row_export'; break;
- case __('Delete'): - case __('Kill'): + case 'delete': $submit_mult = 'row_delete'; break;
default: - case __('Edit'): + case 'edit': $submit_mult = 'row_edit'; break; } @@ -77,9 +76,9 @@ require_once './libraries/header.inc.php'; if (!empty($submit_mult)) { switch($submit_mult) { case 'row_edit': - // As we got the fields to be edited from the + // As we got the fields to be edited from the // 'rows_to_delete' checkbox, we use the index of it as the - // indicating WHERE clause. Then we build the array which is used + // indicating WHERE clause. Then we build the array which is used // for the tbl_change.php script. $where_clause = array(); foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) { @@ -94,9 +93,9 @@ if (!empty($submit_mult)) { // Needed to allow SQL export $single_table = TRUE;
- // As we got the fields to be edited from the + // As we got the fields to be edited from the // 'rows_to_delete' checkbox, we use the index of it as the - // indicating WHERE clause. Then we build the array which is used + // indicating WHERE clause. Then we build the array which is used // for the tbl_change.php script. $where_clause = array(); foreach ($_REQUEST['rows_to_delete'] as $i_where_clause => $del_query) { diff --git a/tbl_structure.php b/tbl_structure.php index cd5b9be..18eedee 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -554,19 +554,19 @@ $checkall_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table); <i><?php echo __('With selected:'); ?></i>
<?php -PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', __('Browse'), 'b_browse.png'); +PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', __('Browse'), 'b_browse.png', 'browse');
if (! $tbl_is_view && ! $db_is_information_schema) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', __('Change'), 'b_edit.png'); - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', __('Drop'), 'b_drop.png'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', __('Change'), 'b_edit.png', 'change'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', __('Drop'), 'b_drop.png', 'drop'); if ('ARCHIVE' != $tbl_type) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', __('Primary'), 'b_primary.png'); - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', __('Unique'), 'b_unique.png'); - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', __('Index'), 'b_index.png'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', __('Primary'), 'b_primary.png', 'primary'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', __('Unique'), 'b_unique.png', 'unique'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', __('Index'), 'b_index.png', 'index'); }
if (! empty($tbl_type) && ($tbl_type == 'MYISAM' || $tbl_type == 'ARIA' || $tbl_type == 'MARIA')) { - PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', __('Fulltext'), 'b_ftext.png'); + PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', __('Fulltext'), 'b_ftext.png', 'ftext'); } } ?>
hooks/post-receive