From def60af6e0d1fde4787ff0b8c6f48bc4a719ec5c Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 25 May 2012 22:38:48 +0530 Subject: [PATCH 01/29] Various coding style improvements --- libraries/common.lib.php | 74 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index db1d425950..f679748de4 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -361,7 +361,7 @@ function PMA_formatSql($parsed_sql, $unparsed_sql = '') return $formatted_sql; } - $formatted_sql = ''; + $formatted_sql = ''; switch ($cfg['SQP']['fmtType']) { case 'none': @@ -683,10 +683,10 @@ function PMA_mysqlDie( // modified to show the help on error-returns // (now error-messages-server) $error_msg .= '

' . "\n" - . ' ' . __('MySQL said: ') . '' - . PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server') - . "\n" - . '

' . "\n"; + . ' ' . __('MySQL said: ') . '' + . PMA_showMySQLDocu('Error-messages-server', 'Error-messages-server') + . "\n" + . '

' . "\n"; // The error message will be displayed within a CODE segment. // To preserve original formatting, but allow wordwrapping, @@ -812,7 +812,8 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $group_name_full = ''; $parts_cnt = count($parts) - 1; while ($i < $parts_cnt - && $i < $GLOBALS['cfg']['LeftFrameTableLevel']) { + && $i < $GLOBALS['cfg']['LeftFrameTableLevel'] + ) { $group_name = $parts[$i] . $sep; $group_name_full .= $group_name; @@ -1332,7 +1333,7 @@ function PMA_getMessage( } return $retval; - + } // end of the 'PMA_getMessage()' function /** @@ -1955,17 +1956,17 @@ function PMA_linkOrButton($url, $message, $tag_params = array(), function PMA_splitURLQuery($url) { // decode encoded url separators - $separator = PMA_get_arg_separator(); + $separator = PMA_get_arg_separator(); // on most places separator is still hard coded ... if ($separator !== '&') { // ... so always replace & with $separator - $url = str_replace(htmlentities('&'), $separator, $url); - $url = str_replace('&', $separator, $url); + $url = str_replace(htmlentities('&'), $separator, $url); + $url = str_replace('&', $separator, $url); } - $url = str_replace(htmlentities($separator), $separator, $url); + $url = str_replace(htmlentities($separator), $separator, $url); // end decode - $url_parts = parse_url($url); + $url_parts = parse_url($url); return explode($separator, $url_parts['query']); } @@ -2626,23 +2627,23 @@ function PMA_getCheckbox($html_field_name, $label, $checked, $onclick) function PMA_getRadioFields($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='' ) { - + $radio_html = ''; - + foreach ($choices as $choice_value => $choice_label) { if (! empty($class)) { $radio_html .= '
'; } $html_field_id = $html_field_name . '_' . $choice_value; $radio_html .= '' - . ($escape_label ? htmlspecialchars($choice_label) : $choice_label) - . ''; + . ''; if ($line_break) { $radio_html .= '
'; } @@ -2651,9 +2652,9 @@ function PMA_getRadioFields($html_field_name, $choices, $checked_choice = '', } $radio_html .= "\n"; } - + return $radio_html; - + } /** @@ -2693,9 +2694,9 @@ function PMA_getDropdown($select_name, $choices, $active_choice, $id) * * @param string $id the id of the
on which to apply the effect * @param string $message the message to show as a link - * + * * @return string html div element - * + * */ function PMA_getDivForSliderEffect($id, $message) { @@ -2710,7 +2711,7 @@ function PMA_getDivForSliderEffect($id, $message) * method maybe by using an additional param, the id of the div to * append to */ - + return '