From dc7a308e690ef0994b16014b636f45b584b56520 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 3 Jul 2012 23:31:07 +0530 Subject: [PATCH 01/82] Break _getTableHeaders function in PMA_DisplayResults class, to sub functions --- libraries/DisplayResults.class.php | 318 +++++++++++++++++------------ 1 file changed, 191 insertions(+), 127 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 3ecc853ef1..83fa65e523 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -788,36 +788,13 @@ class PMA_DisplayResults // can the result be sorted? if ($is_display['sort_lnk'] == '1') { - // Just as fallback - $unsorted_sql_query = $this->_sql_query; - if (isset($analyzed_sql[0]['unsorted_query'])) { - $unsorted_sql_query = $analyzed_sql[0]['unsorted_query']; - } - // Handles the case of multiple clicks on a column's header - // which would add many spaces before "ORDER BY" in the - // generated query. - $unsorted_sql_query = trim($unsorted_sql_query); - - // sorting by indexes, only if it makes sense (only one table ref) - if (isset($analyzed_sql) - && isset($analyzed_sql[0]) - && isset($analyzed_sql[0]['querytype']) - && ($analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) - && isset($analyzed_sql[0]['table_ref']) - && (count($analyzed_sql[0]['table_ref']) == 1) - ) { - - // grab indexes data: - $indexes = PMA_Index::getFromTable($this->_table, $this->_db); - - // do we have any index? - if ($indexes) { - $table_headers_html .= $this->_getSortByKeyDropDown( - $indexes, $sort_expression, - $unsorted_sql_query - ); - } - } + list($unsorted_sql_query, $drop_down_html) + = $this->_getUnsortedSqlAndSortByKeyDropDown( + $analyzed_sql, $sort_expression + ); + + $table_headers_html .= $drop_down_html; + } // Output data needed for grid editing @@ -850,103 +827,13 @@ class PMA_DisplayResults $is_display['del_lnk'] ); - // 1. Displays the full/partial text button (part 1)... - if ($directionCondition) { - - $table_headers_html .= '' . "\n"; - - $colspan = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) - ? ' colspan="4"' - : ''; - - } else { - $rowspan = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) - ? ' rowspan="4"' - : ''; - } - - // ... before the result table - if ((($is_display['edit_lnk'] == self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] == self::NO_EDIT_OR_DELETE)) - && ($is_display['text_btn'] == '1') - ) { - - $GLOBALS['vertical_display']['emptypre'] - = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; - - if ($directionCondition) { - - $table_headers_html .= '' - . '' - . ''; - - // end horizontal/horizontalflipped mode - } else { - - $span = $GLOBALS['num_rows'] + 1 + floor( - $GLOBALS['num_rows'] - / $_SESSION['tmp_user_values']['repeat_cells'] - ); - $table_headers_html .= ''; - - } // end vertical mode - - } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) - || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && ($is_display['text_btn'] == '1') - ) { - // ... at the left column of the result table header if possible - // and required - - $GLOBALS['vertical_display']['emptypre'] - = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; - - if ($directionCondition) { - - $table_headers_html .= '' - . $full_or_partial_text_link . ''; - // end horizontal/horizontalflipped mode - - } else { - - $GLOBALS['vertical_display']['textbtn'] - = ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; - } // end vertical mode - - } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) - || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - || ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) - ) { - // ... elseif no button, displays empty(ies) col(s) if required - - $GLOBALS['vertical_display']['emptypre'] - = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; - - if ($directionCondition) { - - $table_headers_html .= ''; - - // end horizontal/horizontalfipped mode - } else { - $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n"; - } // end vertical mode - - } elseif (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) - && ($directionCondition) - ) { - // ... elseif display an empty column if the actions links are - // disabled to match the rest of the table - $table_headers_html .= ''; - } + list($colspan, $rowspan, $button_html) + = $this->_getFeildVisibilityParams( + $directionCondition, $is_display, $fields_cnt, + $full_or_partial_text_link + ); + + $table_headers_html .= $button_html; // 2. Displays the fields' name // 2.0 If sorting links should be used, checks if the query is a "JOIN" @@ -1191,8 +1078,62 @@ class PMA_DisplayResults return $table_headers_html; } // end of the '_getTableHeaders()' function + + + /** + * Prepare unsorted sql query and sort by key drop down + * + * @param array $analyzed_sql the analyzed query + * @param string $sort_expression sort expression + * + * @return array two element array - $unsorted_sql_query, $drop_down_html + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getUnsortedSqlAndSortByKeyDropDown( + $analyzed_sql, $sort_expression + ) { + + $drop_down_html = ''; + + // Just as fallback + $unsorted_sql_query = $this->_sql_query; + if (isset($analyzed_sql[0]['unsorted_query'])) { + $unsorted_sql_query = $analyzed_sql[0]['unsorted_query']; + } + // Handles the case of multiple clicks on a column's header + // which would add many spaces before "ORDER BY" in the + // generated query. + $unsorted_sql_query = trim($unsorted_sql_query); + // sorting by indexes, only if it makes sense (only one table ref) + if (isset($analyzed_sql) + && isset($analyzed_sql[0]) + && isset($analyzed_sql[0]['querytype']) + && ($analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) + && isset($analyzed_sql[0]['table_ref']) + && (count($analyzed_sql[0]['table_ref']) == 1) + ) { + // grab indexes data: + $indexes = PMA_Index::getFromTable($this->_table, $this->_db); + + // do we have any index? + if ($indexes) { + $drop_down_html = $this->_getSortByKeyDropDown( + $indexes, $sort_expression, + $unsorted_sql_query + ); + } + } + + return array($unsorted_sql_query, $drop_down_html); + + } // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function + + /** * Prepare sort by key dropdown - html code segment * @@ -1280,7 +1221,130 @@ class PMA_DisplayResults return $drop_down_html; } // end of the '_getSortByKeyDropDown()' function + + + /** + * Set column span, row span and prepare html with full/partial + * text button or link + * + * @param boolean $directionCondition display direction horizontal or + * horizontalflipped + * @param array &$is_display which elements to display + * @param integer $fields_cnt the total number of fields + * returned by the SQL query + * @param string $full_or_partial_text_link full/partial link or text button + * + * @return array 3 element array - $colspan, $rowspan, $button_html + */ + private function _getFeildVisibilityParams( + $directionCondition, &$is_display, $fields_cnt, $full_or_partial_text_link + ) { + + $button_html = ''; + $colspan = $rowspan = null; + + // 1. Displays the full/partial text button (part 1)... + if ($directionCondition) { + $button_html .= '' . "\n"; + + $colspan = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) + ? ' colspan="4"' + : ''; + + } else { + $rowspan = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) + ? ' rowspan="4"' + : ''; + } + + // ... before the result table + if ((($is_display['edit_lnk'] == self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] == self::NO_EDIT_OR_DELETE)) + && ($is_display['text_btn'] == '1') + ) { + + $GLOBALS['vertical_display']['emptypre'] + = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + if ($directionCondition) { + + $button_html .= '' + . '' + . ''; + + // end horizontal/horizontalflipped mode + } else { + + $span = $GLOBALS['num_rows'] + 1 + floor( + $GLOBALS['num_rows'] + / $_SESSION['tmp_user_values']['repeat_cells'] + ); + $button_html .= ''; + + } // end vertical mode + + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && ($is_display['text_btn'] == '1') + ) { + // ... at the left column of the result table header if possible + // and required + + $GLOBALS['vertical_display']['emptypre'] + = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + if ($directionCondition) { + + $button_html .= '' + . $full_or_partial_text_link . ''; + // end horizontal/horizontalflipped mode + + } else { + + $GLOBALS['vertical_display']['textbtn'] + = ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n"; + } // end vertical mode + + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) + ) { + // ... elseif no button, displays empty(ies) col(s) if required + + $GLOBALS['vertical_display']['emptypre'] + = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + if ($directionCondition) { + + $button_html .= ''; + + // end horizontal/horizontalfipped mode + } else { + $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n"; + } // end vertical mode + + } elseif (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) + && ($directionCondition) + ) { + // ... elseif display an empty column if the actions links are + // disabled to match the rest of the table + $button_html .= ''; + } + + return array($colspan, $rowspan, $button_html); + + } // end of the '_getFeildVisibilityParams()' function + /** * Prepare data for column restoring and show/hide From 76409e259d061ba65458516ca16c8f99588f6630 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Wed, 4 Jul 2012 23:06:01 +0530 Subject: [PATCH 02/82] Break _getTableHeaders function in PMA_DisplayResults class, to more sub functions --- libraries/DisplayResults.class.php | 477 ++++++++++++++++++----------- 1 file changed, 306 insertions(+), 171 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 83fa65e523..82ddc64979 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -827,6 +827,8 @@ class PMA_DisplayResults $is_display['del_lnk'] ); + // 1. Set $colspan or $rowspan and generate html with full/partial + // text button or link list($colspan, $rowspan, $button_html) = $this->_getFeildVisibilityParams( $directionCondition, $is_display, $fields_cnt, @@ -843,19 +845,8 @@ class PMA_DisplayResults // ($GLOBALS['cfg']['ShowBrowseComments']). // Do not show comments, if using horizontalflipped mode, // because of space usage - if ($GLOBALS['cfg']['ShowBrowseComments'] - && ($direction != self::DISP_DIR_HORIZONTAL_FLIPPED) - ) { - $comments_map = array(); - if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) { - foreach ($analyzed_sql[0]['table_ref'] as $tbl) { - $tb = $tbl['table_true_name']; - $comments_map[$tb] = PMA_getComments($this->_db, $tb); - unset($tb); - } - } - } - + $comments_map = $this->_getTableCommentsArray($direction, $analyzed_sql); + if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] @@ -867,23 +858,8 @@ class PMA_DisplayResults // See if we have to highlight any header fields of a WHERE query. // Uses SQL-Parser results. - $GLOBALS['highlight_columns'] = array(); - if (isset($analyzed_sql) && isset($analyzed_sql[0]) - && isset($analyzed_sql[0]['where_clause_identifiers']) - ) { - - $wi = 0; - if (isset($analyzed_sql[0]['where_clause_identifiers']) - && is_array($analyzed_sql[0]['where_clause_identifiers']) - ) { - foreach ($analyzed_sql[0]['where_clause_identifiers'] - as $wci_nr => $wci - ) { - $GLOBALS['highlight_columns'][$wci] = 'true'; - } - } - } - + $this->_setHighlightedColumnGlobalField($analyzed_sql); + list($col_order, $col_visib) = $this->_getColumnParams(); for ($j = 0; $j < $fields_cnt; $j++) { @@ -902,98 +878,17 @@ class PMA_DisplayResults $comments = $this->_getCommentForRow($comments_map, $fields_meta[$i]); if ($is_display['sort_lnk'] == '1') { - // 2.1 Results can be sorted - - // 2.1.1 Checks if the table name is required; it's the case - // for a query with a "JOIN" statement and if the column - // isn't aliased, or in queries like - // SELECT `1`.`master_field` , `2`.`master_field` - // FROM `PMA_relation` AS `1` , `PMA_relation` AS `2` - - $sort_tbl = (isset($fields_meta[$i]->table) - && strlen($fields_meta[$i]->table)) - ? $this->getCommonFunctions()->backquote( - $fields_meta[$i]->table - ) . '.' - : ''; - - // 2.1.2 Checks if the current column is used to sort the - // results - // the orgname member does not exist for all MySQL versions - // but if found, it's the one on which to sort - $name_to_use_in_sort = $fields_meta[$i]->name; - $is_orgname = false; - if (isset($fields_meta[$i]->orgname) - && strlen($fields_meta[$i]->orgname) - ) { - $name_to_use_in_sort = $fields_meta[$i]->orgname; - $is_orgname = true; - } - - // $name_to_use_in_sort might contain a space due to - // formatting of function expressions like "COUNT(name )" - // so we remove the space in this situation - $name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort); - - $is_in_sort = $this->_isInSorted( - $sort_expression, $sort_expression_nodirection, - $sort_tbl, $name_to_use_in_sort - ); - - // 2.1.3 Check the field name for a bracket. - // If it contains one, it's probably a function column - // like 'COUNT(`field`)' - // It still might be a column name of a view. See bug #3383711 - // Check is_orgname. - if ((strpos($name_to_use_in_sort, '(') !== false) && ! $is_orgname) { - $sort_order = "\n" . 'ORDER BY ' . $name_to_use_in_sort . ' '; - } else { - $sort_order = "\n" . 'ORDER BY ' . $sort_tbl - . $this->getCommonFunctions()->backquote( - $name_to_use_in_sort - ) . ' '; - } - unset($name_to_use_in_sort); - unset($is_orgname); - - // 2.1.4 Do define the sorting URL - - list($sort_order, $order_img) = $this->_getSortingUrlParams( - $is_in_sort, $sort_direction, $fields_meta[$i], - $sort_order, $i - ); - - if (preg_match( - '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|' - . 'LOCK IN SHARE MODE))@is', - $unsorted_sql_query, $regs3 - )) { - $sorted_sql_query = $regs3[1] . $sort_order . $regs3[2]; - } else { - $sorted_sql_query = $unsorted_sql_query . $sort_order; - } - - $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, - 'sql_query' => $sorted_sql_query, - 'session_max_rows' => $session_max_rows - ); - $order_url = 'sql.php' . PMA_generate_common_url($_url_params); - - // 2.1.5 Displays the sorting URL - // enable sort order swapping for image - $order_link = $this->_getSortOrderLink( - $order_img, $i, $direction, $fields_meta[$i], $order_url - ); - - if ($directionCondition) { - $table_headers_html - .= $this->_getDraggableClassForSortableColumns( - $col_visib, $col_visib[$j], $condition_field, - $direction, $fields_meta[$i], $order_link, $comments - ); - } + + list($order_link, $sorted_headrer_html) + = $this->_getOrderLinkAndSortedHeaderHtml( + $fields_meta[$i], $sort_expression, + $sort_expression_nodirection, $i, $unsorted_sql_query, + $session_max_rows, $direction, $comments, + $sort_direction, $directionCondition, $col_visib, + $col_visib[$j], $condition_field + ); + + $table_headers_html .= $sorted_headrer_html; $GLOBALS['vertical_display']['desc'][] = ' '; } // end else (2.2) } // end for - - // 3. Displays the needed checkboxes at the right - // column of the result table header if possible and required... - if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) - || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - || ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) - && ($is_display['text_btn'] == '1') - ) { - - $GLOBALS['vertical_display']['emptyafter'] - = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; - - if ($directionCondition) { - $table_headers_html .= "\n" - . '' . $full_or_partial_text_link - . ''; - - // end horizontal/horizontalflipped mode - } else { - $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n" - . ' ' . "\n" - . ' ' . "\n"; - } // end vertical mode - } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) - || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && (($is_display['edit_lnk'] == self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] == self::NO_EDIT_OR_DELETE)) - && (! isset($GLOBALS['is_header_sent']) || ! $GLOBALS['is_header_sent']) - ) { - // ... elseif no button, displays empty columns if required - // (unless coming from Browse mode print view) - - $GLOBALS['vertical_display']['emptyafter'] - = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) - && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; - - if ($directionCondition) { - $table_headers_html .= "\n" - . ''; - - // end horizontal/horizontalflipped mode - } else { - $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n"; - } // end vertical mode - } + + // Display column at rightside - checkboxes or empty column + $table_headers_html .= $this->_getColumnAtRightSide( + $is_display, $directionCondition, $full_or_partial_text_link, + $colspan, $rowspan + ); if ($directionCondition) { $table_headers_html .= '' @@ -1235,6 +1087,10 @@ class PMA_DisplayResults * @param string $full_or_partial_text_link full/partial link or text button * * @return array 3 element array - $colspan, $rowspan, $button_html + * + * @access private + * + * @see _getTableHeaders() */ private function _getFeildVisibilityParams( $directionCondition, &$is_display, $fields_cnt, $full_or_partial_text_link @@ -1345,6 +1201,77 @@ class PMA_DisplayResults } // end of the '_getFeildVisibilityParams()' function + + /** + * Get table comments as array + * + * @param boolean $directionCondition display direction horizontal + * or horizontalflipped + * @param array $analyzed_sql the analyzed query + * + * @return array $comments_map table comments when condition true + * null when condition falls + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getTableCommentsArray($direction, $analyzed_sql) + { + + $comments_map = null; + + if ($GLOBALS['cfg']['ShowBrowseComments'] + && ($direction != self::DISP_DIR_HORIZONTAL_FLIPPED) + ) { + $comments_map = array(); + if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) { + foreach ($analyzed_sql[0]['table_ref'] as $tbl) { + $tb = $tbl['table_true_name']; + $comments_map[$tb] = PMA_getComments($this->_db, $tb); + unset($tb); + } + } + } + + return $comments_map; + + } // end of the '_getTableCommentsArray()' function + + + /** + * Set global array for store highlighted header fields + * + * @param array $analyzed_sql the analyzed query + * + * @return void + * + * @access private + * + * @see _getTableHeaders() + */ + private function _setHighlightedColumnGlobalField($analyzed_sql) + { + + $GLOBALS['highlight_columns'] = array(); + if (isset($analyzed_sql) && isset($analyzed_sql[0]) + && isset($analyzed_sql[0]['where_clause_identifiers']) + ) { + + $wi = 0; + if (isset($analyzed_sql[0]['where_clause_identifiers']) + && is_array($analyzed_sql[0]['where_clause_identifiers']) + ) { + foreach ($analyzed_sql[0]['where_clause_identifiers'] + as $wci_nr => $wci + ) { + $GLOBALS['highlight_columns'][$wci] = 'true'; + } + } + } + + } // end of the '_setHighlightedColumnGlobalField()' function + /** * Prepare data for column restoring and show/hide @@ -1622,7 +1549,138 @@ class PMA_DisplayResults } return $comments; } // end of the '_getCommentForRow()' function + + + /** + * Prepare parameters and html for sorted table header fields + * + * @param array $fields_meta set of field properties + * @param string $sort_expression sort expression + * @param string $sort_expression_nodirection sort expression without direction + * @param integer $column_index the index of the column + * @param string $unsorted_sql_query the unsorted sql query + * @param integer $session_max_rows maximum rows resulted by sql + * @param string $direction the display direction + * @param string $comments comment for row + * @param string $sort_direction sort direction + * @param boolean $directionCondition display direction horizontal + * or horizontalflipped + * @param boolean $col_visib column is visible(false) + * array column isn't visible(string array) + * @param string $col_visib_j element of $col_visib array + * @param boolean $condition_field whether the column is a part of the + * where clause + * + * @return array 2 element array - $order_link, $sorted_header_html + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getOrderLinkAndSortedHeaderHtml( + $fields_meta, $sort_expression, $sort_expression_nodirection, + $column_index, $unsorted_sql_query, $session_max_rows, $direction, + $comments, $sort_direction, $directionCondition, $col_visib, + $col_visib_j, $condition_field + ) { + $sorted_header_html = ''; + + // Checks if the table name is required; it's the case + // for a query with a "JOIN" statement and if the column + // isn't aliased, or in queries like + // SELECT `1`.`master_field` , `2`.`master_field` + // FROM `PMA_relation` AS `1` , `PMA_relation` AS `2` + + $sort_tbl = (isset($fields_meta->table) + && strlen($fields_meta->table)) + ? $this->getCommonFunctions()->backquote( + $fields_meta->table + ) . '.' + : ''; + + // Checks if the current column is used to sort the + // results + // the orgname member does not exist for all MySQL versions + // but if found, it's the one on which to sort + $name_to_use_in_sort = $fields_meta->name; + $is_orgname = false; + if (isset($fields_meta->orgname) + && strlen($fields_meta->orgname) + ) { + $name_to_use_in_sort = $fields_meta->orgname; + $is_orgname = true; + } + + // $name_to_use_in_sort might contain a space due to + // formatting of function expressions like "COUNT(name )" + // so we remove the space in this situation + $name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort); + + $is_in_sort = $this->_isInSorted( + $sort_expression, $sort_expression_nodirection, + $sort_tbl, $name_to_use_in_sort + ); + + // Check the field name for a bracket. + // If it contains one, it's probably a function column + // like 'COUNT(`field`)' + // It still might be a column name of a view. See bug #3383711 + // Check is_orgname. + if ((strpos($name_to_use_in_sort, '(') !== false) && ! $is_orgname) { + $sort_order = "\n" . 'ORDER BY ' . $name_to_use_in_sort . ' '; + } else { + $sort_order = "\n" . 'ORDER BY ' . $sort_tbl + . $this->getCommonFunctions()->backquote( + $name_to_use_in_sort + ) . ' '; + } + unset($name_to_use_in_sort); + unset($is_orgname); + + // Do define the sorting URL + + list($sort_order, $order_img) = $this->_getSortingUrlParams( + $is_in_sort, $sort_direction, $fields_meta, + $sort_order, $column_index + ); + + if (preg_match( + '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|' + . 'LOCK IN SHARE MODE))@is', + $unsorted_sql_query, $regs3 + )) { + $sorted_sql_query = $regs3[1] . $sort_order . $regs3[2]; + } else { + $sorted_sql_query = $unsorted_sql_query . $sort_order; + } + + $_url_params = array( + 'db' => $this->_db, + 'table' => $this->_table, + 'sql_query' => $sorted_sql_query, + 'session_max_rows' => $session_max_rows + ); + $order_url = 'sql.php' . PMA_generate_common_url($_url_params); + + // Displays the sorting URL + // enable sort order swapping for image + $order_link = $this->_getSortOrderLink( + $order_img, $column_index, $direction, + $fields_meta, $order_url + ); + + if ($directionCondition) { + $sorted_header_html .= $this->_getDraggableClassForSortableColumns( + $col_visib, $col_visib_j, $condition_field, $direction, + $fields_meta, $order_link, $comments + ); + } + + return array($order_link, $sorted_header_html); + + } // end of the '_getOrderLinkAndSortedHeaderHtml()' function + /** * Check whether the column is sorted @@ -1934,6 +1992,83 @@ class PMA_DisplayResults } // end of the '_getDraggableClassForNonSortableColumns()' function + + /** + * Prepare column to show at right side - check boxes or empty column + * + * @param array &$is_display which elements to display + * @param boolean $directionCondition display direction horizontal + * or horizontalflipped + * @param string $full_or_partial_text_link full/partial link or text button + * @param string $colspan column span of table header + * @param string $rowspan row span of table header + * + * @return string html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getColumnAtRightSide( + &$is_display, $directionCondition, $full_or_partial_text_link, + $colspan, $rowspan + ) { + + $right_column_html = ''; + + // Displays the needed checkboxes at the right + // column of the result table header if possible and required... + if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) + && ($is_display['text_btn'] == '1') + ) { + + $GLOBALS['vertical_display']['emptyafter'] + = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; + + if ($directionCondition) { + $right_column_html .= "\n" + . '' . $full_or_partial_text_link + . ''; + + // end horizontal/horizontalflipped mode + } else { + $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n"; + } // end vertical mode + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($is_display['edit_lnk'] == self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] == self::NO_EDIT_OR_DELETE)) + && (! isset($GLOBALS['is_header_sent']) || ! $GLOBALS['is_header_sent']) + ) { + // ... elseif no button, displays empty columns if required + // (unless coming from Browse mode print view) + + $GLOBALS['vertical_display']['emptyafter'] + = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; + + if ($directionCondition) { + $right_column_html .= "\n" + . ''; + + // end horizontal/horizontalflipped mode + } else { + $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n"; + } // end vertical mode + } + + return $right_column_html; + + } // end of the '_getColumnAtRightSide()' function + /** * Prepares the display for a value From 0e818398dc91245051f9fc2266d368fc132a70e1 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Thu, 5 Jul 2012 01:35:30 +0530 Subject: [PATCH 03/82] Break _getTableBody function in PMA_DisplayResults class, to sub functions --- libraries/DisplayResults.class.php | 566 +++++++++++++++++------------ 1 file changed, 324 insertions(+), 242 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 82ddc64979..701aa75e64 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2357,175 +2357,12 @@ class PMA_DisplayResults } // end if (1) // 2. Displays the rows' values - - for ($j = 0; $j < $GLOBALS['fields_cnt']; ++$j) { - - // assign $i with appropriate column order - $i = $col_order ? $col_order[$j] : $j; - - $meta = $GLOBALS['fields_meta'][$i]; - $not_null_class = $meta->not_null ? 'not_null' : ''; - $relation_class = isset($map[$meta->name]) ? 'relation' : ''; - $hide_class = ($col_visib && !$col_visib[$j] - // hide per only if the display dir is not vertical - && ($_SESSION['tmp_user_values']['disp_direction'] - != self::DISP_DIR_VERTICAL)) - ? 'hide' - : ''; - - // handle datetime-related class, for grid editing - $field_type_class - = $this->_getClassForDateTimeRelatedFields($meta->type); - - $pointer = $i; - $is_field_truncated = false; - //If the previous column had blob data, we need to reset the class - // to $inline_edit_class - $class = $this->_getResettedClassForInlineEdit( - $grid_edit_class, $not_null_class, $relation_class, - $hide_class, $field_type_class, $row_no - ); - - // See if this column should get highlight because it's used in the - // where-query. - $condition_field = (isset($GLOBALS['highlight_columns']) - && (isset($GLOBALS['highlight_columns'][$meta->name]) - || isset($GLOBALS['highlight_columns'][$this->getCommonFunctions()->backquote($meta->name)]))) - ? true - : false; - - // Wrap MIME-transformations. [MIME] - $default_function = '_mimeDefaultFunction'; // default_function - $transformation_plugin = $default_function; - $transform_options = array(); - - if ($GLOBALS['cfgRelation']['mimework'] - && $GLOBALS['cfg']['BrowseMIME'] - ) { - - if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) - && isset($GLOBALS['mime_map'][$meta->name]['transformation']) - && !empty($GLOBALS['mime_map'][$meta->name]['transformation']) - ) { - - $file = $GLOBALS['mime_map'][$meta->name]['transformation']; - $include_file = 'libraries/plugins/transformations/' . $file; - - if (file_exists($include_file)) { - - include_once $include_file; - $class_name = str_replace('.class.php', '', $file); - // todo add $plugin_manager - $plugin_manager = null; - $transformation_plugin = new $class_name( - $plugin_manager - ); - - $transform_options = PMA_transformation_getOptions( - isset($GLOBALS['mime_map'][$meta->name] - ['transformation_options'] - ) - ? $GLOBALS['mime_map'][$meta->name] - ['transformation_options'] - : '' - ); - - $meta->mimetype = str_replace( - '_', '/', - $GLOBALS['mime_map'][$meta->name]['mimetype'] - ); - - } // end if file_exists - } // end if transformation is set - } // end if mime/transformation works. - - $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, - 'where_clause' => $where_clause, - 'transform_key' => $meta->name, - ); - - if (! empty($this->_sql_query)) { - $_url_params['sql_query'] = $url_sql_query; - } - - $transform_options['wrapper_link'] - = PMA_generate_common_url($_url_params); - - if ($meta->numeric == 1) { - // n u m e r i c - - // if two fields have the same name (this is possible - // with self-join queries, for example), using $meta->name - // will show both fields NULL even if only one is NULL, - // so use the $pointer - - $GLOBALS['vertical_display']['data'][$row_no][$i] - = $this->_getDataCellForNumericColumns( - $row[$i], $class, $condition_field, $meta, $map, - $is_field_truncated, $analyzed_sql, - $transformation_plugin, $default_function, - $transform_options - ); - - } elseif (stristr($meta->type, self::BLOB_FIELD)) { - // b l o b - - // PMA_mysql_fetch_fields returns BLOB in place of - // TEXT fields type so we have to ensure it's really a BLOB - $field_flags = PMA_DBI_field_flags($dt_result, $i); - - $GLOBALS['vertical_display']['data'][$row_no][$i] - = $this->_getDataCellForBlobColumns( - $row[$i], $class, $meta, $_url_params, $field_flags, - $transformation_plugin, $default_function, - $transform_options, $condition_field, $is_field_truncated - ); - - } elseif ($meta->type == self::GEOMETRY_FIELD) { - // g e o m e t r y - - // Remove 'grid_edit' from $class as we do not allow to - // inline-edit geometry data. - $class = str_replace('grid_edit', '', $class); - - $GLOBALS['vertical_display']['data'][$row_no][$i] - = $this->_getDataCellForGeometryColumns( - $row[$i], $class, $meta, $map, $_url_params, - $condition_field, $transformation_plugin, - $default_function, $transform_options, - $is_field_truncated, $analyzed_sql - ); - - } else { - // n o t n u m e r i c a n d n o t B L O B - - $GLOBALS['vertical_display']['data'][$row_no][$i] - = $this->_getDataCellForNonNumericAndNonBlobColumns( - $row[$i], $class, $meta, $map, $_url_params, - $condition_field, $transformation_plugin, - $default_function, $transform_options, - $is_field_truncated, $analyzed_sql, $dt_result, $i - ); - - } - - // output stored cell - if ($directionCondition) { - $table_body_html - .= $GLOBALS['vertical_display']['data'][$row_no][$i]; - } - - if (isset($GLOBALS['vertical_display']['rowdata'][$i][$row_no])) { - $GLOBALS['vertical_display']['rowdata'][$i][$row_no] - .= $GLOBALS['vertical_display']['data'][$row_no][$i]; - } else { - $GLOBALS['vertical_display']['rowdata'][$i][$row_no] - = $GLOBALS['vertical_display']['data'][$row_no][$i]; - } - } // end for (2) - + $table_body_html .= $this->_getRowValues( + $dt_result, $row, $row_no, $col_order, $map, + $grid_edit_class, $col_visib, $where_clause, + $url_sql_query, $analyzed_sql, $directionCondition + ); + // 3. Displays the modify/delete links on the right if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) @@ -2546,79 +2383,13 @@ class PMA_DisplayResults } // end if // 4. Gather links of del_urls and edit_urls in an array for later - // output - if (! isset($GLOBALS['vertical_display']['edit'][$row_no])) { - $GLOBALS['vertical_display']['edit'][$row_no] = ''; - $GLOBALS['vertical_display']['copy'][$row_no] = ''; - $GLOBALS['vertical_display']['delete'][$row_no] = ''; - $GLOBALS['vertical_display']['row_delete'][$row_no] = ''; - } - - $vertical_class = ' row_' . $row_no; - if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) { - $vertical_class .= ' vpointer'; - } - - if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) { - $vertical_class .= ' vmarker'; - } - - if (!empty($del_url) - && ($is_display['del_lnk'] != self::KILL_PROCESS) - ) { - - $GLOBALS['vertical_display']['row_delete'][$row_no] - .= $this->_getCheckboxForMultiRowSubmissions( - $del_url, $is_display, $row_no, $where_clause_html, - $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', - $alternating_color_class . $vertical_class - ); - - } else { - unset($GLOBALS['vertical_display']['row_delete'][$row_no]); - } - - if (isset($edit_url)) { - - $GLOBALS['vertical_display']['edit'][$row_no] .= $this->_getEditLink( - $edit_url, - $alternating_color_class . ' ' . $edit_anchor_class - . $vertical_class, $edit_str, - $where_clause, - $where_clause_html - ); - - } else { - unset($GLOBALS['vertical_display']['edit'][$row_no]); - } - - if (isset($copy_url)) { - - $GLOBALS['vertical_display']['copy'][$row_no] .= $this->_getCopyLink( - $copy_url, $copy_str, $where_clause, $where_clause_html, - $alternating_color_class . $vertical_class - ); - - } else { - unset($GLOBALS['vertical_display']['copy'][$row_no]); - } - - if (isset($del_url)) { - - if (! isset($js_conf)) { - $js_conf = ''; - } - - $GLOBALS['vertical_display']['delete'][$row_no] - .= $this->_getDeleteLink( - $del_url, $del_str, $js_conf, - $alternating_color_class . $vertical_class - ); - - } else { - unset($GLOBALS['vertical_display']['delete'][$row_no]); - } - + // output + $this->_gatherLinksForLaterOutputs( + $row_no, $is_display, $where_clause, $where_clause_html, $js_conf, + $del_url, $del_query, $del_str, $edit_anchor_class, $edit_str, + $copy_url, $copy_str, $alternating_color_class, $condition_array + ); + $table_body_html .= $directionCondition ? "\n" : ''; $row_no++; @@ -2627,7 +2398,318 @@ class PMA_DisplayResults return $table_body_html; } // end of the '_getTableBody()' function + + + /** + * Prepare rows + * + * @param integer &$dt_result the link id associated to the query + * which results have to be displayed + * @param array $row current row data + * @param integer $row_no the index of current row + * @param array $col_order the column order + * false when a property not found + * @param array $map the list of relations + * @param string $grid_edit_class the class for all editable columns + * @param boolean $col_visib column is visible(false) + * array column isn't visible(string array) + * @param string $where_clause where clause + * @param string $url_sql_query the analyzed sql query + * @param array $analyzed_sql the analyzed query + * @param boolean $directionCondition the directional condition + * + * @return string $row_values_html html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getRowValues( + &$dt_result, $row, $row_no, $col_order, $map, + $grid_edit_class, $col_visib, $where_clause, + $url_sql_query, $analyzed_sql, $directionCondition + ) { + + $row_values_html = ''; + + for ($j = 0; $j < $GLOBALS['fields_cnt']; ++$j) { + // assign $i with appropriate column order + $i = $col_order ? $col_order[$j] : $j; + + $meta = $GLOBALS['fields_meta'][$i]; + $not_null_class = $meta->not_null ? 'not_null' : ''; + $relation_class = isset($map[$meta->name]) ? 'relation' : ''; + $hide_class = ($col_visib && !$col_visib[$j] + // hide per only if the display dir is not vertical + && ($_SESSION['tmp_user_values']['disp_direction'] + != self::DISP_DIR_VERTICAL)) + ? 'hide' + : ''; + + // handle datetime-related class, for grid editing + $field_type_class + = $this->_getClassForDateTimeRelatedFields($meta->type); + + $pointer = $i; + $is_field_truncated = false; + //If the previous column had blob data, we need to reset the class + // to $inline_edit_class + $class = $this->_getResettedClassForInlineEdit( + $grid_edit_class, $not_null_class, $relation_class, + $hide_class, $field_type_class, $row_no + ); + + // See if this column should get highlight because it's used in the + // where-query. + $condition_field = (isset($GLOBALS['highlight_columns']) + && (isset($GLOBALS['highlight_columns'][$meta->name]) + || isset($GLOBALS['highlight_columns'][$this->getCommonFunctions()->backquote($meta->name)]))) + ? true + : false; + + // Wrap MIME-transformations. [MIME] + $default_function = '_mimeDefaultFunction'; // default_function + $transformation_plugin = $default_function; + $transform_options = array(); + + if ($GLOBALS['cfgRelation']['mimework'] + && $GLOBALS['cfg']['BrowseMIME'] + ) { + + if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) + && isset($GLOBALS['mime_map'][$meta->name]['transformation']) + && !empty($GLOBALS['mime_map'][$meta->name]['transformation']) + ) { + + $file = $GLOBALS['mime_map'][$meta->name]['transformation']; + $include_file = 'libraries/plugins/transformations/' . $file; + + if (file_exists($include_file)) { + + include_once $include_file; + $class_name = str_replace('.class.php', '', $file); + // todo add $plugin_manager + $plugin_manager = null; + $transformation_plugin = new $class_name( + $plugin_manager + ); + + $transform_options = PMA_transformation_getOptions( + isset($GLOBALS['mime_map'][$meta->name] + ['transformation_options'] + ) + ? $GLOBALS['mime_map'][$meta->name] + ['transformation_options'] + : '' + ); + + $meta->mimetype = str_replace( + '_', '/', + $GLOBALS['mime_map'][$meta->name]['mimetype'] + ); + + } // end if file_exists + } // end if transformation is set + } // end if mime/transformation works. + + $_url_params = array( + 'db' => $this->_db, + 'table' => $this->_table, + 'where_clause' => $where_clause, + 'transform_key' => $meta->name, + ); + + if (! empty($this->_sql_query)) { + $_url_params['sql_query'] = $url_sql_query; + } + + $transform_options['wrapper_link'] + = PMA_generate_common_url($_url_params); + + if ($meta->numeric == 1) { + // n u m e r i c + + // if two fields have the same name (this is possible + // with self-join queries, for example), using $meta->name + // will show both fields NULL even if only one is NULL, + // so use the $pointer + + $GLOBALS['vertical_display']['data'][$row_no][$i] + = $this->_getDataCellForNumericColumns( + $row[$i], $class, $condition_field, $meta, $map, + $is_field_truncated, $analyzed_sql, + $transformation_plugin, $default_function, + $transform_options + ); + + } elseif (stristr($meta->type, self::BLOB_FIELD)) { + // b l o b + + // PMA_mysql_fetch_fields returns BLOB in place of + // TEXT fields type so we have to ensure it's really a BLOB + $field_flags = PMA_DBI_field_flags($dt_result, $i); + + $GLOBALS['vertical_display']['data'][$row_no][$i] + = $this->_getDataCellForBlobColumns( + $row[$i], $class, $meta, $_url_params, $field_flags, + $transformation_plugin, $default_function, + $transform_options, $condition_field, $is_field_truncated + ); + + } elseif ($meta->type == self::GEOMETRY_FIELD) { + // g e o m e t r y + + // Remove 'grid_edit' from $class as we do not allow to + // inline-edit geometry data. + $class = str_replace('grid_edit', '', $class); + + $GLOBALS['vertical_display']['data'][$row_no][$i] + = $this->_getDataCellForGeometryColumns( + $row[$i], $class, $meta, $map, $_url_params, + $condition_field, $transformation_plugin, + $default_function, $transform_options, + $is_field_truncated, $analyzed_sql + ); + + } else { + // n o t n u m e r i c a n d n o t B L O B + + $GLOBALS['vertical_display']['data'][$row_no][$i] + = $this->_getDataCellForNonNumericAndNonBlobColumns( + $row[$i], $class, $meta, $map, $_url_params, + $condition_field, $transformation_plugin, + $default_function, $transform_options, + $is_field_truncated, $analyzed_sql, $dt_result, $i + ); + + } + + // output stored cell + if ($directionCondition) { + $row_values_html + .= $GLOBALS['vertical_display']['data'][$row_no][$i]; + } + + if (isset($GLOBALS['vertical_display']['rowdata'][$i][$row_no])) { + $GLOBALS['vertical_display']['rowdata'][$i][$row_no] + .= $GLOBALS['vertical_display']['data'][$row_no][$i]; + } else { + $GLOBALS['vertical_display']['rowdata'][$i][$row_no] + = $GLOBALS['vertical_display']['data'][$row_no][$i]; + } + } // end for + + return $row_values_html; + + } // end of the '_getRowValues()' function + + + /** + * Gather delete/edit url links for further outputs + * + * @param integer $row_no the index of current row + * @param array $is_display which elements to display + * @param string $where_clause where clause + * @param string $where_clause_html the html encoded where clause + * @param string $js_conf text for the JS confirmation + * @param string $del_url the url for delete row + * @param string $del_query the query for delete row + * @param string $del_str the label for delete row + * @param string $edit_anchor_class the class for html element for edit + * @param string $edit_str the label for edit row + * @param string $copy_url the url for copy row + * @param string $copy_str the label for copy row + * @param string $alternating_color_class class for display two colors in rows + * @param array $condition_array array of keys + * (primary,unique,condition) + * + * @return void + * + * @access private + * + * @see _getTableBody() + */ + private function _gatherLinksForLaterOutputs( + $row_no, $is_display, $where_clause, $where_clause_html, $js_conf, + $del_url, $del_query, $del_str, $edit_anchor_class, $edit_str, + $copy_url, $copy_str, $alternating_color_class, $condition_array + ) { + + if (! isset($GLOBALS['vertical_display']['edit'][$row_no])) { + $GLOBALS['vertical_display']['edit'][$row_no] = ''; + $GLOBALS['vertical_display']['copy'][$row_no] = ''; + $GLOBALS['vertical_display']['delete'][$row_no] = ''; + $GLOBALS['vertical_display']['row_delete'][$row_no] = ''; + } + + $vertical_class = ' row_' . $row_no; + if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) { + $vertical_class .= ' vpointer'; + } + + if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) { + $vertical_class .= ' vmarker'; + } + + if (!empty($del_url) + && ($is_display['del_lnk'] != self::KILL_PROCESS) + ) { + + $GLOBALS['vertical_display']['row_delete'][$row_no] + .= $this->_getCheckboxForMultiRowSubmissions( + $del_url, $is_display, $row_no, $where_clause_html, + $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', + $alternating_color_class . $vertical_class + ); + + } else { + unset($GLOBALS['vertical_display']['row_delete'][$row_no]); + } + + if (isset($edit_url)) { + + $GLOBALS['vertical_display']['edit'][$row_no] .= $this->_getEditLink( + $edit_url, + $alternating_color_class . ' ' . $edit_anchor_class + . $vertical_class, $edit_str, + $where_clause, + $where_clause_html + ); + + } else { + unset($GLOBALS['vertical_display']['edit'][$row_no]); + } + + if (isset($copy_url)) { + + $GLOBALS['vertical_display']['copy'][$row_no] .= $this->_getCopyLink( + $copy_url, $copy_str, $where_clause, $where_clause_html, + $alternating_color_class . $vertical_class + ); + + } else { + unset($GLOBALS['vertical_display']['copy'][$row_no]); + } + + if (isset($del_url)) { + + if (! isset($js_conf)) { + $js_conf = ''; + } + + $GLOBALS['vertical_display']['delete'][$row_no] + .= $this->_getDeleteLink( + $del_url, $del_str, $js_conf, + $alternating_color_class . $vertical_class + ); + + } else { + unset($GLOBALS['vertical_display']['delete'][$row_no]); + } + + } // end of the '_gatherLinksForLaterOutputs()' function + /** * Get url sql query without conditions to shorten URLs From 9a83ad284e4925aab644823f739eed3890c15876 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Thu, 5 Jul 2012 07:41:39 +0530 Subject: [PATCH 04/82] Break _getTable function in PMA_DisplayResults class, to sub functions --- libraries/DisplayResults.class.php | 155 +++++++++++++++++++---------- 1 file changed, 104 insertions(+), 51 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 701aa75e64..e103753c69 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -28,6 +28,9 @@ class PMA_DisplayResults const POSITION_RIGHT = 'right'; const POSITION_BOTH = 'both'; const POSITION_NONE = 'none'; + + const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown'; + const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown'; const DISP_DIR_HORIZONTAL = 'horizontal'; const DISP_DIR_HORIZONTAL_FLIPPED = 'horizontalflipped'; @@ -4108,18 +4111,10 @@ class PMA_DisplayResults } - if (($is_display['nav_bar'] == '1') - && empty($analyzed_sql[0]['limit_clause']) - ) { - - $table_html .= $this->_getTableNavigation( - $pos_next, $pos_prev, 'top_direction_dropdown' - ) - . "\n"; - - } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { - $table_html .= "\n" . '

' . "\n"; - } + $table_html .= $this->_getPlacedTableNavigatoins( + $is_display, $analyzed_sql, $pos_next, $pos_prev, + self::PLACE_TOP_DIRECTION_DROPDOWN, "\n" + ); // 2b ----- Get field references from Database ----- // (see the 'relation' configuration variable) @@ -4146,33 +4141,8 @@ class PMA_DisplayResults if (! strlen($this->_table)) { $exist_rel = false; } else { - - // To be able to later display a link to the related table, - // we verify both types of relations: either those that are - // native foreign keys or those defined in the phpMyAdmin - // configuration storage. If no PMA storage, we won't be able - // to use the "column to display" notion (for example show - // the name related to a numeric id). - $exist_rel = PMA_getForeigners( - $this->_db, $this->_table, '', self::POSITION_BOTH - ); - - if ($exist_rel) { - - foreach ($exist_rel as $master_field => $rel) { - - $display_field = PMA_getDisplayField( - $rel['foreign_db'], $rel['foreign_table'] - ); - - $map[$master_field] = array( - $rel['foreign_table'], - $rel['foreign_field'], - $display_field, - $rel['foreign_db'] - ); - } // end while - } // end if + // This method set the values for $map array + $this->_setParamForLinkForiegnKeyRelatedTables($map); } // end if // end 2b @@ -4213,18 +4183,10 @@ class PMA_DisplayResults // 5. ----- Get the navigation bar at the bottom if required ----- - if (($is_display['nav_bar'] == '1') - && empty($analyzed_sql[0]['limit_clause']) - ) { - - $table_html .= '
' . "\n"; - $table_html .= $this->_getTableNavigation( - $pos_next, $pos_prev, 'bottom_direction_dropdown' - ); - - } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { - $table_html .= "\n" . '

' . "\n"; - } + $table_html .= $this->_getPlacedTableNavigatoins( + $is_display, $analyzed_sql, $pos_next, $pos_prev, + self::PLACE_BOTTOM_DIRECTION_DROPDOWN, '
' . "\n" + ); // 6. ----- Prepare "Query results operations" if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { @@ -4548,6 +4510,50 @@ class PMA_DisplayResults } // end of the '_setMessageInformation()' function + + /** + * Set the value of $map array for linking foreign key related tables + * + * @param array $map the list of relations + * + * @return void + * + * @access private + * + * @see getTable() + */ + private function _setParamForLinkForiegnKeyRelatedTables(&$map) + { + + // To be able to later display a link to the related table, + // we verify both types of relations: either those that are + // native foreign keys or those defined in the phpMyAdmin + // configuration storage. If no PMA storage, we won't be able + // to use the "column to display" notion (for example show + // the name related to a numeric id). + $exist_rel = PMA_getForeigners( + $this->_db, $this->_table, '', self::POSITION_BOTH + ); + + if ($exist_rel) { + + foreach ($exist_rel as $master_field => $rel) { + + $display_field = PMA_getDisplayField( + $rel['foreign_db'], $rel['foreign_table'] + ); + + $map[$master_field] = array( + $rel['foreign_table'], + $rel['foreign_field'], + $display_field, + $rel['foreign_db'] + ); + } // end while + } // end if + + } // end of the '_setParamForLinkForiegnKeyRelatedTables()' function + /** * Prepare multi field edit/delete links @@ -4646,6 +4652,53 @@ class PMA_DisplayResults } // end of the '_getMultiRowOperationLinks()' function + + /** + * Prepare table navigation bar at the top or bottom + * + * @param array $is_display which elements to display + * @param array $analyzed_sql the analyzed query + * @param integer $pos_next the offset for the "next" page + * @param integer $pos_prev the offset for the "previous" page + * @param string $place the place to show navigation + * @param string $empty_line empty line depend on the $place + * + * @return string html content of navigation bar + * + * @access private + * + * @see _getTable() + */ + private function _getPlacedTableNavigatoins( + $is_display, $analyzed_sql, $pos_next, $pos_prev, $place, $empty_line + ) { + + $navigation_html = ''; + + if (($is_display['nav_bar'] == '1') + && empty($analyzed_sql[0]['limit_clause']) + ) { + + if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) { + $navigation_html .= '
' . "\n"; + } + + $navigation_html .= $this->_getTableNavigation( + $pos_next, $pos_prev, 'top_direction_dropdown' + ); + + if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { + $navigation_html .= "\n"; + } + + } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { + $navigation_html .= "\n" . '

' . "\n"; + } + + return $navigation_html; + + } // end of the '_getPlacedTableNavigatoins()' function + /** * Get operations that are available on results. From e7794d65c9f08b81474663ccc84f6db609123e55 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sat, 7 Jul 2012 09:13:31 +0530 Subject: [PATCH 05/82] Reduce the use of superglobal variables in PMA_DisplayResults class --- libraries/DisplayResults.class.php | 397 ++++++++++++++++------------- 1 file changed, 218 insertions(+), 179 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index e103753c69..f8425799f0 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -68,7 +68,12 @@ class PMA_DisplayResults private $_common_functions; - private $_db, $_table, $_goto, $_sql_query; + private $_db, $_table, $_goto, $_sql_query; + private $_unlim_num_rows, $_fields_meta, $_is_count, $_is_export, $_is_func, + $_is_analyse, $_num_rows, $_showtable, $_highlight_columns, + $_vertical_display, $_fields_cnt, $_printview, $_querytime, + $_pma_theme_image, $_text_dir, $_url_query, $_is_maint, $_is_explain, + $_is_show, $_mime_map; /** @@ -166,7 +171,7 @@ class PMA_DisplayResults // 2. Display mode is not "false for all elements" -> updates the // display mode if ($the_disp_mode != 'nnnn000000') { - if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') { + if (isset($this->_printview) && $this->_printview == '1') { // 2.0 Print view -> set all elements to false! $do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link $do_display['del_lnk'] = self::NO_EDIT_OR_DELETE; // no delete link @@ -176,8 +181,8 @@ class PMA_DisplayResults $do_display['bkm_form'] = (string) '0'; $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; - } elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse'] - || $GLOBALS['is_maint'] || $GLOBALS['is_explain'] + } elseif ($this->_is_count || $this->_is_analyse + || $this->_is_maint || $this->_is_explain ) { // 2.1 Statement is a "SELECT COUNT", a // "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or @@ -188,14 +193,14 @@ class PMA_DisplayResults $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; - if ($GLOBALS['is_maint']) { + if ($this->_is_maint) { $do_display['text_btn'] = (string) '1'; } else { $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; - } elseif ($GLOBALS['is_show']) { + } elseif ($this->_is_show) { // 2.2 Statement is a "SHOW..." /** * 2.2.1 @@ -205,7 +210,7 @@ class PMA_DisplayResults '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?' . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS' . ')@i', - $GLOBALS['sql_query'], $which + $this->_sql_query, $which ); if (isset($which[1]) && (strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) @@ -232,17 +237,17 @@ class PMA_DisplayResults // 2.3 Other statements (ie "SELECT" ones) -> updates // $do_display['edit_lnk'], $do_display['del_lnk'] and // $do_display['text_btn'] (keeps other default values) - $prev_table = $GLOBALS['fields_meta'][0]->table; + $prev_table = $this->_fields_meta[0]->table; $do_display['text_btn'] = (string) '1'; - for ($i = 0; $i < $GLOBALS['fields_cnt']; $i++) { + for ($i = 0; $i < $this->_fields_cnt; $i++) { $is_link = ($do_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['del_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['sort_lnk'] != '0') || ($do_display['ins_row'] != '0'); // 2.3.2 Displays edit/delete/sort/insert links? if ($is_link - && (($GLOBALS['fields_meta'][$i]->table == '') - || ($GLOBALS['fields_meta'][$i]->table != $prev_table)) + && (($this->_fields_meta[$i]->table == '') + || ($this->_fields_meta[$i]->table != $prev_table)) ) { // don't display links $do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; @@ -259,14 +264,14 @@ class PMA_DisplayResults } // end if (2.3.2) // 2.3.3 Always display print view link $do_display['pview_lnk'] = (string) '1'; - $prev_table = $GLOBALS['fields_meta'][$i]->table; + $prev_table = $this->_fields_meta[$i]->table; } // end for } // end if..elseif...else (2.1 -> 2.3) } // end if (2) // 3. Gets the total number of rows if it is unknown - if (isset($GLOBALS['unlim_num_rows']) && $GLOBALS['unlim_num_rows'] != '') { - $the_total = $GLOBALS['unlim_num_rows']; + if (isset($this->_unlim_num_rows) && $this->_unlim_num_rows != '') { + $the_total = $this->_unlim_num_rows; } elseif ((($do_display['nav_bar'] == '1') || ($do_display['sort_lnk'] == '1')) && (strlen($this->_db) && !empty($this->_table)) @@ -283,8 +288,8 @@ class PMA_DisplayResults // - For a VIEW we (probably) did not count the number of rows // so don't test this number here, it would remove the possibility // of sorting VIEW results. - if (isset($GLOBALS['unlim_num_rows']) - && $GLOBALS['unlim_num_rows'] < 2 + if (isset($this->_unlim_num_rows) + && $this->_unlim_num_rows < 2 && ! PMA_Table::isView($this->_db, $this->_table) ) { // force display of navbar for vertical/horizontal display-choice. @@ -304,6 +309,8 @@ class PMA_DisplayResults /** * Return true if we are executing a query in the form of * "SELECT * FROM ..." + * + * @param array $analyzed_sql the analyzed query * * @return boolean * @@ -311,13 +318,13 @@ class PMA_DisplayResults * * @see _getTableHeaders(), _getColumnParams() */ - private function _isSelect() + private function _isSelect($analyzed_sql) { - return ! ($GLOBALS['is_count'] || $GLOBALS['is_export'] - || $GLOBALS['is_func'] || $GLOBALS['is_analyse']) - && (count($GLOBALS['analyzed_sql'][0]['select_expr']) == 0) - && isset($GLOBALS['analyzed_sql'][0]['queryflags']['select_from']) - && (count($GLOBALS['analyzed_sql'][0]['table_ref']) == 1); + return ! ($this->_is_count || $this->_is_export + || $this->_is_func || $this->_is_analyse) + && (count($analyzed_sql[0]['select_expr']) == 0) + && isset($analyzed_sql[0]['queryflags']['select_from']) + && (count($analyzed_sql[0]['table_ref']) == 1); } @@ -381,6 +388,7 @@ class PMA_DisplayResults * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $id_for_direction_dropdown the id for the direction dropdown + * @param boolean $is_innodb whether its InnoDB or not * * @return string html content * @@ -389,7 +397,7 @@ class PMA_DisplayResults * @see _getTable() */ private function _getTableNavigation( - $pos_next, $pos_prev, $id_for_direction_dropdown + $pos_next, $pos_prev, $id_for_direction_dropdown, $is_innodb ) { $table_navigation_html = ''; @@ -402,8 +410,8 @@ class PMA_DisplayResults * @todo move this to a central place * @todo for other future table types */ - $GLOBALS['is_innodb'] = (isset($GLOBALS['showtable']['Type']) - && $GLOBALS['showtable']['Type'] == self::TABLE_TYPE_INNO_DB); + $is_innodb = (isset($this->_showtable['Type']) + && $this->_showtable['Type'] == self::TABLE_TYPE_INNO_DB); // Navigation bar $table_navigation_html .= '' @@ -433,7 +441,7 @@ class PMA_DisplayResults ) + 1; $nbTotalPage = @ceil( - $GLOBALS['unlim_num_rows'] + $this->_unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'] ); @@ -464,9 +472,9 @@ class PMA_DisplayResults } //_if1 // Display the "Show all" button if allowed - if (($GLOBALS['num_rows'] < $GLOBALS['unlim_num_rows']) + if (($this->_num_rows < $this->_unlim_num_rows) && ($GLOBALS['cfg']['ShowAll'] - || ($GLOBALS['cfg']['MaxRows'] * 5 >= $GLOBALS['unlim_num_rows'])) + || ($GLOBALS['cfg']['MaxRows'] * 5 >= $this->_unlim_num_rows)) ) { $table_navigation_html .= $this->_getShowAllButtonForTableNavigation( @@ -479,15 +487,15 @@ class PMA_DisplayResults $endpos = $_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows']; - if (($endpos < $GLOBALS['unlim_num_rows']) - && ($GLOBALS['num_rows'] >= $_SESSION['tmp_user_values']['max_rows']) + if (($endpos < $this->_unlim_num_rows) + && ($this->_num_rows >= $_SESSION['tmp_user_values']['max_rows']) && ($_SESSION['tmp_user_values']['max_rows'] != self::ALL_ROWS) ) { $table_navigation_html .= $this->_getMoveForwardButtonsForTableNavigation( - $html_sql_query, $pos_next, $GLOBALS['is_innodb'], - $GLOBALS['unlim_num_rows'], $GLOBALS['num_rows'] + $html_sql_query, $pos_next, $is_innodb, + $this->_unlim_num_rows, $this->_num_rows ); } // end move toward @@ -534,8 +542,8 @@ class PMA_DisplayResults . str_replace('\'', '\\\'', __('%d is not valid row number.')) . '\', ' . '0' - . (($GLOBALS['unlim_num_rows'] > 0) - ? ', ' . ($GLOBALS['unlim_num_rows'] - 1) + . (($this->_unlim_num_rows > 0) + ? ', ' . ($this->_unlim_num_rows - 1) : '' ) . ')' @@ -548,7 +556,7 @@ class PMA_DisplayResults $table_navigation_html .= $this->_getAdditionalFieldsForTableNavigation( $html_sql_query, $pos_next, - $GLOBALS['unlim_num_rows'], $id_for_direction_dropdown + $this->_unlim_num_rows, $id_for_direction_dropdown ); $table_navigation_html .= '' @@ -773,7 +781,7 @@ class PMA_DisplayResults // required to generate sort links that will remember whether the // "Show all" button has been clicked - $sql_md5 = md5($GLOBALS['sql_query']); + $sql_md5 = md5($this->_sql_query); $session_max_rows = $_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows']; @@ -808,16 +816,16 @@ class PMA_DisplayResults . ''; // Output data needed for column reordering and show/hide column - if ($this->_isSelect()) { + if ($this->_isSelect($analyzed_sql)) { $table_headers_html .= $this->_getDataForResettingColumnOrder(); } - $GLOBALS['vertical_display']['emptypre'] = 0; - $GLOBALS['vertical_display']['emptyafter'] = 0; - $GLOBALS['vertical_display']['textbtn'] = ''; + $this->_vertical_display['emptypre'] = 0; + $this->_vertical_display['emptyafter'] = 0; + $this->_vertical_display['textbtn'] = ''; // Display options (if we are not in print view) - if (! (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1'))) { + if (! (isset($this->_printview) && ($this->_printview == '1'))) { $table_headers_html .= $this->_getOptionsBlock(); @@ -856,14 +864,14 @@ class PMA_DisplayResults && ! $_SESSION['tmp_user_values']['hide_transformation'] ) { include_once './libraries/transformations.lib.php'; - $GLOBALS['mime_map'] = PMA_getMIME($this->_db, $this->_table); + $this->_mime_map = PMA_getMIME($this->_db, $this->_table); } // See if we have to highlight any header fields of a WHERE query. // Uses SQL-Parser results. $this->_setHighlightedColumnGlobalField($analyzed_sql); - list($col_order, $col_visib) = $this->_getColumnParams(); + list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); for ($j = 0; $j < $fields_cnt; $j++) { @@ -872,8 +880,8 @@ class PMA_DisplayResults // See if this column should get highlight because it's used in the // where-query. - $condition_field = (isset($GLOBALS['highlight_columns'][$fields_meta[$i]->name]) - || isset($GLOBALS['highlight_columns'][$this->getCommonFunctions()->backquote($fields_meta[$i]->name)])) + $condition_field = (isset($this->_highlight_columns[$fields_meta[$i]->name]) + || isset($this->_highlight_columns[$this->getCommonFunctions()->backquote($fields_meta[$i]->name)])) ? true : false; @@ -893,7 +901,7 @@ class PMA_DisplayResults $table_headers_html .= $sorted_headrer_html; - $GLOBALS['vertical_display']['desc'][] = ' '; @@ -1153,7 +1161,7 @@ class PMA_DisplayResults // ... at the left column of the result table header if possible // and required - $GLOBALS['vertical_display']['emptypre'] + $this->_vertical_display['emptypre'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; @@ -1165,7 +1173,7 @@ class PMA_DisplayResults } else { - $GLOBALS['vertical_display']['textbtn'] + $this->_vertical_display['textbtn'] = ' ' . "\n"; @@ -1178,7 +1186,7 @@ class PMA_DisplayResults ) { // ... elseif no button, displays empty(ies) col(s) if required - $GLOBALS['vertical_display']['emptypre'] + $this->_vertical_display['emptypre'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; @@ -1188,7 +1196,7 @@ class PMA_DisplayResults // end horizontal/horizontalfipped mode } else { - $GLOBALS['vertical_display']['textbtn'] = ' _vertical_display['textbtn'] = ' ' . "\n"; } // end vertical mode @@ -1256,7 +1264,7 @@ class PMA_DisplayResults private function _setHighlightedColumnGlobalField($analyzed_sql) { - $GLOBALS['highlight_columns'] = array(); + $this->_highlight_columns = array(); if (isset($analyzed_sql) && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['where_clause_identifiers']) ) { @@ -1268,7 +1276,7 @@ class PMA_DisplayResults foreach ($analyzed_sql[0]['where_clause_identifiers'] as $wci_nr => $wci ) { - $GLOBALS['highlight_columns'][$wci] = 'true'; + $this->_highlight_columns[$wci] = 'true'; } } } @@ -1291,7 +1299,7 @@ class PMA_DisplayResults $data_html = ''; // generate the column order, if it is set - $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); + $pmatable = new PMA_Table($this->_table, $this->_db); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); if ($col_order) { @@ -1307,10 +1315,10 @@ class PMA_DisplayResults } // generate table create time - if (! PMA_Table::isView($GLOBALS['table'], $GLOBALS['db'])) { + if (! PMA_Table::isView($this->_db, $this->_table)) { $data_html .= ''; } @@ -1464,11 +1472,11 @@ class PMA_DisplayResults if ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_FULL_TEXT) { // currently in fulltext mode so show the opposite link - $tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_partialtext.png'; + $tmp_image_file = $this->_pma_theme_image . 's_partialtext.png'; $tmp_txt = __('Partial texts'); $url_params_full_text['display_text'] = self::DISPLAY_PARTIAL_TEXT; } else { - $tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_fulltext.png'; + $tmp_image_file = $this->_pma_theme_image . 's_fulltext.png'; $tmp_txt = __('Full texts'); $url_params_full_text['display_text'] = self::DISPLAY_FULL_TEXT; } @@ -2028,7 +2036,7 @@ class PMA_DisplayResults && ($is_display['text_btn'] == '1') ) { - $GLOBALS['vertical_display']['emptyafter'] + $this->_vertical_display['emptyafter'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; @@ -2039,7 +2047,7 @@ class PMA_DisplayResults // end horizontal/horizontalflipped mode } else { - $GLOBALS['vertical_display']['textbtn'] = ' ' . "\n"; @@ -2053,7 +2061,7 @@ class PMA_DisplayResults // ... elseif no button, displays empty columns if required // (unless coming from Browse mode print view) - $GLOBALS['vertical_display']['emptyafter'] + $this->_vertical_display['emptyafter'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; @@ -2063,7 +2071,7 @@ class PMA_DisplayResults // end horizontal/horizontalflipped mode } else { - $GLOBALS['vertical_display']['textbtn'] = ' _vertical_display['textbtn'] = ' ' . "\n"; } // end vertical mode } @@ -2234,16 +2242,16 @@ class PMA_DisplayResults } $row_no = 0; - $GLOBALS['vertical_display']['edit'] = array(); - $GLOBALS['vertical_display']['copy'] = array(); - $GLOBALS['vertical_display']['delete'] = array(); - $GLOBALS['vertical_display']['data'] = array(); - $GLOBALS['vertical_display']['row_delete'] = array(); + $this->_vertical_display['edit'] = array(); + $this->_vertical_display['copy'] = array(); + $this->_vertical_display['delete'] = array(); + $this->_vertical_display['data'] = array(); + $this->_vertical_display['row_delete'] = array(); // name of the class added to all grid editable elements $grid_edit_class = 'grid_edit'; // prepare to get the column order, if available - list($col_order, $col_visib) = $this->_getColumnParams(); + list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); // Correction University of Virginia 19991216 in the while below // Previous code assumed that all tables have keys, specifically that @@ -2268,7 +2276,7 @@ class PMA_DisplayResults // "vertical display" mode stuff $table_body_html .= $this->_getVerticalDisplaySupportSegments( - $GLOBALS['vertical_display'], $row_no, $directionCondition + $this->_vertical_display, $row_no, $directionCondition ); $alternating_color_class = ($odd_row ? 'odd' : 'even'); @@ -2289,7 +2297,7 @@ class PMA_DisplayResults */ list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $GLOBALS['fields_cnt'], $GLOBALS['fields_meta'], $row + $dt_result, $this->_fields_cnt, $this->_fields_meta, $row ); $where_clause_html = urlencode($where_clause); @@ -2435,12 +2443,12 @@ class PMA_DisplayResults $row_values_html = ''; - for ($j = 0; $j < $GLOBALS['fields_cnt']; ++$j) { + for ($j = 0; $j < $this->_fields_cnt; ++$j) { // assign $i with appropriate column order $i = $col_order ? $col_order[$j] : $j; - $meta = $GLOBALS['fields_meta'][$i]; + $meta = $this->_fields_meta[$i]; $not_null_class = $meta->not_null ? 'not_null' : ''; $relation_class = isset($map[$meta->name]) ? 'relation' : ''; $hide_class = ($col_visib && !$col_visib[$j] @@ -2465,9 +2473,9 @@ class PMA_DisplayResults // See if this column should get highlight because it's used in the // where-query. - $condition_field = (isset($GLOBALS['highlight_columns']) - && (isset($GLOBALS['highlight_columns'][$meta->name]) - || isset($GLOBALS['highlight_columns'][$this->getCommonFunctions()->backquote($meta->name)]))) + $condition_field = (isset($this->_highlight_columns) + && (isset($this->_highlight_columns[$meta->name]) + || isset($this->_highlight_columns[$this->getCommonFunctions()->backquote($meta->name)]))) ? true : false; @@ -2480,12 +2488,12 @@ class PMA_DisplayResults && $GLOBALS['cfg']['BrowseMIME'] ) { - if (isset($GLOBALS['mime_map'][$meta->name]['mimetype']) - && isset($GLOBALS['mime_map'][$meta->name]['transformation']) - && !empty($GLOBALS['mime_map'][$meta->name]['transformation']) + if (isset($this->_mime_map[$meta->name]['mimetype']) + && isset($this->_mime_map[$meta->name]['transformation']) + && !empty($this->_mime_map[$meta->name]['transformation']) ) { - $file = $GLOBALS['mime_map'][$meta->name]['transformation']; + $file = $this->_mime_map[$meta->name]['transformation']; $include_file = 'libraries/plugins/transformations/' . $file; if (file_exists($include_file)) { @@ -2499,17 +2507,17 @@ class PMA_DisplayResults ); $transform_options = PMA_transformation_getOptions( - isset($GLOBALS['mime_map'][$meta->name] + isset($this->_mime_map[$meta->name] ['transformation_options'] ) - ? $GLOBALS['mime_map'][$meta->name] + ? $this->_mime_map[$meta->name] ['transformation_options'] : '' ); $meta->mimetype = str_replace( '_', '/', - $GLOBALS['mime_map'][$meta->name]['mimetype'] + $this->_mime_map[$meta->name]['mimetype'] ); } // end if file_exists @@ -2538,7 +2546,7 @@ class PMA_DisplayResults // will show both fields NULL even if only one is NULL, // so use the $pointer - $GLOBALS['vertical_display']['data'][$row_no][$i] + $this->_vertical_display['data'][$row_no][$i] = $this->_getDataCellForNumericColumns( $row[$i], $class, $condition_field, $meta, $map, $is_field_truncated, $analyzed_sql, @@ -2553,7 +2561,7 @@ class PMA_DisplayResults // TEXT fields type so we have to ensure it's really a BLOB $field_flags = PMA_DBI_field_flags($dt_result, $i); - $GLOBALS['vertical_display']['data'][$row_no][$i] + $this->_vertical_display['data'][$row_no][$i] = $this->_getDataCellForBlobColumns( $row[$i], $class, $meta, $_url_params, $field_flags, $transformation_plugin, $default_function, @@ -2567,7 +2575,7 @@ class PMA_DisplayResults // inline-edit geometry data. $class = str_replace('grid_edit', '', $class); - $GLOBALS['vertical_display']['data'][$row_no][$i] + $this->_vertical_display['data'][$row_no][$i] = $this->_getDataCellForGeometryColumns( $row[$i], $class, $meta, $map, $_url_params, $condition_field, $transformation_plugin, @@ -2578,7 +2586,7 @@ class PMA_DisplayResults } else { // n o t n u m e r i c a n d n o t B L O B - $GLOBALS['vertical_display']['data'][$row_no][$i] + $this->_vertical_display['data'][$row_no][$i] = $this->_getDataCellForNonNumericAndNonBlobColumns( $row[$i], $class, $meta, $map, $_url_params, $condition_field, $transformation_plugin, @@ -2591,15 +2599,15 @@ class PMA_DisplayResults // output stored cell if ($directionCondition) { $row_values_html - .= $GLOBALS['vertical_display']['data'][$row_no][$i]; + .= $this->_vertical_display['data'][$row_no][$i]; } - if (isset($GLOBALS['vertical_display']['rowdata'][$i][$row_no])) { - $GLOBALS['vertical_display']['rowdata'][$i][$row_no] - .= $GLOBALS['vertical_display']['data'][$row_no][$i]; + if (isset($this->_vertical_display['rowdata'][$i][$row_no])) { + $this->_vertical_display['rowdata'][$i][$row_no] + .= $this->_vertical_display['data'][$row_no][$i]; } else { - $GLOBALS['vertical_display']['rowdata'][$i][$row_no] - = $GLOBALS['vertical_display']['data'][$row_no][$i]; + $this->_vertical_display['rowdata'][$i][$row_no] + = $this->_vertical_display['data'][$row_no][$i]; } } // end for @@ -2639,11 +2647,11 @@ class PMA_DisplayResults $copy_url, $copy_str, $alternating_color_class, $condition_array ) { - if (! isset($GLOBALS['vertical_display']['edit'][$row_no])) { - $GLOBALS['vertical_display']['edit'][$row_no] = ''; - $GLOBALS['vertical_display']['copy'][$row_no] = ''; - $GLOBALS['vertical_display']['delete'][$row_no] = ''; - $GLOBALS['vertical_display']['row_delete'][$row_no] = ''; + if (! isset($this->_vertical_display['edit'][$row_no])) { + $this->_vertical_display['edit'][$row_no] = ''; + $this->_vertical_display['copy'][$row_no] = ''; + $this->_vertical_display['delete'][$row_no] = ''; + $this->_vertical_display['row_delete'][$row_no] = ''; } $vertical_class = ' row_' . $row_no; @@ -2659,7 +2667,7 @@ class PMA_DisplayResults && ($is_display['del_lnk'] != self::KILL_PROCESS) ) { - $GLOBALS['vertical_display']['row_delete'][$row_no] + $this->_vertical_display['row_delete'][$row_no] .= $this->_getCheckboxForMultiRowSubmissions( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', @@ -2667,12 +2675,12 @@ class PMA_DisplayResults ); } else { - unset($GLOBALS['vertical_display']['row_delete'][$row_no]); + unset($this->_vertical_display['row_delete'][$row_no]); } if (isset($edit_url)) { - $GLOBALS['vertical_display']['edit'][$row_no] .= $this->_getEditLink( + $this->_vertical_display['edit'][$row_no] .= $this->_getEditLink( $edit_url, $alternating_color_class . ' ' . $edit_anchor_class . $vertical_class, $edit_str, @@ -2681,18 +2689,18 @@ class PMA_DisplayResults ); } else { - unset($GLOBALS['vertical_display']['edit'][$row_no]); + unset($this->_vertical_display['edit'][$row_no]); } if (isset($copy_url)) { - $GLOBALS['vertical_display']['copy'][$row_no] .= $this->_getCopyLink( + $this->_vertical_display['copy'][$row_no] .= $this->_getCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, $alternating_color_class . $vertical_class ); } else { - unset($GLOBALS['vertical_display']['copy'][$row_no]); + unset($this->_vertical_display['copy'][$row_no]); } if (isset($del_url)) { @@ -2701,14 +2709,14 @@ class PMA_DisplayResults $js_conf = ''; } - $GLOBALS['vertical_display']['delete'][$row_no] + $this->_vertical_display['delete'][$row_no] .= $this->_getDeleteLink( $del_url, $del_str, $js_conf, $alternating_color_class . $vertical_class ); } else { - unset($GLOBALS['vertical_display']['delete'][$row_no]); + unset($this->_vertical_display['delete'][$row_no]); } } // end of the '_gatherLinksForLaterOutputs()' function @@ -2755,6 +2763,8 @@ class PMA_DisplayResults /** * Get column order and column visibility + * + * @param array $analyzed_sql the analyzed query * * @return array 2 element array - $col_order, $col_visib * @@ -2762,10 +2772,10 @@ class PMA_DisplayResults * * @see _getTableBody() */ - private function _getColumnParams() + private function _getColumnParams($analyzed_sql) { - if ($this->_isSelect()) { - $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); + if ($this->_isSelect($analyzed_sql)) { + $pmatable = new PMA_Table($this->_table, $this->_db); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); $col_visib = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_VISIB); } else { @@ -3046,7 +3056,7 @@ class PMA_DisplayResults . $relation_class . ' ' . $hide_class . ' ' . $field_type_class; if (($_SESSION['tmp_user_values']['disp_direction'] == self::DISP_DIR_VERTICAL) - && (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) + && (! isset($this->_printview) || ($this->_printview != '1')) ) { // the row number corresponds to a data row, not HTML table row $class .= ' row_' . $row_no; @@ -3438,7 +3448,7 @@ class PMA_DisplayResults // so don't treat them as BINARY } elseif (stristr($field_flags, self::BINARY_FIELD) && ($meta->type == self::STRING_FIELD) - && !(isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse']) + && !(isset($this->_is_analyse) && $this->_is_analyse) ) { if ($_SESSION['tmp_user_values']['display_binary']) { @@ -3513,6 +3523,8 @@ class PMA_DisplayResults /** * Get the resulted table with the vertical direction mode. + * + * @param array $analyzed_sql the analyzed query * * @return string html content * @@ -3520,16 +3532,16 @@ class PMA_DisplayResults * * @see _getTable() */ - private function _getVerticalTable() + private function _getVerticalTable($analyzed_sql) { $vertical_table_html = ''; // Prepares "multi row delete" link at top if required if (($GLOBALS['cfg']['RowActionLinks'] != self::POSITION_RIGHT) - && is_array($GLOBALS['vertical_display']['row_delete']) - && ((count($GLOBALS['vertical_display']['row_delete']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['row_delete']) + && ((count($this->_vertical_display['row_delete']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= '' . "\n"; @@ -3539,9 +3551,9 @@ class PMA_DisplayResults $vertical_table_html .= '' . "\n"; } - $vertical_table_html .= $GLOBALS['vertical_display']['textbtn'] + $vertical_table_html .= $this->_vertical_display['textbtn'] . $this->_getCheckBoxesForMultipleRowOperations( - $GLOBALS['vertical_display'], '_left' + $this->_vertical_display, '_left' ) . '' . "\n"; } // end if @@ -3549,43 +3561,43 @@ class PMA_DisplayResults // Prepares "edit" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['edit']) - && ((count($GLOBALS['vertical_display']['edit']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['edit']) + && ((count($this->_vertical_display['edit']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'edit' + $this->_vertical_display, 'edit' ); } // end if // Prepares "copy" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['copy']) - && ((count($GLOBALS['vertical_display']['copy']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['copy']) + && ((count($this->_vertical_display['copy']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'copy' + $this->_vertical_display, 'copy' ); } // end if // Prepares "delete" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['delete']) - && ((count($GLOBALS['vertical_display']['delete']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['delete']) + && ((count($this->_vertical_display['delete']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'delete' + $this->_vertical_display, 'delete' ); } // end if - list($col_order, $col_visib) = $this->_getColumnParams(); + list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); // Prepares data - foreach ($GLOBALS['vertical_display']['desc'] AS $j => $val) { + foreach ($this->_vertical_display['desc'] AS $j => $val) { // assign appropriate key with current column order $key = $col_order ? $col_order[$j] : $j; @@ -3596,7 +3608,7 @@ class PMA_DisplayResults . $val; $cell_displayed = 0; - foreach ($GLOBALS['vertical_display']['rowdata'][$key] as $subval) { + foreach ($this->_vertical_display['rowdata'][$key] as $subval) { if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) @@ -3616,15 +3628,15 @@ class PMA_DisplayResults // Prepares "multi row delete" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['row_delete']) - && ((count($GLOBALS['vertical_display']['row_delete']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['row_delete']) + && ((count($this->_vertical_display['row_delete']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= '' . "\n" - . $GLOBALS['vertical_display']['textbtn'] + . $this->_vertical_display['textbtn'] . $this->_getCheckBoxesForMultipleRowOperations( - $GLOBALS['vertical_display'], '_right' + $this->_vertical_display, '_right' ) . '' . "\n"; } // end if @@ -3632,36 +3644,36 @@ class PMA_DisplayResults // Prepares "edit" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['edit']) - && ((count($GLOBALS['vertical_display']['edit']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['edit']) + && ((count($this->_vertical_display['edit']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'edit' + $this->_vertical_display, 'edit' ); } // end if // Prepares "copy" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['copy']) - && ((count($GLOBALS['vertical_display']['copy']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['copy']) + && ((count($this->_vertical_display['copy']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'copy' + $this->_vertical_display, 'copy' ); } // end if // Prepares "delete" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($GLOBALS['vertical_display']['delete']) - && ((count($GLOBALS['vertical_display']['delete']) > 0) - || !empty($GLOBALS['vertical_display']['textbtn'])) + && is_array($this->_vertical_display['delete']) + && ((count($this->_vertical_display['delete']) > 0) + || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $GLOBALS['vertical_display'], 'delete' + $this->_vertical_display, 'delete' ); } @@ -3773,10 +3785,10 @@ class PMA_DisplayResults public function setConfigParamsForDisplayTable() { - $sql_md5 = md5($GLOBALS['sql_query']); + $sql_md5 = md5($this->_sql_query); $_SESSION['tmp_user_values']['query'][$sql_md5]['sql'] - = $GLOBALS['sql_query']; + = $this->_sql_query; $valid_disp_dir = PMA_isValid( $_REQUEST['disp_direction'], @@ -4012,6 +4024,31 @@ class PMA_DisplayResults public function getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) { + // Initialize global variables which is not set in constructor + $this->_unlim_num_rows = $GLOBALS['unlim_num_rows']; + $this->_fields_meta = $GLOBALS['fields_meta']; + $this->_is_count = $GLOBALS['is_count']; + $this->_is_export = $GLOBALS['is_export']; + $this->_is_func = $GLOBALS['is_func']; + $this->_is_analyse = $GLOBALS['is_analyse']; + $this->_num_rows = $GLOBALS['num_rows']; + $this->_fields_cnt = $GLOBALS['fields_cnt']; + $this->_querytime = $GLOBALS['querytime']; + $this->_pma_theme_image = $GLOBALS['pmaThemeImage']; + $this->_text_dir = $GLOBALS['text_dir']; + $this->_is_maint = $GLOBALS['is_maint']; + $this->_is_explain = $GLOBALS['is_explain']; + $this->_is_show = $GLOBALS['is_show']; + if (isset ($GLOBALS['showtable'])) { + $this->_showtable = $GLOBALS['showtable']; + } + if (isset ($GLOBALS['printview'])) { + $this->_printview = $GLOBALS['printview']; + } + if (isset ($GLOBALS['url_query'])) { + $this->_url_query = $GLOBALS['url_query']; + } + $table_html = ''; // why was this called here? (already called from sql.php) @@ -4021,8 +4058,8 @@ class PMA_DisplayResults * @todo move this to a central place * @todo for other future table types */ - $is_innodb = (isset($GLOBALS['showtable']['Type']) - && $GLOBALS['showtable']['Type'] == self::TABLE_TYPE_INNO_DB); + $is_innodb = (isset($this->_showtable['Type']) + && $this->_showtable['Type'] == self::TABLE_TYPE_INNO_DB); if ($is_innodb && ! isset($analyzed_sql[0]['queryflags']['union']) @@ -4067,7 +4104,7 @@ class PMA_DisplayResults // 1.4 Prepares display of first and last value of the sorted column $sorted_column_message = $this->_getSortedColumnMessage( - $dt_result, $GLOBALS['fields_meta'], $GLOBALS['num_rows'], + $dt_result, $this->_fields_meta, $this->_num_rows, $sort_expression_nodirection ); @@ -4079,7 +4116,7 @@ class PMA_DisplayResults $message = $this->_setMessageInformation( $sorted_column_message, - $analyzed_sql[0]['limit_clause'], $GLOBALS['unlim_num_rows'], + $analyzed_sql[0]['limit_clause'], $this->_unlim_num_rows, $total, $pos_next, $pre_count, $after_count ); @@ -4087,7 +4124,7 @@ class PMA_DisplayResults $message, $this->_sql_query, 'success' ); - } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { + } elseif (! isset($this->_printview) || ($this->_printview != '1')) { $table_html .= $this->getCommonFunctions()->getMessage( __('Your SQL query has been executed successfully'), @@ -4104,7 +4141,7 @@ class PMA_DisplayResults // table does not always contain a real table name, // for example in MySQL 5.0.x, the query SHOW STATUS // returns STATUS as a table name - $this->_table = $GLOBALS['fields_meta'][0]->table; + $this->_table = $this->_fields_meta[0]->table; } else { $this->_table = ''; } @@ -4113,7 +4150,7 @@ class PMA_DisplayResults $table_html .= $this->_getPlacedTableNavigatoins( $is_display, $analyzed_sql, $pos_next, $pos_prev, - self::PLACE_TOP_DIRECTION_DROPDOWN, "\n" + self::PLACE_TOP_DIRECTION_DROPDOWN, "\n", $is_innodb ); // 2b ----- Get field references from Database ----- @@ -4148,8 +4185,8 @@ class PMA_DisplayResults // 3. ----- Prepare the results table ----- $table_html .= $this->_getTableHeaders( - $is_display, $GLOBALS['fields_meta'], - $GLOBALS['fields_cnt'], $analyzed_sql, $sort_expression, + $is_display, $this->_fields_meta, + $this->_fields_cnt, $analyzed_sql, $sort_expression, $sort_expression_nodirection, $sort_direction ) . '' . "\n"; @@ -4161,10 +4198,10 @@ class PMA_DisplayResults // vertical output case if ($_SESSION['tmp_user_values']['disp_direction'] == self::DISP_DIR_VERTICAL) { - $table_html .= $this->_getVerticalTable(); + $table_html .= $this->_getVerticalTable($analyzed_sql); } // end if - unset($GLOBALS['vertical_display']); + unset($this->_vertical_display); $table_html .= '' . "\n" . ''; @@ -4175,8 +4212,8 @@ class PMA_DisplayResults ) { $table_html .= $this->_getMultiRowOperationLinks( - $dt_result, $GLOBALS['fields_cnt'], $GLOBALS['fields_meta'], - $GLOBALS['num_rows'], $analyzed_sql, $is_display['del_lnk'] + $dt_result, $this->_fields_cnt, $this->_fields_meta, + $this->_num_rows, $analyzed_sql, $is_display['del_lnk'] ); } @@ -4185,11 +4222,11 @@ class PMA_DisplayResults $table_html .= $this->_getPlacedTableNavigatoins( $is_display, $analyzed_sql, $pos_next, $pos_prev, - self::PLACE_BOTTOM_DIRECTION_DROPDOWN, '
' . "\n" + self::PLACE_BOTTOM_DIRECTION_DROPDOWN, '
' . "\n", $is_innodb ); // 6. ----- Prepare "Query results operations" - if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { + if (! isset($this->_printview) || $this->_printview != '1') { $table_html .= $this->_getResultsOperations( $the_disp_mode, $analyzed_sql ); @@ -4499,7 +4536,7 @@ class PMA_DisplayResults } $messagge_qt = PMA_Message::notice(__('Query took %01.4f sec') . ')'); - $messagge_qt->addParam($GLOBALS['querytime']); + $messagge_qt->addParam($this->_querytime); $message->addMessage($messagge_qt, ''); if (! is_null($sorted_column_message)) { @@ -4592,8 +4629,8 @@ class PMA_DisplayResults if ($_SESSION['tmp_user_values']['disp_direction'] != self::DISP_DIR_VERTICAL) { $links_html .= '' . __('With selected:') . ''; } @@ -4624,9 +4661,9 @@ class PMA_DisplayResults $links_html .= '' . "\n"; - if (! empty($GLOBALS['url_query'])) { + if (! empty($this->_url_query)) { $links_html .= '' . "\n"; + .' value="' . $this->_url_query . '" />' . "\n"; } // fetch last row of the result set @@ -4662,6 +4699,7 @@ class PMA_DisplayResults * @param integer $pos_prev the offset for the "previous" page * @param string $place the place to show navigation * @param string $empty_line empty line depend on the $place + * @param boolean $is_innodb whether its InnoDB or not * * @return string html content of navigation bar * @@ -4670,7 +4708,8 @@ class PMA_DisplayResults * @see _getTable() */ private function _getPlacedTableNavigatoins( - $is_display, $analyzed_sql, $pos_next, $pos_prev, $place, $empty_line + $is_display, $analyzed_sql, $pos_next, $pos_prev + , $place, $empty_line, $is_innodb ) { $navigation_html = ''; @@ -4684,14 +4723,14 @@ class PMA_DisplayResults } $navigation_html .= $this->_getTableNavigation( - $pos_next, $pos_prev, 'top_direction_dropdown' + $pos_next, $pos_prev, 'top_direction_dropdown', $is_innodb ); if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { $navigation_html .= "\n"; } - } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { + } elseif (! isset($this->_printview) || ($this->_printview != '1')) { $navigation_html .= "\n" . '

' . "\n"; } @@ -4790,7 +4829,7 @@ class PMA_DisplayResults $header_shown = true; } - $_url_params['unlim_num_rows'] = $GLOBALS['unlim_num_rows']; + $_url_params['unlim_num_rows'] = $this->_unlim_num_rows; /** * At this point we don't know the table name; this can happen @@ -4830,7 +4869,7 @@ class PMA_DisplayResults // prepare GIS chart $geometry_found = false; // If atleast one geometry field is found - foreach ($GLOBALS['fields_meta'] as $meta) { + foreach ($this->_fields_meta as $meta) { if ($meta->type == self::GEOMETRY_FIELD) { $geometry_found = true; break; @@ -5073,7 +5112,7 @@ class PMA_DisplayResults $dispval = ''; } // end if... else... - if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') { + if (isset($this->_printview) && $this->_printview == '1') { $result .= ($transformation_plugin != $default_function ? $transformation_plugin->applyTransformation( From f37304b8e03ff19a44b31ea12349f689b9f1e88a Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sat, 7 Jul 2012 11:06:20 +0530 Subject: [PATCH 06/82] Use class varables without passing them to functions in PMA_DisplayResults class --- libraries/DisplayResults.class.php | 228 ++++++++++++++++------------- 1 file changed, 130 insertions(+), 98 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index f8425799f0..c44d4bbad2 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -66,14 +66,83 @@ class PMA_DisplayResults const ALL_ROWS = 'all'; const QUERY_TYPE_SELECT = 'SELECT'; - + /** PMA_CommonFunctions object */ private $_common_functions; - private $_db, $_table, $_goto, $_sql_query; - private $_unlim_num_rows, $_fields_meta, $_is_count, $_is_export, $_is_func, - $_is_analyse, $_num_rows, $_showtable, $_highlight_columns, - $_vertical_display, $_fields_cnt, $_printview, $_querytime, - $_pma_theme_image, $_text_dir, $_url_query, $_is_maint, $_is_explain, - $_is_show, $_mime_map; + + /** string Database name */ + private $_db; + + /** string Table name */ + private $_table; + + /** string the URL to go back in case of errors */ + private $_goto; + + /** string the SQL query */ + private $_sql_query; + + /** + * integer the total number of rows returned by the SQL query without any + * appended "LIMIT" clause programmatically + */ + private $_unlim_num_rows; + + /** array meta information about fields */ + private $_fields_meta; + + /** boolean */ + private $_is_count; + + /** integer */ + private $_is_export; + + /** boolean */ + private $_is_func; + + /** integer */ + private $_is_analyse; + + /** integer the total number of rows returned by the SQL query */ + private $_num_rows; + + /** array table definitions */ + private $_showtable; + + /** array column names to highlight */ + private $_highlight_columns; + + /** array informations used with vertical display mode */ + private $_vertical_display; + + /** integer the total number of fields returned by the SQL query */ + private $_fields_cnt; + + /** string */ + private $_printview; + + /** double time taken for execute the SQL query */ + private $_querytime; + + /** string path for theme images directory */ + private $_pma_theme_image; + + /** string */ + private $_text_dir; + + /** string URL query */ + private $_url_query; + + /** boolean */ + private $_is_maint; + + /** boolean */ + private $_is_explain; + + /** boolean */ + private $_is_show; + + /** array mime types information of fields */ + private $_mime_map; /** @@ -494,8 +563,7 @@ class PMA_DisplayResults $table_navigation_html .= $this->_getMoveForwardButtonsForTableNavigation( - $html_sql_query, $pos_next, $is_innodb, - $this->_unlim_num_rows, $this->_num_rows + $html_sql_query, $pos_next, $is_innodb ); } // end move toward @@ -555,8 +623,7 @@ class PMA_DisplayResults ); $table_navigation_html .= $this->_getAdditionalFieldsForTableNavigation( - $html_sql_query, $pos_next, - $this->_unlim_num_rows, $id_for_direction_dropdown + $html_sql_query, $pos_next, $id_for_direction_dropdown ); $table_navigation_html .= '' @@ -629,8 +696,6 @@ class PMA_DisplayResults * @param string $html_sql_query the sql encoded by html special characters * @param integer $pos_next the offset for the "next" page * @param boolean $is_innodb whether its InnoDB or not - * @param integer $unlim_num_rows the total number of rows returned by the - * @param integer $num_rows the total number of rows returned by the * * @return string $buttons_html html content * @@ -639,7 +704,7 @@ class PMA_DisplayResults * @see _getTableNavigation() */ private function _getMoveForwardButtonsForTableNavigation( - $html_sql_query, $pos_next, $is_innodb, $unlim_num_rows, $num_rows + $html_sql_query, $pos_next, $is_innodb ) { // display the Next button @@ -651,7 +716,7 @@ class PMA_DisplayResults ); // prepare some options for the End button - if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) { + if ($is_innodb && $this->_unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) { $input_for_real_end = ''; // no backquote around this message @@ -662,8 +727,8 @@ class PMA_DisplayResults $onsubmit = 'onsubmit="return ' . ($_SESSION['tmp_user_values']['pos'] - + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows - && $num_rows >= $_SESSION['tmp_user_values']['max_rows']) + + $_SESSION['tmp_user_values']['max_rows'] < $this->_unlim_num_rows + && $this->_num_rows >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false' . '"'; @@ -671,7 +736,7 @@ class PMA_DisplayResults $buttons_html .= $this->_getTableNavigationButton( '>>', _pgettext('Last page', 'End'), - @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) + @((ceil($this->_unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']), $html_sql_query, $onsubmit, $input_for_real_end, $onclick ); @@ -688,10 +753,6 @@ class PMA_DisplayResults * @param string $html_sql_query the sql encoded by html special * characters * @param integer $pos_next the offset for the "next" page - * @param integer $unlim_num_rows the total number of rows returned - * by the SQL query without any - * programmatically appended "LIMIT" - * clause * @param string $id_for_direction_dropdown the id for the direction dropdown * * @return string $additional_fields_html html content @@ -701,8 +762,7 @@ class PMA_DisplayResults * @see _getTableNavigation() */ private function _getAdditionalFieldsForTableNavigation( - $html_sql_query, $pos_next, - $unlim_num_rows, $id_for_direction_dropdown + $html_sql_query, $pos_next, $id_for_direction_dropdown ) { $additional_fields_html = ''; @@ -715,7 +775,7 @@ class PMA_DisplayResults . ' value="' . __('Show') . ' :" />' . __('Start row') . ': ' . "\n" . '' . __('Number of rows') . ': ' . "\n" . '' . "\n" . $order_link . $comments . ' ' . "\n"; } else { // 2.2 Results can't be sorted @@ -913,16 +969,16 @@ class PMA_DisplayResults $table_headers_html .= $this->_getDraggableClassForNonSortableColumns( $col_visib, $col_visib[$j], $condition_field, - $direction, $fields_meta[$i], $comments + $direction, $this->_fields_meta[$i], $comments ); } $this->_vertical_display['desc'][] = ' ' . "\n" . ' ' - . htmlspecialchars($fields_meta[$i]->name) + . htmlspecialchars($this->_fields_meta[$i]->name) . "\n" . $comments . ' '; } // end else (2.2) } // end for @@ -1093,8 +1149,6 @@ class PMA_DisplayResults * @param boolean $directionCondition display direction horizontal or * horizontalflipped * @param array &$is_display which elements to display - * @param integer $fields_cnt the total number of fields - * returned by the SQL query * @param string $full_or_partial_text_link full/partial link or text button * * @return array 3 element array - $colspan, $rowspan, $button_html @@ -1104,7 +1158,7 @@ class PMA_DisplayResults * @see _getTableHeaders() */ private function _getFeildVisibilityParams( - $directionCondition, &$is_display, $fields_cnt, $full_or_partial_text_link + $directionCondition, &$is_display, $full_or_partial_text_link ) { $button_html = ''; @@ -1139,7 +1193,7 @@ class PMA_DisplayResults if ($directionCondition) { - $button_html .= '' + $button_html .= '' . '' . ''; @@ -3553,7 +3607,7 @@ class PMA_DisplayResults $vertical_table_html .= $this->_vertical_display['textbtn'] . $this->_getCheckBoxesForMultipleRowOperations( - $this->_vertical_display, '_left' + '_left' ) . '' . "\n"; } // end if @@ -3566,7 +3620,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'edit' + 'edit' ); } // end if @@ -3578,7 +3632,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'copy' + 'copy' ); } // end if @@ -3590,7 +3644,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'delete' + 'delete' ); } // end if @@ -3635,9 +3689,7 @@ class PMA_DisplayResults $vertical_table_html .= '' . "\n" . $this->_vertical_display['textbtn'] - . $this->_getCheckBoxesForMultipleRowOperations( - $this->_vertical_display, '_right' - ) + . $this->_getCheckBoxesForMultipleRowOperations('_right') . '' . "\n"; } // end if @@ -3649,7 +3701,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'edit' + 'edit' ); } // end if @@ -3661,7 +3713,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'copy' + 'copy' ); } // end if @@ -3673,7 +3725,7 @@ class PMA_DisplayResults || !empty($this->_vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( - $this->_vertical_display, 'delete' + 'delete' ); } @@ -3685,7 +3737,6 @@ class PMA_DisplayResults /** * Prepare edit, copy and delete links for verticle table * - * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * * @return string $links_html html content @@ -3694,26 +3745,24 @@ class PMA_DisplayResults * * @see _getVerticalTable() */ - private function _getOperationLinksForVerticleTable( - $vertical_display, $operation - ) { + private function _getOperationLinksForVerticleTable($operation) { $link_html = '' . "\n"; - if (! is_array($vertical_display['row_delete'])) { + if (! is_array($this->_vertical_display['row_delete'])) { if (($operation == 'edit') || ($operation == 'copy')) { - $link_html .= $vertical_display['textbtn']; + $link_html .= $this->_vertical_display['textbtn']; } elseif ($operation == 'delete') { - if (! is_array($vertical_display['edit'])) { - $link_html .= $vertical_display['textbtn']; + if (! is_array($this->_vertical_display['edit'])) { + $link_html .= $this->_vertical_display['textbtn']; } } } - foreach ($vertical_display[$operation] as $val) { + foreach ($this->_vertical_display[$operation] as $val) { $link_html .= $val; } // end while @@ -3727,7 +3776,6 @@ class PMA_DisplayResults /** * Get checkboxes for multiple row data operations * - * @param array $vertical_display the information to display * @param string $dir _left / _right * * @return $checkBoxes_html html content @@ -3736,13 +3784,13 @@ class PMA_DisplayResults * * @see _getVerticalTable() */ - private function _getCheckBoxesForMultipleRowOperations($vertical_display, $dir) + private function _getCheckBoxesForMultipleRowOperations($dir) { $checkBoxes_html = ''; $cell_displayed = 0; - foreach ($vertical_display['row_delete'] as $val) { + foreach ($this->_vertical_display['row_delete'] as $val) { if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) @@ -4104,8 +4152,7 @@ class PMA_DisplayResults // 1.4 Prepares display of first and last value of the sorted column $sorted_column_message = $this->_getSortedColumnMessage( - $dt_result, $this->_fields_meta, $this->_num_rows, - $sort_expression_nodirection + $dt_result, $sort_expression_nodirection ); @@ -4115,8 +4162,7 @@ class PMA_DisplayResults if (($is_display['nav_bar'] == '1') && isset($pos_next)) { $message = $this->_setMessageInformation( - $sorted_column_message, - $analyzed_sql[0]['limit_clause'], $this->_unlim_num_rows, + $sorted_column_message, $analyzed_sql[0]['limit_clause'], $total, $pos_next, $pre_count, $after_count ); @@ -4185,8 +4231,7 @@ class PMA_DisplayResults // 3. ----- Prepare the results table ----- $table_html .= $this->_getTableHeaders( - $is_display, $this->_fields_meta, - $this->_fields_cnt, $analyzed_sql, $sort_expression, + $is_display, $analyzed_sql, $sort_expression, $sort_expression_nodirection, $sort_direction ) . '' . "\n"; @@ -4212,8 +4257,7 @@ class PMA_DisplayResults ) { $table_html .= $this->_getMultiRowOperationLinks( - $dt_result, $this->_fields_cnt, $this->_fields_meta, - $this->_num_rows, $analyzed_sql, $is_display['del_lnk'] + $dt_result, $analyzed_sql, $is_display['del_lnk'] ); } @@ -4321,9 +4365,6 @@ class PMA_DisplayResults * @param integer &$dt_result the link id associated to the * query which results have to * be displayed - * @param array $fields_meta the list of fields properties - * @param integer $num_rows the total number of rows returned - * by the SQL query * @param string $sort_expression_nodirection sort expression without direction * * @return string html content @@ -4334,7 +4375,7 @@ class PMA_DisplayResults * @see getTable() */ private function _getSortedColumnMessage( - &$dt_result, $fields_meta, $num_rows, $sort_expression_nodirection + &$dt_result, $sort_expression_nodirection ) { if (! empty($sort_expression_nodirection)) { @@ -4354,7 +4395,7 @@ class PMA_DisplayResults // (this might be a multi-table query) $sorted_column_index = false; - foreach ($fields_meta as $key => $meta) { + foreach ($this->_fields_meta as $key => $meta) { if (($meta->table == $sort_table) && ($meta->name == $sort_column)) { $sorted_column_index = $key; break; @@ -4372,7 +4413,7 @@ class PMA_DisplayResults $transform_options = array(); // check for non printable sorted row data - $meta = $fields_meta[$sorted_column_index]; + $meta = $this->_fields_meta[$sorted_column_index]; if (stristr($meta->type, self::BLOB_FIELD) || ($meta->type == self::GEOMETRY_FIELD) @@ -4393,11 +4434,11 @@ class PMA_DisplayResults ); // fetch last row of the result set - PMA_DBI_data_seek($dt_result, $num_rows - 1); + PMA_DBI_data_seek($dt_result, $this->_num_rows - 1); $row = PMA_DBI_fetch_row($dt_result); // check for non printable sorted row data - $meta = $fields_meta[$sorted_column_index]; + $meta = $this->_fields_meta[$sorted_column_index]; if (stristr($meta->type, self::BLOB_FIELD) || ($meta->type == self::GEOMETRY_FIELD) ) { @@ -4436,9 +4477,6 @@ class PMA_DisplayResults * * @param string $sorted_column_message the message for sorted column * @param string $limit_clause the limit clause of analyzed query - * @param integer $unlim_num_rows the total number of rows returned by - * the SQL query without any appended - * "LIMIT" clause programmatically * @param integer $total the total number of rows returned by * the SQL query without any * programmatically appended LIMIT clause @@ -4453,12 +4491,12 @@ class PMA_DisplayResults * @see getTable() */ private function _setMessageInformation( - $sorted_column_message, $limit_clause, $unlim_num_rows, - $total, $pos_next, $pre_count, $after_count + $sorted_column_message, $limit_clause, $total, + $pos_next, $pre_count, $after_count ) { - if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) { - $selectstring = ', ' . $unlim_num_rows . ' ' . __('in query'); + if (isset($this->_unlim_num_rows) && ($this->_unlim_num_rows != $total)) { + $selectstring = ', ' . $this->_unlim_num_rows . ' ' . __('in query'); } else { $selectstring = ''; } @@ -4597,11 +4635,6 @@ class PMA_DisplayResults * * @param integer &$dt_result the link id associated to the query * which results have to be displayed - * @param integer $fields_cnt the total number of fields returned by - * the SQL query - * @param array $fields_meta the list of fields properties - * @param integer $num_rows the total number of rows returned - * by the SQL query * @param array $analyzed_sql the analyzed query * @param string $del_link the display element - 'del_link' * @@ -4612,8 +4645,7 @@ class PMA_DisplayResults * @see getTable() */ private function _getMultiRowOperationLinks( - &$dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql, - $del_link + &$dt_result, $analyzed_sql, $del_link ) { $links_html = ''; @@ -4667,14 +4699,14 @@ class PMA_DisplayResults } // fetch last row of the result set - PMA_DBI_data_seek($dt_result, $num_rows - 1); + PMA_DBI_data_seek($dt_result, $this->_num_rows - 1); $row = PMA_DBI_fetch_row($dt_result); // $clause_is_unique is needed by getTable() to generate the proper param // in the multi-edit and multi-delete form list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $fields_cnt, $fields_meta, $row + $dt_result, $this->_fields_cnt, $this->_fields_meta, $row ); // reset to first row for the loop in _getTableBody() From 3a66d4862c497f6422ad52a239b25d338c4366ba Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sun, 8 Jul 2012 15:16:00 +0530 Subject: [PATCH 07/82] Add get set magic methods for PMA_DisplayResults class --- libraries/DisplayResults.class.php | 641 +++++++++++++++++------------ 1 file changed, 380 insertions(+), 261 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index c44d4bbad2..4424c54472 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -19,6 +19,7 @@ if (! defined('PHPMYADMIN')) { class PMA_DisplayResults { + // Define constants const NO_EDIT_OR_DELETE = 'nn'; const UPDATE_ROW = 'ur'; const DELETE_ROW = 'dr'; @@ -66,6 +67,8 @@ class PMA_DisplayResults const ALL_ROWS = 'all'; const QUERY_TYPE_SELECT = 'SELECT'; + + // Declare global fields /** PMA_CommonFunctions object */ private $_common_functions; @@ -145,6 +148,40 @@ class PMA_DisplayResults private $_mime_map; + /** + * Get any property of this class + * + * @param string $property name of the property + * @return if property exist, value of the relavant property + */ + public function __get($property) { + + if (property_exists($this, $property)) { + return $this->$property; + } + + } + + + /** + * Set values for any property of this class + * + * @param string $property name of the property + * @param $value value to set + * + * @return PMA_DisplayResults + */ + public function __set($property, $value) { + + if (property_exists($this, $property)) { + $this->$property = $value; + } + + return $this; + + } + + /** * Set CommmonFunctions * @@ -170,8 +207,8 @@ class PMA_DisplayResults } return $this->_common_functions; } + - /** * Constructor for PMA_DisplayResults class * @@ -184,10 +221,10 @@ class PMA_DisplayResults */ public function __construct($db, $table, $goto, $sql_query) { - $this->_db = $db; - $this->_table = $table; - $this->_goto = $goto; - $this->_sql_query = $sql_query; + $this->__set('_db', $db); + $this->__set('_table', $table); + $this->__set('_goto', $goto); + $this->__set('_sql_query', $sql_query); } @@ -226,6 +263,14 @@ class PMA_DisplayResults private function _setDisplayMode(&$the_disp_mode, &$the_total) { + // Following variables are needed for use in isset/empty or + // use with array indexes or safe use in foreach + $db = $this->__get('_db'); + $table = $this->__get('_table'); + $unlim_num_rows = $this->__get('_unlim_num_rows'); + $fields_meta = $this->__get('_fields_meta'); + $printview = $this->__get('_printview'); + // 1. Initializes the $do_display array $do_display = array(); $do_display['edit_lnk'] = $the_disp_mode[0] . $the_disp_mode[1]; @@ -240,7 +285,8 @@ class PMA_DisplayResults // 2. Display mode is not "false for all elements" -> updates the // display mode if ($the_disp_mode != 'nnnn000000') { - if (isset($this->_printview) && $this->_printview == '1') { + + if (isset($printview) && ($printview == '1')) { // 2.0 Print view -> set all elements to false! $do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link $do_display['del_lnk'] = self::NO_EDIT_OR_DELETE; // no delete link @@ -250,8 +296,9 @@ class PMA_DisplayResults $do_display['bkm_form'] = (string) '0'; $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; - } elseif ($this->_is_count || $this->_is_analyse - || $this->_is_maint || $this->_is_explain + + } elseif ($this->__get ('_is_count') || $this->__get ('_is_analyse') + || $this->__get ('_is_maint') || $this->__get ('_is_explain') ) { // 2.1 Statement is a "SELECT COUNT", a // "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or @@ -262,14 +309,15 @@ class PMA_DisplayResults $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; - if ($this->_is_maint) { + + if ($this->__get ('_is_maint')) { $do_display['text_btn'] = (string) '1'; } else { $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; - } elseif ($this->_is_show) { + } elseif ($this->__get ('_is_show')) { // 2.2 Statement is a "SHOW..." /** * 2.2.1 @@ -279,7 +327,7 @@ class PMA_DisplayResults '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?' . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS' . ')@i', - $this->_sql_query, $which + $this->__get('_sql_query'), $which ); if (isset($which[1]) && (strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) @@ -302,21 +350,25 @@ class PMA_DisplayResults $do_display['bkm_form'] = (string) '1'; $do_display['text_btn'] = (string) '1'; $do_display['pview_lnk'] = (string) '1'; + } else { // 2.3 Other statements (ie "SELECT" ones) -> updates // $do_display['edit_lnk'], $do_display['del_lnk'] and // $do_display['text_btn'] (keeps other default values) - $prev_table = $this->_fields_meta[0]->table; + $prev_table = $fields_meta[0]->table; $do_display['text_btn'] = (string) '1'; - for ($i = 0; $i < $this->_fields_cnt; $i++) { + + for ($i = 0; $i < $this->__get('_fields_cnt'); $i++) { + $is_link = ($do_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['del_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['sort_lnk'] != '0') || ($do_display['ins_row'] != '0'); + // 2.3.2 Displays edit/delete/sort/insert links? if ($is_link - && (($this->_fields_meta[$i]->table == '') - || ($this->_fields_meta[$i]->table != $prev_table)) + && (($fields_meta[$i]->table == '') + || ($fields_meta[$i]->table != $prev_table)) ) { // don't display links $do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; @@ -331,21 +383,23 @@ class PMA_DisplayResults break; } } // end if (2.3.2) + // 2.3.3 Always display print view link $do_display['pview_lnk'] = (string) '1'; - $prev_table = $this->_fields_meta[$i]->table; + $prev_table = $fields_meta[$i]->table; + } // end for } // end if..elseif...else (2.1 -> 2.3) } // end if (2) // 3. Gets the total number of rows if it is unknown - if (isset($this->_unlim_num_rows) && $this->_unlim_num_rows != '') { - $the_total = $this->_unlim_num_rows; + if (isset($unlim_num_rows) && $unlim_num_rows != '') { + $the_total = $unlim_num_rows; } elseif ((($do_display['nav_bar'] == '1') || ($do_display['sort_lnk'] == '1')) - && (strlen($this->_db) && !empty($this->_table)) + && (strlen($db) && !empty($table)) ) { - $the_total = PMA_Table::countRecords($this->_db, $this->_table); + $the_total = PMA_Table::countRecords($db, $table); } // 4. If navigation bar or sorting fields names URLs should be @@ -357,9 +411,9 @@ class PMA_DisplayResults // - For a VIEW we (probably) did not count the number of rows // so don't test this number here, it would remove the possibility // of sorting VIEW results. - if (isset($this->_unlim_num_rows) - && $this->_unlim_num_rows < 2 - && ! PMA_Table::isView($this->_db, $this->_table) + if (isset($unlim_num_rows) + && ($unlim_num_rows < 2) + && ! PMA_Table::isView($db, $table) ) { // force display of navbar for vertical/horizontal display-choice. // $do_display['nav_bar'] = (string) '0'; @@ -389,8 +443,8 @@ class PMA_DisplayResults */ private function _isSelect($analyzed_sql) { - return ! ($this->_is_count || $this->_is_export - || $this->_is_func || $this->_is_analyse) + return ! ($this->__get ('_is_count') || $this->__get('_is_export') + || $this->__get('_is_func') || $this->__get ('_is_analyse')) && (count($analyzed_sql[0]['select_expr']) == 0) && isset($analyzed_sql[0]['queryflags']['select_from']) && (count($analyzed_sql[0]['table_ref']) == 1); @@ -436,11 +490,11 @@ class PMA_DisplayResults return '' . '
' - . PMA_generate_common_hidden_inputs($this->_db, $this->_table) + . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) . '' . '' - . '' + . '' . $input_for_real_end . '__get('_showtable'); // To use in isset // here, using htmlentities() would cause problems if the query // contains accented characters - $html_sql_query = htmlspecialchars($this->_sql_query); + $html_sql_query = htmlspecialchars($this->__get('_sql_query')); /** * @todo move this to a central place * @todo for other future table types */ - $is_innodb = (isset($this->_showtable['Type']) - && $this->_showtable['Type'] == self::TABLE_TYPE_INNO_DB); + $is_innodb = (isset($showtable['Type']) + && $showtable['Type'] == self::TABLE_TYPE_INNO_DB); // Navigation bar $table_navigation_html .= '' @@ -510,7 +565,7 @@ class PMA_DisplayResults ) + 1; $nbTotalPage = @ceil( - $this->_unlim_num_rows + $this->__get('_unlim_num_rows') / $_SESSION['tmp_user_values']['max_rows'] ); @@ -518,10 +573,10 @@ class PMA_DisplayResults $table_navigation_html .= ''; @@ -716,7 +771,7 @@ class PMA_DisplayResults ); // prepare some options for the End button - if ($is_innodb && $this->_unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) { + if ($is_innodb && $this->__get('_unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount']) { $input_for_real_end = ''; // no backquote around this message @@ -727,8 +782,8 @@ class PMA_DisplayResults $onsubmit = 'onsubmit="return ' . ($_SESSION['tmp_user_values']['pos'] - + $_SESSION['tmp_user_values']['max_rows'] < $this->_unlim_num_rows - && $this->_num_rows >= $_SESSION['tmp_user_values']['max_rows']) + + $_SESSION['tmp_user_values']['max_rows'] < $this->__get('_unlim_num_rows') + && $this->__get('_num_rows') >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false' . '"'; @@ -736,7 +791,7 @@ class PMA_DisplayResults $buttons_html .= $this->_getTableNavigationButton( '>>', _pgettext('Last page', 'End'), - @((ceil($this->_unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) + @((ceil($this->__get('_unlim_num_rows') / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']), $html_sql_query, $onsubmit, $input_for_real_end, $onclick ); @@ -769,13 +824,13 @@ class PMA_DisplayResults $additional_fields_html .= '' - . '' + . '' . '' . __('Start row') . ': ' . "\n" . '' . __('Number of rows') . ': ' . "\n" . '_sql_query); + $sql_md5 = md5($this->__get('_sql_query')); $session_max_rows = $_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows']; @@ -869,7 +930,7 @@ class PMA_DisplayResults $table_headers_html .= '' . '
' - . PMA_generate_common_hidden_inputs($this->_db, $this->_table) + . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) . '
'; // Output data needed for column reordering and show/hide column @@ -877,12 +938,14 @@ class PMA_DisplayResults $table_headers_html .= $this->_getDataForResettingColumnOrder(); } - $this->_vertical_display['emptypre'] = 0; - $this->_vertical_display['emptyafter'] = 0; - $this->_vertical_display['textbtn'] = ''; + $vertical_display['emptypre'] = 0; + $vertical_display['emptyafter'] = 0; + $vertical_display['textbtn'] = ''; + $this->__set('_vertical_display', $vertical_display); + // Display options (if we are not in print view) - if (! (isset($this->_printview) && ($this->_printview == '1'))) { + if (! (isset($printview) && ($printview == '1'))) { $table_headers_html .= $this->_getOptionsBlock(); @@ -920,7 +983,7 @@ class PMA_DisplayResults && ! $_SESSION['tmp_user_values']['hide_transformation'] ) { include_once './libraries/transformations.lib.php'; - $this->_mime_map = PMA_getMIME($this->_db, $this->_table); + $this->__set('_mime_map', PMA_getMIME($this->__get('_db'), $this->__get('_table'))); } // See if we have to highlight any header fields of a WHERE query. @@ -929,26 +992,28 @@ class PMA_DisplayResults list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); - for ($j = 0; $j < $this->_fields_cnt; $j++) { + for ($j = 0; $j < $this->__get('_fields_cnt'); $j++) { // assign $i with appropriate column order $i = $col_order ? $col_order[$j] : $j; // See if this column should get highlight because it's used in the // where-query. - $condition_field = (isset($this->_highlight_columns[$this->_fields_meta[$i]->name]) - || isset($this->_highlight_columns[$this->getCommonFunctions()->backquote($this->_fields_meta[$i]->name)])) + $condition_field = (isset($highlight_columns[$fields_meta[$i]->name]) + || isset($highlight_columns[$this->getCommonFunctions()->backquote($fields_meta[$i]->name)])) ? true : false; // 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled. - $comments = $this->_getCommentForRow($comments_map, $this->_fields_meta[$i]); + $comments = $this->_getCommentForRow($comments_map, $fields_meta[$i]); + + $vertical_display = $this->__get('_vertical_display'); if ($is_display['sort_lnk'] == '1') { list($order_link, $sorted_headrer_html) = $this->_getOrderLinkAndSortedHeaderHtml( - $this->_fields_meta[$i], $sort_expression, + $fields_meta[$i], $sort_expression, $sort_expression_nodirection, $i, $unsorted_sql_query, $session_max_rows, $direction, $comments, $sort_direction, $directionCondition, $col_visib, @@ -957,10 +1022,10 @@ class PMA_DisplayResults $table_headers_html .= $sorted_headrer_html; - $this->_vertical_display['desc'][] = ' ' . "\n"; } else { // 2.2 Results can't be sorted @@ -969,18 +1034,21 @@ class PMA_DisplayResults $table_headers_html .= $this->_getDraggableClassForNonSortableColumns( $col_visib, $col_visib[$j], $condition_field, - $direction, $this->_fields_meta[$i], $comments + $direction, $fields_meta[$i], $comments ); } - $this->_vertical_display['desc'][] = ' '; } // end else (2.2) + + $this->__set('_vertical_display', $vertical_display); + } // end for // Display column at rightside - checkboxes or empty column @@ -1018,7 +1086,7 @@ class PMA_DisplayResults $drop_down_html = ''; // Just as fallback - $unsorted_sql_query = $this->_sql_query; + $unsorted_sql_query = $this->__get('_sql_query'); if (isset($analyzed_sql[0]['unsorted_query'])) { $unsorted_sql_query = $analyzed_sql[0]['unsorted_query']; } @@ -1037,7 +1105,7 @@ class PMA_DisplayResults ) { // grab indexes data: - $indexes = PMA_Index::getFromTable($this->_table, $this->_db); + $indexes = PMA_Index::getFromTable($this->__get('_table'), $this->__get('_db')); // do we have any index? if ($indexes) { @@ -1073,7 +1141,7 @@ class PMA_DisplayResults $drop_down_html = ''; $drop_down_html .= '' . "\n" - . PMA_generate_common_hidden_inputs($this->_db, $this->_table) + . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) . __('Sort by key') . ': ' + $button_html .= '' . '' . ''; // end horizontal/horizontalflipped mode } else { - $span = $this->_num_rows + 1 + floor( - $this->_num_rows + $span = $this->__get('_num_rows') + 1 + floor( + $this->__get('_num_rows') / $_SESSION['tmp_user_values']['repeat_cells'] ); $button_html .= ''; @@ -1215,7 +1284,7 @@ class PMA_DisplayResults // ... at the left column of the result table header if possible // and required - $this->_vertical_display['emptypre'] + $vertical_display['emptypre'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; @@ -1227,7 +1296,7 @@ class PMA_DisplayResults } else { - $this->_vertical_display['textbtn'] + $vertical_display['textbtn'] = ' ' . "\n"; @@ -1240,7 +1309,7 @@ class PMA_DisplayResults ) { // ... elseif no button, displays empty(ies) col(s) if required - $this->_vertical_display['emptypre'] + $vertical_display['emptypre'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; @@ -1250,7 +1319,7 @@ class PMA_DisplayResults // end horizontal/horizontalfipped mode } else { - $this->_vertical_display['textbtn'] = ' ' . "\n"; } // end vertical mode @@ -1262,6 +1331,8 @@ class PMA_DisplayResults $button_html .= ''; } + $this->__set('_vertical_display', $vertical_display); + return array($colspan, $rowspan, $button_html); } // end of the '_getFeildVisibilityParams()' function @@ -1293,7 +1364,7 @@ class PMA_DisplayResults if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) { foreach ($analyzed_sql[0]['table_ref'] as $tbl) { $tb = $tbl['table_true_name']; - $comments_map[$tb] = PMA_getComments($this->_db, $tb); + $comments_map[$tb] = PMA_getComments($this->__get('_db'), $tb); unset($tb); } } @@ -1318,7 +1389,7 @@ class PMA_DisplayResults private function _setHighlightedColumnGlobalField($analyzed_sql) { - $this->_highlight_columns = array(); + $highlight_columns = array(); if (isset($analyzed_sql) && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['where_clause_identifiers']) ) { @@ -1330,11 +1401,13 @@ class PMA_DisplayResults foreach ($analyzed_sql[0]['where_clause_identifiers'] as $wci_nr => $wci ) { - $this->_highlight_columns[$wci] = 'true'; + $highlight_columns[$wci] = 'true'; } } } + $this->__set('_highlight_columns', $highlight_columns); + } // end of the '_setHighlightedColumnGlobalField()' function @@ -1353,7 +1426,7 @@ class PMA_DisplayResults $data_html = ''; // generate the column order, if it is set - $pmatable = new PMA_Table($this->_table, $this->_db); + $pmatable = new PMA_Table($this->__get('_table'), $this->__get('_db')); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); if ($col_order) { @@ -1369,10 +1442,10 @@ class PMA_DisplayResults } // generate table create time - if (! PMA_Table::isView($this->_db, $this->_table)) { + if (! PMA_Table::isView($this->__get('_db'), $this->__get('_table'))) { $data_html .= ''; } @@ -1405,10 +1478,10 @@ class PMA_DisplayResults $options_html .= '>'; $url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, - 'sql_query' => $this->_sql_query, - 'goto' => $this->_goto, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), + 'sql_query' => $this->__get('_sql_query'), + 'goto' => $this->__get('_goto'), 'display_options_form' => 1 ); @@ -1517,20 +1590,20 @@ class PMA_DisplayResults { $url_params_full_text = array( - 'db' => $this->_db, - 'table' => $this->_table, - 'sql_query' => $this->_sql_query, - 'goto' => $this->_goto, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), + 'sql_query' => $this->__get('_sql_query'), + 'goto' => $this->__get('_goto'), 'full_text_button' => 1 ); if ($_SESSION['tmp_user_values']['display_text'] == self::DISPLAY_FULL_TEXT) { // currently in fulltext mode so show the opposite link - $tmp_image_file = $this->_pma_theme_image . 's_partialtext.png'; + $tmp_image_file = $this->__get('_pma_theme_image') . 's_partialtext.png'; $tmp_txt = __('Partial texts'); $url_params_full_text['display_text'] = self::DISPLAY_PARTIAL_TEXT; } else { - $tmp_image_file = $this->_pma_theme_image . 's_fulltext.png'; + $tmp_image_file = $this->__get('_pma_theme_image') . 's_fulltext.png'; $tmp_txt = __('Full texts'); $url_params_full_text['display_text'] = self::DISPLAY_FULL_TEXT; } @@ -1572,7 +1645,7 @@ class PMA_DisplayResults } $form_html .= '>' . "\n" - . PMA_generate_common_hidden_inputs($this->_db, $this->_table, 1) + . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table'), 1) . '' . "\n"; } @@ -1721,8 +1794,8 @@ class PMA_DisplayResults } $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'sql_query' => $sorted_sql_query, 'session_max_rows' => $session_max_rows ); @@ -2080,6 +2153,7 @@ class PMA_DisplayResults ) { $right_column_html = ''; + $vertical_display = $this->__get('_vertical_display'); // Displays the needed checkboxes at the right // column of the result table header if possible and required... @@ -2090,7 +2164,7 @@ class PMA_DisplayResults && ($is_display['text_btn'] == '1') ) { - $this->_vertical_display['emptyafter'] + $vertical_display['emptyafter'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; @@ -2101,7 +2175,7 @@ class PMA_DisplayResults // end horizontal/horizontalflipped mode } else { - $this->_vertical_display['textbtn'] = ' ' . "\n"; @@ -2115,7 +2189,7 @@ class PMA_DisplayResults // ... elseif no button, displays empty columns if required // (unless coming from Browse mode print view) - $this->_vertical_display['emptyafter'] + $vertical_display['emptyafter'] = (($is_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) && ($is_display['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; @@ -2125,11 +2199,13 @@ class PMA_DisplayResults // end horizontal/horizontalflipped mode } else { - $this->_vertical_display['textbtn'] = ' ' . "\n"; } // end vertical mode } + $this->__set('_vertical_display', $vertical_display); + return $right_column_html; } // end of the '_getColumnAtRightSide()' function @@ -2290,17 +2366,20 @@ class PMA_DisplayResults // query without conditions to shorten URLs when needed, 200 is just // guess, it should depend on remaining URL length $url_sql_query = $this->_getUrlSqlQuery($analyzed_sql); + + $vertical_display = $this->__get('_vertical_display'); if (! is_array($map)) { $map = array(); } $row_no = 0; - $this->_vertical_display['edit'] = array(); - $this->_vertical_display['copy'] = array(); - $this->_vertical_display['delete'] = array(); - $this->_vertical_display['data'] = array(); - $this->_vertical_display['row_delete'] = array(); + $vertical_display['edit'] = array(); + $vertical_display['copy'] = array(); + $vertical_display['delete'] = array(); + $vertical_display['data'] = array(); + $vertical_display['row_delete'] = array(); + $this->__set('_vertical_display', $vertical_display); // name of the class added to all grid editable elements $grid_edit_class = 'grid_edit'; @@ -2330,7 +2409,7 @@ class PMA_DisplayResults // "vertical display" mode stuff $table_body_html .= $this->_getVerticalDisplaySupportSegments( - $this->_vertical_display, $row_no, $directionCondition + $vertical_display, $row_no, $directionCondition ); $alternating_color_class = ($odd_row ? 'odd' : 'even'); @@ -2351,7 +2430,7 @@ class PMA_DisplayResults */ list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $this->_fields_cnt, $this->_fields_meta, $row + $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row ); $where_clause_html = urlencode($where_clause); @@ -2497,12 +2576,19 @@ class PMA_DisplayResults $row_values_html = ''; - for ($j = 0; $j < $this->_fields_cnt; ++$j) { + // Following variable are needed for use in isset/empty or + // use with array indexes/safe use in foreach + $sql_query = $this->__get('_sql_query'); + $fields_meta = $this->__get('_fields_meta'); + $highlight_columns = $this->__get('_highlight_columns'); + $mime_map = $this->__get('_mime_map'); + + for ($j = 0; $j < $this->__get('_fields_cnt'); ++$j) { // assign $i with appropriate column order $i = $col_order ? $col_order[$j] : $j; - $meta = $this->_fields_meta[$i]; + $meta = $fields_meta[$i]; $not_null_class = $meta->not_null ? 'not_null' : ''; $relation_class = isset($map[$meta->name]) ? 'relation' : ''; $hide_class = ($col_visib && !$col_visib[$j] @@ -2527,9 +2613,9 @@ class PMA_DisplayResults // See if this column should get highlight because it's used in the // where-query. - $condition_field = (isset($this->_highlight_columns) - && (isset($this->_highlight_columns[$meta->name]) - || isset($this->_highlight_columns[$this->getCommonFunctions()->backquote($meta->name)]))) + $condition_field = (isset($highlight_columns) + && (isset($highlight_columns[$meta->name]) + || isset($highlight_columns[$this->getCommonFunctions()->backquote($meta->name)]))) ? true : false; @@ -2542,12 +2628,12 @@ class PMA_DisplayResults && $GLOBALS['cfg']['BrowseMIME'] ) { - if (isset($this->_mime_map[$meta->name]['mimetype']) - && isset($this->_mime_map[$meta->name]['transformation']) - && !empty($this->_mime_map[$meta->name]['transformation']) + if (isset($mime_map[$meta->name]['mimetype']) + && isset($mime_map[$meta->name]['transformation']) + && !empty($mime_map[$meta->name]['transformation']) ) { - $file = $this->_mime_map[$meta->name]['transformation']; + $file = $mime_map[$meta->name]['transformation']; $include_file = 'libraries/plugins/transformations/' . $file; if (file_exists($include_file)) { @@ -2561,17 +2647,17 @@ class PMA_DisplayResults ); $transform_options = PMA_transformation_getOptions( - isset($this->_mime_map[$meta->name] + isset($mime_map[$meta->name] ['transformation_options'] ) - ? $this->_mime_map[$meta->name] + ? $mime_map[$meta->name] ['transformation_options'] : '' ); $meta->mimetype = str_replace( '_', '/', - $this->_mime_map[$meta->name]['mimetype'] + $mime_map[$meta->name]['mimetype'] ); } // end if file_exists @@ -2579,19 +2665,21 @@ class PMA_DisplayResults } // end if mime/transformation works. $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'where_clause' => $where_clause, 'transform_key' => $meta->name, ); - if (! empty($this->_sql_query)) { + if (! empty($sql_query)) { $_url_params['sql_query'] = $url_sql_query; } $transform_options['wrapper_link'] = PMA_generate_common_url($_url_params); + $vertical_display = $this->__get('_vertical_display'); + if ($meta->numeric == 1) { // n u m e r i c @@ -2600,7 +2688,7 @@ class PMA_DisplayResults // will show both fields NULL even if only one is NULL, // so use the $pointer - $this->_vertical_display['data'][$row_no][$i] + $vertical_display['data'][$row_no][$i] = $this->_getDataCellForNumericColumns( $row[$i], $class, $condition_field, $meta, $map, $is_field_truncated, $analyzed_sql, @@ -2615,7 +2703,7 @@ class PMA_DisplayResults // TEXT fields type so we have to ensure it's really a BLOB $field_flags = PMA_DBI_field_flags($dt_result, $i); - $this->_vertical_display['data'][$row_no][$i] + $vertical_display['data'][$row_no][$i] = $this->_getDataCellForBlobColumns( $row[$i], $class, $meta, $_url_params, $field_flags, $transformation_plugin, $default_function, @@ -2629,7 +2717,7 @@ class PMA_DisplayResults // inline-edit geometry data. $class = str_replace('grid_edit', '', $class); - $this->_vertical_display['data'][$row_no][$i] + $vertical_display['data'][$row_no][$i] = $this->_getDataCellForGeometryColumns( $row[$i], $class, $meta, $map, $_url_params, $condition_field, $transformation_plugin, @@ -2640,7 +2728,7 @@ class PMA_DisplayResults } else { // n o t n u m e r i c a n d n o t B L O B - $this->_vertical_display['data'][$row_no][$i] + $vertical_display['data'][$row_no][$i] = $this->_getDataCellForNonNumericAndNonBlobColumns( $row[$i], $class, $meta, $map, $_url_params, $condition_field, $transformation_plugin, @@ -2653,16 +2741,19 @@ class PMA_DisplayResults // output stored cell if ($directionCondition) { $row_values_html - .= $this->_vertical_display['data'][$row_no][$i]; + .= $vertical_display['data'][$row_no][$i]; } - if (isset($this->_vertical_display['rowdata'][$i][$row_no])) { - $this->_vertical_display['rowdata'][$i][$row_no] - .= $this->_vertical_display['data'][$row_no][$i]; + if (isset($vertical_display['rowdata'][$i][$row_no])) { + $vertical_display['rowdata'][$i][$row_no] + .= $vertical_display['data'][$row_no][$i]; } else { - $this->_vertical_display['rowdata'][$i][$row_no] - = $this->_vertical_display['data'][$row_no][$i]; + $vertical_display['rowdata'][$i][$row_no] + = $vertical_display['data'][$row_no][$i]; } + + $this->__set('_vertical_display', $vertical_display); + } // end for return $row_values_html; @@ -2701,11 +2792,13 @@ class PMA_DisplayResults $copy_url, $copy_str, $alternating_color_class, $condition_array ) { - if (! isset($this->_vertical_display['edit'][$row_no])) { - $this->_vertical_display['edit'][$row_no] = ''; - $this->_vertical_display['copy'][$row_no] = ''; - $this->_vertical_display['delete'][$row_no] = ''; - $this->_vertical_display['row_delete'][$row_no] = ''; + $vertical_display = $this->__get('_vertical_display'); + + if (! isset($vertical_display['edit'][$row_no])) { + $vertical_display['edit'][$row_no] = ''; + $vertical_display['copy'][$row_no] = ''; + $vertical_display['delete'][$row_no] = ''; + $vertical_display['row_delete'][$row_no] = ''; } $vertical_class = ' row_' . $row_no; @@ -2721,7 +2814,7 @@ class PMA_DisplayResults && ($is_display['del_lnk'] != self::KILL_PROCESS) ) { - $this->_vertical_display['row_delete'][$row_no] + $vertical_display['row_delete'][$row_no] .= $this->_getCheckboxForMultiRowSubmissions( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', @@ -2729,12 +2822,12 @@ class PMA_DisplayResults ); } else { - unset($this->_vertical_display['row_delete'][$row_no]); + unset($vertical_display['row_delete'][$row_no]); } if (isset($edit_url)) { - $this->_vertical_display['edit'][$row_no] .= $this->_getEditLink( + $vertical_display['edit'][$row_no] .= $this->_getEditLink( $edit_url, $alternating_color_class . ' ' . $edit_anchor_class . $vertical_class, $edit_str, @@ -2743,18 +2836,18 @@ class PMA_DisplayResults ); } else { - unset($this->_vertical_display['edit'][$row_no]); + unset($vertical_display['edit'][$row_no]); } if (isset($copy_url)) { - $this->_vertical_display['copy'][$row_no] .= $this->_getCopyLink( + $vertical_display['copy'][$row_no] .= $this->_getCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, $alternating_color_class . $vertical_class ); } else { - unset($this->_vertical_display['copy'][$row_no]); + unset($vertical_display['copy'][$row_no]); } if (isset($del_url)) { @@ -2763,16 +2856,18 @@ class PMA_DisplayResults $js_conf = ''; } - $this->_vertical_display['delete'][$row_no] + $vertical_display['delete'][$row_no] .= $this->_getDeleteLink( $del_url, $del_str, $js_conf, $alternating_color_class . $vertical_class ); } else { - unset($this->_vertical_display['delete'][$row_no]); + unset($vertical_display['delete'][$row_no]); } + $this->__set('_vertical_display', $vertical_display); + } // end of the '_gatherLinksForLaterOutputs()' function @@ -2794,7 +2889,7 @@ class PMA_DisplayResults && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['querytype']) && ($analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) - && (strlen($this->_sql_query) > 200) + && (strlen($this->__get('_sql_query')) > 200) ) { $url_sql_query = 'SELECT '; @@ -2810,7 +2905,7 @@ class PMA_DisplayResults return $url_sql_query; } - return $this->_sql_query; + return $this->__get('_sql_query'); } // end of the '_getUrlSqlQuery()' function @@ -2829,7 +2924,7 @@ class PMA_DisplayResults private function _getColumnParams($analyzed_sql) { if ($this->_isSelect($analyzed_sql)) { - $pmatable = new PMA_Table($this->_table, $this->_db); + $pmatable = new PMA_Table($this->__get('_table'), $this->__get('_db')); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); $col_visib = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_VISIB); } else { @@ -2915,8 +3010,8 @@ class PMA_DisplayResults ) { $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'where_clause' => $where_clause, 'clause_is_unique' => $clause_is_unique, 'sql_query' => $url_sql_query, @@ -2970,35 +3065,37 @@ class PMA_DisplayResults $where_clause, $clause_is_unique, $url_sql_query, $del_lnk ) { + $goto = $this->__get('_goto'); + if ($del_lnk == self::DELETE_ROW) { // delete row case $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'sql_query' => $url_sql_query, 'message_to_show' => __('The row has been deleted'), - 'goto' => (empty($this->_goto) ? 'tbl_sql.php' : $this->_goto), + 'goto' => (empty($goto) ? 'tbl_sql.php' : $goto), ); $lnk_goto = 'sql.php' . PMA_generate_common_url($_url_params, 'text'); $del_query = 'DELETE FROM ' - . $this->getCommonFunctions()->backquote($this->_db) . '.' - . $this->getCommonFunctions()->backquote($this->_table) + . $this->getCommonFunctions()->backquote($this->__get('_db')) . '.' + . $this->getCommonFunctions()->backquote($this->__get('_table')) . ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1'); $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'sql_query' => $del_query, 'message_to_show' => __('The row has been deleted'), 'goto' => $lnk_goto, ); $del_url = 'sql.php' . PMA_generate_common_url($_url_params); - $js_conf = 'DELETE FROM ' . PMA_jsFormat($this->_db) . '.' - . PMA_jsFormat($this->_table) + $js_conf = 'DELETE FROM ' . PMA_jsFormat($this->__get('_db')) . '.' + . PMA_jsFormat($this->__get('_table')) . ' WHERE ' . PMA_jsFormat($where_clause, false) . ($clause_is_unique ? '' : ' LIMIT 1'); @@ -3009,8 +3106,8 @@ class PMA_DisplayResults } elseif ($del_lnk == self::KILL_PROCESS) { // kill process case $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'sql_query' => $url_sql_query, 'goto' => 'main.php', ); @@ -3105,12 +3202,14 @@ class PMA_DisplayResults $grid_edit_class, $not_null_class, $relation_class, $hide_class, $field_type_class, $row_no ) { + + $printview = $this->__get('_printview'); $class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' ' . $relation_class . ' ' . $hide_class . ' ' . $field_type_class; if (($_SESSION['tmp_user_values']['disp_direction'] == self::DISP_DIR_VERTICAL) - && (! isset($this->_printview) || ($this->_printview != '1')) + && (! isset($printview) || ($printview != '1')) ) { // the row number corresponds to a data row, not HTML table row $class .= ' row_' . $row_no; @@ -3468,6 +3567,8 @@ class PMA_DisplayResults $transformation_plugin, $default_function, $transform_options, $is_field_truncated, $analyzed_sql, &$dt_result, $col_index ) { + + $is_analyse = $this->__get ('_is_analyse'); if (! isset($column) || is_null($column)) { @@ -3502,7 +3603,7 @@ class PMA_DisplayResults // so don't treat them as BINARY } elseif (stristr($field_flags, self::BINARY_FIELD) && ($meta->type == self::STRING_FIELD) - && !(isset($this->_is_analyse) && $this->_is_analyse) + && !(isset($is_analyse) && $is_analyse) ) { if ($_SESSION['tmp_user_values']['display_binary']) { @@ -3590,12 +3691,13 @@ class PMA_DisplayResults { $vertical_table_html = ''; + $vertical_display = $this->__get('_vertical_display'); // Prepares "multi row delete" link at top if required if (($GLOBALS['cfg']['RowActionLinks'] != self::POSITION_RIGHT) - && is_array($this->_vertical_display['row_delete']) - && ((count($this->_vertical_display['row_delete']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['row_delete']) + && ((count($vertical_display['row_delete']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= '' . "\n"; @@ -3605,7 +3707,7 @@ class PMA_DisplayResults $vertical_table_html .= '' . "\n"; } - $vertical_table_html .= $this->_vertical_display['textbtn'] + $vertical_table_html .= $vertical_display['textbtn'] . $this->_getCheckBoxesForMultipleRowOperations( '_left' ) @@ -3615,9 +3717,9 @@ class PMA_DisplayResults // Prepares "edit" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['edit']) - && ((count($this->_vertical_display['edit']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['edit']) + && ((count($vertical_display['edit']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'edit' @@ -3627,9 +3729,9 @@ class PMA_DisplayResults // Prepares "copy" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['copy']) - && ((count($this->_vertical_display['copy']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['copy']) + && ((count($vertical_display['copy']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'copy' @@ -3639,9 +3741,9 @@ class PMA_DisplayResults // Prepares "delete" link at top if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['delete']) - && ((count($this->_vertical_display['delete']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['delete']) + && ((count($vertical_display['delete']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'delete' @@ -3651,7 +3753,7 @@ class PMA_DisplayResults list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); // Prepares data - foreach ($this->_vertical_display['desc'] AS $j => $val) { + foreach ($vertical_display['desc'] AS $j => $val) { // assign appropriate key with current column order $key = $col_order ? $col_order[$j] : $j; @@ -3662,7 +3764,7 @@ class PMA_DisplayResults . $val; $cell_displayed = 0; - foreach ($this->_vertical_display['rowdata'][$key] as $subval) { + foreach ($vertical_display['rowdata'][$key] as $subval) { if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) @@ -3682,13 +3784,13 @@ class PMA_DisplayResults // Prepares "multi row delete" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['row_delete']) - && ((count($this->_vertical_display['row_delete']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['row_delete']) + && ((count($vertical_display['row_delete']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= '' . "\n" - . $this->_vertical_display['textbtn'] + . $vertical_display['textbtn'] . $this->_getCheckBoxesForMultipleRowOperations('_right') . '' . "\n"; } // end if @@ -3696,9 +3798,9 @@ class PMA_DisplayResults // Prepares "edit" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['edit']) - && ((count($this->_vertical_display['edit']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['edit']) + && ((count($vertical_display['edit']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'edit' @@ -3708,9 +3810,9 @@ class PMA_DisplayResults // Prepares "copy" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['copy']) - && ((count($this->_vertical_display['copy']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['copy']) + && ((count($vertical_display['copy']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'copy' @@ -3720,9 +3822,9 @@ class PMA_DisplayResults // Prepares "delete" link at bottom if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) - && is_array($this->_vertical_display['delete']) - && ((count($this->_vertical_display['delete']) > 0) - || !empty($this->_vertical_display['textbtn'])) + && is_array($vertical_display['delete']) + && ((count($vertical_display['delete']) > 0) + || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= $this->_getOperationLinksForVerticleTable( 'delete' @@ -3748,21 +3850,22 @@ class PMA_DisplayResults private function _getOperationLinksForVerticleTable($operation) { $link_html = '' . "\n"; + $vertical_display = $this->__get('_vertical_display'); - if (! is_array($this->_vertical_display['row_delete'])) { + if (! is_array($vertical_display['row_delete'])) { if (($operation == 'edit') || ($operation == 'copy')) { - $link_html .= $this->_vertical_display['textbtn']; + $link_html .= $vertical_display['textbtn']; } elseif ($operation == 'delete') { - if (! is_array($this->_vertical_display['edit'])) { - $link_html .= $this->_vertical_display['textbtn']; + if (! is_array($vertical_display['edit'])) { + $link_html .= $vertical_display['textbtn']; } } } - foreach ($this->_vertical_display[$operation] as $val) { + foreach ($vertical_display[$operation] as $val) { $link_html .= $val; } // end while @@ -3789,8 +3892,9 @@ class PMA_DisplayResults $checkBoxes_html = ''; $cell_displayed = 0; + $vertical_display = $this->__get('_vertical_display'); - foreach ($this->_vertical_display['row_delete'] as $val) { + foreach ($vertical_display['row_delete'] as $val) { if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) @@ -3833,10 +3937,10 @@ class PMA_DisplayResults public function setConfigParamsForDisplayTable() { - $sql_md5 = md5($this->_sql_query); + $sql_md5 = md5($this->__get('_sql_query')); $_SESSION['tmp_user_values']['query'][$sql_md5]['sql'] - = $this->_sql_query; + = $this->__get('_sql_query'); $valid_disp_dir = PMA_isValid( $_REQUEST['disp_direction'], @@ -4073,31 +4177,37 @@ class PMA_DisplayResults { // Initialize global variables which is not set in constructor - $this->_unlim_num_rows = $GLOBALS['unlim_num_rows']; - $this->_fields_meta = $GLOBALS['fields_meta']; - $this->_is_count = $GLOBALS['is_count']; - $this->_is_export = $GLOBALS['is_export']; - $this->_is_func = $GLOBALS['is_func']; - $this->_is_analyse = $GLOBALS['is_analyse']; - $this->_num_rows = $GLOBALS['num_rows']; - $this->_fields_cnt = $GLOBALS['fields_cnt']; - $this->_querytime = $GLOBALS['querytime']; - $this->_pma_theme_image = $GLOBALS['pmaThemeImage']; - $this->_text_dir = $GLOBALS['text_dir']; - $this->_is_maint = $GLOBALS['is_maint']; - $this->_is_explain = $GLOBALS['is_explain']; - $this->_is_show = $GLOBALS['is_show']; + $this->__set('_unlim_num_rows', $GLOBALS['unlim_num_rows']); + $this->__set('_fields_meta', $GLOBALS['fields_meta']); + $this->__set('_is_count', $GLOBALS['is_count']); + $this->__set('_is_export', $GLOBALS['is_export']); + $this->__set('_is_func', $GLOBALS['is_func']); + $this->__set('_is_analyse', $GLOBALS['is_analyse']); + $this->__set('_num_rows', $GLOBALS['num_rows']); + $this->__set('_fields_cnt', $GLOBALS['fields_cnt']); + $this->__set('_querytime', $GLOBALS['querytime']); + $this->__set('_pma_theme_image', $GLOBALS['pmaThemeImage']); + $this->__set('_text_dir', $GLOBALS['text_dir']); + $this->__set('_is_maint', $GLOBALS['is_maint']); + $this->__set('_is_explain', $GLOBALS['is_explain']); + $this->__set('_is_show', $GLOBALS['is_show']); + if (isset ($GLOBALS['showtable'])) { - $this->_showtable = $GLOBALS['showtable']; + $this->__set('_showtable', $GLOBALS['showtable']); } if (isset ($GLOBALS['printview'])) { - $this->_printview = $GLOBALS['printview']; + $this->__set('_printview', $GLOBALS['printview']); } if (isset ($GLOBALS['url_query'])) { - $this->_url_query = $GLOBALS['url_query']; - } + $this->__set('_url_query', $GLOBALS['url_query']); + } $table_html = ''; + // Following variable are needed for use in isset/empty or + // use with array indexes/safe use in foreach + $fields_meta = $this->__get('_fields_meta'); + $showtable = $this->__get('_showtable'); + $printview = $this->__get('_printview'); // why was this called here? (already called from sql.php) //$this->setConfigParamsForDisplayTable(); @@ -4106,8 +4216,8 @@ class PMA_DisplayResults * @todo move this to a central place * @todo for other future table types */ - $is_innodb = (isset($this->_showtable['Type']) - && $this->_showtable['Type'] == self::TABLE_TYPE_INNO_DB); + $is_innodb = (isset($showtable['Type']) + && $showtable['Type'] == self::TABLE_TYPE_INNO_DB); if ($is_innodb && ! isset($analyzed_sql[0]['queryflags']['union']) @@ -4167,19 +4277,19 @@ class PMA_DisplayResults ); $table_html .= $this->getCommonFunctions()->getMessage( - $message, $this->_sql_query, 'success' + $message, $this->__get('_sql_query'), 'success' ); - } elseif (! isset($this->_printview) || ($this->_printview != '1')) { + } elseif (! isset($printview) || ($printview != '1')) { $table_html .= $this->getCommonFunctions()->getMessage( __('Your SQL query has been executed successfully'), - $this->_sql_query, 'success' + $this->__get('_sql_query'), 'success' ); } // 2.3 Prepare the navigation bars - if (! strlen($this->_table)) { + if (! strlen($this->__get('_table'))) { if (isset($analyzed_sql[0]['query_type']) && ($analyzed_sql[0]['query_type'] == self::QUERY_TYPE_SELECT) @@ -4187,9 +4297,9 @@ class PMA_DisplayResults // table does not always contain a real table name, // for example in MySQL 5.0.x, the query SHOW STATUS // returns STATUS as a table name - $this->_table = $this->_fields_meta[0]->table; + $this->__set('_table', $fields_meta[0]->table); } else { - $this->_table = ''; + $this->__set('_table', ''); } } @@ -4221,7 +4331,7 @@ class PMA_DisplayResults $tabs = '(\'' . join('\',\'', $target) . '\')'; - if (! strlen($this->_table)) { + if (! strlen($this->__get('_table'))) { $exist_rel = false; } else { // This method set the values for $map array @@ -4246,7 +4356,8 @@ class PMA_DisplayResults $table_html .= $this->_getVerticalTable($analyzed_sql); } // end if - unset($this->_vertical_display); + $this->__set('_vertical_display', null); + $table_html .= '' . "\n" . ''; @@ -4270,7 +4381,7 @@ class PMA_DisplayResults ); // 6. ----- Prepare "Query results operations" - if (! isset($this->_printview) || $this->_printview != '1') { + if (! isset($printview) || ($printview != '1')) { $table_html .= $this->_getResultsOperations( $the_disp_mode, $analyzed_sql ); @@ -4378,10 +4489,12 @@ class PMA_DisplayResults &$dt_result, $sort_expression_nodirection ) { + $fields_meta = $this->__get('_fields_meta'); // To use array indexes + if (! empty($sort_expression_nodirection)) { if (strpos($sort_expression_nodirection, '.') === false) { - $sort_table = $this->_table; + $sort_table = $this->__get('_table'); $sort_column = $sort_expression_nodirection; } else { list($sort_table, $sort_column) @@ -4395,7 +4508,7 @@ class PMA_DisplayResults // (this might be a multi-table query) $sorted_column_index = false; - foreach ($this->_fields_meta as $key => $meta) { + foreach ($fields_meta as $key => $meta) { if (($meta->table == $sort_table) && ($meta->name == $sort_column)) { $sorted_column_index = $key; break; @@ -4413,7 +4526,7 @@ class PMA_DisplayResults $transform_options = array(); // check for non printable sorted row data - $meta = $this->_fields_meta[$sorted_column_index]; + $meta = $fields_meta[$sorted_column_index]; if (stristr($meta->type, self::BLOB_FIELD) || ($meta->type == self::GEOMETRY_FIELD) @@ -4434,11 +4547,11 @@ class PMA_DisplayResults ); // fetch last row of the result set - PMA_DBI_data_seek($dt_result, $this->_num_rows - 1); + PMA_DBI_data_seek($dt_result, $this->__get('_num_rows') - 1); $row = PMA_DBI_fetch_row($dt_result); // check for non printable sorted row data - $meta = $this->_fields_meta[$sorted_column_index]; + $meta = $fields_meta[$sorted_column_index]; if (stristr($meta->type, self::BLOB_FIELD) || ($meta->type == self::GEOMETRY_FIELD) ) { @@ -4494,9 +4607,11 @@ class PMA_DisplayResults $sorted_column_message, $limit_clause, $total, $pos_next, $pre_count, $after_count ) { + + $unlim_num_rows = $this->__get('_unlim_num_rows'); // To use in isset() - if (isset($this->_unlim_num_rows) && ($this->_unlim_num_rows != $total)) { - $selectstring = ', ' . $this->_unlim_num_rows . ' ' . __('in query'); + if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) { + $selectstring = ', ' . $unlim_num_rows . ' ' . __('in query'); } else { $selectstring = ''; } @@ -4527,7 +4642,7 @@ class PMA_DisplayResults } - if (PMA_Table::isView($this->_db, $this->_table) + if (PMA_Table::isView($this->__get('_db'), $this->__get('_table')) && ($total == $GLOBALS['cfg']['MaxExactCountViews']) ) { @@ -4574,7 +4689,7 @@ class PMA_DisplayResults } $messagge_qt = PMA_Message::notice(__('Query took %01.4f sec') . ')'); - $messagge_qt->addParam($this->_querytime); + $messagge_qt->addParam($this->__get('_querytime')); $message->addMessage($messagge_qt, ''); if (! is_null($sorted_column_message)) { @@ -4607,7 +4722,7 @@ class PMA_DisplayResults // to use the "column to display" notion (for example show // the name related to a numeric id). $exist_rel = PMA_getForeigners( - $this->_db, $this->_table, '', self::POSITION_BOTH + $this->__get('_db'), $this->__get('_table'), '', self::POSITION_BOTH ); if ($exist_rel) { @@ -4649,20 +4764,21 @@ class PMA_DisplayResults ) { $links_html = ''; + $url_query = $this->__get('_url_query'); $delete_text = ($del_link == self::DELETE_ROW) ? __('Delete') : __('Kill'); $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, - 'sql_query' => $this->_sql_query, - 'goto' => $this->_goto, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), + 'sql_query' => $this->__get('_sql_query'), + 'goto' => $this->__get('_goto'), ); if ($_SESSION['tmp_user_values']['disp_direction'] != self::DISP_DIR_VERTICAL) { $links_html .= '' . __('With selected:') . ''; } @@ -4691,22 +4807,22 @@ class PMA_DisplayResults $links_html .= "\n"; $links_html .= '' . "\n"; + .' value="' . htmlspecialchars($this->__get('_sql_query')) . '" />' . "\n"; - if (! empty($this->_url_query)) { + if (! empty($url_query)) { $links_html .= '' . "\n"; + .' value="' . $url_query . '" />' . "\n"; } // fetch last row of the result set - PMA_DBI_data_seek($dt_result, $this->_num_rows - 1); + PMA_DBI_data_seek($dt_result, $this->__get('_num_rows') - 1); $row = PMA_DBI_fetch_row($dt_result); // $clause_is_unique is needed by getTable() to generate the proper param // in the multi-edit and multi-delete form list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $this->_fields_cnt, $this->_fields_meta, $row + $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row ); // reset to first row for the loop in _getTableBody() @@ -4745,6 +4861,7 @@ class PMA_DisplayResults ) { $navigation_html = ''; + $printview = $this->__get('_printview'); if (($is_display['nav_bar'] == '1') && empty($analyzed_sql[0]['limit_clause']) @@ -4762,7 +4879,7 @@ class PMA_DisplayResults $navigation_html .= "\n"; } - } elseif (! isset($this->_printview) || ($this->_printview != '1')) { + } elseif (! isset($printview) || ($printview != '1')) { $navigation_html .= "\n" . '

' . "\n"; } @@ -4787,6 +4904,7 @@ class PMA_DisplayResults { $results_operations_html = ''; + $fields_meta = $this->__get('_fields_meta'); // To safe use in foreach $header_shown = false; $header = '
' . __('Query results operations') . ''; @@ -4801,10 +4919,10 @@ class PMA_DisplayResults } $_url_params = array( - 'db' => $this->_db, - 'table' => $this->_table, + 'db' => $this->__get('_db'), + 'table' => $this->__get('_table'), 'printview' => '1', - 'sql_query' => $this->_sql_query, + 'sql_query' => $this->__get('_sql_query'), ); $url_query = PMA_generate_common_url($_url_params); @@ -4861,7 +4979,7 @@ class PMA_DisplayResults $header_shown = true; } - $_url_params['unlim_num_rows'] = $this->_unlim_num_rows; + $_url_params['unlim_num_rows'] = $this->__get('_unlim_num_rows'); /** * At this point we don't know the table name; this can happen @@ -4901,7 +5019,7 @@ class PMA_DisplayResults // prepare GIS chart $geometry_found = false; // If atleast one geometry field is found - foreach ($this->_fields_meta as $meta) { + foreach ($fields_meta as $meta) { if ($meta->type == self::GEOMETRY_FIELD) { $geometry_found = true; break; @@ -5082,7 +5200,8 @@ class PMA_DisplayResults $transformation_plugin, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated ) { - + + $printview = $this->__get('_printview'); $result = ' $this->_db, + 'db' => $this->__get('_db'), 'table' => $meta->orgtable, 'pos' => '0', 'sql_query' => 'SELECT * FROM ' - . $this->getCommonFunctions()->backquote($this->_db) . '.' + . $this->getCommonFunctions()->backquote($this->__get('_db')) . '.' . $this->getCommonFunctions()->backquote($meta->orgtable) . ' WHERE ' . $this->getCommonFunctions()->backquote($meta->orgname) From 10224f7dad7389add80ed253a36b467323a63f5b Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sun, 8 Jul 2012 23:39:45 +0530 Subject: [PATCH 08/82] Remove setCommonFunctions --- libraries/DisplayResults.class.php | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 4424c54472..cdad4c181d 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -168,33 +168,16 @@ class PMA_DisplayResults * * @param string $property name of the property * @param $value value to set - * - * @return PMA_DisplayResults */ public function __set($property, $value) { if (property_exists($this, $property)) { $this->$property = $value; } - - return $this; } - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * @@ -270,7 +253,7 @@ class PMA_DisplayResults $unlim_num_rows = $this->__get('_unlim_num_rows'); $fields_meta = $this->__get('_fields_meta'); $printview = $this->__get('_printview'); - +//var_dump($the_disp_mode);echo "-----
"; var_dump($the_total);echo "-----
"; // 1. Initializes the $do_display array $do_display = array(); $do_display['edit_lnk'] = $the_disp_mode[0] . $the_disp_mode[1]; @@ -423,7 +406,7 @@ class PMA_DisplayResults // 5. Updates the synthetic var $the_disp_mode = join('', $do_display); - +//echo "****
";var_dump($do_display);echo "
****"; return $do_display; } // end of the 'setDisplayMode()' function From 8507005d371efdfc10dadb6dc20ecf940689f122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 9 Jul 2012 15:14:53 +0200 Subject: [PATCH 09/82] Translated using Weblate. --- po/cs.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/po/cs.po b/po/cs.po index 1ae953af96..4b0198e2dd 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-06-26 16:48+0200\n" +"PO-Revision-Date: 2012-07-09 15:14+0200\n" "Last-Translator: Michal Čihař \n" "Language-Team: czech \n" "Language: cs\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 1.0\n" +"X-Generator: Weblate 1.1\n" #: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354 #: libraries/DisplayResults.class.php:609 server_privileges.php:1851 @@ -7888,7 +7888,6 @@ msgstr "" "musí být prázdný." #: libraries/plugins/transformations/abstract/ExternalTransformationsPlugin.class.php:31 -#, fuzzy #| msgid "" #| "LINUX ONLY: Launches an external application and feeds it the column data " #| "via standard input. Returns the standard output of the application. The " @@ -7915,13 +7914,14 @@ msgstr "" "JEN PRO LINUX: Spustí externí program, na jeho standardní vstup pošle obsah " "pole a zobrazí výstup programu. Výchozí je program Tidy, který pěkně " "zformátuje HTML. Z bezpečnostních důvodů musíte jména povolených programů " -"zapsat do souboru libraries/transformations/text_plain__external.inc.php. " -"První parametr je číslo programu, který má být spuštěn a druhý parametr " -"udává parametry tohoto programu. Třetí parametr určuje, zda mají být ve " -"výstupu nahrazeny HTML entity (např. pro zobrazení zdrojového kódu HTML) " -"(výchozí je 1, tedy převádět na entity), čtvrtý (při nastavení na 1) zajistí " -"přidání parametru NOWRAP k vypisovanému textu, čímž se zachová formátování " -"(výchozí je 1)." +"zapsat do souboru " +"libraries/plugins/transformations/Text_Plain_External.class.php. První " +"parametr je číslo programu, který má být spuštěn a druhý parametr udává " +"parametry tohoto programu. Třetí parametr určuje, zda mají být ve výstupu " +"nahrazeny HTML entity (např. pro zobrazení zdrojového kódu HTML) (výchozí je " +"1, tedy převádět na entity), čtvrtý (při nastavení na 1) zajistí přidání " +"parametru NOWRAP k vypisovanému textu, čímž se zachová formátování (výchozí " +"je 1)." #: libraries/plugins/transformations/abstract/FormattedTransformationsPlugin.class.php:31 msgid "" From 6a9b53c8e51dbb17389dfc5e0ffa757c8ea7060f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Bellone?= Date: Mon, 9 Jul 2012 17:51:21 +0200 Subject: [PATCH 10/82] Translated using Weblate. --- po/es.po | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/po/es.po b/po/es.po index aca876f04d..9f0e1497d4 100644 --- a/po/es.po +++ b/po/es.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-06-26 20:02+0200\n" +"PO-Revision-Date: 2012-07-09 17:51+0200\n" "Last-Translator: Matías Bellone \n" "Language-Team: spanish \n" "Language: es\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 1.0\n" +"X-Generator: Weblate 1.1\n" #: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354 #: libraries/DisplayResults.class.php:609 server_privileges.php:1851 @@ -8066,7 +8066,6 @@ msgstr "" "usa esta última, la primer opción tiene que ser una cadena vacía." #: libraries/plugins/transformations/abstract/ExternalTransformationsPlugin.class.php:31 -#, fuzzy #| msgid "" #| "LINUX ONLY: Launches an external application and feeds it the column data " #| "via standard input. Returns the standard output of the application. The " @@ -8094,10 +8093,10 @@ msgstr "" "columna mediante entrada estándar. Devuelve la salidad de la aplicación. El " "valor predeterminado es Tidy para mostrar código HTML agradable para la " "impresión. Por razones de seguridad, debe editar manualmente el archivo " -"libraries/transformations/text_plain__external.inc.php y agregar las " -"herramientas que permitirá ejecutar. La primera opción será el número del " -"programa que querrá utilizar y la segunda opción son los parámetros para el " -"programa. Si el tercer parámetro es 1 (el valor predeterminado), se " +"libraries/plugins/transformations/Text_Plain_External.class.php y agregar " +"las herramientas que permitirá ejecutar. La primera opción será el número " +"del programa que querrá utilizar y la segunda opción los parámetros para " +"dicho programa. Si el tercer parámetro es 1 (el valor predeterminado), se " "convertirá la salida utilizando htmlspecialchars(). La cuarta opción, de ser " "1 (el valor predeterminado), evitará separar la salida en varias líneas " "asegurando que aparezca completa en una sola línea." From c2ec7a232194ed3342ef1405982707d5f67164c9 Mon Sep 17 00:00:00 2001 From: Yasitha Pandithawatta Date: Tue, 10 Jul 2012 00:33:40 +0530 Subject: [PATCH 11/82] Test cases for mime.lib.php --- test/libraries/PMA_mime_test.php | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 test/libraries/PMA_mime_test.php diff --git a/test/libraries/PMA_mime_test.php b/test/libraries/PMA_mime_test.php new file mode 100644 index 0000000000..57ef205ec6 --- /dev/null +++ b/test/libraries/PMA_mime_test.php @@ -0,0 +1,55 @@ +assertEquals( + PMA_detectMIME($test), + $output + ); + } + + /** + * Provider for testPMA_detectMIME + */ + public function providerForTestPMA_detectMIME(){ + return array( + array( + 'pma', + 'application/octet-stream' + ), + array( + 'GIF', + 'image/gif' + ), + array( + "\x89PNG", + 'image/png' + ), + array( + chr(0xff).chr(0xd8), + 'image/jpeg' + ), + ); + } +} From f25472455baa4451ab8c3fe17e62642de7eaeb71 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 10 Jul 2012 01:03:16 +0530 Subject: [PATCH 12/82] Fix defect in print view when vertical mode is on --- libraries/DisplayResults.class.php | 81 ++++++++++++++++-------------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index cdad4c181d..80a523bc0a 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -253,7 +253,7 @@ class PMA_DisplayResults $unlim_num_rows = $this->__get('_unlim_num_rows'); $fields_meta = $this->__get('_fields_meta'); $printview = $this->__get('_printview'); -//var_dump($the_disp_mode);echo "-----
"; var_dump($the_total);echo "-----
"; + // 1. Initializes the $do_display array $do_display = array(); $do_display['edit_lnk'] = $the_disp_mode[0] . $the_disp_mode[1]; @@ -406,7 +406,7 @@ class PMA_DisplayResults // 5. Updates the synthetic var $the_disp_mode = join('', $do_display); -//echo "****
";var_dump($do_display);echo "
****"; + return $do_display; } // end of the 'setDisplayMode()' function @@ -924,6 +924,7 @@ class PMA_DisplayResults $vertical_display['emptypre'] = 0; $vertical_display['emptyafter'] = 0; $vertical_display['textbtn'] = ''; + $full_or_partial_text_link = null; $this->__set('_vertical_display', $vertical_display); @@ -1021,7 +1022,7 @@ class PMA_DisplayResults ); } - $vertical_display[] = ' __get('_fields_cnt'), $this->__get('_fields_meta'), $row ); $where_clause_html = urlencode($where_clause); + + // In print view these variable needs toinitialized + $del_url = $del_query = $del_str = $edit_anchor_class + = $edit_str = $js_conf = $copy_url = $copy_str = null; // 1.2 Defines the URLs for the modify/delete link(s) @@ -4186,7 +4191,7 @@ class PMA_DisplayResults } $table_html = ''; - // Following variable are needed for use in isset/empty or + // Following variable are needed for use in isset/empty or // use with array indexes/safe use in foreach $fields_meta = $this->__get('_fields_meta'); $showtable = $this->__get('_showtable'); @@ -4286,11 +4291,19 @@ class PMA_DisplayResults } } + + if (($is_display['nav_bar'] == '1') + && empty($analyzed_sql[0]['limit_clause']) + ) { - $table_html .= $this->_getPlacedTableNavigatoins( - $is_display, $analyzed_sql, $pos_next, $pos_prev, - self::PLACE_TOP_DIRECTION_DROPDOWN, "\n", $is_innodb - ); + $table_html .= $this->_getPlacedTableNavigatoins( + $pos_next, $pos_prev, self::PLACE_TOP_DIRECTION_DROPDOWN, + "\n", $is_innodb + ); + + } elseif (! isset($printview) || ($printview != '1')) { + $table_html .= "\n" . '

' . "\n"; + } // 2b ----- Get field references from Database ----- // (see the 'relation' configuration variable) @@ -4357,11 +4370,17 @@ class PMA_DisplayResults } // 5. ----- Get the navigation bar at the bottom if required ----- - - $table_html .= $this->_getPlacedTableNavigatoins( - $is_display, $analyzed_sql, $pos_next, $pos_prev, - self::PLACE_BOTTOM_DIRECTION_DROPDOWN, '
' . "\n", $is_innodb - ); + if (($is_display['nav_bar'] == '1') + && empty($analyzed_sql[0]['limit_clause']) + ) { + $table_html .= $this->_getPlacedTableNavigatoins( + $pos_next, $pos_prev, self::PLACE_BOTTOM_DIRECTION_DROPDOWN, + '
' . "\n", $is_innodb + ); + } elseif (! isset($printview) || ($printview != '1')) { + $table_html .= "\n" . '

' . "\n"; + } + // 6. ----- Prepare "Query results operations" if (! isset($printview) || ($printview != '1')) { @@ -4824,8 +4843,6 @@ class PMA_DisplayResults /** * Prepare table navigation bar at the top or bottom * - * @param array $is_display which elements to display - * @param array $analyzed_sql the analyzed query * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $place the place to show navigation @@ -4839,31 +4856,21 @@ class PMA_DisplayResults * @see _getTable() */ private function _getPlacedTableNavigatoins( - $is_display, $analyzed_sql, $pos_next, $pos_prev - , $place, $empty_line, $is_innodb + $pos_next, $pos_prev, $place, $empty_line, $is_innodb ) { $navigation_html = ''; - $printview = $this->__get('_printview'); - if (($is_display['nav_bar'] == '1') - && empty($analyzed_sql[0]['limit_clause']) - ) { - - if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) { - $navigation_html .= '
' . "\n"; - } - - $navigation_html .= $this->_getTableNavigation( - $pos_next, $pos_prev, 'top_direction_dropdown', $is_innodb - ); - - if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { - $navigation_html .= "\n"; - } - - } elseif (! isset($printview) || ($printview != '1')) { - $navigation_html .= "\n" . '

' . "\n"; + if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) { + $navigation_html .= '
' . "\n"; + } + + $navigation_html .= $this->_getTableNavigation( + $pos_next, $pos_prev, 'top_direction_dropdown', $is_innodb + ); + + if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { + $navigation_html .= "\n"; } return $navigation_html; From e811fbe295f2382ba426e27b4ae3316d9234f918 Mon Sep 17 00:00:00 2001 From: Nicholas Arnesen Date: Tue, 10 Jul 2012 08:39:05 +0200 Subject: [PATCH 13/82] Translated using Weblate. --- po/nb.po | 65 ++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/po/nb.po b/po/nb.po index b00296a132..4b2a3a9f13 100644 --- a/po/nb.po +++ b/po/nb.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-09 03:26+0200\n" +"PO-Revision-Date: 2012-07-09 16:04+0200\n" "Last-Translator: Nicholas Arnesen \n" "Language-Team: norwegian \n" "Language: nb\n" @@ -1922,7 +1922,7 @@ msgstr "" #: js/messages.php:308 msgid "Click a data point to view and possibly edit the data row." -msgstr "" +msgstr "Velg et datapunkt for å vise, og muligens endre raden med data." #: js/messages.php:310 msgid "The plot can be resized by dragging it along the bottom right corner." @@ -2514,7 +2514,6 @@ msgid "Inline edit of this query" msgstr "Inline redigering av denne spørringa" #: libraries/CommonFunctions.class.php:1405 -#, fuzzy msgctxt "Inline edit query" msgid "Inline" msgstr "Innebygd" @@ -2541,15 +2540,13 @@ msgid "%s days, %s hours, %s minutes and %s seconds" msgstr "%s dager, %s timer, %s minutter og %s sekunder" #: libraries/CommonFunctions.class.php:2204 -#, fuzzy #| msgid "Routines" msgid "Missing parameter:" -msgstr "Rutiner" +msgstr "Mangler parametere:" #: libraries/CommonFunctions.class.php:2624 #: libraries/CommonFunctions.class.php:2628 #: libraries/DisplayResults.class.php:578 -#, fuzzy #| msgid "Begin" msgctxt "First page" msgid "Begin" @@ -2559,7 +2556,6 @@ msgstr "Start" #: libraries/CommonFunctions.class.php:2629 #: libraries/DisplayResults.class.php:581 server_binlog.php:140 #: server_binlog.php:142 -#, fuzzy #| msgid "Previous" msgctxt "Previous page" msgid "Previous" @@ -2569,7 +2565,6 @@ msgstr "Forrige" #: libraries/CommonFunctions.class.php:2664 #: libraries/DisplayResults.class.php:637 server_binlog.php:175 #: server_binlog.php:177 -#, fuzzy #| msgid "Next" msgctxt "Next page" msgid "Next" @@ -2578,11 +2573,10 @@ msgstr "Neste" #: libraries/CommonFunctions.class.php:2662 #: libraries/CommonFunctions.class.php:2665 #: libraries/DisplayResults.class.php:662 -#, fuzzy #| msgid "End" msgctxt "Last page" msgid "End" -msgstr "Slutt" +msgstr "Siste" #: libraries/CommonFunctions.class.php:2741 #, php-format @@ -2595,10 +2589,9 @@ msgid "The %s functionality is affected by a known bug, see %s" msgstr "Funksjonaliteten %s er påvirket av en kjent feil, se %s" #: libraries/CommonFunctions.class.php:2950 -#, fuzzy #| msgid "Click to select" msgid "Click to toggle" -msgstr "Klikk for å velge" +msgstr "Klikk for å endre" #: libraries/CommonFunctions.class.php:3381 #: libraries/CommonFunctions.class.php:3388 @@ -2666,7 +2659,7 @@ msgstr "Det er ingen filer å laste opp" #: libraries/CommonFunctions.class.php:3602 #: libraries/CommonFunctions.class.php:3603 msgid "Execute" -msgstr "" +msgstr "Utfør" #: libraries/CommonFunctions.class.php:4146 msgid "Print" @@ -3694,6 +3687,8 @@ msgid "" "This usually means there is a syntax error in it, please check any errors " "shown below." msgstr "" +"Dette mener vanligvis at det er en syntaksfeil i det, sjekk mulige feil som " +"vises under." #: libraries/common.inc.php:581 #, php-format @@ -3750,15 +3745,15 @@ msgstr "Begge" #: libraries/config.values.php:57 msgid "Nowhere" -msgstr "" +msgstr "Ingensteds" #: libraries/config.values.php:58 msgid "Left" -msgstr "" +msgstr "Venstre" #: libraries/config.values.php:59 msgid "Right" -msgstr "" +msgstr "Høyre" #: libraries/config.values.php:98 msgid "Open" @@ -3973,9 +3968,8 @@ msgstr "" "autentisering" #: libraries/config/messages.inc.php:25 -#, fuzzy msgid "Blowfish secret" -msgstr "Blowfish hemmelighet" +msgstr "Blowfish hemmelig kode" #: libraries/config/messages.inc.php:26 msgid "Highlight selected rows" @@ -4034,24 +4028,26 @@ msgid "" "Defines the minimum size for input fields generated for CHAR and VARCHAR " "columns" msgstr "" +"Definerer minimum størrelse for innskrivningfelt laget for CHAR og VARCHAR " +"kolonner" #: libraries/config/messages.inc.php:37 -#, fuzzy #| msgid "Customize export options" msgid "Minimum size for input field" -msgstr "Endre eksportstandarder" +msgstr "Minste størrelse for innskrivningsfelt" #: libraries/config/messages.inc.php:38 msgid "" "Defines the maximum size for input fields generated for CHAR and VARCHAR " "columns" msgstr "" +"Definerer maks størrelse for innskrivningsfelt laget for CHAR og VARCHAR " +"kolonner" #: libraries/config/messages.inc.php:39 -#, fuzzy #| msgid "Maximum size for temporary sort files" msgid "Maximum size for input field" -msgstr "Maksimum størrelse for midlertidige sorteringsfiler" +msgstr "Maksimum størrelse for innskrivningsfelt" #: libraries/config/messages.inc.php:40 msgid "Number of columns for CHAR/VARCHAR textareas" @@ -4171,10 +4167,9 @@ msgid "" msgstr "" #: libraries/config/messages.inc.php:67 -#, fuzzy #| msgid "Table maintenance" msgid "Disable multi table maintenance" -msgstr "Tabellvedlikehold" +msgstr "Deaktiver multitabellvedlikehold" #: libraries/config/messages.inc.php:68 msgid "Edit SQL queries in popup window" @@ -4366,7 +4361,7 @@ msgstr "SQL kompatibilitetsmodus" #: libraries/config/messages.inc.php:126 #: libraries/plugins/export/ExportSql.class.php:332 msgid "CREATE TABLE options:" -msgstr "" +msgstr "OPPRETT TABELL valg:" #: libraries/config/messages.inc.php:127 msgid "Creation/Update/Check dates" @@ -4706,6 +4701,11 @@ msgid "" "strong].[br][em][a@http://sqlvalidator.mimer.com/]Mimer SQL Validator[/a], " "Copyright 2002 Upright Database Technology. All rights reserved.[/em]" msgstr "" +"Om du ønsker å bruke SQL-vurderingsservicen så må du være klar over at " +"[strong] alle SQL-spørringer blir lagret anonymt for statistisk " +"bruk[/strong].[br][em][a@http://sqlvalidator.mimer.com/]Mimer SQL-" +"vurderer(engelsk)[/a], Kopirettigheter 2002 Upright Database Technology. " +"Alle rettigheter reservert.[/em]" #: libraries/config/messages.inc.php:226 msgid "Startup" @@ -4848,7 +4848,6 @@ msgid "Do not import empty rows" msgstr "Ikke importer tomme rader" #: libraries/config/messages.inc.php:264 -#, fuzzy #| msgid "Import currencies ($5.00 to 5.00)" msgid "Import currencies ($5.00 to 5.00)" msgstr "Importer valuta ($5.00 til 5.00)" @@ -4866,7 +4865,6 @@ msgid "Partial import: skip queries" msgstr "Delvis import: hopp over spørringer" #: libraries/config/messages.inc.php:269 -#, fuzzy #| msgid "Do not use AUTO_INCREMENT for zero values" msgid "Do not use AUTO_INCREMENT for zero values" msgstr "Ikke bruk AUTO_INCREMENT for nullverdier" @@ -4988,10 +4986,9 @@ msgid "Maximum number of recently used tables; set 0 to disable" msgstr "Maks antall tabeller vist i tabellista" #: libraries/config/messages.inc.php:298 -#, fuzzy #| msgid "Untracked tables" msgid "Recently used tables" -msgstr "Ikke overvåkede tabeller" +msgstr "Sist brukte tabeller" #: libraries/config/messages.inc.php:299 #, fuzzy @@ -5130,14 +5127,13 @@ msgid "Memory limit" msgstr "Minnetak" #: libraries/config/messages.inc.php:325 -#, fuzzy #| msgid "These are Edit, Inline edit, Copy and Delete links" msgid "These are Edit, Copy and Delete links" -msgstr "Dette er rediger, innsmettet rediger, kopier og slettede lenker" +msgstr "Disse er Rediger-, kopi- og slettelenker" #: libraries/config/messages.inc.php:326 msgid "Where to show the table row links" -msgstr "" +msgstr "Hvor tabell-lenkene skal vises" #: libraries/config/messages.inc.php:327 msgid "Use natural order for sorting table and database names" @@ -5192,7 +5188,7 @@ msgstr "" #: libraries/config/messages.inc.php:338 msgid "Missing phpMyAdmin configuration storage tables" -msgstr "" +msgstr "Mangler phpMyAdmin konfigurasjonslagertabeller" #: libraries/config/messages.inc.php:340 msgid "Iconic table operations" @@ -5207,7 +5203,6 @@ msgid "Protect binary columns" msgstr "Beskytt binære kolonner" #: libraries/config/messages.inc.php:343 -#, fuzzy #| msgid "" #| " if you want DB-based query history (requires pmadb). If disabled, s " #| "lizes JS-routines to display query history (lost by window close)." @@ -5241,7 +5236,7 @@ msgstr "Standard spørringsvindufane" #: libraries/config/messages.inc.php:350 msgid "Query window height (in pixels)" -msgstr "" +msgstr "Spørringsvinduets høyde (i piksler)" #: libraries/config/messages.inc.php:351 msgid "Query window height" From fe62795f6ea05668799e790136f529bdc44636c8 Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Tue, 10 Jul 2012 08:39:06 +0200 Subject: [PATCH 14/82] Translated using Weblate. --- po/pt_BR.po | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 3af8d0613c..e30c26361a 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-08 20:32+0200\n" -"Last-Translator: Keven do Nascimento Carneiro \n" +"PO-Revision-Date: 2012-07-10 05:08+0200\n" +"Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -6764,7 +6764,7 @@ msgstr "" #: libraries/engines/pbxt.lib.php:28 msgid "Index cache size" -msgstr "" +msgstr "Tamanho de cache de índice" #: libraries/engines/pbxt.lib.php:29 msgid "" @@ -6774,7 +6774,7 @@ msgstr "" #: libraries/engines/pbxt.lib.php:33 msgid "Record cache size" -msgstr "" +msgstr "Tamanho de cache de gravação" #: libraries/engines/pbxt.lib.php:34 msgid "" @@ -6782,6 +6782,10 @@ msgid "" "table data. The default value is 32MB. This memory is used to cache changes " "to the handle data (.xtd) and row pointer (.xtr) files." msgstr "" +"Esta é a quantidade de memória alocada para o cache de gravação usado no " +"cache de dados de tabela. O valor padrão é 32MB. Esta memória será usada " +"para fazer cache de alterações para a manipulação de dados (.xtd) e arquivos " +"apontadores de linha (.xtr)." #: libraries/engines/pbxt.lib.php:38 msgid "Log cache size" @@ -6792,10 +6796,12 @@ msgid "" "The amount of memory allocated to the transaction log cache used to cache on " "transaction log data. The default is 16MB." msgstr "" +"Quantidade de memória alocada para o cache de log de transação usada para " +"manter cache no log da transação de dados. O valor padrão é 16MB." #: libraries/engines/pbxt.lib.php:43 msgid "Log file threshold" -msgstr "" +msgstr "Limite de arquivo de log" #: libraries/engines/pbxt.lib.php:44 msgid "" From 0f32f805d49166c2ba9f33323a54e338ce660e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 09:18:56 +0200 Subject: [PATCH 15/82] Let the test have full environment in setup --- test/classes/PMA_Theme_test.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/classes/PMA_Theme_test.php b/test/classes/PMA_Theme_test.php index d65f2a0e6c..6a7c548778 100644 --- a/test/classes/PMA_Theme_test.php +++ b/test/classes/PMA_Theme_test.php @@ -33,6 +33,9 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['SQP']['fmtColor'] = array('fake' => 'red'); $GLOBALS['text_dir'] = 'ltr'; require 'themes/pmahomme/layout.inc.php'; + $_SESSION[' PMA_token '] = 'token'; + $GLOBALS['lang'] = 'en'; + $GLOBALS['server'] = '99'; } /** @@ -222,7 +225,7 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase { $this->assertEquals( $this->object->getPrintPreview(), - '
' + '' ); } From 88abe53d2e604cd59e022e9ea1edecda1cd3481d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 09:32:22 +0200 Subject: [PATCH 16/82] Define all parameters --- test/libraries/PMA_bookmark_test.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/libraries/PMA_bookmark_test.php b/test/libraries/PMA_bookmark_test.php index 7454299905..0054815743 100644 --- a/test/libraries/PMA_bookmark_test.php +++ b/test/libraries/PMA_bookmark_test.php @@ -102,7 +102,12 @@ class PMA_bookmark_test extends PHPUnit_Framework_TestCase } } $this->assertEquals( - PMA_Bookmark_save('phpmyadmin'), + PMA_Bookmark_save(array( + 'dbase' => 'phpmyadmin', + 'user' => 'phpmyadmin', + 'query' => 'SELECT "phpmyadmin"', + 'label' => 'phpmyadmin', + )), true ); } From e6634cf3b0e434ac77d22b53449709317c633a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 10:21:08 +0200 Subject: [PATCH 17/82] Fix docblocks --- test/classes/PMA_DisplayResults_test.php | 260 ++++++++++++----------- 1 file changed, 135 insertions(+), 125 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 12bb7127b2..a81759299e 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -14,7 +14,11 @@ require_once 'libraries/php-gettext/gettext.inc'; require_once 'libraries/CommonFunctions.class.php'; require_once 'libraries/js_escape.lib.php'; - +/** + * Test cases for displaying results. + * + * @package PhpMyAdmin-test + */ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase { /** @@ -64,14 +68,16 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } /** - * @param $the_disp_mode string the synthetic value for display_mode (see a few lines above for explanations) - * @param $the_total the total number of rows returned by the SQL - * query without any programmatically appended - * LIMIT clause - * (just a copy of $unlim_num_rows if it exists, - * elsecomputed inside this function) + * Test for setting display mode * - * @param $output output from the _setDisplayMode method + * @param string $the_disp_mode the synthetic value for display_mode (see a + * few lines above for explanations) + * @param integer $the_total the total number of rows returned by the SQL + * query without any programmatically appended + * LIMIT clause + * (just a copy of $unlim_num_rows if it exists, + * elsecomputed inside this function) + * @param string $output output from the _setDisplayMode method * * @dataProvider providerForTestSetDisplayModeCase1 */ @@ -127,14 +133,16 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } /** - * @param $the_disp_mode string the synthetic value for display_mode (see a few lines above for explanations) - * @param $the_total the total number of rows returned by the SQL - * query without any programmatically appended - * LIMIT clause - * (just a copy of $unlim_num_rows if it exists, - * elsecomputed inside this function) + * Test for setting display mode * - * @param $output output from the _setDisplayMode method + * @param string $the_disp_mode the synthetic value for display_mode (see a + * few lines above for explanations) + * @param integer $the_total the total number of rows returned by the SQL + * query without any programmatically appended + * LIMIT clause + * (just a copy of $unlim_num_rows if it exists, + * elsecomputed inside this function) + * @param string $output output from the _setDisplayMode method * * @dataProvider providerForTestSetDisplayModeCase2 */ @@ -196,14 +204,16 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } /** - * @param $the_disp_mode string the synthetic value for display_mode (see a few lines above for explanations) - * @param $the_total the total number of rows returned by the SQL - * query without any programmatically appended - * LIMIT clause - * (just a copy of $unlim_num_rows if it exists, - * elsecomputed inside this function) + * Test for setting display mode * - * @param $output output from the _setDisplayMode method + * @param string $the_disp_mode the synthetic value for display_mode (see a + * few lines above for explanations) + * @param integer $the_total the total number of rows returned by the SQL + * query without any programmatically appended + * LIMIT clause + * (just a copy of $unlim_num_rows if it exists, + * elsecomputed inside this function) + * @param string $output output from the _setDisplayMode method * * @dataProvider providerForTestSetDisplayModeCase3 */ @@ -283,11 +293,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } /** - * @param string $caption iconic caption for button - * @param string $title text for button - * @param integer $pos position for next query - * @param string $html_sql_query query ready for display - * @param $output output from the _getTableNavigationButton method + * @param string $caption iconic caption for button + * @param string $title text for button + * @param integer $pos position for next query + * @param string $html_sql_query query ready for display + * @param string $output output from the _getTableNavigationButton method * * @dataProvider providerForTestGetTableNavigationButton */ @@ -364,11 +374,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase '526' ) ); - } - + } + /** * Data provider for testGetResettedClassForInlineEdit - * + * * @return array parameters and output */ public function dataProviderForTestGetResettedClassForInlineEdit() @@ -385,10 +395,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getResettedClassForInlineEdit - * + * * @param string $grid_edit_class the class for all editable columns * @param string $not_null_class the class for not null columns * @param string $relation_class the class for relations in a column @@ -396,7 +406,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $field_type_class the class related to type of the field * @param integer $row_no the row index * @param string $output output of__getResettedClassForInlineEdit - * + * * @dataProvider dataProviderForTestGetResettedClassForInlineEdit */ public function testGetResettedClassForInlineEdit( @@ -407,8 +417,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['BrowseMarkerEnable'] = true; $GLOBALS['printview'] = 2; $_SESSION['tmp_user_values']['disp_direction'] - = PMA_DisplayResults::DISP_DIR_VERTICAL; - + = PMA_DisplayResults::DISP_DIR_VERTICAL; + $this->assertEquals( $this->_callPrivateFunction( '_getResettedClassForInlineEdit', @@ -434,7 +444,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase 'datetimefield' ); } - + /** * Test for _getClassForDateTimeRelatedFields - case 2 */ @@ -448,7 +458,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase 'datefield' ); } - + /** * Test for _getClassForDateTimeRelatedFields - case 3 */ @@ -462,10 +472,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase '' ); } - + /** * Provide data for testGetOperationLinksForVerticleTableCase1 - * + * * @return array parameters and output */ public function dataProviderForTestGetOperationLinksForVerticleTableCase1() @@ -500,11 +510,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getOperationLinksForVerticleTable - case 1 - * + * * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * @param string $output output of _getOperationLinksForVerticleTable - * + * * @dataProvider dataProviderForTestGetOperationLinksForVerticleTableCase1 */ public function testGetOperationLinksForVerticleTableCase1( @@ -518,10 +528,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Provide data for testGetOperationLinksForVerticleTableCase2 - * + * * @return array parameters and output */ public function dataProviderForTestGetOperationLinksForVerticleTableCase2() @@ -548,9 +558,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ), 'edit', ' - - - + + + \nEdit Edit\n ' ) @@ -559,11 +569,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getOperationLinksForVerticleTable - case 2 - * + * * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * @param string $output output of _getOperationLinksForVerticleTable - * + * * @dataProvider dataProviderForTestGetOperationLinksForVerticleTableCase2 */ public function testGetOperationLinksForVerticleTableCase2( @@ -577,11 +587,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - - + + /** * Provide data for testGetOperationLinksForVerticleTableCase3 - * + * * @return array parameters and output */ public function dataProviderForTestGetOperationLinksForVerticleTableCase3() @@ -608,9 +618,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ), 'delete', ' - - - + + + \n ' ) @@ -619,11 +629,11 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getOperationLinksForVerticleTable - case 3 - * + * * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * @param string $output output of _getOperationLinksForVerticleTable - * + * * @dataProvider dataProviderForTestGetOperationLinksForVerticleTableCase3 */ public function testGetOperationLinksForVerticleTableCase3( @@ -637,10 +647,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetCheckBoxesForMultipleRowOperations - * + * * @return array parameters and output */ public function dataProviderForGetCheckBoxesForMultipleRowOperations() @@ -728,14 +738,14 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getCheckBoxesForMultipleRowOperations - * + * * @param array $vertical_display the information to display * @param string $dir _left / _right * @param string $output output of _getCheckBoxesForMultipleRowOperations - * + * * @dataProvider dataProviderForGetCheckBoxesForMultipleRowOperations */ public function testGetCheckBoxesForMultipleRowOperations( @@ -750,7 +760,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Test for _getOffsets - case 1 */ @@ -762,7 +772,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase array(0, 0) ); } - + /** * Test for _getOffsets - case 2 */ @@ -775,10 +785,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase array(9, 0) ); } - + /** * Data provider for testGetSortParamsCase1 - * + * * @return array parameters and output */ public function dataProviderForGetSortParamsCase1() @@ -787,13 +797,13 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase array('', array('', '', '')) ); } - + /** * Test for _getSortParams - case 1 - * + * * @param string $order_by_clause the order by clause of the sql query * @param string $output output of _getSortParams - * + * * @dataProvider dataProviderForGetSortParamsCase1 */ public function testGetSortParamsCase1($order_by_clause, $output) @@ -805,10 +815,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetSortParamsCase2 - * + * * @return array parameters and output */ public function dataProviderForGetSortParamsCase2() @@ -824,13 +834,13 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getSortParams - case 2 - * + * * @param string $order_by_clause the order by clause of the sql query * @param string $output output of _getSortParams - * + * * @dataProvider dataProviderForGetSortParamsCase2 */ public function testGetSortParamsCase2($order_by_clause, $output) @@ -842,10 +852,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetCheckboxForMultiRowSubmissions - * + * * @return array parameters and output */ public function dataProviderForGetCheckboxForMultiRowSubmissions() @@ -876,7 +886,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getCheckboxForMultiRowSubmissions - * + * * @param string $del_url delete url * @param array $is_display array with explicit indexes for all * the display elements @@ -888,7 +898,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $class css classes for the td element * @param string $output output of _getSortParams * @param string $output output of _getCheckboxForMultiRowSubmissions - * + * * @dataProvider dataProviderForGetCheckboxForMultiRowSubmissions */ public function testGetCheckboxForMultiRowSubmissions( @@ -901,15 +911,15 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase array( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix, $class - ) + ) ), $output ); } - + /** * Data provider for testGetEditLink - * + * * @return array parametres and output */ public function dataProviderForGetEditLink() @@ -927,26 +937,26 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getEditLink - * + * * @param string $edit_url edit url * @param string $class css classes for td element * @param string $edit_str text for the edit link * @param string $where_clause where clause * @param string $where_clause_html url encoded where clause * @param string $output output of _getEditLink - * + * * @dataProvider dataProviderForGetEditLink */ public function testGetEditLink( $edit_url, $class, $edit_str, $where_clause, $where_clause_html, $output ) { - + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; - + $this->assertEquals( $this->_callPrivateFunction( '_getEditLink', @@ -956,12 +966,12 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ), $output ); - + } - + /** * Data provider for testGetCopyLink - * + * * @return array parameters and output */ public function dataProviderForGetCopyLink() @@ -979,26 +989,26 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getCopyLink - * + * * @param string $copy_url copy url * @param string $copy_str text for the copy link * @param string $where_clause where clause * @param string $where_clause_html url encoded where clause * @param string $class css classes for the td element * @param string $output output of _getCopyLink - * + * * @dataProvider dataProviderForGetCopyLink */ public function testGetCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, $class, $output ) { - + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; - + $this->assertEquals( $this->_callPrivateFunction( '_getCopyLink', @@ -1009,10 +1019,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetDeleteLink - * + * * @return array parameters and output */ public function dataProviderForGetDeleteLink() @@ -1029,25 +1039,25 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getDeleteLink - * + * * @param string $del_url delete url * @param string $del_str text for the delete link * @param string $js_conf text for the JS confirmation * @param string $class css classes for the td element * @param string $output output of _getDeleteLink - * + * * @dataProvider dataProviderForGetDeleteLink */ public function testGetDeleteLink( $del_url, $del_str, $js_conf, $class, $output ) { - + $GLOBALS['cfg']['PropertiesIconic'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; - + $this->assertEquals( $this->_callPrivateFunction( '_getDeleteLink', @@ -1058,10 +1068,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetCheckboxAndLinksCase1 - * + * * @return array parameters and output */ public function dataProviderForGetCheckboxAndLinksCase1() @@ -1105,10 +1115,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getCheckboxAndLinks - case 1 - * + * * @param string $position the position of the checkbox and links * @param string $del_url delete url * @param array $is_display array with explicit indexes for all the @@ -1127,7 +1137,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $del_str text for the delete link * @param string $js_conf text for the JS confirmation * @param string $output output of _getCheckboxAndLinks - * + * * @dataProvider dataProviderForGetCheckboxAndLinksCase1 */ public function testGetCheckboxAndLinksCase1( @@ -1135,7 +1145,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output ) { - + $this->assertEquals( $this->_callPrivateFunction( '_getCheckboxAndLinks', @@ -1149,10 +1159,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetCheckboxAndLinksCase2 - * + * * @return array parameters and output */ public function dataProviderForGetCheckboxAndLinksCase2() @@ -1196,10 +1206,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getCheckboxAndLinks - case 2 - * + * * @param string $position the position of the checkbox and links * @param string $del_url delete url * @param array $is_display array with explicit indexes for all the @@ -1218,7 +1228,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $del_str text for the delete link * @param string $js_conf text for the JS confirmation * @param string $output output of _getCheckboxAndLinks - * + * * @dataProvider dataProviderForGetCheckboxAndLinksCase2 */ public function testGetCheckboxAndLinksCase2( @@ -1226,7 +1236,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output ) { - + $this->assertEquals( $this->_callPrivateFunction( '_getCheckboxAndLinks', @@ -1240,10 +1250,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Data provider for testGetCheckboxAndLinksCase3 - * + * * @return array parameters and output */ public function dataProviderForGetCheckboxAndLinksCase3() @@ -1281,10 +1291,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase ) ); } - + /** * Test for _getCheckboxAndLinks - case 3 - * + * * @param string $position the position of the checkbox and links * @param string $del_url delete url * @param array $is_display array with explicit indexes for all the @@ -1303,7 +1313,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $del_str text for the delete link * @param string $js_conf text for the JS confirmation * @param string $output output of _getCheckboxAndLinks - * + * * @dataProvider dataProviderForGetCheckboxAndLinksCase3 */ public function testGetCheckboxAndLinksCase3( @@ -1311,7 +1321,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $output ) { - + $this->assertEquals( $this->_callPrivateFunction( '_getCheckboxAndLinks', @@ -1325,7 +1335,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + /** * Test for _mimeDefaultFunction */ @@ -1339,10 +1349,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase "A 'quote' is <b>bold</b>" ); } - + /** * Data provider for testGetPlacedLinks - * + * * @return array parameters and output */ public function dataProviderForGetPlacedLinks() @@ -1383,7 +1393,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getPlacedLinks - * + * * @param string $dir the direction of links should place * @param string $del_url the url for delete row * @param array $is_display which elements to display @@ -1401,14 +1411,14 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $del_str the label for delete row * @param string $js_conf text for the JS confirmation * @param string $output output of _getPlacedLinks - * + * * @dataProvider dataProviderForGetPlacedLinks */ public function testGetPlacedLinks( $dir, $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $condition_array, $del_query, $dir_letter, $edit_url, $copy_url, $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf, $output - ) { + ) { $this->assertEquals( $this->_callPrivateFunction( '_getPlacedLinks', @@ -1422,6 +1432,6 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $output ); } - + } From 66d2d28e0eef9183ac41a8f6053e88751f5077c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 10:23:03 +0200 Subject: [PATCH 18/82] Fix parenthesis location --- test/classes/PMA_DisplayResults_test.php | 31 +++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index a81759299e..5da97295ca 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -81,8 +81,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestSetDisplayModeCase1 */ - public function testSetDisplayModeCase1($the_disp_mode, $the_total, $output){ - + public function testSetDisplayModeCase1($the_disp_mode, $the_total, $output) + { $GLOBALS['is_count'] = true; $GLOBALS['is_maint'] = true; @@ -92,7 +92,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase array(&$the_disp_mode, &$the_total) ), $output - ); + ); } /** @@ -146,7 +146,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestSetDisplayModeCase2 */ - public function testSetDisplayModeCase2($the_disp_mode, $the_total, $output){ + public function testSetDisplayModeCase2($the_disp_mode, $the_total, $output) + { $GLOBALS['is_count'] = false; @@ -217,7 +218,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestSetDisplayModeCase3 */ - public function testSetDisplayModeCase3($the_disp_mode, $the_total, $output){ + public function testSetDisplayModeCase3($the_disp_mode, $the_total, $output) + { $GLOBALS['is_count'] = false; $GLOBALS['is_maint'] = false; @@ -274,7 +276,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _isSelect function */ - public function testisSelect(){ + public function testisSelect() + { $GLOBALS['is_count'] = false; $GLOBALS['is_export'] = false; @@ -301,7 +304,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestGetTableNavigationButton */ - public function testGetTableNavigationButton($caption, $title, $pos, $html_sql_query, $output){ + public function testGetTableNavigationButton($caption, $title, $pos, $html_sql_query, $output) + { $GLOBALS['cfg']['NavigationBarIconic'] = true; $GLOBALS['cfg']['AjaxEnable'] = true; @@ -340,7 +344,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestGetTableNavigation */ - public function testGetTableNavigation($pos_next, $pos_prev, $id_for_direction_dropdown, $output){ + public function testGetTableNavigation($pos_next, $pos_prev, $id_for_direction_dropdown, $output) + { $_SESSION['tmp_user_values']['max_rows'] = '20'; $GLOBALS['cfg']['AjaxEnable'] = true; @@ -353,10 +358,12 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $_SESSION['tmp_user_values']['disp_direction'] = '1'; $this->assertEquals( - str_word_count($this->_callPrivateFunction( - '_getTableNavigation', - array($pos_next, $pos_prev, $id_for_direction_dropdown) - )), + str_word_count( + $this->_callPrivateFunction( + '_getTableNavigation', + array($pos_next, $pos_prev, $id_for_direction_dropdown) + ) + ), $output ); } From 6486bc452191dc5c252936eb124da01d96933082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 10:24:35 +0200 Subject: [PATCH 19/82] Wrap some long lines --- test/classes/PMA_DisplayResults_test.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 5da97295ca..8aff3aec35 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -35,7 +35,10 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->object = $this->getMockForAbstractClass('PMA_DisplayResults', array('as', '','','')); + $this->object = $this->getMockForAbstractClass( + 'PMA_DisplayResults', + array('as', '','','') + ); } @@ -300,12 +303,14 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $title text for button * @param integer $pos position for next query * @param string $html_sql_query query ready for display - * @param string $output output from the _getTableNavigationButton method + * @param string $output output from the _getTableNavigationButton + * method * * @dataProvider providerForTestGetTableNavigationButton */ - public function testGetTableNavigationButton($caption, $title, $pos, $html_sql_query, $output) - { + public function testGetTableNavigationButton( + $caption, $title, $pos, $html_sql_query, $output + ) { $GLOBALS['cfg']['NavigationBarIconic'] = true; $GLOBALS['cfg']['AjaxEnable'] = true; @@ -344,8 +349,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * * @dataProvider providerForTestGetTableNavigation */ - public function testGetTableNavigation($pos_next, $pos_prev, $id_for_direction_dropdown, $output) - { + public function testGetTableNavigation( + $pos_next, $pos_prev, $id_for_direction_dropdown, $output + ) { $_SESSION['tmp_user_values']['max_rows'] = '20'; $GLOBALS['cfg']['AjaxEnable'] = true; From fb4f8d712186503d0ec78460c699cd744cb5009c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 10 Jul 2012 10:26:01 +0200 Subject: [PATCH 20/82] Fix alignment of docblocks --- test/classes/PMA_DisplayResults_test.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 8aff3aec35..f05325a179 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -345,7 +345,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $id_for_direction_dropdown the id for the direction dropdown - * @param $output output from the _getTableNavigation method + * @param string $output output from the _getTableNavigation + * method * * @dataProvider providerForTestGetTableNavigation */ @@ -1423,7 +1424,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param string $copy_str the label for copy row * @param string $del_str the label for delete row * @param string $js_conf text for the JS confirmation - * @param string $output output of _getPlacedLinks + * @param string $output output of _getPlacedLinks * * @dataProvider dataProviderForGetPlacedLinks */ From 49c7956a7a525b14ce417e10176a99b70745eba7 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Tue, 10 Jul 2012 19:40:50 +0530 Subject: [PATCH 21/82] Introduce new function to set properties in PMA_DisplayResults class --- libraries/DisplayResults.class.php | 80 ++++++++++++++++++++---------- sql.php | 22 ++++++++ 2 files changed, 76 insertions(+), 26 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 80a523bc0a..6882a0dfe6 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -209,6 +209,60 @@ class PMA_DisplayResults $this->__set('_goto', $goto); $this->__set('_sql_query', $sql_query); } + + + /** + * Set properties which were not initialized at the constructor + * + * @param type $unlim_num_rows integer the total number of rows returned by + * the SQL query without any appended + * "LIMIT" clause programmatically + * @param type $fields_meta array meta information about fields + * @param type $is_count boolean + * @param type $is_export integer + * @param type $is_func boolean + * @param type $is_analyse integer + * @param type $num_rows integer total no. of rows returned by SQL query + * @param type $fields_cnt integer total no.of fields returned by SQL query + * @param type $querytime double time taken for execute the SQL query + * @param type $pmaThemeImage string path for theme images directory + * @param type $text_dir string + * @param type $is_maint boolean + * @param type $is_explain boolean + * @param type $is_show boolean + * @param type $showtable array table definitions + * @param type $printview string + * @param type $url_query string URL query + * + * @return void + * + * @see sql.php + */ + public function processParams( + $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, + $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, + $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query + ) { + + $this->__set('_unlim_num_rows', $unlim_num_rows); + $this->__set('_fields_meta', $fields_meta); + $this->__set('_is_count', $is_count); + $this->__set('_is_export', $is_export); + $this->__set('_is_func', $is_func); + $this->__set('_is_analyse', $is_analyse); + $this->__set('_num_rows', $num_rows); + $this->__set('_fields_cnt', $fields_cnt); + $this->__set('_querytime', $querytime); + $this->__set('_pma_theme_image', $pmaThemeImage); + $this->__set('_text_dir', $text_dir); + $this->__set('_is_maint', $is_maint); + $this->__set('_is_explain', $is_explain); + $this->__set('_is_show', $is_show); + $this->__set('_showtable', $showtable); + $this->__set('_printview', $printview); + $this->__set('_url_query', $url_query); + + } /** @@ -4164,32 +4218,6 @@ class PMA_DisplayResults public function getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) { - // Initialize global variables which is not set in constructor - $this->__set('_unlim_num_rows', $GLOBALS['unlim_num_rows']); - $this->__set('_fields_meta', $GLOBALS['fields_meta']); - $this->__set('_is_count', $GLOBALS['is_count']); - $this->__set('_is_export', $GLOBALS['is_export']); - $this->__set('_is_func', $GLOBALS['is_func']); - $this->__set('_is_analyse', $GLOBALS['is_analyse']); - $this->__set('_num_rows', $GLOBALS['num_rows']); - $this->__set('_fields_cnt', $GLOBALS['fields_cnt']); - $this->__set('_querytime', $GLOBALS['querytime']); - $this->__set('_pma_theme_image', $GLOBALS['pmaThemeImage']); - $this->__set('_text_dir', $GLOBALS['text_dir']); - $this->__set('_is_maint', $GLOBALS['is_maint']); - $this->__set('_is_explain', $GLOBALS['is_explain']); - $this->__set('_is_show', $GLOBALS['is_show']); - - if (isset ($GLOBALS['showtable'])) { - $this->__set('_showtable', $GLOBALS['showtable']); - } - if (isset ($GLOBALS['printview'])) { - $this->__set('_printview', $GLOBALS['printview']); - } - if (isset ($GLOBALS['url_query'])) { - $this->__set('_url_query', $GLOBALS['url_query']); - } - $table_html = ''; // Following variable are needed for use in isset/empty or // use with array indexes/safe use in foreach diff --git a/sql.php b/sql.php index e45f70660e..5932221a8e 100644 --- a/sql.php +++ b/sql.php @@ -931,8 +931,20 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { $message, $GLOBALS['sql_query'], 'success' ); } + + // Should be initialized these parameters before parsing + $showtable = isset($showtable) ? $showtable : null; + $printview = isset($printview) ? $printview : null; + $url_query = isset($url_query) ? $url_query : null; + + $displayResultsObject->processParams( + $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, + $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, + $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query + ); echo $displayResultsObject->getTable($result, $disp_mode, $analyzed_sql); exit(); + } // Displays the headers @@ -1080,6 +1092,16 @@ $(makeProfilingChart); $message->display(); } + // Should be initialized these parameters before parsing + $showtable = isset($showtable) ? $showtable : null; + $printview = isset($printview) ? $printview : null; + $url_query = isset($url_query) ? $url_query : null; + + $displayResultsObject->processParams( + $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, + $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, + $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query + ); echo $displayResultsObject->getTable($result, $disp_mode, $analyzed_sql); PMA_DBI_free_result($result); From 096a9c58f9af2250ee36f8032c60d9f5abc39625 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 10 Jul 2012 21:49:05 +0530 Subject: [PATCH 22/82] White space cleanup --- libraries/DisplayResults.class.php | 424 ++++++++++++++--------------- 1 file changed, 212 insertions(+), 212 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 6882a0dfe6..aa835b35e4 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -29,7 +29,7 @@ class PMA_DisplayResults const POSITION_RIGHT = 'right'; const POSITION_BOTH = 'both'; const POSITION_NONE = 'none'; - + const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown'; const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown'; @@ -66,121 +66,121 @@ class PMA_DisplayResults const TABLE_TYPE_INNO_DB = 'InnoDB'; const ALL_ROWS = 'all'; const QUERY_TYPE_SELECT = 'SELECT'; - - + + // Declare global fields /** PMA_CommonFunctions object */ private $_common_functions; - + /** string Database name */ private $_db; - + /** string Table name */ private $_table; - + /** string the URL to go back in case of errors */ private $_goto; - + /** string the SQL query */ private $_sql_query; - + /** * integer the total number of rows returned by the SQL query without any * appended "LIMIT" clause programmatically */ private $_unlim_num_rows; - + /** array meta information about fields */ private $_fields_meta; - + /** boolean */ private $_is_count; - + /** integer */ private $_is_export; - + /** boolean */ private $_is_func; - + /** integer */ private $_is_analyse; - + /** integer the total number of rows returned by the SQL query */ private $_num_rows; - + /** array table definitions */ private $_showtable; - + /** array column names to highlight */ private $_highlight_columns; - + /** array informations used with vertical display mode */ private $_vertical_display; - + /** integer the total number of fields returned by the SQL query */ private $_fields_cnt; - + /** string */ private $_printview; - + /** double time taken for execute the SQL query */ private $_querytime; - + /** string path for theme images directory */ private $_pma_theme_image; - + /** string */ private $_text_dir; - + /** string URL query */ private $_url_query; - + /** boolean */ private $_is_maint; - + /** boolean */ private $_is_explain; - + /** boolean */ private $_is_show; - + /** array mime types information of fields */ private $_mime_map; - - + + /** * Get any property of this class - * + * * @param string $property name of the property * @return if property exist, value of the relavant property */ public function __get($property) { - + if (property_exists($this, $property)) { return $this->$property; } - + } - - + + /** * Set values for any property of this class - * + * * @param string $property name of the property * @param $value value to set */ public function __set($property, $value) { - + if (property_exists($this, $property)) { $this->$property = $value; } - + } - - + + /** * Get CommmonFunctions - * + * * @return CommonFunctions object */ public function getCommonFunctions() @@ -190,8 +190,8 @@ class PMA_DisplayResults } return $this->_common_functions; } - - + + /** * Constructor for PMA_DisplayResults class * @@ -209,33 +209,33 @@ class PMA_DisplayResults $this->__set('_goto', $goto); $this->__set('_sql_query', $sql_query); } - - + + /** * Set properties which were not initialized at the constructor - * + * * @param type $unlim_num_rows integer the total number of rows returned by * the SQL query without any appended * "LIMIT" clause programmatically * @param type $fields_meta array meta information about fields - * @param type $is_count boolean - * @param type $is_export integer - * @param type $is_func boolean - * @param type $is_analyse integer + * @param type $is_count boolean + * @param type $is_export integer + * @param type $is_func boolean + * @param type $is_analyse integer * @param type $num_rows integer total no. of rows returned by SQL query * @param type $fields_cnt integer total no.of fields returned by SQL query * @param type $querytime double time taken for execute the SQL query * @param type $pmaThemeImage string path for theme images directory - * @param type $text_dir string - * @param type $is_maint boolean - * @param type $is_explain boolean - * @param type $is_show boolean + * @param type $text_dir string + * @param type $is_maint boolean + * @param type $is_explain boolean + * @param type $is_show boolean * @param type $showtable array table definitions - * @param type $printview string + * @param type $printview string * @param type $url_query string URL query - * + * * @return void - * + * * @see sql.php */ public function processParams( @@ -243,7 +243,7 @@ class PMA_DisplayResults $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query ) { - + $this->__set('_unlim_num_rows', $unlim_num_rows); $this->__set('_fields_meta', $fields_meta); $this->__set('_is_count', $is_count); @@ -261,7 +261,7 @@ class PMA_DisplayResults $this->__set('_showtable', $showtable); $this->__set('_printview', $printview); $this->__set('_url_query', $url_query); - + } @@ -322,7 +322,7 @@ class PMA_DisplayResults // 2. Display mode is not "false for all elements" -> updates the // display mode if ($the_disp_mode != 'nnnn000000') { - + if (isset($printview) && ($printview == '1')) { // 2.0 Print view -> set all elements to false! $do_display['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link @@ -333,7 +333,7 @@ class PMA_DisplayResults $do_display['bkm_form'] = (string) '0'; $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; - + } elseif ($this->__get ('_is_count') || $this->__get ('_is_analyse') || $this->__get ('_is_maint') || $this->__get ('_is_explain') ) { @@ -346,7 +346,7 @@ class PMA_DisplayResults $do_display['nav_bar'] = (string) '0'; $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; - + if ($this->__get ('_is_maint')) { $do_display['text_btn'] = (string) '1'; } else { @@ -387,21 +387,21 @@ class PMA_DisplayResults $do_display['bkm_form'] = (string) '1'; $do_display['text_btn'] = (string) '1'; $do_display['pview_lnk'] = (string) '1'; - + } else { // 2.3 Other statements (ie "SELECT" ones) -> updates // $do_display['edit_lnk'], $do_display['del_lnk'] and // $do_display['text_btn'] (keeps other default values) $prev_table = $fields_meta[0]->table; $do_display['text_btn'] = (string) '1'; - + for ($i = 0; $i < $this->__get('_fields_cnt'); $i++) { - + $is_link = ($do_display['edit_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['del_lnk'] != self::NO_EDIT_OR_DELETE) || ($do_display['sort_lnk'] != '0') || ($do_display['ins_row'] != '0'); - + // 2.3.2 Displays edit/delete/sort/insert links? if ($is_link && (($fields_meta[$i]->table == '') @@ -420,11 +420,11 @@ class PMA_DisplayResults break; } } // end if (2.3.2) - + // 2.3.3 Always display print view link $do_display['pview_lnk'] = (string) '1'; $prev_table = $fields_meta[$i]->table; - + } // end for } // end if..elseif...else (2.1 -> 2.3) } // end if (2) @@ -469,7 +469,7 @@ class PMA_DisplayResults /** * Return true if we are executing a query in the form of * "SELECT * FROM ..." - * + * * @param array $analyzed_sql the analyzed query * * @return boolean @@ -958,9 +958,9 @@ class PMA_DisplayResults = $this->_getUnsortedSqlAndSortByKeyDropDown( $analyzed_sql, $sort_expression ); - - $table_headers_html .= $drop_down_html; - + + $table_headers_html .= $drop_down_html; + } // Output data needed for grid editing @@ -981,7 +981,7 @@ class PMA_DisplayResults $full_or_partial_text_link = null; $this->__set('_vertical_display', $vertical_display); - + // Display options (if we are not in print view) if (! (isset($printview) && ($printview == '1'))) { @@ -1002,7 +1002,7 @@ class PMA_DisplayResults = $this->_getFeildVisibilityParams( $directionCondition, $is_display, $full_or_partial_text_link ); - + $table_headers_html .= $button_html; // 2. Displays the fields' name @@ -1014,7 +1014,7 @@ class PMA_DisplayResults // Do not show comments, if using horizontalflipped mode, // because of space usage $comments_map = $this->_getTableCommentsArray($direction, $analyzed_sql); - + if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] @@ -1027,7 +1027,7 @@ class PMA_DisplayResults // See if we have to highlight any header fields of a WHERE query. // Uses SQL-Parser results. $this->_setHighlightedColumnGlobalField($analyzed_sql); - + list($col_order, $col_visib) = $this->_getColumnParams($analyzed_sql); for ($j = 0; $j < $this->__get('_fields_cnt'); $j++) { @@ -1044,11 +1044,11 @@ class PMA_DisplayResults // 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled. $comments = $this->_getCommentForRow($comments_map, $fields_meta[$i]); - + $vertical_display = $this->__get('_vertical_display'); if ($is_display['sort_lnk'] == '1') { - + list($order_link, $sorted_headrer_html) = $this->_getOrderLinkAndSortedHeaderHtml( $fields_meta[$i], $sort_expression, @@ -1057,7 +1057,7 @@ class PMA_DisplayResults $sort_direction, $directionCondition, $col_visib, $col_visib[$j], $condition_field ); - + $table_headers_html .= $sorted_headrer_html; $vertical_display['desc'][] = ' name) . "\n" . $comments . ' '; } // end else (2.2) - + $this->__set('_vertical_display', $vertical_display); - + } // end for - + // Display column at rightside - checkboxes or empty column $table_headers_html .= $this->_getColumnAtRightSide( $is_display, $directionCondition, $full_or_partial_text_link, @@ -1103,26 +1103,26 @@ class PMA_DisplayResults return $table_headers_html; } // end of the '_getTableHeaders()' function - - + + /** * Prepare unsorted sql query and sort by key drop down - * + * * @param array $analyzed_sql the analyzed query * @param string $sort_expression sort expression - * + * * @return array two element array - $unsorted_sql_query, $drop_down_html - * + * * @access private - * + * * @see _getTableHeaders() */ private function _getUnsortedSqlAndSortByKeyDropDown( $analyzed_sql, $sort_expression ) { - + $drop_down_html = ''; - + // Just as fallback $unsorted_sql_query = $this->__get('_sql_query'); if (isset($analyzed_sql[0]['unsorted_query'])) { @@ -1153,12 +1153,12 @@ class PMA_DisplayResults ); } } - + return array($unsorted_sql_query, $drop_down_html); - + } // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function - + /** * Prepare sort by key dropdown - html code segment * @@ -1246,31 +1246,31 @@ class PMA_DisplayResults return $drop_down_html; } // end of the '_getSortByKeyDropDown()' function - - + + /** * Set column span, row span and prepare html with full/partial * text button or link - * + * * @param boolean $directionCondition display direction horizontal or * horizontalflipped * @param array &$is_display which elements to display * @param string $full_or_partial_text_link full/partial link or text button - * + * * @return array 3 element array - $colspan, $rowspan, $button_html - * + * * @access private - * + * * @see _getTableHeaders() */ private function _getFeildVisibilityParams( $directionCondition, &$is_display, $full_or_partial_text_link ) { - + $button_html = ''; $colspan = $rowspan = null; $vertical_display = $this->__get('_vertical_display'); - + // 1. Displays the full/partial text button (part 1)... if ($directionCondition) { @@ -1368,33 +1368,33 @@ class PMA_DisplayResults // disabled to match the rest of the table $button_html .= ''; } - + $this->__set('_vertical_display', $vertical_display); - + return array($colspan, $rowspan, $button_html); - + } // end of the '_getFeildVisibilityParams()' function - - + + /** * Get table comments as array - * + * * @param boolean $directionCondition display direction horizontal * or horizontalflipped * @param array $analyzed_sql the analyzed query - * + * * @return array $comments_map table comments when condition true * null when condition falls - * + * * @access private - * + * * @see _getTableHeaders() */ private function _getTableCommentsArray($direction, $analyzed_sql) { - + $comments_map = null; - + if ($GLOBALS['cfg']['ShowBrowseComments'] && ($direction != self::DISP_DIR_HORIZONTAL_FLIPPED) ) { @@ -1407,26 +1407,26 @@ class PMA_DisplayResults } } } - + return $comments_map; - + } // end of the '_getTableCommentsArray()' function - - + + /** * Set global array for store highlighted header fields - * + * * @param array $analyzed_sql the analyzed query - * + * * @return void - * + * * @access private - * + * * @see _getTableHeaders() */ private function _setHighlightedColumnGlobalField($analyzed_sql) { - + $highlight_columns = array(); if (isset($analyzed_sql) && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['where_clause_identifiers']) @@ -1443,11 +1443,11 @@ class PMA_DisplayResults } } } - + $this->__set('_highlight_columns', $highlight_columns); - + } // end of the '_setHighlightedColumnGlobalField()' function - + /** * Prepare data for column restoring and show/hide @@ -1725,11 +1725,11 @@ class PMA_DisplayResults } return $comments; } // end of the '_getCommentForRow()' function - - + + /** * Prepare parameters and html for sorted table header fields - * + * * @param array $fields_meta set of field properties * @param string $sort_expression sort expression * @param string $sort_expression_nodirection sort expression without direction @@ -1746,11 +1746,11 @@ class PMA_DisplayResults * @param string $col_visib_j element of $col_visib array * @param boolean $condition_field whether the column is a part of the * where clause - * + * * @return array 2 element array - $order_link, $sorted_header_html - * + * * @access private - * + * * @see _getTableHeaders() */ private function _getOrderLinkAndSortedHeaderHtml( @@ -1761,7 +1761,7 @@ class PMA_DisplayResults ) { $sorted_header_html = ''; - + // Checks if the table name is required; it's the case // for a query with a "JOIN" statement and if the column // isn't aliased, or in queries like @@ -1852,11 +1852,11 @@ class PMA_DisplayResults $fields_meta, $order_link, $comments ); } - + return array($order_link, $sorted_header_html); - + } // end of the '_getOrderLinkAndSortedHeaderHtml()' function - + /** * Check whether the column is sorted @@ -2168,31 +2168,31 @@ class PMA_DisplayResults } // end of the '_getDraggableClassForNonSortableColumns()' function - + /** * Prepare column to show at right side - check boxes or empty column - * + * * @param array &$is_display which elements to display * @param boolean $directionCondition display direction horizontal * or horizontalflipped * @param string $full_or_partial_text_link full/partial link or text button * @param string $colspan column span of table header * @param string $rowspan row span of table header - * + * * @return string html content - * + * * @access private - * + * * @see _getTableHeaders() */ private function _getColumnAtRightSide( &$is_display, $directionCondition, $full_or_partial_text_link, $colspan, $rowspan ) { - + $right_column_html = ''; $vertical_display = $this->__get('_vertical_display'); - + // Displays the needed checkboxes at the right // column of the result table header if possible and required... if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) @@ -2241,13 +2241,13 @@ class PMA_DisplayResults . '>' . "\n"; } // end vertical mode } - + $this->__set('_vertical_display', $vertical_display); - + return $right_column_html; - + } // end of the '_getColumnAtRightSide()' function - + /** * Prepares the display for a value @@ -2404,7 +2404,7 @@ class PMA_DisplayResults // query without conditions to shorten URLs when needed, 200 is just // guess, it should depend on remaining URL length $url_sql_query = $this->_getUrlSqlQuery($analyzed_sql); - + $vertical_display = $this->__get('_vertical_display'); if (! is_array($map)) { @@ -2417,7 +2417,7 @@ class PMA_DisplayResults $vertical_display['delete'] = array(); $vertical_display['data'] = array(); $vertical_display['row_delete'] = array(); - $this->__set('_vertical_display', $vertical_display); + $this->__set('_vertical_display', $vertical_display); // name of the class added to all grid editable elements $grid_edit_class = 'grid_edit'; @@ -2471,7 +2471,7 @@ class PMA_DisplayResults $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row ); $where_clause_html = urlencode($where_clause); - + // In print view these variable needs toinitialized $del_url = $del_query = $del_str = $edit_anchor_class = $edit_str = $js_conf = $copy_url = $copy_str = null; @@ -2548,7 +2548,7 @@ class PMA_DisplayResults $grid_edit_class, $col_visib, $where_clause, $url_sql_query, $analyzed_sql, $directionCondition ); - + // 3. Displays the modify/delete links on the right if required if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) @@ -2569,13 +2569,13 @@ class PMA_DisplayResults } // end if // 4. Gather links of del_urls and edit_urls in an array for later - // output + // output $this->_gatherLinksForLaterOutputs( $row_no, $is_display, $where_clause, $where_clause_html, $js_conf, $del_url, $del_query, $del_str, $edit_anchor_class, $edit_str, $copy_url, $copy_str, $alternating_color_class, $condition_array ); - + $table_body_html .= $directionCondition ? "\n" : ''; $row_no++; @@ -2584,11 +2584,11 @@ class PMA_DisplayResults return $table_body_html; } // end of the '_getTableBody()' function - - + + /** * Prepare rows - * + * * @param integer &$dt_result the link id associated to the query * which results have to be displayed * @param array $row current row data @@ -2605,9 +2605,9 @@ class PMA_DisplayResults * @param boolean $directionCondition the directional condition * * @return string $row_values_html html content - * + * * @access private - * + * * @see _getTableBody() */ private function _getRowValues( @@ -2615,16 +2615,16 @@ class PMA_DisplayResults $grid_edit_class, $col_visib, $where_clause, $url_sql_query, $analyzed_sql, $directionCondition ) { - + $row_values_html = ''; - + // Following variable are needed for use in isset/empty or // use with array indexes/safe use in foreach $sql_query = $this->__get('_sql_query'); $fields_meta = $this->__get('_fields_meta'); $highlight_columns = $this->__get('_highlight_columns'); $mime_map = $this->__get('_mime_map'); - + for ($j = 0; $j < $this->__get('_fields_cnt'); ++$j) { // assign $i with appropriate column order @@ -2721,7 +2721,7 @@ class PMA_DisplayResults = PMA_generate_common_url($_url_params); $vertical_display = $this->__get('_vertical_display'); - + if ($meta->numeric == 1) { // n u m e r i c @@ -2793,19 +2793,19 @@ class PMA_DisplayResults $vertical_display['rowdata'][$i][$row_no] = $vertical_display['data'][$row_no][$i]; } - + $this->__set('_vertical_display', $vertical_display); - + } // end for - + return $row_values_html; - + } // end of the '_getRowValues()' function - - + + /** * Gather delete/edit url links for further outputs - * + * * @param integer $row_no the index of current row * @param array $is_display which elements to display * @param string $where_clause where clause @@ -2819,13 +2819,13 @@ class PMA_DisplayResults * @param string $copy_url the url for copy row * @param string $copy_str the label for copy row * @param string $alternating_color_class class for display two colors in rows - * @param array $condition_array array of keys + * @param array $condition_array array of keys * (primary,unique,condition) - * + * * @return void - * + * * @access private - * + * * @see _getTableBody() */ private function _gatherLinksForLaterOutputs( @@ -2833,9 +2833,9 @@ class PMA_DisplayResults $del_url, $del_query, $del_str, $edit_anchor_class, $edit_str, $copy_url, $copy_str, $alternating_color_class, $condition_array ) { - + $vertical_display = $this->__get('_vertical_display'); - + if (! isset($vertical_display['edit'][$row_no])) { $vertical_display['edit'][$row_no] = ''; $vertical_display['copy'][$row_no] = ''; @@ -2907,11 +2907,11 @@ class PMA_DisplayResults } else { unset($vertical_display['delete'][$row_no]); } - + $this->__set('_vertical_display', $vertical_display); - + } // end of the '_gatherLinksForLaterOutputs()' function - + /** * Get url sql query without conditions to shorten URLs @@ -2954,7 +2954,7 @@ class PMA_DisplayResults /** * Get column order and column visibility - * + * * @param array $analyzed_sql the analyzed query * * @return array 2 element array - $col_order, $col_visib @@ -3108,7 +3108,7 @@ class PMA_DisplayResults ) { $goto = $this->__get('_goto'); - + if ($del_lnk == self::DELETE_ROW) { // delete row case $_url_params = array( @@ -3244,7 +3244,7 @@ class PMA_DisplayResults $grid_edit_class, $not_null_class, $relation_class, $hide_class, $field_type_class, $row_no ) { - + $printview = $this->__get('_printview'); $class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' ' @@ -3609,7 +3609,7 @@ class PMA_DisplayResults $transformation_plugin, $default_function, $transform_options, $is_field_truncated, $analyzed_sql, &$dt_result, $col_index ) { - + $is_analyse = $this->__get ('_is_analyse'); if (! isset($column) || is_null($column)) { @@ -3720,7 +3720,7 @@ class PMA_DisplayResults /** * Get the resulted table with the vertical direction mode. - * + * * @param array $analyzed_sql the analyzed query * * @return string html content @@ -4319,7 +4319,7 @@ class PMA_DisplayResults } } - + if (($is_display['nav_bar'] == '1') && empty($analyzed_sql[0]['limit_clause']) ) { @@ -4359,7 +4359,7 @@ class PMA_DisplayResults $exist_rel = false; } else { // This method set the values for $map array - $this->_setParamForLinkForiegnKeyRelatedTables($map); + $this->_setParamForLinkForiegnKeyRelatedTables($map); } // end if // end 2b @@ -4381,7 +4381,7 @@ class PMA_DisplayResults } // end if $this->__set('_vertical_display', null); - + $table_html .= '' . "\n" . ''; @@ -4408,7 +4408,7 @@ class PMA_DisplayResults } elseif (! isset($printview) || ($printview != '1')) { $table_html .= "\n" . '

' . "\n"; } - + // 6. ----- Prepare "Query results operations" if (! isset($printview) || ($printview != '1')) { @@ -4520,7 +4520,7 @@ class PMA_DisplayResults ) { $fields_meta = $this->__get('_fields_meta'); // To use array indexes - + if (! empty($sort_expression_nodirection)) { if (strpos($sort_expression_nodirection, '.') === false) { @@ -4637,7 +4637,7 @@ class PMA_DisplayResults $sorted_column_message, $limit_clause, $total, $pos_next, $pre_count, $after_count ) { - + $unlim_num_rows = $this->__get('_unlim_num_rows'); // To use in isset() if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) { @@ -4730,21 +4730,21 @@ class PMA_DisplayResults } // end of the '_setMessageInformation()' function - + /** * Set the value of $map array for linking foreign key related tables - * + * * @param array $map the list of relations - * + * * @return void - * + * * @access private - * + * * @see getTable() */ private function _setParamForLinkForiegnKeyRelatedTables(&$map) { - + // To be able to later display a link to the related table, // we verify both types of relations: either those that are // native foreign keys or those defined in the phpMyAdmin @@ -4771,9 +4771,9 @@ class PMA_DisplayResults ); } // end while } // end if - + } // end of the '_setParamForLinkForiegnKeyRelatedTables()' function - + /** * Prepare multi field edit/delete links @@ -4867,44 +4867,44 @@ class PMA_DisplayResults } // end of the '_getMultiRowOperationLinks()' function - + /** * Prepare table navigation bar at the top or bottom - * + * * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $place the place to show navigation * @param string $empty_line empty line depend on the $place * @param boolean $is_innodb whether its InnoDB or not - * + * * @return string html content of navigation bar - * + * * @access private - * + * * @see _getTable() */ private function _getPlacedTableNavigatoins( $pos_next, $pos_prev, $place, $empty_line, $is_innodb ) { - + $navigation_html = ''; - + if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) { $navigation_html .= '
' . "\n"; } - + $navigation_html .= $this->_getTableNavigation( $pos_next, $pos_prev, 'top_direction_dropdown', $is_innodb ); - + if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { $navigation_html .= "\n"; } - + return $navigation_html; - + } // end of the '_getPlacedTableNavigatoins()' function - + /** * Get operations that are available on results. @@ -5123,7 +5123,7 @@ class PMA_DisplayResults $category, $content, $transformation_plugin, $transform_options, $default_function, $meta, $url_params = array() ) { - + $result = '[' . $category; if (is_null($content)) { @@ -5218,7 +5218,7 @@ class PMA_DisplayResults $transformation_plugin, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated ) { - + $printview = $this->__get('_printview'); $result = '', $buffer); return $buffer; - } + } } ?> From 0fd8848073c9ce09a05d3615c023b3e176456dfa Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 10 Jul 2012 21:50:57 +0530 Subject: [PATCH 23/82] Coding style fixes --- libraries/DisplayResults.class.php | 168 +++++++++++++++++------------ 1 file changed, 98 insertions(+), 70 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index aa835b35e4..c64f0c5aac 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -152,14 +152,14 @@ class PMA_DisplayResults * Get any property of this class * * @param string $property name of the property + * * @return if property exist, value of the relavant property */ - public function __get($property) { - + public function __get($property) + { if (property_exists($this, $property)) { return $this->$property; } - } @@ -168,13 +168,14 @@ class PMA_DisplayResults * * @param string $property name of the property * @param $value value to set + * + * @return void */ - public function __set($property, $value) { - + public function __set($property, $value) + { if (property_exists($this, $property)) { $this->$property = $value; } - } @@ -334,8 +335,8 @@ class PMA_DisplayResults $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; - } elseif ($this->__get ('_is_count') || $this->__get ('_is_analyse') - || $this->__get ('_is_maint') || $this->__get ('_is_explain') + } elseif ($this->__get('_is_count') || $this->__get('_is_analyse') + || $this->__get('_is_maint') || $this->__get('_is_explain') ) { // 2.1 Statement is a "SELECT COUNT", a // "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or @@ -347,14 +348,14 @@ class PMA_DisplayResults $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; - if ($this->__get ('_is_maint')) { + if ($this->__get('_is_maint')) { $do_display['text_btn'] = (string) '1'; } else { $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; - } elseif ($this->__get ('_is_show')) { + } elseif ($this->__get('_is_show')) { // 2.2 Statement is a "SHOW..." /** * 2.2.1 @@ -480,8 +481,8 @@ class PMA_DisplayResults */ private function _isSelect($analyzed_sql) { - return ! ($this->__get ('_is_count') || $this->__get('_is_export') - || $this->__get('_is_func') || $this->__get ('_is_analyse')) + return ! ($this->__get('_is_count') || $this->__get('_is_export') + || $this->__get('_is_func') || $this->__get('_is_analyse')) && (count($analyzed_sql[0]['select_expr']) == 0) && isset($analyzed_sql[0]['queryflags']['select_from']) && (count($analyzed_sql[0]['table_ref']) == 1); @@ -808,7 +809,9 @@ class PMA_DisplayResults ); // prepare some options for the End button - if ($is_innodb && $this->__get('_unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount']) { + if ($is_innodb + && $this->__get('_unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount'] + ) { $input_for_real_end = ''; // no backquote around this message @@ -908,11 +911,11 @@ class PMA_DisplayResults /** * Get the headers of the results table * - * @param array &$is_display which elements to display - * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression - * @param string $sort_expression_nodirection sort expression without direction - * @param string $sort_direction sort direction + * @param array &$is_display which elements to display + * @param array $analyzed_sql the analyzed query + * @param string $sort_expression sort expression + * @param string $sort_expression_nodirection sort expression without direction + * @param string $sort_direction sort direction * * @return string html content * @@ -1021,7 +1024,10 @@ class PMA_DisplayResults && ! $_SESSION['tmp_user_values']['hide_transformation'] ) { include_once './libraries/transformations.lib.php'; - $this->__set('_mime_map', PMA_getMIME($this->__get('_db'), $this->__get('_table'))); + $this->__set( + '_mime_map', + PMA_getMIME($this->__get('_db'), $this->__get('_table')) + ); } // See if we have to highlight any header fields of a WHERE query. @@ -1108,8 +1114,8 @@ class PMA_DisplayResults /** * Prepare unsorted sql query and sort by key drop down * - * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression + * @param array $analyzed_sql the analyzed query + * @param string $sort_expression sort expression * * @return array two element array - $unsorted_sql_query, $drop_down_html * @@ -1141,9 +1147,11 @@ class PMA_DisplayResults && isset($analyzed_sql[0]['table_ref']) && (count($analyzed_sql[0]['table_ref']) == 1) ) { - // grab indexes data: - $indexes = PMA_Index::getFromTable($this->__get('_table'), $this->__get('_db')); + $indexes = PMA_Index::getFromTable( + $this->__get('_table'), + $this->__get('_db') + ); // do we have any index? if ($indexes) { @@ -1300,7 +1308,8 @@ class PMA_DisplayResults if ($directionCondition) { - $button_html .= '' + $button_html .= '' + . '' . '' . ''; @@ -1379,9 +1388,9 @@ class PMA_DisplayResults /** * Get table comments as array * - * @param boolean $directionCondition display direction horizontal - * or horizontalflipped - * @param array $analyzed_sql the analyzed query + * @param boolean $direction display direction, horizontal + * or horizontalflipped + * @param array $analyzed_sql the analyzed query * * @return array $comments_map table comments when condition true * null when condition falls @@ -1416,7 +1425,7 @@ class PMA_DisplayResults /** * Set global array for store highlighted header fields * - * @param array $analyzed_sql the analyzed query + * @param array $analyzed_sql the analyzed query * * @return void * @@ -1744,8 +1753,8 @@ class PMA_DisplayResults * @param boolean $col_visib column is visible(false) * array column isn't visible(string array) * @param string $col_visib_j element of $col_visib array - * @param boolean $condition_field whether the column is a part of the - * where clause + * @param boolean $condition_field whether the column is a part of + * the where clause * * @return array 2 element array - $order_link, $sorted_header_html * @@ -1890,8 +1899,8 @@ class PMA_DisplayResults // SELECT p.*, FROM_UNIXTIME(p.temps) FROM mytable AS p // (and try clicking on each column's header twice) if (! empty($sort_tbl) - && (strpos($sort_expression_nodirection, $sort_tbl) === false) - && (strpos($sort_expression_nodirection, '(') === false) + && strpos($sort_expression_nodirection, $sort_tbl) === false + && strpos($sort_expression_nodirection, '(') === false ) { $new_sort_expression_nodirection = $sort_tbl . $sort_expression_nodirection; @@ -1902,8 +1911,8 @@ class PMA_DisplayResults $is_in_sort = false; $sort_name = str_replace('`', '', $sort_tbl) . $name_to_use_in_sort; - if (($sort_name == str_replace('`', '', $new_sort_expression_nodirection)) - || ($sort_name == str_replace('`', '', $sort_expression_nodirection)) + if ($sort_name == str_replace('`', '', $new_sort_expression_nodirection) + || $sort_name == str_replace('`', '', $sort_expression_nodirection) ) { $is_in_sort = true; } @@ -2468,7 +2477,10 @@ class PMA_DisplayResults */ list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row + $dt_result, + $this->__get('_fields_cnt'), + $this->__get('_fields_meta'), + $row ); $where_clause_html = urlencode($where_clause); @@ -3610,7 +3622,7 @@ class PMA_DisplayResults $is_field_truncated, $analyzed_sql, &$dt_result, $col_index ) { - $is_analyse = $this->__get ('_is_analyse'); + $is_analyse = $this->__get('_is_analyse'); if (! isset($column) || is_null($column)) { @@ -3750,10 +3762,8 @@ class PMA_DisplayResults } $vertical_table_html .= $vertical_display['textbtn'] - . $this->_getCheckBoxesForMultipleRowOperations( - '_left' - ) - . '' . "\n"; + . $this->_getCheckBoxesForMultipleRowOperations('_left') + . '' . "\n"; } // end if // Prepares "edit" link at top if required @@ -3810,7 +3820,7 @@ class PMA_DisplayResults if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) - && !($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells']) + && ! ($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells']) ) { $vertical_table_html .= $val; } @@ -3881,16 +3891,16 @@ class PMA_DisplayResults /** * Prepare edit, copy and delete links for verticle table * - * @param string $operation edit/copy/delete + * @param string $operation edit/copy/delete * - * @return string $links_html html content + * @return string $links_html html content * * @access private * * @see _getVerticalTable() */ - private function _getOperationLinksForVerticleTable($operation) { - + private function _getOperationLinksForVerticleTable($operation) + { $link_html = '' . "\n"; $vertical_display = $this->__get('_vertical_display'); @@ -3921,7 +3931,7 @@ class PMA_DisplayResults /** * Get checkboxes for multiple row data operations * - * @param string $dir _left / _right + * @param string $dir _left / _right * * @return $checkBoxes_html html content * @@ -4245,10 +4255,7 @@ class PMA_DisplayResults $pre_count = '~'; $after_count = $this->getCommonFunctions()->showHint( PMA_sanitize( - __( - 'May be approximate. See [a@./Documentation.html' - . '#faq3_11@Documentation]FAQ 3.11[/a]' - ) + __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]') ) ); } else { @@ -4353,7 +4360,7 @@ class PMA_DisplayResults } - $tabs = '(\'' . join('\',\'', $target) . '\')'; + $tabs = '(\'' . join('\',\'', $target) . '\')'; if (! strlen($this->__get('_table'))) { $exist_rel = false; @@ -4734,7 +4741,7 @@ class PMA_DisplayResults /** * Set the value of $map array for linking foreign key related tables * - * @param array $map the list of relations + * @param array &$map the list of relations * * @return void * @@ -4827,7 +4834,9 @@ class PMA_DisplayResults $delete_text, 'b_drop.png', 'delete' ); - if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT) { + if (isset($analyzed_sql[0]) + && $analyzed_sql[0]['querytype'] == self::QUERY_TYPE_SELECT + ) { $links_html .= $this->getCommonFunctions()->getButtonOrImage( 'submit_mult', 'mult_submit', 'submit_mult_export', __('Export'), 'b_tblexport.png', 'export' @@ -4852,7 +4861,10 @@ class PMA_DisplayResults // in the multi-edit and multi-delete form list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row + $dt_result, + $this->__get('_fields_cnt'), + $this->__get('_fields_meta'), + $row ); // reset to first row for the loop in _getTableBody() @@ -4871,11 +4883,11 @@ class PMA_DisplayResults /** * Prepare table navigation bar at the top or bottom * - * @param integer $pos_next the offset for the "next" page - * @param integer $pos_prev the offset for the "previous" page - * @param string $place the place to show navigation - * @param string $empty_line empty line depend on the $place - * @param boolean $is_innodb whether its InnoDB or not + * @param integer $pos_next the offset for the "next" page + * @param integer $pos_prev the offset for the "previous" page + * @param string $place the place to show navigation + * @param string $empty_line empty line depend on the $place + * @param boolean $is_innodb whether its InnoDB or not * * @return string html content of navigation bar * @@ -4950,7 +4962,10 @@ class PMA_DisplayResults $this->getCommonFunctions()->getIcon( 'b_print.png', __('Print view'), true ), - '', true, true, 'print_view' + '', + true, + true, + 'print_view' ) . "\n"; @@ -4965,7 +4980,10 @@ class PMA_DisplayResults 'b_print.png', __('Print view (with full texts)'), true ), - '', true, true, 'print_view' + '', + true, + true, + 'print_view' ) . "\n"; unset($_url_params['display_text']); @@ -4992,7 +5010,7 @@ class PMA_DisplayResults $_url_params['single_table'] = 'true'; } - if (!$header_shown) { + if (! $header_shown) { $results_operations_html .= $header; $header_shown = true; } @@ -5007,7 +5025,7 @@ class PMA_DisplayResults * first table of this database, so that tbl_export.php and * the script it calls do not fail */ - if (empty($_url_params['table']) && !empty($_url_params['db'])) { + if (empty($_url_params['table']) && ! empty($_url_params['db'])) { $_url_params['table'] = PMA_DBI_fetch_value("SHOW TABLES"); /* No result (probably no database selected) */ if ($_url_params['table'] === false) { @@ -5020,7 +5038,10 @@ class PMA_DisplayResults $this->getCommonFunctions()->getIcon( 'b_tblexport.png', __('Export'), true ), - '', true, true, '' + '', + true, + true, + '' ) . "\n"; @@ -5030,7 +5051,10 @@ class PMA_DisplayResults $this->getCommonFunctions()->getIcon( 'b_chart.png', __('Display chart'), true ), - '', true, true, '' + '', + true, + true, + '' ) . "\n"; @@ -5052,7 +5076,10 @@ class PMA_DisplayResults $this->getCommonFunctions()->getIcon( 'b_globe.gif', __('Visualize GIS data'), true ), - '', true, true, '' + '', + true, + true, + '' ) . "\n"; } @@ -5115,7 +5142,8 @@ class PMA_DisplayResults * * @access private * - * @see _getDataCellForBlobColumns(), _getDataCellForGeometryColumns(), + * @see _getDataCellForBlobColumns(), + * _getDataCellForGeometryColumns(), * _getDataCellForNonNumericAndNonBlobColumns(), * _getSortedColumnMessage() */ @@ -5257,7 +5285,7 @@ class PMA_DisplayResults // Field to display from the foreign table? if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) { - $dispsql = 'SELECT ' + $dispsql = 'SELECT ' . $this->getCommonFunctions()->backquote($map[$meta->name][2]) . ' FROM ' . $this->getCommonFunctions()->backquote($map[$meta->name][3]) @@ -5372,8 +5400,8 @@ class PMA_DisplayResults 'table' => $meta->orgtable, 'pos' => '0', 'sql_query' => 'SELECT * FROM ' - . $this->getCommonFunctions()->backquote($this->__get('_db')) . '.' - . $this->getCommonFunctions()->backquote($meta->orgtable) + . $this->getCommonFunctions()->backquote($this->__get('_db')) + . '.' . $this->getCommonFunctions()->backquote($meta->orgtable) . ' WHERE ' . $this->getCommonFunctions()->backquote($meta->orgname) . $where_comparison, From a3a366a35348769f2c51411c9a4e5e04b9a61375 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 10 Jul 2012 21:52:27 +0530 Subject: [PATCH 24/82] Wrap some long lines --- main.php | 211 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 165 insertions(+), 46 deletions(-) diff --git a/main.php b/main.php index e158e29b27..a58a938b09 100644 --- a/main.php +++ b/main.php @@ -91,7 +91,7 @@ if ($server > 0 /** * Displays the mysql server related links */ - if ($server > 0 && !PMA_DRIZZLE) { + if ($server > 0 && ! PMA_DRIZZLE) { include_once 'libraries/check_user_privileges.lib.php'; // Logout for advanced authentication @@ -120,10 +120,22 @@ if ($server > 0 . ' ' . "\n" - . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true) + . PMA_generateCharsetDropdownBox( + PMA_CSDROPDOWN_COLLATION, + 'collation_connection', + 'select_collation_connection', + $collation_connection, + true, + 4, + true + ) . ' ' . "\n" . ' ' . "\n"; } // end of if ($server > 0 && !PMA_DRIZZLE) @@ -176,13 +188,22 @@ echo '
'; if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) { - + echo '
'; echo '

' . __('Database server') . '

'; echo '
    ' . "\n"; - PMA_printListItem(__('Server') . ': ' . $server_info, 'li_server_info'); - PMA_printListItem(__('Software') . ': ' . $common_functions->getServerType(), 'li_server_type'); - PMA_printListItem(__('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT, 'li_server_version'); + PMA_printListItem( + __('Server') . ': ' . $server_info, + 'li_server_info' + ); + PMA_printListItem( + __('Software') . ': ' . $common_functions->getServerType(), + 'li_server_type' + ); + PMA_printListItem( + __('Software version') . ': ' . PMA_MYSQL_STR_VERSION . ' - ' . PMA_MYSQL_VERSION_COMMENT, + 'li_server_version' + ); PMA_printListItem( __('Protocol version') . ': ' . PMA_DBI_get_proto_info(), 'li_mysql_proto' @@ -221,16 +242,25 @@ if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) { __('Database client version') . ': ' . $client_version_str, 'li_mysql_client_version' ); + + $php_ext_string = __('PHP extension') . ': ' + . $GLOBALS['cfg']['Server']['extension'] . ' ' + . $common_functions->showPHPDocu( + 'book.' . $GLOBALS['cfg']['Server']['extension'] . '.php' + ); PMA_printListItem( - __('PHP extension') . ': ' . $GLOBALS['cfg']['Server']['extension']. ' ' - . $common_functions->showPHPDocu('book.' . $GLOBALS['cfg']['Server']['extension'] . '.php'), + $php_ext_string, 'li_used_php_extension' ); } } if ($cfg['ShowPhpInfo']) { - PMA_printListItem(__('Show PHP information'), 'li_phpinfo', 'phpinfo.php?' . $common_url_query); + PMA_printListItem( + __('Show PHP information'), + 'li_phpinfo', + 'phpinfo.php?' . $common_url_query + ); } echo '
'; echo '
'; @@ -242,18 +272,64 @@ echo '
    '; $class = null; // We rely on CSP to allow access to http://www.phpmyadmin.net, but IE lacks // support here and does not allow request to http once using https. -if ($GLOBALS['cfg']['VersionCheck'] && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE')) { +if ($GLOBALS['cfg']['VersionCheck'] + && (! $GLOBALS['PMA_Config']->get('is_https') || PMA_USR_BROWSER_AGENT != 'IE') +) { $class = 'jsversioncheck'; } -PMA_printListItem(__('Version information') . ': ' . PMA_VERSION, 'li_pma_version', null, null, null, null, $class); -PMA_printListItem(__('Documentation'), 'li_pma_docs', 'Documentation.html', null, '_blank'); -PMA_printListItem(__('Wiki'), 'li_pma_wiki', PMA_linkURL('http://wiki.phpmyadmin.net/'), null, '_blank'); +PMA_printListItem( + __('Version information') . ': ' . PMA_VERSION, + 'li_pma_version', + null, + null, + null, + null, + $class +); +PMA_printListItem( + __('Documentation'), + 'li_pma_docs', + 'Documentation.html', + null, + '_blank' +); +PMA_printListItem( + __('Wiki'), + 'li_pma_wiki', + PMA_linkURL('http://wiki.phpmyadmin.net/'), + null, + '_blank' +); // does not work if no target specified, don't know why -PMA_printListItem(__('Official Homepage'), 'li_pma_homepage', PMA_linkURL('http://www.phpMyAdmin.net/'), null, '_blank'); -PMA_printListItem(__('Contribute'), 'li_pma_contribute', PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'), null, '_blank'); -PMA_printListItem(__('Get support'), 'li_pma_support', PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'), null, '_blank'); -PMA_printListItem(__('List of changes'), 'li_pma_changes', PMA_linkURL('changelog.php'), null, '_blank'); +PMA_printListItem( + __('Official Homepage'), + 'li_pma_homepage', + PMA_linkURL('http://www.phpMyAdmin.net/'), + null, + '_blank' +); +PMA_printListItem( + __('Contribute'), + 'li_pma_contribute', + PMA_linkURL('http://www.phpmyadmin.net/home_page/improve.php'), + null, + '_blank' +); +PMA_printListItem( + __('Get support'), + 'li_pma_support', + PMA_linkURL('http://www.phpmyadmin.net/home_page/support.php'), + null, + '_blank' +); +PMA_printListItem( + __('List of changes'), + 'li_pma_changes', + PMA_linkURL('changelog.php'), + null, + '_blank' +); ?>
@@ -278,7 +354,10 @@ if ($server != 0 && $cfg['Server']['user'] == 'root' && $cfg['Server']['password'] == '' ) { - trigger_error(__('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'), E_USER_WARNING); + trigger_error( + __('Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole by setting a password for user \'root\'.'), + E_USER_WARNING + ); } /** @@ -286,7 +365,10 @@ if ($server != 0 * break it, see bug 1063821. */ if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) { - trigger_error(__('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'), E_USER_WARNING); + trigger_error( + __('You have enabled mbstring.func_overload in your PHP configuration. This option is incompatible with phpMyAdmin and might cause some data to be corrupted!'), + E_USER_WARNING + ); } /** @@ -294,7 +376,10 @@ if (@extension_loaded('mbstring') && @ini_get('mbstring.func_overload') > 1) { * to tell user something might be broken without it, see bug #1063149. */ if (! @extension_loaded('mbstring')) { - trigger_error(__('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'), E_USER_WARNING); + trigger_error( + __('The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.'), + E_USER_WARNING + ); } /** @@ -302,14 +387,22 @@ if (! @extension_loaded('mbstring')) { */ $gc_time = (int)@ini_get('session.gc_maxlifetime'); if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) { - trigger_error(__('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING); + trigger_error( + __('Your PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), + E_USER_WARNING + ); } /** * Check whether LoginCookieValidity is limited by LoginCookieStore. */ -if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity']) { - trigger_error(__('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), E_USER_WARNING); +if ($GLOBALS['cfg']['LoginCookieStore'] != 0 + && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity'] +) { + trigger_error( + __('Login cookie store is lower than cookie validity configured in phpMyAdmin, because of this, your login will expire sooner than configured in phpMyAdmin.'), + E_USER_WARNING + ); } /** @@ -318,7 +411,10 @@ if ($GLOBALS['cfg']['LoginCookieStore'] != 0 && $GLOBALS['cfg']['LoginCookieStor if (! empty($_SESSION['auto_blowfish_secret']) && empty($GLOBALS['cfg']['blowfish_secret']) ) { - trigger_error(__('The configuration file now needs a secret passphrase (blowfish_secret).'), E_USER_WARNING); + trigger_error( + __('The configuration file now needs a secret passphrase (blowfish_secret).'), + E_USER_WARNING + ); } /** @@ -326,14 +422,22 @@ if (! empty($_SESSION['auto_blowfish_secret']) * production environment. */ if (file_exists('config')) { - trigger_error(__('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'), E_USER_WARNING); + trigger_error( + __('Directory [code]config[/code], which is used by the setup script, still exists in your phpMyAdmin directory. You should remove it once phpMyAdmin has been configured.'), + E_USER_WARNING + ); } if ($server > 0) { $cfgRelation = PMA_getRelationsParam(); - if (! $cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) { + if (! $cfgRelation['allworks'] + && $cfg['PmaNoRelation_DisableWarning'] == false + ) { $msg = PMA_Message::notice(__('The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click %shere%s.')); - $msg->addParam('
', false); + $msg->addParam( + '', + false + ); $msg->addParam('', false); /* Show error if user has configured something, notice elsewhere */ if (!empty($cfg['Servers'][$server]['pmadb'])) { @@ -346,14 +450,18 @@ if ($server > 0) { /** * Warning about different MySQL library and server version * (a difference on the third digit does not count). - * If someday there is a constant that we can check about mysqlnd, we can use it instead - * of strpos(). + * If someday there is a constant that we can check about mysqlnd, + * we can use it instead of strpos(). * If no default server is set, PMA_DBI_get_client_info() is not defined yet. - * Drizzle can speak MySQL protocol, so don't warn about version mismatch for Drizzle servers. + * Drizzle can speak MySQL protocol, so don't warn about version mismatch for + * Drizzle servers. */ if (function_exists('PMA_DBI_get_client_info') && !PMA_DRIZZLE) { $_client_info = PMA_DBI_get_client_info(); - if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) { + if ($server > 0 + && strpos($_client_info, 'mysqlnd') === false + && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3) + ) { trigger_error( PMA_sanitize( sprintf( @@ -391,7 +499,9 @@ if ($cfg['SuhosinDisableWarning'] == false /** * Warning about mcrypt. */ -if (!function_exists('mcrypt_encrypt') && !$GLOBALS['cfg']['McryptDisableWarning']) { +if (! function_exists('mcrypt_encrypt') + && ! $GLOBALS['cfg']['McryptDisableWarning'] +) { PMA_warnMissingExtension('mcrypt'); } @@ -407,25 +517,34 @@ if (file_exists('libraries/language_stats.inc.php')) { * handling incomplete translations here and focus on english * speaking users. */ - if (isset($GLOBALS['language_stats'][$lang]) && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold']) { - trigger_error('You are using an incomplete translation, please help to make it better by contributing.', E_USER_NOTICE); + if (isset($GLOBALS['language_stats'][$lang]) + && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold'] + ) { + trigger_error( + 'You are using an incomplete translation, please help to make it better by contributing.', + E_USER_NOTICE + ); } } /** * prints list item for main page * - * @param string $name displayed text - * @param string $id id, used for css styles - * @param string $url make item as link with $url as target - * @param string $mysql_help_page display a link to MySQL's manual - * @param string $target special target for $url - * @param string $a_id id for the anchor, used for jQuery to hook in functions - * @param string $class class for the li element - * @param string $a_class class for the anchor element + * @param string $name displayed text + * @param string $id id, used for css styles + * @param string $url make item as link with $url as target + * @param string $mysql_help_page display a link to MySQL's manual + * @param string $target special target for $url + * @param string $a_id id for the anchor, + * used for jQuery to hook in functions + * @param string $class class for the li element + * @param string $a_class class for the anchor element + * + * @return void */ -function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, $target = null, $a_id = null, $class = null, $a_class = null) -{ +function PMA_printListItem($name, $id = null, $url = null, $mysql_help_page = null, + $target = null, $a_id = null, $class = null, $a_class = null +) { echo '
  • Date: Tue, 10 Jul 2012 21:56:48 +0530 Subject: [PATCH 25/82] Fix some code violations in PMA_DisplayResults class --- libraries/DisplayResults.class.php | 128 ++++++++++++++++++----------- 1 file changed, 78 insertions(+), 50 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 6882a0dfe6..26df14a636 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -152,9 +152,11 @@ class PMA_DisplayResults * Get any property of this class * * @param string $property name of the property + * * @return if property exist, value of the relavant property */ - public function __get($property) { + public function __get($property) + { if (property_exists($this, $property)) { return $this->$property; @@ -167,9 +169,12 @@ class PMA_DisplayResults * Set values for any property of this class * * @param string $property name of the property - * @param $value value to set + * @param type $value value to set + * + * @return void */ - public function __set($property, $value) { + public function __set($property, $value) + { if (property_exists($this, $property)) { $this->$property = $value; @@ -334,8 +339,8 @@ class PMA_DisplayResults $do_display['text_btn'] = (string) '0'; $do_display['pview_lnk'] = (string) '0'; - } elseif ($this->__get ('_is_count') || $this->__get ('_is_analyse') - || $this->__get ('_is_maint') || $this->__get ('_is_explain') + } elseif ($this->__get('_is_count') || $this->__get('_is_analyse') + || $this->__get('_is_maint') || $this->__get('_is_explain') ) { // 2.1 Statement is a "SELECT COUNT", a // "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or @@ -347,14 +352,14 @@ class PMA_DisplayResults $do_display['ins_row'] = (string) '0'; $do_display['bkm_form'] = (string) '1'; - if ($this->__get ('_is_maint')) { + if ($this->__get('_is_maint')) { $do_display['text_btn'] = (string) '1'; } else { $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; - } elseif ($this->__get ('_is_show')) { + } elseif ($this->__get('_is_show')) { // 2.2 Statement is a "SHOW..." /** * 2.2.1 @@ -480,8 +485,8 @@ class PMA_DisplayResults */ private function _isSelect($analyzed_sql) { - return ! ($this->__get ('_is_count') || $this->__get('_is_export') - || $this->__get('_is_func') || $this->__get ('_is_analyse')) + return ! ($this->__get('_is_count') || $this->__get('_is_export') + || $this->__get('_is_func') || $this->__get('_is_analyse')) && (count($analyzed_sql[0]['select_expr']) == 0) && isset($analyzed_sql[0]['queryflags']['select_from']) && (count($analyzed_sql[0]['table_ref']) == 1); @@ -527,11 +532,14 @@ class PMA_DisplayResults return '' . '
    ' - . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) + . PMA_generate_common_hidden_inputs( + $this->__get('_db'), $this->__get('_table') + ) . '' . '' - . '' + . '' . $input_for_real_end . '' . '' - . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) + . PMA_generate_common_hidden_inputs( + $this->__get('_db'), $this->__get('_table') + ) . '' . '' . '' - . '' + . '' . '' . '
    ' . ''; @@ -819,7 +830,8 @@ class PMA_DisplayResults $onsubmit = 'onsubmit="return ' . ($_SESSION['tmp_user_values']['pos'] - + $_SESSION['tmp_user_values']['max_rows'] < $this->__get('_unlim_num_rows') + + $_SESSION['tmp_user_values']['max_rows'] + < $this->__get('_unlim_num_rows') && $this->__get('_num_rows') >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false' . '"'; @@ -828,8 +840,10 @@ class PMA_DisplayResults $buttons_html .= $this->_getTableNavigationButton( '>>', _pgettext('Last page', 'End'), - @((ceil($this->__get('_unlim_num_rows') / $_SESSION['tmp_user_values']['max_rows'])- 1) - * $_SESSION['tmp_user_values']['max_rows']), + @((ceil( + $this->__get('_unlim_num_rows') + / $_SESSION['tmp_user_values']['max_rows'] + )- 1) * $_SESSION['tmp_user_values']['max_rows']), $html_sql_query, $onsubmit, $input_for_real_end, $onclick ); @@ -861,7 +875,8 @@ class PMA_DisplayResults $additional_fields_html .= '' - . '' + . '' . '' @@ -908,11 +923,11 @@ class PMA_DisplayResults /** * Get the headers of the results table * - * @param array &$is_display which elements to display - * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression - * @param string $sort_expression_nodirection sort expression without direction - * @param string $sort_direction sort direction + * @param array &$is_display which elements to display + * @param array $analyzed_sql the analyzed query + * @param string $sort_expression sort expression + * @param string $sort_expression_nodirection sort expression without direction + * @param string $sort_direction sort direction * * @return string html content * @@ -967,7 +982,9 @@ class PMA_DisplayResults $table_headers_html .= '' . '
    ' - . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) + . PMA_generate_common_hidden_inputs( + $this->__get('_db'), $this->__get('_table') + ) . '
    '; // Output data needed for column reordering and show/hide column @@ -1021,7 +1038,10 @@ class PMA_DisplayResults && ! $_SESSION['tmp_user_values']['hide_transformation'] ) { include_once './libraries/transformations.lib.php'; - $this->__set('_mime_map', PMA_getMIME($this->__get('_db'), $this->__get('_table'))); + $this->__set( + '_mime_map', + PMA_getMIME($this->__get('_db'), $this->__get('_table')) + ); } // See if we have to highlight any header fields of a WHERE query. @@ -1108,8 +1128,8 @@ class PMA_DisplayResults /** * Prepare unsorted sql query and sort by key drop down * - * @param array $analyzed_sql the analyzed query - * @param string $sort_expression sort expression + * @param array $analyzed_sql the analyzed query + * @param string $sort_expression sort expression * * @return array two element array - $unsorted_sql_query, $drop_down_html * @@ -1143,7 +1163,9 @@ class PMA_DisplayResults ) { // grab indexes data: - $indexes = PMA_Index::getFromTable($this->__get('_table'), $this->__get('_db')); + $indexes = PMA_Index::getFromTable( + $this->__get('_table'), $this->__get('_db') + ); // do we have any index? if ($indexes) { @@ -1179,7 +1201,9 @@ class PMA_DisplayResults $drop_down_html = ''; $drop_down_html .= '
    ' . "\n" - . PMA_generate_common_hidden_inputs($this->__get('_db'), $this->__get('_table')) + . PMA_generate_common_hidden_inputs( + $this->__get('_db'), $this->__get('_table') + ) . __('Sort by key') . ': ' . "\n"; } @@ -1744,8 +1770,8 @@ class PMA_DisplayResults * @param boolean $col_visib column is visible(false) * array column isn't visible(string array) * @param string $col_visib_j element of $col_visib array - * @param boolean $condition_field whether the column is a part of the - * where clause + * @param boolean $condition_field whether the column is a part of + * the where clause * * @return array 2 element array - $order_link, $sorted_header_html * @@ -2468,7 +2494,8 @@ class PMA_DisplayResults */ list($where_clause, $clause_is_unique, $condition_array) = $this->getCommonFunctions()->getUniqueCondition( - $dt_result, $this->__get('_fields_cnt'), $this->__get('_fields_meta'), $row + $dt_result, $this->__get('_fields_cnt'), + $this->__get('_fields_meta'), $row ); $where_clause_html = urlencode($where_clause); @@ -3610,7 +3637,7 @@ class PMA_DisplayResults $is_field_truncated, $analyzed_sql, &$dt_result, $col_index ) { - $is_analyse = $this->__get ('_is_analyse'); + $is_analyse = $this->__get('_is_analyse'); if (! isset($column) || is_null($column)) { @@ -3881,7 +3908,7 @@ class PMA_DisplayResults /** * Prepare edit, copy and delete links for verticle table * - * @param string $operation edit/copy/delete + * @param string $operation edit/copy/delete * * @return string $links_html html content * @@ -3889,7 +3916,8 @@ class PMA_DisplayResults * * @see _getVerticalTable() */ - private function _getOperationLinksForVerticleTable($operation) { + private function _getOperationLinksForVerticleTable($operation) + { $link_html = '' . "\n"; $vertical_display = $this->__get('_vertical_display'); @@ -3921,9 +3949,9 @@ class PMA_DisplayResults /** * Get checkboxes for multiple row data operations * - * @param string $dir _left / _right + * @param string $dir _left/_right * - * @return $checkBoxes_html html content + * @return $checkBoxes_html html content * * @access private * @@ -4734,7 +4762,7 @@ class PMA_DisplayResults /** * Set the value of $map array for linking foreign key related tables * - * @param array $map the list of relations + * @param array &$map the list of relations * * @return void * @@ -4871,11 +4899,11 @@ class PMA_DisplayResults /** * Prepare table navigation bar at the top or bottom * - * @param integer $pos_next the offset for the "next" page - * @param integer $pos_prev the offset for the "previous" page - * @param string $place the place to show navigation - * @param string $empty_line empty line depend on the $place - * @param boolean $is_innodb whether its InnoDB or not + * @param integer $pos_next the offset for the "next" page + * @param integer $pos_prev the offset for the "previous" page + * @param string $place the place to show navigation + * @param string $empty_line empty line depend on the $place + * @param boolean $is_innodb whether its InnoDB or not * * @return string html content of navigation bar * @@ -5372,8 +5400,8 @@ class PMA_DisplayResults 'table' => $meta->orgtable, 'pos' => '0', 'sql_query' => 'SELECT * FROM ' - . $this->getCommonFunctions()->backquote($this->__get('_db')) . '.' - . $this->getCommonFunctions()->backquote($meta->orgtable) + . $this->getCommonFunctions()->backquote($this->__get('_db')) + . '.' . $this->getCommonFunctions()->backquote($meta->orgtable) . ' WHERE ' . $this->getCommonFunctions()->backquote($meta->orgname) . $where_comparison, From 03f34c4ef028e64c1284fd96423a64fda1c879a5 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 10 Jul 2012 12:36:27 -0400 Subject: [PATCH 26/82] Unused method: setCommonFunctions() --- libraries/DbSearch.class.php | 13 ---------- libraries/Menu.class.php | 14 ---------- libraries/Table.class.php | 14 ---------- libraries/TableSearch.class.php | 14 ---------- .../schema/Pdf_Relation_Schema.class.php | 26 ------------------- libraries/schema/User_Schema.class.php | 14 ---------- 6 files changed, 95 deletions(-) diff --git a/libraries/DbSearch.class.php b/libraries/DbSearch.class.php index 8e7f14cf0b..7c42982bbb 100644 --- a/libraries/DbSearch.class.php +++ b/libraries/DbSearch.class.php @@ -93,19 +93,6 @@ class PMA_DbSearch $this->_setSearchParams(); } - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index dc264560d5..d6de4af77e 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -40,20 +40,6 @@ class PMA_Menu private $_common_functions; - - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 570a1519cb..891240a1bf 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -68,20 +68,6 @@ class PMA_Table private $_common_functions; - - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index 5c96dd6c0f..457e8d16af 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -83,20 +83,6 @@ class PMA_TableSearch private $_common_functions; - - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php index 83bed4e08f..b93547bd07 100644 --- a/libraries/schema/Pdf_Relation_Schema.class.php +++ b/libraries/schema/Pdf_Relation_Schema.class.php @@ -37,19 +37,6 @@ class PMA_Schema_PDF extends PMA_PDF private $_ff = PMA_PDF_FONT; private $_common_functions; - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * @@ -406,19 +393,6 @@ class Table_Stats private $_ff = PMA_PDF_FONT; private $_common_functions; - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index fb72734ac7..e66645b970 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -25,20 +25,6 @@ class PMA_User_Schema public $action; private $_common_functions; - - /** - * Set CommmonFunctions - * - * @param PMA_CommonFunctions $commonFunctions - * - * @return void - */ - public function setCommonFunctions(PMA_CommonFunctions $commonFunctions) - { - $this->_common_functions = $commonFunctions; - } - - /** * Get CommmonFunctions * From c8e96d0bf0fdf6fdd9017976b5d3e2569cf42106 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 10 Jul 2012 12:47:58 -0400 Subject: [PATCH 27/82] Missing getCommonFunctions method in class --- libraries/schema/Pdf_Relation_Schema.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libraries/schema/Pdf_Relation_Schema.class.php b/libraries/schema/Pdf_Relation_Schema.class.php index b93547bd07..42befe9998 100644 --- a/libraries/schema/Pdf_Relation_Schema.class.php +++ b/libraries/schema/Pdf_Relation_Schema.class.php @@ -860,6 +860,20 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema private $leftMargin = 10; private $rightMargin = 10; private $_tablewidth; + private $_common_functions; + + /** + * Get CommmonFunctions + * + * @return CommonFunctions object + */ + public function getCommonFunctions() + { + if (is_null($this->_common_functions)) { + $this->_common_functions = PMA_CommonFunctions::getInstance(); + } + return $this->_common_functions; + } /** * The "PMA_Pdf_Relation_Schema" constructor From c393fe1b795a7566bc869d597105724a89a02aac Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 11:48:33 +0530 Subject: [PATCH 28/82] $found_unique_key can be confusing --- libraries/insert_edit.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 2f17f20db0..091300aa32 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -54,12 +54,11 @@ function PMA_getFormParametersForInsertForm($db, $table, $where_clauses, */ function PMA_getStuffForEditMode($where_clause, $table, $db) { - $found_unique_key = false; if (isset($where_clause)) { $where_clause_array = PMA_getWhereClauseArray($where_clause); list($whereClauses, $resultArray, $rowsArray, $found_unique_key) = PMA_analyzeWhereClauses( - $where_clause_array, $table, $db, $found_unique_key + $where_clause_array, $table, $db, false ); return array( false, $whereClauses, @@ -68,7 +67,7 @@ function PMA_getStuffForEditMode($where_clause, $table, $db) ); } else { list($results, $row) = PMA_loadFirstRowInEditMode($table, $db); - return array(true, null, $results, $row, null, $found_unique_key); + return array(true, null, $results, $row, null, false); } } From 5ec2b4deabe020a568da000b960293065315b084 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 11:55:08 +0530 Subject: [PATCH 29/82] Shorten a long line --- libraries/insert_edit.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 091300aa32..4c4efd000d 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -107,12 +107,12 @@ function PMA_analyzeWhereClauses( $where_clauses = array(); foreach ($where_clause_array as $key_id => $where_clause) { - $local_query = 'SELECT * FROM ' + $local_query = 'SELECT * FROM ' . PMA_CommonFunctions::getInstance()->backquote($db) . '.' . PMA_CommonFunctions::getInstance()->backquote($table) . ' WHERE ' . $where_clause . ';'; - $result[$key_id] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE); - $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); + $result[$key_id] = PMA_DBI_query($local_query, null, PMA_DBI_QUERY_STORE); + $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); $where_clauses[$key_id] = str_replace('\\', '\\\\', $where_clause); $found_unique_key = PMA_showEmptyResultMessageOrSetUniqueCondition( From f535769f4b7ae7f359e82c55e28a837569a21528 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 12:22:38 +0530 Subject: [PATCH 30/82] Remove redundant space --- libraries/insert_edit.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 4c4efd000d..eec2abad4c 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -480,7 +480,7 @@ function PMA_getFunctionColumn($column, $is_upload, $column_name_appendix, || strstr($column['True_Type'], 'set') || in_array($column['pma_type'], $no_support_types) ) { - $html_output .= ' --' . "\n"; + $html_output .= '--' . "\n"; } else { $html_output .= '' . "\n"; From fb233ef327c3ca29c6afd1a57c86c3705855e379 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 12:39:31 +0530 Subject: [PATCH 31/82] Proper spacing --- libraries/insert_edit.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index eec2abad4c..20a90ea804 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -484,10 +484,10 @@ function PMA_getFunctionColumn($column, $is_upload, $column_name_appendix, } else { $html_output .= '' . "\n"; - $html_output .= ''; $html_output .= PMA_CommonFunctions::getInstance() ->getFunctionsForField($column, $insert_mode) . "\n"; From b72f93eac1d4cacae1e89012caae9b5cad842686 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 12:55:07 +0530 Subject: [PATCH 32/82] Improve clarity --- libraries/insert_edit.lib.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 20a90ea804..65fa41cb9d 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -736,14 +736,18 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix, list($db, $table) = $paramTableDbArray; $html_output = ''; $html_output .= $backup_field . "\n"; + $html_output .= ''; - $html_output .= '' - . ''; + + $html_output .= '' - . ' Date: Wed, 11 Jul 2012 13:07:42 +0530 Subject: [PATCH 34/82] Add missing tab index --- libraries/insert_edit.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 0a43a5f665..258da0d3b7 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -782,7 +782,8 @@ function PMA_dispRowForeignData($backup_field, $column_name_appendix, $html_output .= ''; + . ' id="field_' . $idindex . '_3">'; + $html_output .= PMA_foreignDropdown( + $foreignData['disp_row'], $foreignData['foreign_field'], + $foreignData['foreign_display'], $data, + $GLOBALS['cfg']['ForeignKeyMaxLimit'] + ); + $html_output .= ''; return $html_output; } From f1ec63a65e5a7c5682ea13bbcedbb5448521613b Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 13:17:18 +0530 Subject: [PATCH 37/82] spaces between operands --- libraries/insert_edit.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index d0179f5fc2..297a5c9fb9 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -826,8 +826,8 @@ function PMA_getTextarea($column, $backup_field, $column_name_appendix, } elseif ($GLOBALS['cfg']['LongtextDoubleTextarea'] && strstr($column['pma_type'], 'longtext') ) { - $textAreaRows = $GLOBALS['cfg']['TextareaRows']*2; - $textareaCols = $GLOBALS['cfg']['TextareaCols']*2; + $textAreaRows = $GLOBALS['cfg']['TextareaRows'] * 2; + $textareaCols = $GLOBALS['cfg']['TextareaCols'] * 2; } $html_output = $backup_field . "\n" . ''; From e97a4978e5b975f9748620819224ce698fe16b2f Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 13:52:21 +0530 Subject: [PATCH 39/82] Fix indentation --- libraries/insert_edit.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index f55d7e9fc8..c91f04e3a9 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -909,9 +909,9 @@ function PMA_getColumnEnumValues($column, $extracted_columnspec) // Removes automatic MySQL escape format $val = str_replace('\'\'', '\'', str_replace('\\\\', '\\', $val)); $column['values'][] = array( - 'plain' => $val, - 'html' => htmlspecialchars($val), - ); + 'plain' => $val, + 'html' => htmlspecialchars($val), + ); } return $column['values']; } From f186ab5c240f89e239fbdf59028b16fc6d5969e8 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 14:06:27 +0530 Subject: [PATCH 40/82] Spaces between html attributes. Remove redundant space in html --- libraries/insert_edit.lib.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index c91f04e3a9..697a7b66b8 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -935,14 +935,13 @@ function PMA_getDropDownDependingOnLength( $tabindex, $tabindex_for_value, $idindex, $data, $column_enum_values ) { $html_output = ''; $html_output .= ' '; list($html_out, $biggest_max_file_size) = PMA_getMaxUploadSize( $column, $biggest_max_file_size ); @@ -1176,10 +1176,10 @@ function PMA_getHTMLinput($column, $column_name_appendix, $special_chars, $the_class .= ' datetimefield'; } return ''; + . ' value="' . $special_chars . '" size="' . $fieldsize . '"' + . ' class="' . $the_class . '" ' . $unnullify_trigger + . ' tabindex="' . ($tabindex + $tabindex_for_value). '"' + . ' id="field_' . ($idindex) . '_3" />'; } /** From 9260e7685df6e09d9985e8ed5c6f253ea24ce12d Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Wed, 11 Jul 2012 14:19:11 +0530 Subject: [PATCH 42/82] Coding style fixes --- libraries/insert_edit.lib.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index 148dd2e726..601d4ea534 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -1231,7 +1231,8 @@ function PMA_getMaxUploadSize($column, $biggest_max_file_size) 'tinyblob' => '256', 'blob' => '65536', 'mediumblob' => '16777216', - 'longblob' => '4294967296'); // yeah, really + 'longblob' => '4294967296' // yeah, really + ); $this_field_max_size = $max_upload_size; // from PHP max if ($this_field_max_size > $max_field_sizes[$column['pma_type']]) { @@ -1396,13 +1397,13 @@ function PMA_getContinueInsertionForm($table, $db, $where_clause_array, $err_url if (isset($_REQUEST['where_clause'])) { foreach ($where_clause_array as $key_id => $where_clause) { - $html_output .= ''. "\n"; + $html_output .= ''. "\n"; } } $tmp = '' - . '' - . ''; + . '' + . '' + . ''; if (isset($_REQUEST['where_clause'])) { foreach ($where_clause_array as $key_id => $where_clause) { @@ -1646,7 +1650,9 @@ function PMA_getSpecialCharsAndBackupFieldForExistingRow( if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && $GLOBALS['cfg']['ShowFunctionFields'] ) { - $current_row[$column['Field']] = bin2hex($current_row[$column['Field']]); + $current_row[$column['Field']] = bin2hex( + $current_row[$column['Field']] + ); $column['display_binary_as_hex'] = true; } else { $current_row[$column['Field']] @@ -2006,7 +2012,7 @@ function PMA_getDisplayValueForForeignTableColumn($where_comparison, ); // Field to display from the foreign table? if (isset($display_field) && strlen($display_field)) { - $dispsql = 'SELECT ' . $common_functions->backquote($display_field) + $dispsql = 'SELECT ' . $common_functions->backquote($display_field) . ' FROM ' . $common_functions->backquote($map[$relation_field]['foreign_db']) . '.' . $common_functions->backquote($map[$relation_field]['foreign_table']) . ' WHERE ' . $common_functions->backquote($map[$relation_field]['foreign_field']) @@ -2081,6 +2087,7 @@ function PMA_getLinkForRelationalDisplayField($map, $relation_field, * [field_name][field_key] * @param array $edited_values transform fields list * @param array $extra_data extra data array + * @param string $include_file file containing the transformation plugin * * @return array $extra_data */ @@ -2178,10 +2185,12 @@ function PMA_getCurrentValueAsAnArrayForMultipleEdit($multi_edit_colummns, * @param boolean $is_insert boolean value whether insert or not * @param array $query_values SET part of the sql query * @param array $query_fields array of query fileds - * @param string $current_value_as_an_array current value in the column as an array + * @param string $current_value_as_an_array current value in the column + * as an array * @param array $value_sets array of valu sets * @param string $key an md5 of the column name - * @param array $multi_edit_columns_null_prev array of multiple edit columnd null previous + * @param array $multi_edit_columns_null_prev array of multiple edit columns + * null previous * * @return array ($query_values, $query_fields) */ @@ -2200,7 +2209,9 @@ function PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_ $query_values[] = $current_value_as_an_array; // first inserted row so prepare the list of fields if (empty($value_sets)) { - $query_fields[] = $common_functions->backquote($multi_edit_columns_name[$key]); + $query_fields[] = $common_functions->backquote( + $multi_edit_columns_name[$key] + ); } } @@ -2211,7 +2222,8 @@ function PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_ // field had the null checkbox before the update // field no longer has the null checkbox - $query_values[] = $common_functions->backquote($multi_edit_columns_name[$key]) + $query_values[] + = $common_functions->backquote($multi_edit_columns_name[$key]) . ' = ' . $current_value_as_an_array; } elseif (empty($multi_edit_funcs[$key]) && isset($multi_edit_columns_prev[$key]) @@ -2225,7 +2237,8 @@ function PMA_getQueryValuesForInsertAndUpdateInMultipleEdit($multi_edit_columns_ if (empty($multi_edit_columns_null_prev[$key]) || empty($multi_edit_columns_null[$key]) ) { - $query_values[] = $common_functions->backquote($multi_edit_columns_name[$key]) + $query_values[] + = $common_functions->backquote($multi_edit_columns_name[$key]) . ' = ' . $current_value_as_an_array; } } From 65f24f0e363d62a1805e326a74577120bc05229b Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Wed, 11 Jul 2012 21:09:33 +0530 Subject: [PATCH 45/82] Renamed the function processParams() in PMA_DisplayResults class, to setProperties() --- libraries/DisplayResults.class.php | 4 ++-- sql.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 26df14a636..cb0614934c 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -243,7 +243,7 @@ class PMA_DisplayResults * * @see sql.php */ - public function processParams( + public function setProperties( $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query @@ -267,7 +267,7 @@ class PMA_DisplayResults $this->__set('_printview', $printview); $this->__set('_url_query', $url_query); - } + } // end of the 'setProperties()' function /** diff --git a/sql.php b/sql.php index 5932221a8e..65a50cf440 100644 --- a/sql.php +++ b/sql.php @@ -937,7 +937,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { $printview = isset($printview) ? $printview : null; $url_query = isset($url_query) ? $url_query : null; - $displayResultsObject->processParams( + $displayResultsObject->setProperties( $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query @@ -1097,7 +1097,7 @@ $(makeProfilingChart); $printview = isset($printview) ? $printview : null; $url_query = isset($url_query) ? $url_query : null; - $displayResultsObject->processParams( + $displayResultsObject->setProperties( $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query From 60d0c8a13294588977ffb076d7471054aed86144 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 12 Jul 2012 06:33:42 +0530 Subject: [PATCH 46/82] No need to pass $found_unique_key through all these functions --- libraries/insert_edit.lib.php | 44 ++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/libraries/insert_edit.lib.php b/libraries/insert_edit.lib.php index e08a63012a..0fbc152099 100644 --- a/libraries/insert_edit.lib.php +++ b/libraries/insert_edit.lib.php @@ -58,13 +58,13 @@ function PMA_getStuffForEditMode($where_clause, $table, $db) $where_clause_array = PMA_getWhereClauseArray($where_clause); list($whereClauses, $resultArray, $rowsArray, $found_unique_key) = PMA_analyzeWhereClauses( - $where_clause_array, $table, $db, false + $where_clause_array, $table, $db ); return array( false, $whereClauses, $resultArray, $rowsArray, $where_clause_array, $found_unique_key - ); + ); } else { list($results, $row) = PMA_loadFirstRowInEditMode($table, $db); return array(true, null, $results, $row, null, false); @@ -92,19 +92,19 @@ function PMA_getWhereClauseArray($where_clause) /** * Analysing where clauses array * - * @param array $where_clause_array array of where clauses - * @param string $table name of the table - * @param string $db name of the database - * @param boolean $found_unique_key boolean variable for unique key + * @param array $where_clause_array array of where clauses + * @param string $table name of the table + * @param string $db name of the database * * @return array $where_clauses, $result, $rows */ function PMA_analyzeWhereClauses( - $where_clause_array, $table, $db, $found_unique_key + $where_clause_array, $table, $db ) { $rows = array(); $result = array(); $where_clauses = array(); + $found_unique_key = false; foreach ($where_clause_array as $key_id => $where_clause) { $local_query = 'SELECT * FROM ' @@ -115,11 +115,12 @@ function PMA_analyzeWhereClauses( $rows[$key_id] = PMA_DBI_fetch_assoc($result[$key_id]); $where_clauses[$key_id] = str_replace('\\', '\\\\', $where_clause); - $found_unique_key = PMA_showEmptyResultMessageOrSetUniqueCondition( - $rows, $key_id, - $where_clause_array, $local_query, - $result, $found_unique_key + $has_unique_condition = PMA_showEmptyResultMessageOrSetUniqueCondition( + $rows, $key_id, $where_clause_array, $local_query, $result ); + if ($has_unique_condition) { + $found_unique_key = true; + } } return array($where_clauses, $result, $rows, $found_unique_key); } @@ -127,18 +128,19 @@ function PMA_analyzeWhereClauses( /** * Show message for empty reult or set the unique_condition * - * @param array $rows MySQL returned rows - * @param string $key_id ID in current key - * @param array $where_clause_array array of where clauses - * @param string $local_query query performed - * @param array $result MySQL result handle - * @param boolean $found_unique_key boolean variable for unique key + * @param array $rows MySQL returned rows + * @param string $key_id ID in current key + * @param array $where_clause_array array of where clauses + * @param string $local_query query performed + * @param array $result MySQL result handle * - * @return boolean $found_unique_key + * @return boolean $has_unique_condition */ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, - $where_clause_array, $local_query, $result, $found_unique_key + $where_clause_array, $local_query, $result ) { + $has_unique_condition = false; + // No row returned if (! $rows[$key_id]) { unset($rows[$key_id], $where_clause_array[$key_id]); @@ -156,11 +158,11 @@ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id, ); if (! empty($unique_condition)) { - $found_unique_key = true; + $has_unique_condition = true; } unset($unique_condition, $tmp_clause_is_unique); } - return $found_unique_key; + return $has_unique_condition; } /** From bfc9cf5045606b18fd2e9bc9ec852db8d265d584 Mon Sep 17 00:00:00 2001 From: Hyun-Sung Yun Date: Thu, 12 Jul 2012 03:05:16 +0200 Subject: [PATCH 47/82] Translated using Weblate. --- po/ko.po | 86 +++++++++++++++++++++++++------------------------------- 1 file changed, 39 insertions(+), 47 deletions(-) diff --git a/po/ko.po b/po/ko.po index b9f81f38b9..d4f425aa2b 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,15 +4,15 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-06-26 18:35+0200\n" -"Last-Translator: Gyu-sun Youm \n" +"PO-Revision-Date: 2012-07-11 16:17+0200\n" +"Last-Translator: Hyun-Sung Yun \n" "Language-Team: korean \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 1.0\n" +"X-Generator: Weblate 1.1\n" #: browse_foreigners.php:36 browse_foreigners.php:60 js/messages.php:354 #: libraries/DisplayResults.class.php:609 server_privileges.php:1851 @@ -885,7 +885,7 @@ msgstr "출력" msgid "" "Chose \"GeomFromText\" from the \"Function\" column and paste the below " "string into the \"Value\" field" -msgstr "" +msgstr "\"기능\"컬럼에서 \"GeomFromText\"를 선택하고 아래 문자를 복사하여 \"값\"필드에 붙여넣으십시오." #: import.php:88 #, php-format @@ -1155,7 +1155,6 @@ msgstr "마지막 새로고침 이후 Questions" #. l10n: Questions is the name of a MySQL Status variable #: js/messages.php:85 -#, fuzzy msgid "Questions (executed statements by the server)" msgstr "Questions(서버에 의해 실행된 문장)" @@ -1294,7 +1293,7 @@ msgstr "EB" #: js/messages.php:128 #, php-format msgid "%d table(s)" -msgstr "%d개 테이블 " +msgstr "%d개 테이블(s)" #. l10n: Questions is the name of a MySQL Status variable #: js/messages.php:131 @@ -1345,11 +1344,12 @@ msgstr "모니터링 정지" #: js/messages.php:143 msgid "general_log and slow_query_log are enabled." -msgstr "" +msgstr "general_log 와 slow_query_log 가 활성화 되었습니다." #: js/messages.php:144 +#, fuzzy msgid "general_log is enabled." -msgstr "" +msgstr "general_log 가 활성화 되었습니다." #: js/messages.php:145 msgid "slow_query_log is enabled." @@ -1388,8 +1388,7 @@ msgstr "long_query_time이 %d초로 설정되였습니다." msgid "" "Following settings will be applied globally and reset to default on server " "restart:" -msgstr "" -"다음 설정은 서버 전체에 적용됩니다. 서버 재기동시 기본 설정으로 초기화됩니다." +msgstr "다음 설정은 서버 전체에 적용되고 서버 재기동시 기본 설정으로 초기화됩니다:" #. l10n: %s is FILE or TABLE #: js/messages.php:153 @@ -1413,7 +1412,7 @@ msgstr "%s 사용안함" #: js/messages.php:159 #, php-format msgid "Set long_query_time to %ds" -msgstr "long_query_time을 %d초로 설정합니다." +msgstr "long_query_time을 %d초로 설정합니다" #: js/messages.php:160 msgid "" @@ -1458,9 +1457,8 @@ msgid "From general log" msgstr "일반 로그로부터" #: js/messages.php:172 -#, fuzzy msgid "Analysing logs" -msgstr "로그를 불러오고 있습니다." +msgstr "로그 분석중" #: js/messages.php:173 msgid "Analysing & loading logs. This may take a while." @@ -1488,17 +1486,16 @@ msgstr "" #: js/messages.php:177 msgid "Log data loaded. Queries executed in this time span:" -msgstr "로그자료가 적재되였습니다. 그동안 질의가 실행되였습니다." +msgstr "로그자료가 로드되었습니다. 쿼리들이 실행되었던 기간:" #: js/messages.php:179 msgid "Jump to Log table" msgstr "로그 테이블로 이동" #: js/messages.php:180 -#, fuzzy #| msgid "No databases" msgid "No data found" -msgstr "데이터베이스가 없습니다" +msgstr "자료가 없습니다" #: js/messages.php:181 msgid "Log analysed, but no data found in this time span." @@ -1509,7 +1506,6 @@ msgid "Analyzing..." msgstr "분석중..." #: js/messages.php:184 -#, fuzzy #| msgid "Explain SQL" msgid "Explain output" msgstr "SQL 해석" @@ -1527,24 +1523,22 @@ msgid "Total time:" msgstr "전체 시간:" #: js/messages.php:188 -#, fuzzy #| msgid "Profiling" msgid "Profiling results" -msgstr "프로파일링" +msgstr "프로파일링 결과" #: js/messages.php:189 msgctxt "Display format" msgid "Table" -msgstr "테이블 " +msgstr "테이블" #: js/messages.php:190 msgid "Chart" msgstr "차트" #: js/messages.php:191 -#, fuzzy msgid "Edit chart" -msgstr "필드 추가하기" +msgstr "차트 편집" #: js/messages.php:192 #, fuzzy @@ -1574,19 +1568,17 @@ msgid "Sum of grouped rows:" msgstr "그룹화된 행의 합계:" #: js/messages.php:201 -#, fuzzy #| msgid "Total" msgid "Total:" -msgstr "전체 사용량" +msgstr "전체:" #: js/messages.php:203 -#, fuzzy msgid "Loading logs" -msgstr "로그를 불러오고 있습니다." +msgstr "로그를 불러오는 중" #: js/messages.php:204 msgid "Monitor refresh failed" -msgstr "모니터링 리프리쉬가 실패하였습니다." +msgstr "모니터링 리프리쉬가 실패하였습니다" #: js/messages.php:205 msgid "" @@ -1594,6 +1586,8 @@ msgid "" "This is most likely because your session expired. Reloading the page and " "reentering your credentials should help." msgstr "" +"새로운 차트 데이터를 요청하는 동안 서버에서 잘못된 응답을 반환했습니다.대부분의 경우 세션이 만료되었기 때문입니다.페이지를 다시 로드하고 " +"새로 인증받는 것이 도움이 될것입니다." #: js/messages.php:206 msgid "Reload page" @@ -1611,7 +1605,7 @@ msgstr "구성 파일을 분석할 수 없습니다. 유효한 JSON 코드가 msgid "" "Failed building chart grid with imported config. Resetting to default " "config..." -msgstr "" +msgstr "가져온 설정과 차트 격자를 그리는데 실패했습니다. 기본 설정으로 적용중..." #: js/messages.php:212 libraries/Menu.class.php:309 #: libraries/Menu.class.php:396 libraries/Menu.class.php:493 @@ -1621,14 +1615,13 @@ msgid "Import" msgstr "가져오기" #: js/messages.php:213 -#, fuzzy #| msgid "Local monitor configuration incompatible" msgid "Import monitor configuration" -msgstr "호환되지 않는 로컬 모니터 설정입니다." +msgstr "모니터 설정 가져오기" #: js/messages.php:214 msgid "Please select the file you want to import" -msgstr "" +msgstr "가져올 파일을 선택해 주시기 바랍니다" #: js/messages.php:216 msgid "Analyse Query" @@ -1644,7 +1637,7 @@ msgstr "가능한 성능 문제" #: js/messages.php:222 msgid "Issue" -msgstr "" +msgstr "이슈" #: js/messages.php:223 msgid "Recommendation" @@ -1676,15 +1669,15 @@ msgstr "취소" #: js/messages.php:235 msgid "Loading" -msgstr "불러오고 있습니다." +msgstr "불러오는 중" #: js/messages.php:236 msgid "Processing Request" -msgstr "요청을 처리중입니다." +msgstr "요청을 처리중입니다" #: js/messages.php:237 libraries/rte/rte_export.lib.php:41 msgid "Error in Processing Request" -msgstr "요청 처리중 에러가 발생했습니다." +msgstr "요청 처리중 에러가 발생했습니다" #: js/messages.php:238 server_databases.php:90 msgid "No databases selected." @@ -1692,11 +1685,11 @@ msgstr "데이터베이스를 선택하지 않았습니다." #: js/messages.php:239 msgid "Dropping Column" -msgstr "열을 삭제하고 있습니다." +msgstr "열을 삭제하고 있습니다" #: js/messages.php:240 msgid "Adding Primary Key" -msgstr "기본 키를 추가하고 있습니다." +msgstr "기본 키를 추가하고 있습니다" #: js/messages.php:241 pmd_general.php:415 pmd_general.php:572 #: pmd_general.php:620 pmd_general.php:696 pmd_general.php:750 @@ -1706,27 +1699,27 @@ msgstr "확인" #: js/messages.php:242 msgid "Click to dismiss this notification" -msgstr "클릭하면 이 알림을 받지 않습니다." +msgstr "클릭하면 이 알림을 받지 않습니다" #: js/messages.php:245 msgid "Renaming Databases" -msgstr "데이터베이스 이름을 변경중입니다." +msgstr "데이터베이스 이름을 변경중입니다" #: js/messages.php:246 msgid "Reload Database" -msgstr "데이터베이스를 다시 불러오고 있습니다." +msgstr "데이터베이스를 다시 불러오기" #: js/messages.php:247 msgid "Copying Database" -msgstr "데이터베이스를 복사중입니다." +msgstr "데이터베이스를 복사중입니다" #: js/messages.php:248 msgid "Changing Charset" -msgstr "언어를 변경하고 있습니다." +msgstr "언어를 변경하고 있습니다" #: js/messages.php:249 msgid "Table must have at least one column" -msgstr "테이블은 적어도 1개 이상의 컬럼이 있어야 합니다." +msgstr "테이블은 적어도 1개 이상의 컬럼이 있어야 합니다" #: js/messages.php:254 msgid "Insert Table" @@ -1809,7 +1802,7 @@ msgstr "%d 값 추가" #: js/messages.php:279 msgid "" "Note: If the file contains multiple tables, they will be combined into one" -msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다." +msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다" #: js/messages.php:282 msgid "Hide query box" @@ -1821,7 +1814,7 @@ msgstr "질의 상자 보이기" #: js/messages.php:285 tbl_row_action.php:21 msgid "No rows selected" -msgstr "선택된 행이 없습니다." +msgstr "선택된 행이 없습니다" #: js/messages.php:286 libraries/DisplayResults.class.php:4320 #: querywindow.php:84 tbl_structure.php:148 tbl_structure.php:577 @@ -1836,7 +1829,7 @@ msgstr "질의 실행 시간" #: libraries/DisplayResults.class.php:531 #, php-format msgid "%d is not valid row number." -msgstr "" +msgstr "%d는 올바른 행번호가 아닙니다." #: js/messages.php:291 libraries/config/FormDisplay.tpl.php:387 #: libraries/insert_edit.lib.php:1487 @@ -1862,7 +1855,6 @@ msgid "Zoom Search" msgstr "추가 검색" #: js/messages.php:300 -#, fuzzy msgid "Each point represents a data row." msgstr "각 포인트는 데이터 행을 나타냅니다." From 990928bc57f1dbc8c038fb46687ea71ecda68937 Mon Sep 17 00:00:00 2001 From: Jan Kowalski Date: Thu, 12 Jul 2012 10:13:32 +0200 Subject: [PATCH 48/82] Translated using Weblate. --- po/pl.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/po/pl.po b/po/pl.po index 79f5d7e28a..ffb4244980 100644 --- a/po/pl.po +++ b/po/pl.po @@ -4,9 +4,9 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-05-17 14:07+0200\n" -"Last-Translator: Michal Čihař \n" -"Language-Team: iMutrix\n" +"PO-Revision-Date: 2012-07-12 10:11+0000\n" +"Last-Translator: Jan Kowalski \n" +"Language-Team: pl_PL\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14254,9 +14254,9 @@ msgstr "concurrent_insert jest ustawiony na 0" #~ "column, click the \"Choose column to display\" icon, then click on the " #~ "appropriate column name." #~ msgstr "" -#~ "Wyświetlania kolumna jest pokazywana w kolorze różowym. Aby ustawić/" -#~ "zmienić kolumny jak wyświetlanie kolumn, kliknij \"Wybierz kolumny do " -#~ "wyświetlenia\", a następnie kliknij odpowiednią nazwę kolumny." +#~ "Wyświetlania kolumna jest pokazywana w kolorze różowym. Aby ustawić/zmienić " +#~ "kolumny jak wyświetlanie kolumn, kliknij \"Wybierz kolumny do wyświetlenia\", " +#~ "a następnie kliknij odpowiednią nazwę kolumny." #~ msgid "The number of free memory blocks in query cache." #~ msgstr "Liczba wolnych bloków pamięci w podręcznym buforze zapytań." From 3bac41d5ebfea2bbe07e2531ba32912025e84224 Mon Sep 17 00:00:00 2001 From: Jan Kowalski Date: Thu, 12 Jul 2012 10:13:46 +0200 Subject: [PATCH 49/82] Translated using Weblate. --- po/pl.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/pl.po b/po/pl.po index 52bfe1fcd9..10619099c1 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1,12 +1,12 @@ # iMutrix , 2012. msgid "" msgstr "" -"Project-Id-Version: phpMyAdmin 3.5.2-dev\n" +"Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-05-14 15:30+0200\n" -"Last-Translator: Marcin Kozioł \n" -"Language-Team: iMutrix\n" +"PO-Revision-Date: 2012-07-12 10:11+0000\n" +"Last-Translator: Jan Kowalski \n" +"Language-Team: pl_PL\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13420,9 +13420,9 @@ msgstr "concurrent_insert jest ustawiony na 0" #~ "column, click the \"Choose column to display\" icon, then click on the " #~ "appropriate column name." #~ msgstr "" -#~ "Wyświetlania kolumna jest pokazywana w kolorze różowym. Aby ustawić/" -#~ "zmienić kolumny jak wyświetlanie kolumn, kliknij \"Wybierz kolumny do " -#~ "wyświetlenia\", a następnie kliknij odpowiednią nazwę kolumny." +#~ "Wyświetlania kolumna jest pokazywana w kolorze różowym. Aby ustawić/zmienić " +#~ "kolumny jak wyświetlanie kolumn, kliknij \"Wybierz kolumny do wyświetlenia\", " +#~ "a następnie kliknij odpowiednią nazwę kolumny." #~ msgid "The number of free memory blocks in query cache." #~ msgstr "Liczba wolnych bloków pamięci w podręcznym buforze zapytań." From f4e12d09db358d11dcd98c45e11a69d873f3b2c6 Mon Sep 17 00:00:00 2001 From: Aputsiaq Niels Janussen Date: Thu, 12 Jul 2012 10:36:33 +0200 Subject: [PATCH 50/82] Translated using Weblate. --- po/da.po | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/po/da.po b/po/da.po index ad8f43b951..a9854137ce 100644 --- a/po/da.po +++ b/po/da.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-05 23:51+0200\n" +"PO-Revision-Date: 2012-07-12 03:37+0200\n" "Last-Translator: Aputsiaq Niels Janussen \n" "Language-Team: danish \n" "Language: da\n" @@ -3255,36 +3255,49 @@ msgstr "Tema" msgid "" "A 1-byte integer, signed range is -128 to 127, unsigned range is 0 to 255" msgstr "" +"Et heltal på 1 byte, signeret interval er -128 til 127, usigneret interval " +"er 0 til 255" #: libraries/Types.class.php:297 msgid "" "A 2-byte integer, signed range is -32,768 to 32,767, unsigned range is 0 to " "65,535" msgstr "" +"Et heltal på 2 byte, signeret interval er -32.768 til 32.767, usigneret " +"interval er 0 til 65.535" #: libraries/Types.class.php:299 msgid "" "A 3-byte integer, signed range is -8,388,608 to 8,388,607, unsigned range is " "0 to 16,777,215" msgstr "" +"Et heltal på 3 byte, signeret interval er -8.388.608 til 8.388.607, " +"usigneret interval er 0 til 16.777.215" #: libraries/Types.class.php:301 msgid "" "A 4-byte integer, signed range is -2,147,483,648 to 2,147,483,647, unsigned " "range is 0 to 4,294,967,295." msgstr "" +"Et heltal på 4 byte, signeret interval er -2.147.483.648 til 2.147.483.647, " +"usigneret interval er 0 til 4.294.967.295." #: libraries/Types.class.php:303 msgid "" "An 8-byte integer, signed range is -9,223,372,036,854,775,808 to " "9,223,372,036,854,775,807, unsigned range is 0 to 18,446,744,073,709,551,615" msgstr "" +"Et heltal på 8 byte, signeret interval er -9.223.372.036.854.755.808 til " +"9.223.372.036.854.755.807, usigneret interval er 0 til " +"18.446.744.073.709.55.615" #: libraries/Types.class.php:305 libraries/Types.class.php:711 msgid "" "A fixed-point number (M, D) - the maximum number of digits (M) is 65 " "(default 10), the maximum number of decimals (D) is 30 (default 0)" msgstr "" +"Et fast decimaltal (M, D) - det maksimale antal af tal (M) er 65 (standard " +"10), det maksimale antal decimaler (D) er 30 (standard 0)" #: libraries/Types.class.php:307 msgid "" @@ -3316,10 +3329,12 @@ msgid "" "A synonym for TINYINT(1), a value of zero is considered false, nonzero " "values are considered true" msgstr "" +"Et synonym for TINYINT(1), en værdi på nul anses som falsk, værdier som ikke " +"er nul anses som sande" #: libraries/Types.class.php:317 msgid "An alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE" -msgstr "" +msgstr "Et alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE" #: libraries/Types.class.php:319 libraries/Types.class.php:721 #, php-format @@ -3330,13 +3345,16 @@ msgstr "En dato, understøttet interval er %1$s til %2$s" #: libraries/Types.class.php:321 libraries/Types.class.php:723 #, php-format msgid "A date and time combination, supported range is %1$s to %2$s" -msgstr "" +msgstr "En kombination af dato og tid, understøttet interval er %1$s til %2$s" #: libraries/Types.class.php:323 msgid "" "A timestamp, range is 1970-01-01 00:00:01 UTC to 2038-01-09 03:14:07 UTC, " "stored as the number of seconds since the epoch (1970-01-01 00:00:00 UTC)" msgstr "" +"Et tidsstempel, intervallet er 1970-01-01 00:00:01 UTC til 2038-01-09 " +"03:14:07 UTC, lagret som antallet af sekunder siden epoken (1970-01-01 " +"00:00:00 UTC)" #: libraries/Types.class.php:325 libraries/Types.class.php:727 #, php-format @@ -3349,6 +3367,8 @@ msgid "" "A year in four-digit (4, default) or two-digit (2) format, the allowable " "values are 70 (1970) to 69 (2069) or 1901 to 2155 and 0000" msgstr "" +"Et år med formater på fire cifre (4, standard) eller to cifre (2), hvor " +"tilladte værdier er 70 (1970) til 69 (2069) eller 1901 til 2155 og 0000" #: libraries/Types.class.php:329 msgid "" From 9782308b8e3fd61d5197c0e045b737f5f6346d7c Mon Sep 17 00:00:00 2001 From: Aputsiaq Niels Janussen Date: Fri, 13 Jul 2012 10:33:47 +0200 Subject: [PATCH 51/82] Translated using Weblate. --- po/da.po | 91 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/po/da.po b/po/da.po index eb3930c694..ee28b8660b 100644 --- a/po/da.po +++ b/po/da.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-07-05 23:51+0200\n" +"PO-Revision-Date: 2012-07-12 23:10+0200\n" "Last-Translator: Aputsiaq Niels Janussen \n" "Language-Team: danish \n" "Language: da\n" @@ -5217,9 +5217,9 @@ msgid "" "alias, the table name itself stays unchanged" msgstr "" "Når denne sættes til [kbd]nested[/kbd] bruges alias for tabelnavnet kun til " -"at splitte/samle tabellerne i henhold til direktivet $cfg" -"['LeftFrameTableSeparator'], så kun mappen benævnes som aliaset; tabelnavnet " -"selv forbliver uændret." +"at splitte/samle tabellerne i henhold til direktivet " +"$cfg['LeftFrameTableSeparator'], så kun mappen benævnes som aliaset; " +"tabelnavnet selv forbliver uændret" #: libraries/config/messages.inc.php:480 msgid "Display table comment instead of its name" @@ -5492,7 +5492,7 @@ msgstr "Open Document tekst" #: libraries/config/validate.lib.php:198 msgid "Could not initialize Drizzle connection library" -msgstr "Kunne ikke initialisere Drizzle forbindelsesbibliotek." +msgstr "Kunne ikke initialisere Drizzle forbindelsesbibliotek" #: libraries/config/validate.lib.php:205 libraries/config/validate.lib.php:212 msgid "Could not connect to Drizzle server" @@ -6384,7 +6384,7 @@ msgid "" "transaction log data. The default is 16MB." msgstr "" "Mængden af hukommelse allokeret til mellemlageret for transaktionslogdata. " -"Standard er 16MB" +"Standard er 16MB." #: libraries/engines/pbxt.lib.php:37 msgid "Log file threshold" @@ -6395,8 +6395,8 @@ msgid "" "The size of a transaction log before rollover, and a new log is created. The " "default value is 16MB." msgstr "" -"Størrelsen af en transajktionslog før den ruller over og en ny log oprettes. " -"Standardværdien er 16MB" +"Størrelsen af en transaktionslog før den ruller over og en ny log oprettes. " +"Standardværdien er 16MB." #: libraries/engines/pbxt.lib.php:42 msgid "Transaction buffer size" @@ -6477,7 +6477,7 @@ msgstr "Voksestørrelsen af rækkefil" #: libraries/engines/pbxt.lib.php:73 msgid "The grow size of the row pointer (.xtr) files." -msgstr "Voksestørrelsen af rækkepointerfiler (.xtr)" +msgstr "Vækststørrelsen af rækkepointerfiler (.xtr)." #: libraries/engines/pbxt.lib.php:77 msgid "Log file count" @@ -6500,8 +6500,8 @@ msgid "" "Documentation and further information about PBXT can be found on the " "%sPrimeBase XT Home Page%s." msgstr "" -"Dokumentation og yderliger information om PBXT kan findes på %sPrimeBase XT " -"hjemmeside%s" +"Dokumentation og yderligere information om PBXT kan findes på %sPrimeBase XT " +"hjemmeside%s." #: libraries/engines/pbxt.lib.php:129 msgid "The PrimeBase XT Blog by Paul McCullagh" @@ -6971,7 +6971,7 @@ msgstr "ESRI formfil" #: libraries/import/shp.php:280 #, php-format msgid "There was an error importing the ESRI shape file: \"%s\"." -msgstr "Der var en fejl i importen af ESRI formfilen \"%s\"" +msgstr "Der var en fejl i importen af ESRI-formfilen: \"%s\"." #: libraries/import/shp.php:336 msgid "" @@ -7539,7 +7539,7 @@ msgstr "Du skal angive en gyldig intervalværdi for hændelsen." #: libraries/rte/rte_events.lib.php:549 msgid "You must provide a valid execution time for the event." -msgstr "Du skal angive et gyldigt kørselstidspunkt for hændelsen" +msgstr "Du skal angive et gyldigt kørselstidspunkt for hændelsen." #: libraries/rte/rte_events.lib.php:553 msgid "You must provide a valid type for the event." @@ -8419,8 +8419,8 @@ msgid "" "Converts an (IPv4) Internet network address into a string in Internet " "standard dotted format." msgstr "" -"Konverterer en IPV4 internet adresse til en streng i internet standard x.x.x." -"x adresseformat" +"Konverterer en IPV4-internetadresse til en streng i internet-standard " +"x.x.x.x adresseformat." #: libraries/transformations/text_plain__sql.inc.php:10 msgid "Formats text as SQL query with syntax highlighting." @@ -8871,7 +8871,7 @@ msgstr "Importer fra fil" #: prefs_manage.php:243 msgid "Import from browser's storage" -msgstr "Import fra browserens lager." +msgstr "Import fra browserens lager" #: prefs_manage.php:246 msgid "Settings will be imported from your browser's local storage." @@ -8883,7 +8883,7 @@ msgstr "Du har ingen gemte indstillinger!" #: prefs_manage.php:256 prefs_manage.php:310 msgid "This feature is not supported by your web browser" -msgstr "Denne funktion er ikke understøttet af din browser." +msgstr "Denne funktion er ikke understøttet af din browser" #: prefs_manage.php:261 msgid "Merge with current configuration" @@ -8913,7 +8913,8 @@ msgstr "Eksisterende indstillinger vil blive overskrevet!" #: prefs_manage.php:321 msgid "You can reset all your settings and restore them to default values." msgstr "" -"Du han nulstille alle dine indstillinger og gendanne dem med standardværdier" +"Du kan nulstille alle dine indstillinger og gendanne dem med " +"standardværdier." #: querywindow.php:69 msgid "Import files" @@ -9398,7 +9399,7 @@ msgstr "Tilføj privilegier på følgende database" #: server_privileges.php:2124 msgid "Wildcards % and _ should be escaped with a \\ to use them literally" msgstr "" -"Jokertegn % og _ skal escapes med en \\ for brug af dem som almindelige tegn." +"Jokertegn % og _ skal escapes med en \\ for brug af dem som almindelige tegn" #: server_privileges.php:2127 msgid "Add privileges on the following table" @@ -9567,9 +9568,9 @@ msgid "" "should see a message informing you, that this server is configured as " "master" msgstr "" -"Når du har genstartet MySQL serveren, så klik på Go knappen. Bagefter bør du " +"Når du har genstartet MySQL-serveren, så klik på knappen Go. Bagefter bør du " "se en besked, der fortæller, at denne server er konfigureret som " -"master." +"master" #: server_replication.php:291 msgid "Slave SQL Thread not running!" @@ -9778,8 +9779,8 @@ msgid "" "The Advisor system can provide recommendations on server variables by " "analyzing the server status variables." msgstr "" -"Rådgiversystemer kan give anbefalinger om servervariable ved at analysere " -"serverens statusvariable" +"Rådgiversystemet kan give anbefalinger om servervariabler ved at analysere " +"serverens statusvariabler." #: server_status.php:914 msgid "" @@ -9788,7 +9789,7 @@ msgid "" "system." msgstr "" "Bemærk dog, at dette system giver anbefalinger baseret på simple beregninger " -"og tommelfingerregler, som ikke passer med dit system" +"og tommelfingerregler, som ikke nødvendigvis passer med dit system." #: server_status.php:916 msgid "" @@ -10862,7 +10863,7 @@ msgstr "Valgte måltabeller er blevet synkroniseret med kildetabeller." #: server_synchronize.php:988 msgid "Target database has been synchronized with source database" -msgstr "Måldatabasen er blevet synkroniseret med kildedatabase." +msgstr "Måldatabasen er blevet synkroniseret med kildedatabasen" #: server_synchronize.php:1046 msgid "Executed queries" @@ -11229,7 +11230,7 @@ msgstr "Du bør bruge mysqli af ydelsesgrunde." #: setup/lib/index.lib.php:368 msgid "You allow for connecting to the server without a password." -msgstr "Du tillader forbindelse til serveren uden adgangskode" +msgstr "Du tillader forbindelse til serveren uden adgangskode." #: setup/lib/index.lib.php:390 msgid "Key is too short, it should have at least 8 characters." @@ -11250,7 +11251,7 @@ msgstr "Bladre i fremmedværdier" #: sql.php:217 #, php-format msgid "Using bookmark \"%s\" as default browse query." -msgstr "Bruger bogmærke \"%s\" som standard gennemsynsforespørgsel" +msgstr "Bruger bogmærket \"%s\" som standard-forespørgsel til gennemsyn." #: sql.php:705 tbl_replace.php:412 #, php-format @@ -12019,8 +12020,8 @@ msgid "" "To have more accurate averages it is recommended to let the server run for " "longer than a day before running this analyzer" msgstr "" -"For at få mere korrekte gennemsnit anbefales det at lade serveren køre " -"længere end en dag før dette analyseværktøj anvendes." +"For at få mere korrekte gennemsnit, anbefales det at lade serveren køre " +"længere end én dag, før dette analyseværktøj anvendes" #: po/advisory_rules.php:8 #, php-format @@ -12076,7 +12077,7 @@ msgstr "" msgid "The slow query rate should be below 5%%, your value is %s%%." msgstr "" "Andelen af langsomme forespørgsler bør være under 5%%. Den aktuelle værdi er " -"%s%%" +"%s%%." #: po/advisory_rules.php:20 msgid "Slow query rate" @@ -12121,7 +12122,7 @@ msgstr "" #: po/advisory_rules.php:28 #, php-format msgid "long_query_time is currently set to %ds." -msgstr "long_query_time er sat til %ds" +msgstr "long_query_time er i øjeblikket sat til %ds." #: po/advisory_rules.php:30 msgid "Slow query logging" @@ -12149,7 +12150,7 @@ msgstr "Udgivelsesserie" #: po/advisory_rules.php:36 msgid "The MySQL server version less than 5.1." -msgstr "Versionen af MySQL server er mindre end 5.1" +msgstr "Versionen af MySQL-serveren er lavere end 5.1." #: po/advisory_rules.php:37 msgid "" @@ -12169,7 +12170,7 @@ msgstr "Underversion" #: po/advisory_rules.php:41 msgid "Version less than 5.1.30 (the first GA release of 5.1)." -msgstr "Version mindre end 5.1.30 (den første GA release af 5.1)" +msgstr "Versionen er mindre end 5.1.30 (den første GA-udgivelse i 5.1)." #: po/advisory_rules.php:42 msgid "" @@ -12181,7 +12182,7 @@ msgstr "" #: po/advisory_rules.php:46 msgid "Version less than 5.5.8 (the first GA release of 5.5)." -msgstr "Version mindre end 5.5.8 (den første GA release af 5.5)" +msgstr "Version mindre end 5.5.8 (den første GA-udgivelse i 5.5)." #: po/advisory_rules.php:47 msgid "You should upgrade, to a stable version of MySQL 5.5" @@ -12262,7 +12263,7 @@ msgstr "Forespørgsel-mellemlager deaktiveret" #: po/advisory_rules.php:71 msgid "The query cache is not enabled." -msgstr "Forespørgsel-mellemlager er ikke aktiveret" +msgstr "Forespørgsel-mellemlager er ikke aktiveret." #: po/advisory_rules.php:72 msgid "" @@ -12286,7 +12287,7 @@ msgstr "Metode for forespørgsels-mellemlager" #: po/advisory_rules.php:76 msgid "Suboptimal caching method." -msgstr "Suboptimal metode for mellemlager" +msgstr "Suboptimal metode for mellemlager." #: po/advisory_rules.php:77 msgid "" @@ -12391,9 +12392,9 @@ msgid "" "that the query cache is an alternating pattern of free and used blocks. This " "value should be below 20%%." msgstr "" -"Mellemlageret er aktuelt fragmenteret med %s%%. 1%% fragmentering betyder, " +"Mellemlageret er aktuelt fragmenteret med %s%%. 100%% fragmentering betyder, " "at forespørgselmellemlageret er et skiftende mønster af frie og ubrugte " -"blokke. Denne værdi bør være under 20%%" +"blokke. Denne værdi bør være under 20%%." #: po/advisory_rules.php:95 msgid "Query cache low memory prunes" @@ -12404,8 +12405,8 @@ msgid "" "Cached queries are removed due to low query cache memory from the query " "cache." msgstr "" -"Mellemlagrede forespørgsler er fjernet pga lav hukommelse i " -"forspørgselmellemlageret" +"Mellemlagrede forespørgsler er fjernet pga. lav hukommelse i " +"forespørgselmellemlageret." #: po/advisory_rules.php:97 msgid "" @@ -12936,8 +12937,8 @@ msgstr "Frekvens af venten på tabellås" #, php-format msgid "Table lock wait rate: %s, this value should be less than 1 per hour" msgstr "" -"Frekvens af venten på tabellås: %s. Denne værdi bør være mindre end 1 pr " -"time." +"Frekvens af venten på tabellås: %s. Denne værdi bør være mindre end 1 per " +"time" #: po/advisory_rules.php:205 msgid "Thread cache" @@ -12984,7 +12985,7 @@ msgstr "Tråde som er langsomme til at starte" #: po/advisory_rules.php:216 msgid "There are too many threads that are slow to launch." -msgstr "Der er for mange tråde, som starter for langsomt" +msgstr "Der er for mange tråde, som starter for langsomt." #: po/advisory_rules.php:217 msgid "" @@ -13083,7 +13084,7 @@ msgid "" "Aborted connections rate is at %s, this value should be less than 1 per hour" msgstr "" "Frekvensen af aborterede forbindelser er %s. Denne værdi bør være mindre end " -"1 pr time." +"1 per time" #: po/advisory_rules.php:240 msgid "Percentage of aborted clients" @@ -13117,7 +13118,7 @@ msgstr "Frekvens af aborterede klienter" msgid "Aborted client rate is at %s, this value should be less than 1 per hour" msgstr "" "Frekvensen af aborterede klienter er %s. Denne værdi bør være mindre end 1 " -"pr time." +"per time" #: po/advisory_rules.php:250 msgid "Is InnoDB disabled?" From 8fe9e9d73bcfacfad874d8eab453051067e07e2c Mon Sep 17 00:00:00 2001 From: Maxi Lampert Date: Fri, 13 Jul 2012 10:33:49 +0200 Subject: [PATCH 52/82] Translated using Weblate. --- po/de.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/de.po b/po/de.po index 1c6032fc0d..b5782d0bfd 100644 --- a/po/de.po +++ b/po/de.po @@ -4,15 +4,15 @@ msgstr "" "Project-Id-Version: phpMyAdmin-docs 3.5.1-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-06-24 16:15+0200\n" -"Last-Translator: J. M. \n" +"PO-Revision-Date: 2012-07-13 00:19+0200\n" +"Last-Translator: Maxi Lampert \n" "Language-Team: none\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 1.0\n" +"X-Generator: Weblate 1.1\n" #: browse_foreigners.php:35 browse_foreigners.php:53 js/messages.php:353 #: libraries/display_tbl.lib.php:359 server_privileges.php:1677 @@ -9925,7 +9925,7 @@ msgstr "Netzwerk-Datenverkehr seit Start: %s" #: server_status.php:1061 #, php-format msgid "This MySQL server has been running for %1$s. It started up on %2$s." -msgstr "Dieser MySQL-Server läuft bereits %1$s. Er wurde um %2$s gestartet." +msgstr "Dieser MySQL-Server läuft bereits %1$s. Er wurde am %2$s gestartet." #: server_status.php:1072 msgid "" @@ -12250,7 +12250,7 @@ msgstr "Langsame Anfragen Überwachung" #: po/advisory_rules.php:31 msgid "The slow query log is disabled." -msgstr "Die Überwachung langsamer Anfragen ist deaktiveirt." +msgstr "Die Überwachung langsamer Anfragen ist deaktiviert." #: po/advisory_rules.php:32 msgid "" From f0c3ebf3f70256dc6d2f39da9a0a35f3a6b86adb Mon Sep 17 00:00:00 2001 From: Hyun-Sung Yun Date: Fri, 13 Jul 2012 10:33:49 +0200 Subject: [PATCH 53/82] Translated using Weblate. --- po/ko.po | 89 ++++++++++++++++++++++++++------------------------------ 1 file changed, 41 insertions(+), 48 deletions(-) diff --git a/po/ko.po b/po/ko.po index 60bd960084..ce70176245 100644 --- a/po/ko.po +++ b/po/ko.po @@ -4,15 +4,15 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-06-26 18:35+0200\n" -"Last-Translator: Gyu-sun Youm \n" +"PO-Revision-Date: 2012-07-11 16:23+0200\n" +"Last-Translator: Hyun-Sung Yun \n" "Language-Team: korean \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 1.0\n" +"X-Generator: Weblate 1.1\n" #: browse_foreigners.php:35 browse_foreigners.php:53 js/messages.php:353 #: libraries/display_tbl.lib.php:359 server_privileges.php:1677 @@ -949,7 +949,7 @@ msgstr "공간 데이터를 추가" msgid "" "Chose \"GeomFromText\" from the \"Function\" column and paste the below " "string into the \"Value\" field" -msgstr "" +msgstr "\"기능\"컬럼에서 \"GeomFromText\"를 선택하고 아래 문자를 복사하여 \"값\"필드에 붙여넣으십시오." #: import.php:57 #, php-format @@ -1224,7 +1224,6 @@ msgstr "마지막 새로고침 이후 Questions" #. l10n: Questions is the name of a MySQL Status variable #: js/messages.php:89 -#, fuzzy msgid "Questions (executed statements by the server)" msgstr "Questions(서버에 의해 실행된 문장)" @@ -1363,7 +1362,7 @@ msgstr "EB" #: js/messages.php:132 #, php-format msgid "%d table(s)" -msgstr "%d개 테이블 " +msgstr "%d개 테이블(s)" #. l10n: Questions is the name of a MySQL Status variable #: js/messages.php:135 @@ -1414,11 +1413,12 @@ msgstr "모니터링 정지" #: js/messages.php:147 msgid "general_log and slow_query_log are enabled." -msgstr "" +msgstr "general_log 와 slow_query_log 가 활성화 되었습니다." #: js/messages.php:148 +#, fuzzy msgid "general_log is enabled." -msgstr "" +msgstr "general_log 가 활성화 되었습니다." #: js/messages.php:149 msgid "slow_query_log is enabled." @@ -1455,8 +1455,7 @@ msgstr "long_query_time이 %d초로 설정되였습니다." msgid "" "Following settings will be applied globally and reset to default on server " "restart:" -msgstr "" -"다음 설정은 서버 전체에 적용됩니다. 서버 재기동시 기본 설정으로 초기화됩니다." +msgstr "다음 설정은 서버 전체에 적용되고 서버 재기동시 기본 설정으로 초기화됩니다:" #. l10n: %s is FILE or TABLE #: js/messages.php:157 @@ -1480,7 +1479,7 @@ msgstr "%s 사용안함" #: js/messages.php:163 #, php-format msgid "Set long_query_time to %ds" -msgstr "long_query_time을 %d초로 설정합니다." +msgstr "long_query_time을 %d초로 설정합니다" #: js/messages.php:164 msgid "" @@ -1525,9 +1524,8 @@ msgid "From general log" msgstr "일반 로그로부터" #: js/messages.php:176 -#, fuzzy msgid "Analysing logs" -msgstr "로그를 불러오고 있습니다." +msgstr "로그 분석중" #: js/messages.php:177 msgid "Analysing & loading logs. This may take a while." @@ -1555,17 +1553,16 @@ msgstr "" #: js/messages.php:181 msgid "Log data loaded. Queries executed in this time span:" -msgstr "로그자료가 적재되였습니다. 그동안 질의가 실행되였습니다." +msgstr "로그자료가 로드되었습니다. 쿼리들이 실행되었던 기간:" #: js/messages.php:183 msgid "Jump to Log table" msgstr "로그 테이블로 이동" #: js/messages.php:184 -#, fuzzy #| msgid "No databases" msgid "No data found" -msgstr "데이터베이스가 없습니다" +msgstr "자료가 없습니다" #: js/messages.php:185 msgid "Log analysed, but no data found in this time span." @@ -1576,7 +1573,6 @@ msgid "Analyzing..." msgstr "분석중..." #: js/messages.php:188 -#, fuzzy #| msgid "Explain SQL" msgid "Explain output" msgstr "SQL 해석" @@ -1591,24 +1587,22 @@ msgid "Total time:" msgstr "전체 시간:" #: js/messages.php:192 -#, fuzzy #| msgid "Profiling" msgid "Profiling results" -msgstr "프로파일링" +msgstr "프로파일링 결과" #: js/messages.php:193 msgctxt "Display format" msgid "Table" -msgstr "테이블 " +msgstr "테이블" #: js/messages.php:194 msgid "Chart" msgstr "차트" #: js/messages.php:195 -#, fuzzy msgid "Edit chart" -msgstr "필드 추가하기" +msgstr "차트 편집" #: js/messages.php:196 #, fuzzy @@ -1638,19 +1632,17 @@ msgid "Sum of grouped rows:" msgstr "그룹화된 행의 합계:" #: js/messages.php:205 -#, fuzzy #| msgid "Total" msgid "Total:" -msgstr "전체 사용량" +msgstr "전체:" #: js/messages.php:207 -#, fuzzy msgid "Loading logs" -msgstr "로그를 불러오고 있습니다." +msgstr "로그를 불러오는 중" #: js/messages.php:208 msgid "Monitor refresh failed" -msgstr "모니터링 리프리쉬가 실패하였습니다." +msgstr "모니터링 리프리쉬가 실패하였습니다" #: js/messages.php:209 msgid "" @@ -1658,6 +1650,8 @@ msgid "" "This is most likely because your session expired. Reloading the page and " "reentering your credentials should help." msgstr "" +"새로운 차트 데이터를 요청하는 동안 서버에서 잘못된 응답을 반환했습니다.대부분의 경우 세션이 만료되었기 때문입니다.페이지를 다시 로드하고 " +"새로 인증받는 것이 도움이 될것입니다." #: js/messages.php:210 msgid "Reload page" @@ -1675,7 +1669,7 @@ msgstr "구성 파일을 분석할 수 없습니다. 유효한 JSON 코드가 msgid "" "Failed building chart grid with imported config. Resetting to default " "config..." -msgstr "" +msgstr "가져온 설정과 차트 격자를 그리는데 실패했습니다. 기본 설정으로 적용중..." #: js/messages.php:216 libraries/config/messages.inc.php:172 #: libraries/db_links.inc.php:82 libraries/display_import.lib.php:126 @@ -1685,14 +1679,13 @@ msgid "Import" msgstr "가져오기" #: js/messages.php:217 -#, fuzzy #| msgid "Local monitor configuration incompatible" msgid "Import monitor configuration" -msgstr "호환되지 않는 로컬 모니터 설정입니다." +msgstr "모니터 설정 가져오기" #: js/messages.php:218 msgid "Please select the file you want to import" -msgstr "" +msgstr "가져올 파일을 선택해 주시기 바랍니다" #: js/messages.php:220 msgid "Analyse Query" @@ -1708,7 +1701,7 @@ msgstr "가능한 성능 문제" #: js/messages.php:226 msgid "Issue" -msgstr "" +msgstr "이슈" #: js/messages.php:227 msgid "Recommendation" @@ -1740,23 +1733,23 @@ msgstr "취소" #: js/messages.php:239 msgid "Loading" -msgstr "불러오고 있습니다." +msgstr "불러오는 중" #: js/messages.php:240 msgid "Processing Request" -msgstr "요청을 처리중입니다." +msgstr "요청을 처리중입니다" #: js/messages.php:241 libraries/rte/rte_export.lib.php:39 msgid "Error in Processing Request" -msgstr "요청 처리중 에러가 발생했습니다." +msgstr "요청 처리중 에러가 발생했습니다" #: js/messages.php:242 msgid "Dropping Column" -msgstr "열을 삭제하고 있습니다." +msgstr "열을 삭제하고 있습니다" #: js/messages.php:243 msgid "Adding Primary Key" -msgstr "기본 키를 추가하고 있습니다." +msgstr "기본 키를 추가하고 있습니다" #: js/messages.php:244 libraries/relation.lib.php:80 pmd_general.php:380 #: pmd_general.php:537 pmd_general.php:585 pmd_general.php:661 @@ -1766,27 +1759,27 @@ msgstr "확인" #: js/messages.php:245 msgid "Click to dismiss this notification" -msgstr "클릭하면 이 알림을 받지 않습니다." +msgstr "클릭하면 이 알림을 받지 않습니다" #: js/messages.php:248 msgid "Renaming Databases" -msgstr "데이터베이스 이름을 변경중입니다." +msgstr "데이터베이스 이름을 변경중입니다" #: js/messages.php:249 msgid "Reload Database" -msgstr "데이터베이스를 다시 불러오고 있습니다." +msgstr "데이터베이스를 다시 불러오기" #: js/messages.php:250 msgid "Copying Database" -msgstr "데이터베이스를 복사중입니다." +msgstr "데이터베이스를 복사중입니다" #: js/messages.php:251 msgid "Changing Charset" -msgstr "언어를 변경하고 있습니다." +msgstr "언어를 변경하고 있습니다" #: js/messages.php:252 msgid "Table must have at least one column" -msgstr "테이블은 적어도 1개 이상의 컬럼이 있어야 합니다." +msgstr "테이블은 적어도 1개 이상의 컬럼이 있어야 합니다" #: js/messages.php:257 msgid "Insert Table" @@ -1834,7 +1827,7 @@ msgstr "%d 값 추가" #: js/messages.php:279 msgid "" "Note: If the file contains multiple tables, they will be combined into one" -msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다." +msgstr "참고: 파일에 여러 테이블이 포함되어 있다면, 하나로 결합됩니다" #: js/messages.php:282 msgid "Hide query box" @@ -1846,7 +1839,7 @@ msgstr "질의 상자 보이기" #: js/messages.php:285 tbl_row_action.php:28 msgid "No rows selected" -msgstr "선택된 행이 없습니다." +msgstr "선택된 행이 없습니다" #: js/messages.php:286 libraries/common.lib.php:2746 #: libraries/display_tbl.lib.php:2507 querywindow.php:87 tbl_structure.php:149 @@ -1861,7 +1854,7 @@ msgstr "질의 실행 시간" #: js/messages.php:288 libraries/display_tbl.lib.php:423 #, php-format msgid "%d is not valid row number." -msgstr "" +msgstr "%d는 올바른 행번호가 아닙니다." #: js/messages.php:291 libraries/config/FormDisplay.tpl.php:355 #: libraries/schema/User_Schema.class.php:352 @@ -1886,7 +1879,6 @@ msgid "Zoom Search" msgstr "추가 검색" #: js/messages.php:300 -#, fuzzy msgid "Each point represents a data row." msgstr "각 포인트는 데이터 행을 나타냅니다." @@ -1899,8 +1891,9 @@ msgid "To zoom in, select a section of the plot with the mouse." msgstr "" #: js/messages.php:306 +#, fuzzy msgid "Click reset zoom link to come back to original state." -msgstr "" +msgstr "원래 상태로 돌아오려면 줌 다시 설정 링크를 클릭 합니다." #: js/messages.php:308 msgid "Click a data point to view and possibly edit the data row." From b10adfb1ac227b9fbefe412144b6ca8ce45e7635 Mon Sep 17 00:00:00 2001 From: Nicholas Arnesen Date: Fri, 13 Jul 2012 10:33:50 +0200 Subject: [PATCH 54/82] Translated using Weblate. --- po/nb.po | 66 ++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/po/nb.po b/po/nb.po index db25937504..64499874c8 100644 --- a/po/nb.po +++ b/po/nb.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-07-09 03:26+0200\n" +"PO-Revision-Date: 2012-07-09 16:04+0200\n" "Last-Translator: Nicholas Arnesen \n" "Language-Team: norwegian \n" "Language: nb\n" @@ -1950,7 +1950,7 @@ msgstr "Klikk tilbakestill zoom linken for å gå tilbake til normal størrelse. #: js/messages.php:308 msgid "Click a data point to view and possibly edit the data row." -msgstr "" +msgstr "Velg et datapunkt for å vise, og muligens endre raden med data." #: js/messages.php:310 msgid "The plot can be resized by dragging it along the bottom right corner." @@ -2363,6 +2363,7 @@ msgstr "Sekund" #, php-format msgid "Failed formatting string for rule '%s'. PHP threw following error: %s" msgstr "" +"Formatering av string for regel '%s' feilet. PHP skrev ut følgende feil: %s" #: libraries/Advisor.class.php:326 server_status.php:955 msgid "per second" @@ -2880,6 +2881,8 @@ msgid "" "This usually means there is a syntax error in it, please check any errors " "shown below." msgstr "" +"Dette mener vanligvis at det er en syntaksfeil i det, sjekk mulige feil som " +"vises under." #: libraries/common.inc.php:615 #, php-format @@ -3010,7 +3013,6 @@ msgid "Inline edit of this query" msgstr "Inline redigering av denne spørringa" #: libraries/common.lib.php:1307 -#, fuzzy msgctxt "Inline edit query" msgid "Inline" msgstr "Innebygd" @@ -3037,14 +3039,12 @@ msgid "%s days, %s hours, %s minutes and %s seconds" msgstr "%s dager, %s timer, %s minutter og %s sekunder" #: libraries/common.lib.php:2074 -#, fuzzy #| msgid "Routines" msgid "Missing parameter:" -msgstr "Rutiner" +msgstr "Mangler parametere:" #: libraries/common.lib.php:2457 libraries/common.lib.php:2460 #: libraries/display_tbl.lib.php:306 -#, fuzzy #| msgid "Begin" msgctxt "First page" msgid "Begin" @@ -3053,7 +3053,6 @@ msgstr "Start" #: libraries/common.lib.php:2458 libraries/common.lib.php:2461 #: libraries/display_tbl.lib.php:307 server_binlog.php:135 #: server_binlog.php:137 -#, fuzzy #| msgid "Previous" msgctxt "Previous page" msgid "Previous" @@ -3062,7 +3061,6 @@ msgstr "Forrige" #: libraries/common.lib.php:2488 libraries/common.lib.php:2491 #: libraries/display_tbl.lib.php:373 server_binlog.php:170 #: server_binlog.php:172 -#, fuzzy #| msgid "Next" msgctxt "Next page" msgid "Next" @@ -3070,11 +3068,10 @@ msgstr "Neste" #: libraries/common.lib.php:2489 libraries/common.lib.php:2492 #: libraries/display_tbl.lib.php:390 -#, fuzzy #| msgid "End" msgctxt "Last page" msgid "End" -msgstr "Slutt" +msgstr "Siste" #: libraries/common.lib.php:2559 #, php-format @@ -3087,10 +3084,9 @@ msgid "The %s functionality is affected by a known bug, see %s" msgstr "Funksjonaliteten %s er påvirket av en kjent feil, se %s" #: libraries/common.lib.php:2753 -#, fuzzy #| msgid "Click to select" msgid "Click to toggle" -msgstr "Klikk for å velge" +msgstr "Klikk for å endre" #: libraries/common.lib.php:3127 libraries/common.lib.php:3134 #: libraries/common.lib.php:3349 libraries/config/setup.forms.php:296 @@ -3146,7 +3142,7 @@ msgstr "Det er ingen filer å laste opp" #: libraries/common.lib.php:3358 libraries/common.lib.php:3359 msgid "Execute" -msgstr "" +msgstr "Utfør" #: libraries/common.lib.php:3839 msgid "Print" @@ -3159,15 +3155,15 @@ msgstr "Begge" #: libraries/config.values.php:47 msgid "Nowhere" -msgstr "" +msgstr "Ingensteds" #: libraries/config.values.php:47 msgid "Left" -msgstr "" +msgstr "Venstre" #: libraries/config.values.php:47 msgid "Right" -msgstr "" +msgstr "Høyre" #: libraries/config.values.php:76 msgid "Open" @@ -3370,9 +3366,8 @@ msgstr "" "autentisering" #: libraries/config/messages.inc.php:25 -#, fuzzy msgid "Blowfish secret" -msgstr "Blowfish hemmelighet" +msgstr "Blowfish hemmelig kode" #: libraries/config/messages.inc.php:26 msgid "Highlight selected rows" @@ -3421,24 +3416,26 @@ msgid "" "Defines the minimum size for input fields generated for CHAR and VARCHAR " "columns" msgstr "" +"Definerer minimum størrelse for innskrivningfelt laget for CHAR og VARCHAR " +"kolonner" #: libraries/config/messages.inc.php:35 -#, fuzzy #| msgid "Customize export options" msgid "Minimum size for input field" -msgstr "Endre eksportstandarder" +msgstr "Minste størrelse for innskrivningsfelt" #: libraries/config/messages.inc.php:36 msgid "" "Defines the maximum size for input fields generated for CHAR and VARCHAR " "columns" msgstr "" +"Definerer maks størrelse for innskrivningsfelt laget for CHAR og VARCHAR " +"kolonner" #: libraries/config/messages.inc.php:37 -#, fuzzy #| msgid "Maximum size for temporary sort files" msgid "Maximum size for input field" -msgstr "Maksimum størrelse for midlertidige sorteringsfiler" +msgstr "Maksimum størrelse for innskrivningsfelt" #: libraries/config/messages.inc.php:38 msgid "Number of columns for CHAR/VARCHAR textareas" @@ -3552,10 +3549,9 @@ msgid "" msgstr "" #: libraries/config/messages.inc.php:63 -#, fuzzy #| msgid "Table maintenance" msgid "Disable multi table maintenance" -msgstr "Tabellvedlikehold" +msgstr "Deaktiver multitabellvedlikehold" #: libraries/config/messages.inc.php:64 msgid "Edit SQL queries in popup window" @@ -3737,7 +3733,7 @@ msgstr "SQL kompatibilitetsmodus" #: libraries/config/messages.inc.php:124 libraries/export/sql.php:190 msgid "CREATE TABLE options:" -msgstr "" +msgstr "OPPRETT TABELL valg:" #: libraries/config/messages.inc.php:125 msgid "Creation/Update/Check dates" @@ -4073,6 +4069,11 @@ msgid "" "strong].[br][em][a@http://sqlvalidator.mimer.com/]Mimer SQL Validator[/a], " "Copyright 2002 Upright Database Technology. All rights reserved.[/em]" msgstr "" +"Om du ønsker å bruke SQL-vurderingsservicen så må du være klar over at " +"[strong] alle SQL-spørringer blir lagret anonymt for statistisk " +"bruk[/strong].[br][em][a@http://sqlvalidator.mimer.com/]Mimer SQL-" +"vurderer(engelsk)[/a], Kopirettigheter 2002 Upright Database Technology. " +"Alle rettigheter reservert.[/em]" #: libraries/config/messages.inc.php:224 msgid "Startup" @@ -4190,7 +4191,6 @@ msgid "Do not import empty rows" msgstr "Ikke importer tomme rader" #: libraries/config/messages.inc.php:258 -#, fuzzy #| msgid "Import currencies ($5.00 to 5.00)" msgid "Import currencies ($5.00 to 5.00)" msgstr "Importer valuta ($5.00 til 5.00)" @@ -4208,7 +4208,6 @@ msgid "Partial import: skip queries" msgstr "Delvis import: hopp over spørringer" #: libraries/config/messages.inc.php:263 -#, fuzzy #| msgid "Do not use AUTO_INCREMENT for zero values" msgid "Do not use AUTO_INCREMENT for zero values" msgstr "Ikke bruk AUTO_INCREMENT for nullverdier" @@ -4324,10 +4323,9 @@ msgid "Maximum number of recently used tables; set 0 to disable" msgstr "Maks antall tabeller vist i tabellista" #: libraries/config/messages.inc.php:291 -#, fuzzy #| msgid "Untracked tables" msgid "Recently used tables" -msgstr "Ikke overvåkede tabeller" +msgstr "Sist brukte tabeller" #: libraries/config/messages.inc.php:292 msgid "Use less graphically intense tabs" @@ -4478,14 +4476,13 @@ msgid "Memory limit" msgstr "Minnetak" #: libraries/config/messages.inc.php:321 -#, fuzzy #| msgid "These are Edit, Inline edit, Copy and Delete links" msgid "These are Edit, Copy and Delete links" -msgstr "Dette er rediger, innsmettet rediger, kopier og slettede lenker" +msgstr "Disse er Rediger-, kopi- og slettelenker" #: libraries/config/messages.inc.php:322 msgid "Where to show the table row links" -msgstr "" +msgstr "Hvor tabell-lenkene skal vises" #: libraries/config/messages.inc.php:323 msgid "Use natural order for sorting table and database names" @@ -4540,7 +4537,7 @@ msgstr "" #: libraries/config/messages.inc.php:334 msgid "Missing phpMyAdmin configuration storage tables" -msgstr "" +msgstr "Mangler phpMyAdmin konfigurasjonslagertabeller" #: libraries/config/messages.inc.php:336 msgid "Iconic table operations" @@ -4555,7 +4552,6 @@ msgid "Protect binary columns" msgstr "Beskytt binære kolonner" #: libraries/config/messages.inc.php:339 -#, fuzzy #| msgid "" #| " if you want DB-based query history (requires pmadb). If disabled, s " #| "lizes JS-routines to display query history (lost by window close)." @@ -4589,7 +4585,7 @@ msgstr "Standard spørringsvindufane" #: libraries/config/messages.inc.php:346 msgid "Query window height (in pixels)" -msgstr "" +msgstr "Spørringsvinduets høyde (i piksler)" #: libraries/config/messages.inc.php:347 msgid "Query window height" From 661ace60ff281e87cdba00c17e4dfbb5c919596a Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Fri, 13 Jul 2012 10:33:50 +0200 Subject: [PATCH 55/82] Translated using Weblate. --- po/pt_BR.po | 100 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 28 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 49a4e908db..133ca4ae57 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-07-08 20:44+0200\n" -"Last-Translator: Keven do Nascimento Carneiro \n" +"PO-Revision-Date: 2012-07-11 04:43+0200\n" +"Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -6281,10 +6281,12 @@ msgid "" "The port for the PBMS stream-based communications. Setting this value to 0 " "will disable HTTP communication with the daemon." msgstr "" +"Porta para os fluxos de comunicação PBMS. Setando este valor para 0 irá " +"desabilitar a comunicação HTTP com o daemon." #: libraries/engines/pbms.lib.php:40 msgid "Repository Threshold" -msgstr "" +msgstr "Limite de Repositório" #: libraries/engines/pbms.lib.php:41 msgid "" @@ -6298,7 +6300,7 @@ msgstr "" #: libraries/engines/pbms.lib.php:45 msgid "Temp Blob Timeout" -msgstr "" +msgstr "Tempo de espera para Blobs temporários" #: libraries/engines/pbms.lib.php:46 msgid "" @@ -6311,7 +6313,7 @@ msgstr "" #: libraries/engines/pbms.lib.php:50 msgid "Temp Log Threshold" -msgstr "" +msgstr "Limite de Log Temporário" #: libraries/engines/pbms.lib.php:51 msgid "" @@ -6325,7 +6327,7 @@ msgstr "" #: libraries/engines/pbms.lib.php:55 msgid "Max Keep Alive" -msgstr "" +msgstr "Tempo Máximo de Atividade" #: libraries/engines/pbms.lib.php:56 msgid "" @@ -6344,6 +6346,9 @@ msgid "" "A \":\" delimited list of metadata headers to be used to initialize the " "pbms_metadata_header table when a database is created." msgstr "" +"Uma lista delimitada de \":\" de cabeçalhos de metadados para ser usada para " +"inicializar a tabela pbms_metadata_header quando o banco de dados for " +"criado." #: libraries/engines/pbms.lib.php:94 #, php-format @@ -6351,6 +6356,8 @@ msgid "" "Documentation and further information about PBMS can be found on %sThe " "PrimeBase Media Streaming home page%s." msgstr "" +"Documentação e informação adicional sobre PBMS pode ser encontrada na %" +"spágina do The PrimeBase Media Streaming%s." #: libraries/engines/pbms.lib.php:96 libraries/engines/pbxt.lib.php:127 #| msgid "Relations" @@ -6359,7 +6366,7 @@ msgstr "Links relacionados" #: libraries/engines/pbms.lib.php:98 msgid "The PrimeBase Media Streaming Blog by Barry Leslie" -msgstr "" +msgstr "The PrimeBase Media Streaming Blog por Barry Leslie" #: libraries/engines/pbms.lib.php:99 msgid "PrimeBase XT Home Page" @@ -6367,17 +6374,20 @@ msgstr "Página inicial do PrimeBase XT" #: libraries/engines/pbxt.lib.php:22 msgid "Index cache size" -msgstr "" +msgstr "Tamanho de cache de índice" #: libraries/engines/pbxt.lib.php:23 msgid "" "This is the amount of memory allocated to the index cache. Default value is " "32MB. The memory allocated here is used only for caching index pages." msgstr "" +"Esta é a quantidade de memória alocada para o cache de índice. O valor " +"padrão é 32MB. A memória alocada aqui é usada apenas para cache de páginas " +"index." #: libraries/engines/pbxt.lib.php:27 msgid "Record cache size" -msgstr "" +msgstr "Tamanho de cache de gravação" #: libraries/engines/pbxt.lib.php:28 msgid "" @@ -6385,6 +6395,10 @@ msgid "" "table data. The default value is 32MB. This memory is used to cache changes " "to the handle data (.xtd) and row pointer (.xtr) files." msgstr "" +"Esta é a quantidade de memória alocada para o cache de gravação usado no " +"cache de dados de tabela. O valor padrão é 32MB. Esta memória será usada " +"para fazer cache de alterações para a manipulação de dados (.xtd) e arquivos " +"apontadores de linha (.xtr)." #: libraries/engines/pbxt.lib.php:32 msgid "Log cache size" @@ -6395,16 +6409,20 @@ msgid "" "The amount of memory allocated to the transaction log cache used to cache on " "transaction log data. The default is 16MB." msgstr "" +"Quantidade de memória alocada para o cache de log de transação usada para " +"manter cache no log da transação de dados. O valor padrão é 16MB." #: libraries/engines/pbxt.lib.php:37 msgid "Log file threshold" -msgstr "" +msgstr "Limite de arquivo de log" #: libraries/engines/pbxt.lib.php:38 msgid "" "The size of a transaction log before rollover, and a new log is created. The " "default value is 16MB." msgstr "" +"Tamanho do log de transação antes da mudança e o novo log criado. O valor " +"padrão é 16MB." #: libraries/engines/pbxt.lib.php:42 msgid "Transaction buffer size" @@ -6415,20 +6433,24 @@ msgid "" "The size of the global transaction log buffer (the engine allocates 2 " "buffers of this size). The default is 1MB." msgstr "" +"O tamanho do buffer do log global de transações (a engine aloca 2 buffers " +"deste tamanho). O padrão é 1MB." #: libraries/engines/pbxt.lib.php:47 msgid "Checkpoint frequency" -msgstr "" +msgstr "Frequência de ponto de verificação" #: libraries/engines/pbxt.lib.php:48 msgid "" "The amount of data written to the transaction log before a checkpoint is " "performed. The default value is 24MB." msgstr "" +"A quantidade dados escritos no log de transação antes que um ponto de " +"checagem é realizado. O valor padrão é 24MB." #: libraries/engines/pbxt.lib.php:52 msgid "Data log threshold" -msgstr "" +msgstr "Início do log de dados" #: libraries/engines/pbxt.lib.php:53 msgid "" @@ -6437,16 +6459,22 @@ msgid "" "value of this variable can be increased to increase the total amount of data " "that can be stored in the database." msgstr "" +"Tamanho máximo do log de dados. O valor padrão é 64MB. PBXT pode criar no " +"máximo 32000 logs da dados, que são usados por todas as tabelas. Então o " +"valor desta variável pode ser incrementado para aumentar a quantidade total " +"dos dados que podem ser armazenados no banco de dados." #: libraries/engines/pbxt.lib.php:57 msgid "Garbage threshold" -msgstr "" +msgstr "Início do lixo" #: libraries/engines/pbxt.lib.php:58 msgid "" "The percentage of garbage in a data log file before it is compacted. This is " "a value between 1 and 99. The default is 50." msgstr "" +"O percentual de lixo em um arquivo de dados de log antes de compactá-lo. " +"Este valor está entre 1 e 99. O padrão é 50." #: libraries/engines/pbxt.lib.php:62 msgid "Log buffer size" @@ -6461,23 +6489,23 @@ msgstr "" #: libraries/engines/pbxt.lib.php:67 msgid "Data file grow size" -msgstr "" +msgstr "Tamanho que um arquivo de dados pode atingir" #: libraries/engines/pbxt.lib.php:68 msgid "The grow size of the handle data (.xtd) files." -msgstr "" +msgstr "Tamanho que um arquivo de controle de dados (.xtd) pode atingir." #: libraries/engines/pbxt.lib.php:72 msgid "Row file grow size" -msgstr "" +msgstr "Tamanho que a linha de um arquivo pode atingir" #: libraries/engines/pbxt.lib.php:73 msgid "The grow size of the row pointer (.xtr) files." -msgstr "" +msgstr "Tamanho que um ponteiro de linha (.xtr) pode atingir." #: libraries/engines/pbxt.lib.php:77 msgid "Log file count" -msgstr "" +msgstr "Soma de arquivos de log" #: libraries/engines/pbxt.lib.php:78 msgid "" @@ -6493,14 +6521,16 @@ msgid "" "Documentation and further information about PBXT can be found on the " "%sPrimeBase XT Home Page%s." msgstr "" +"Documentação e mais informações sobre PBXT podem ser encontradas na %" +"sPrimeBase XT Home Page%s." #: libraries/engines/pbxt.lib.php:129 msgid "The PrimeBase XT Blog by Paul McCullagh" -msgstr "" +msgstr "O PrimeBase XT Blog por Paul McCullagh" #: libraries/engines/pbxt.lib.php:130 msgid "The PrimeBase Media Streaming (PBMS) home page" -msgstr "" +msgstr "A página inicial do PrimeBase Media Streaming (PBMS)" #: libraries/export/csv.php:24 libraries/import/csv.php:28 msgid "Columns separated with:" @@ -6619,7 +6649,7 @@ msgstr "Versão do PHP" #: libraries/export/mediawiki.php:15 msgid "MediaWiki Table" -msgstr "" +msgstr "Tabela MediaWiki" #: libraries/export/pdf.php:18 msgid "PDF" @@ -6635,13 +6665,15 @@ msgstr "Título do Relatório:" #: libraries/export/php_array.php:18 msgid "PHP array" -msgstr "" +msgstr "Array PHP" #: libraries/export/sql.php:40 msgid "" "Display comments (includes info such as export timestamp, PHP version, " "and server version)" msgstr "" +"Mostrar comentários (incluindo informação como data e hora de exportação, " +"versão do PHP e versão do servidor)" #: libraries/export/sql.php:45 #| msgid "Add custom comment into header (\\n splits lines)" @@ -6658,6 +6690,8 @@ msgstr "" msgid "" "Database system or older MySQL server to maximize output compatibility with:" msgstr "" +"Sistema de banco de dados ou servidor de MySQL antigo para maximizar saída " +"de compatível com:" #: libraries/export/sql.php:114 libraries/export/sql.php:173 #: libraries/export/sql.php:180 @@ -6675,26 +6709,28 @@ msgid "" "Enclose table and column names with backquotes (Protects column and table " "names formed with special characters or keywords)" msgstr "" +"Envolver nomes de tabela e colunas com crase (Proteger nomes de colunas e " +"tabelas formados com caracteres especiais ou palavras chaves)" #: libraries/export/sql.php:231 msgid "Instead of INSERT statements, use:" -msgstr "" +msgstr "Em vez de declarar INSERT, use:" #: libraries/export/sql.php:238 msgid "INSERT DELAYED statements" -msgstr "" +msgstr "declarações INSERT DELAYED" #: libraries/export/sql.php:245 msgid "INSERT IGNORE statements" -msgstr "" +msgstr "declarações INSERT IGNORE" #: libraries/export/sql.php:255 msgid "Function to use when dumping data:" -msgstr "" +msgstr "Função usada quando despejar dados:" #: libraries/export/sql.php:268 msgid "Syntax to use when inserting data:" -msgstr "" +msgstr "Sintaxe para usar quando inserir dados:" #: libraries/export/sql.php:274 msgid "" @@ -6702,6 +6738,9 @@ msgid "" "    Example: INSERT INTO tbl_name (col_A,col_B,col_C) VALUES " "(1,2,3)" msgstr "" +"incluir nomes de columas em cada declaração INSERT
      " +"    Exemplo: INSERT INTO tbl_name (col_A,col_B,col_C) " +"VALUES (1,2,3)" #: libraries/export/sql.php:275 msgid "" @@ -6709,12 +6748,17 @@ msgid "" "    Example: INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), " "(7,8,9)" msgstr "" +"inserir múltiplas linhas em cada declaração INSERT
      " +"    Exemplo: INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), " +"(7,8,9)" #: libraries/export/sql.php:276 msgid "" "both of the above
          Example: INSERT INTO " "tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)" msgstr "" +"acima referidos
          Exemplo: INSERT INTO " +"tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)" #: libraries/export/sql.php:277 msgid "" @@ -6799,7 +6843,7 @@ msgstr "Não foram encontrados dados para a visualização GIS." #: libraries/header_http.inc.php:15 libraries/header_meta_style.inc.php:15 msgid "GLOBALS overwrite attempt" -msgstr "" +msgstr "Tentativa de sobrescrever GLOBALS" #: libraries/header_printview.inc.php:49 libraries/header_printview.inc.php:57 msgid "SQL result" From f190e33dd585341b09eb2df01d8d4cf3f358c023 Mon Sep 17 00:00:00 2001 From: Aputsiaq Niels Janussen Date: Fri, 13 Jul 2012 10:34:08 +0200 Subject: [PATCH 56/82] Translated using Weblate. --- po/da.po | 111 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 49 deletions(-) diff --git a/po/da.po b/po/da.po index a9854137ce..cdec7dfc74 100644 --- a/po/da.po +++ b/po/da.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-12 03:37+0200\n" +"PO-Revision-Date: 2012-07-12 23:18+0200\n" "Last-Translator: Aputsiaq Niels Janussen \n" "Language-Team: danish \n" "Language: da\n" @@ -3304,6 +3304,8 @@ msgid "" "A small floating-point number, allowable values are -3.402823466E+38 to " "-1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38" msgstr "" +"Et lille, flydende decimaltal. Tilladte værdier er -3.402823466E+38 til " +"-1.175494351E-38, 0, samt 1.175494351E-38 til 3.402823466E+38" #: libraries/Types.class.php:309 msgid "" @@ -3311,18 +3313,25 @@ msgid "" "-1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and " "2.2250738585072014E-308 to 1.7976931348623157E+308" msgstr "" +"Et dobbeltpræcisions, flydende decimaltal. Tilladte værdier er " +"-1.7976931348623157E+308 til -2.2250738585072014E-308, 0, samt " +"2.2250738585072014E-308 til 1.7976931348623157E+308" #: libraries/Types.class.php:311 msgid "" "Synonym for DOUBLE (exception: in REAL_AS_FLOAT SQL mode it is a synonym for " "FLOAT)" msgstr "" +"Synonym for DOUBLE (undtagelse: i REAL_AS_FLOAT SQL-tilstanden er det et " +"synonym for FLOAT)" #: libraries/Types.class.php:313 msgid "" "A bit-field type (M), storing M of bits per value (default is 1, maximum is " "64)" msgstr "" +"Et bit-felttype (M), der lagrer M bits per værdi (standard er 1, maksimum er " +"64)" #: libraries/Types.class.php:315 msgid "" @@ -3375,6 +3384,8 @@ msgid "" "A fixed-length (0-255, default 1) string that is always right-padded with " "spaces to the specified length when stored" msgstr "" +"En streng med fast længde (0-255, standard er 1), der altid har mellemrum " +"til højre i den angivet længde når den lagres" #: libraries/Types.class.php:331 libraries/Types.class.php:729 #, php-format @@ -5822,9 +5833,9 @@ msgid "" "alias, the table name itself stays unchanged" msgstr "" "Når denne sættes til [kbd]nested[/kbd] bruges alias for tabelnavnet kun til " -"at splitte/samle tabellerne i henhold til direktivet $cfg" -"['LeftFrameTableSeparator'], så kun mappen benævnes som aliaset; tabelnavnet " -"selv forbliver uændret." +"at splitte/samle tabellerne i henhold til direktivet " +"$cfg['LeftFrameTableSeparator'], så kun mappen benævnes som aliaset; " +"tabelnavnet selv forbliver uændret" #: libraries/config/messages.inc.php:486 msgid "Display table comment instead of its name" @@ -6074,7 +6085,7 @@ msgstr "Open Document tekst" #: libraries/config/validate.lib.php:212 msgid "Could not initialize Drizzle connection library" -msgstr "Kunne ikke initialisere Drizzle forbindelsesbibliotek." +msgstr "Kunne ikke initialisere Drizzle forbindelsesbibliotek" #: libraries/config/validate.lib.php:221 libraries/config/validate.lib.php:229 msgid "Could not connect to Drizzle server" @@ -6768,7 +6779,7 @@ msgid "" "transaction log data. The default is 16MB." msgstr "" "Mængden af hukommelse allokeret til mellemlageret for transaktionslogdata. " -"Standard er 16MB" +"Standard er 16MB." #: libraries/engines/pbxt.lib.php:43 msgid "Log file threshold" @@ -6779,8 +6790,8 @@ msgid "" "The size of a transaction log before rollover, and a new log is created. The " "default value is 16MB." msgstr "" -"Størrelsen af en transajktionslog før den ruller over og en ny log oprettes. " -"Standardværdien er 16MB" +"Størrelsen af en transaktionslog før den ruller over og en ny log oprettes. " +"Standardværdien er 16MB." #: libraries/engines/pbxt.lib.php:48 msgid "Transaction buffer size" @@ -6861,7 +6872,7 @@ msgstr "Voksestørrelsen af rækkefil" #: libraries/engines/pbxt.lib.php:79 msgid "The grow size of the row pointer (.xtr) files." -msgstr "Voksestørrelsen af rækkepointerfiler (.xtr)" +msgstr "Vækststørrelsen af rækkepointerfiler (.xtr)." #: libraries/engines/pbxt.lib.php:83 msgid "Log file count" @@ -6884,8 +6895,8 @@ msgid "" "Documentation and further information about PBXT can be found on the " "%sPrimeBase XT Home Page%s." msgstr "" -"Dokumentation og yderliger information om PBXT kan findes på %sPrimeBase XT " -"hjemmeside%s" +"Dokumentation og yderligere information om PBXT kan findes på %sPrimeBase XT " +"hjemmeside%s." #: libraries/engines/pbxt.lib.php:135 msgid "Related Links" @@ -7850,7 +7861,7 @@ msgstr "ESRI formfil" #: libraries/plugins/import/ImportShp.class.php:149 #, php-format msgid "There was an error importing the ESRI shape file: \"%s\"." -msgstr "Der var en fejl i importen af ESRI formfilen \"%s\"" +msgstr "Der var en fejl i importen af ESRI-formfilen: \"%s\"." #: libraries/plugins/import/ImportShp.class.php:202 msgid "" @@ -7989,8 +8000,8 @@ msgid "" "Converts an (IPv4) Internet network address into a string in Internet " "standard dotted format." msgstr "" -"Konverterer en IPV4 internet adresse til en streng i internet standard x.x.x." -"x adresseformat" +"Konverterer en IPV4-internetadresse til en streng i internet-standard " +"x.x.x.x adresseformat." #: libraries/plugins/transformations/abstract/SQLTransformationsPlugin.class.php:31 msgid "Formats text as SQL query with syntax highlighting." @@ -8328,7 +8339,7 @@ msgstr "Du skal angive en gyldig intervalværdi for hændelsen." #: libraries/rte/rte_events.lib.php:559 msgid "You must provide a valid execution time for the event." -msgstr "Du skal angive et gyldigt kørselstidspunkt for hændelsen" +msgstr "Du skal angive et gyldigt kørselstidspunkt for hændelsen." #: libraries/rte/rte_events.lib.php:563 msgid "You must provide a valid type for the event." @@ -9200,10 +9211,11 @@ msgid "" "cookie validity configured in phpMyAdmin, because of this, your login will " "expire sooner than configured in phpMyAdmin." msgstr "" -"Din PHP parameter [a@http://php.net/manual/en/session.configuration.php#ini." -"session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] er mindre end cooki " -"gyldighed konfigureret i phpMyAdmin; på grund af dette vil din login session " -"udløbe tidligere end konfigureret i phpMyAdmin" +"Dit PHP-parameter " +"[a@http://php.net/manual/en/session.configuration.php#ini.session.gc-" +"maxlifetime@_blank]session.gc_maxlifetime[/a] er mindre end cookie-" +"gyldigheden konfigureret i phpMyAdmin; på grund af dette vil din logind-" +"session udløbe tidligere end konfigureret i phpMyAdmin." #: main.php:312 msgid "" @@ -9472,7 +9484,7 @@ msgstr "Importer fra fil" #: prefs_manage.php:249 msgid "Import from browser's storage" -msgstr "Import fra browserens lager." +msgstr "Import fra browserens lager" #: prefs_manage.php:252 msgid "Settings will be imported from your browser's local storage." @@ -9484,7 +9496,7 @@ msgstr "Du har ingen gemte indstillinger!" #: prefs_manage.php:262 prefs_manage.php:315 msgid "This feature is not supported by your web browser" -msgstr "Denne funktion er ikke understøttet af din browser." +msgstr "Denne funktion er ikke understøttet af din browser" #: prefs_manage.php:267 msgid "Merge with current configuration" @@ -9514,7 +9526,8 @@ msgstr "Eksisterende indstillinger vil blive overskrevet!" #: prefs_manage.php:326 msgid "You can reset all your settings and restore them to default values." msgstr "" -"Du han nulstille alle dine indstillinger og gendanne dem med standardværdier" +"Du kan nulstille alle dine indstillinger og gendanne dem med " +"standardværdier." #: querywindow.php:66 msgid "Import files" @@ -10016,7 +10029,7 @@ msgstr "Tilføj privilegier på følgende database" #: server_privileges.php:2316 msgid "Wildcards % and _ should be escaped with a \\ to use them literally" msgstr "" -"Jokertegn % og _ skal escapes med en \\ for brug af dem som almindelige tegn." +"Jokertegn % og _ skal escapes med en \\ for brug af dem som almindelige tegn" #: server_privileges.php:2319 msgid "Add privileges on the following table" @@ -10180,9 +10193,9 @@ msgid "" "should see a message informing you, that this server is configured as " "master" msgstr "" -"Når du har genstartet MySQL serveren, så klik på Go knappen. Bagefter bør du " +"Når du har genstartet MySQL-serveren, så klik på knappen Go. Bagefter bør du " "se en besked, der fortæller, at denne server er konfigureret som " -"master." +"master" #: server_replication.php:322 msgid "Slave SQL Thread not running!" @@ -10391,8 +10404,8 @@ msgid "" "The Advisor system can provide recommendations on server variables by " "analyzing the server status variables." msgstr "" -"Rådgiversystemer kan give anbefalinger om servervariable ved at analysere " -"serverens statusvariable" +"Rådgiversystemet kan give anbefalinger om servervariabler ved at analysere " +"serverens statusvariabler." #: server_status.php:930 msgid "" @@ -10401,7 +10414,7 @@ msgid "" "system." msgstr "" "Bemærk dog, at dette system giver anbefalinger baseret på simple beregninger " -"og tommelfingerregler, som ikke passer med dit system" +"og tommelfingerregler, som ikke nødvendigvis passer med dit system." #: server_status.php:932 msgid "" @@ -11498,7 +11511,7 @@ msgstr "Valgte måltabeller er blevet synkroniseret med kildetabeller." #: server_synchronize.php:1123 msgid "Target database has been synchronized with source database" -msgstr "Måldatabasen er blevet synkroniseret med kildedatabase." +msgstr "Måldatabasen er blevet synkroniseret med kildedatabasen" #: server_synchronize.php:1191 msgid "Executed queries" @@ -11865,7 +11878,7 @@ msgstr "Du bør bruge mysqli af ydelsesgrunde." #: setup/lib/index.lib.php:396 msgid "You allow for connecting to the server without a password." -msgstr "Du tillader forbindelse til serveren uden adgangskode" +msgstr "Du tillader forbindelse til serveren uden adgangskode." #: setup/lib/index.lib.php:420 msgid "Key is too short, it should have at least 8 characters." @@ -11882,7 +11895,7 @@ msgstr "Forkerte data" #: sql.php:271 #, php-format msgid "Using bookmark \"%s\" as default browse query." -msgstr "Bruger bogmærke \"%s\" som standard gennemsynsforespørgsel" +msgstr "Bruger bogmærket \"%s\" som standard-forespørgsel til gennemsyn." #: sql.php:430 #, fuzzy @@ -12560,8 +12573,8 @@ msgid "" "To have more accurate averages it is recommended to let the server run for " "longer than a day before running this analyzer" msgstr "" -"For at få mere korrekte gennemsnit anbefales det at lade serveren køre " -"længere end en dag før dette analyseværktøj anvendes." +"For at få mere korrekte gennemsnit, anbefales det at lade serveren køre " +"længere end én dag, før dette analyseværktøj anvendes" #: libraries/advisory_rules.txt:54 #, php-format @@ -12617,7 +12630,7 @@ msgstr "" msgid "The slow query rate should be below 5%%, your value is %s%%." msgstr "" "Andelen af langsomme forespørgsler bør være under 5%%. Den aktuelle værdi er " -"%s%%" +"%s%%." #: libraries/advisory_rules.txt:70 msgid "Slow query rate" @@ -12662,7 +12675,7 @@ msgstr "" #: libraries/advisory_rules.txt:82 #, php-format msgid "long_query_time is currently set to %ds." -msgstr "long_query_time er sat til %ds" +msgstr "long_query_time er i øjeblikket sat til %ds." #: libraries/advisory_rules.txt:84 msgid "Slow query logging" @@ -12690,7 +12703,7 @@ msgstr "Udgivelsesserie" #: libraries/advisory_rules.txt:96 msgid "The MySQL server version less than 5.1." -msgstr "Versionen af MySQL server er mindre end 5.1" +msgstr "Versionen af MySQL-serveren er lavere end 5.1." #: libraries/advisory_rules.txt:97 msgid "" @@ -12711,7 +12724,7 @@ msgstr "Underversion" #: libraries/advisory_rules.txt:103 msgid "Version less than 5.1.30 (the first GA release of 5.1)." -msgstr "Version mindre end 5.1.30 (den første GA release af 5.1)" +msgstr "Versionen er mindre end 5.1.30 (den første GA-udgivelse i 5.1)." #: libraries/advisory_rules.txt:104 msgid "" @@ -12723,7 +12736,7 @@ msgstr "" #: libraries/advisory_rules.txt:110 msgid "Version less than 5.5.8 (the first GA release of 5.5)." -msgstr "Version mindre end 5.5.8 (den første GA release af 5.5)" +msgstr "Version mindre end 5.5.8 (den første GA-udgivelse i 5.5)." #: libraries/advisory_rules.txt:111 msgid "You should upgrade, to a stable version of MySQL 5.5" @@ -12805,7 +12818,7 @@ msgstr "Forespørgsel-mellemlager deaktiveret" #: libraries/advisory_rules.txt:149 msgid "The query cache is not enabled." -msgstr "Forespørgsel-mellemlager er ikke aktiveret" +msgstr "Forespørgsel-mellemlager er ikke aktiveret." #: libraries/advisory_rules.txt:150 msgid "" @@ -12829,7 +12842,7 @@ msgstr "Metode for forespørgsels-mellemlager" #: libraries/advisory_rules.txt:156 msgid "Suboptimal caching method." -msgstr "Suboptimal metode for mellemlager" +msgstr "Suboptimal metode for mellemlager." #: libraries/advisory_rules.txt:157 msgid "" @@ -12934,9 +12947,9 @@ msgid "" "that the query cache is an alternating pattern of free and used blocks. This " "value should be below 20%%." msgstr "" -"Mellemlageret er aktuelt fragmenteret med %s%%. 1%% fragmentering betyder, " +"Mellemlageret er aktuelt fragmenteret med %s%%. 100%% fragmentering betyder, " "at forespørgselmellemlageret er et skiftende mønster af frie og ubrugte " -"blokke. Denne værdi bør være under 20%%" +"blokke. Denne værdi bør være under 20%%." #: libraries/advisory_rules.txt:181 msgid "Query cache low memory prunes" @@ -12947,8 +12960,8 @@ msgid "" "Cached queries are removed due to low query cache memory from the query " "cache." msgstr "" -"Mellemlagrede forespørgsler er fjernet pga lav hukommelse i " -"forspørgselmellemlageret" +"Mellemlagrede forespørgsler er fjernet pga. lav hukommelse i " +"forespørgselmellemlageret." #: libraries/advisory_rules.txt:185 msgid "" @@ -13479,8 +13492,8 @@ msgstr "Frekvens af venten på tabellås" #, php-format msgid "Table lock wait rate: %s, this value should be less than 1 per hour" msgstr "" -"Frekvens af venten på tabellås: %s. Denne værdi bør være mindre end 1 pr " -"time." +"Frekvens af venten på tabellås: %s. Denne værdi bør være mindre end 1 per " +"time" #: libraries/advisory_rules.txt:355 msgid "Thread cache" @@ -13527,7 +13540,7 @@ msgstr "Tråde som er langsomme til at starte" #: libraries/advisory_rules.txt:372 msgid "There are too many threads that are slow to launch." -msgstr "Der er for mange tråde, som starter for langsomt" +msgstr "Der er for mange tråde, som starter for langsomt." #: libraries/advisory_rules.txt:373 msgid "" @@ -13626,7 +13639,7 @@ msgid "" "Aborted connections rate is at %s, this value should be less than 1 per hour" msgstr "" "Frekvensen af aborterede forbindelser er %s. Denne værdi bør være mindre end " -"1 pr time." +"1 per time" #: libraries/advisory_rules.txt:406 msgid "Percentage of aborted clients" @@ -13660,7 +13673,7 @@ msgstr "Frekvens af aborterede klienter" msgid "Aborted client rate is at %s, this value should be less than 1 per hour" msgstr "" "Frekvensen af aborterede klienter er %s. Denne værdi bør være mindre end 1 " -"pr time." +"per time" #: libraries/advisory_rules.txt:422 msgid "Is InnoDB disabled?" From 33c9a1193ea5a2831916265f953096f08cc624e4 Mon Sep 17 00:00:00 2001 From: Maxi Lampert Date: Fri, 13 Jul 2012 10:34:10 +0200 Subject: [PATCH 57/82] Translated using Weblate. --- po/de.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/po/de.po b/po/de.po index feb875f782..6e52145ecf 100644 --- a/po/de.po +++ b/po/de.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-01 18:22+0200\n" -"Last-Translator: J. M. \n" +"PO-Revision-Date: 2012-07-13 00:19+0200\n" +"Last-Translator: Maxi Lampert \n" "Language-Team: none\n" "Language: de\n" "MIME-Version: 1.0\n" @@ -10561,7 +10561,7 @@ msgstr "Netzwerk-Datenverkehr seit Start: %s" #: server_status.php:1086 #, php-format msgid "This MySQL server has been running for %1$s. It started up on %2$s." -msgstr "Dieser MySQL-Server läuft bereits %1$s. Er wurde um %2$s gestartet." +msgstr "Dieser MySQL-Server läuft bereits %1$s. Er wurde am %2$s gestartet." #: server_status.php:1097 msgid "" @@ -12799,7 +12799,7 @@ msgstr "Langsame Anfragen Überwachung" #: libraries/advisory_rules.txt:87 msgid "The slow query log is disabled." -msgstr "Die Überwachung langsamer Anfragen ist deaktiveirt." +msgstr "Die Überwachung langsamer Anfragen ist deaktiviert." #: libraries/advisory_rules.txt:88 msgid "" From 7c9c200ec040c992ba16f4eb0ff02fe50e863697 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 14 Jul 2012 09:42:13 -0400 Subject: [PATCH 58/82] Typo --- Documentation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation.html b/Documentation.html index f0a49690cf..1516855120 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1572,7 +1572,7 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE
    $cfg['ShowTooltipAliasDB'] boolean
    If tool-tips are enabled and a DB comment is set, this will flip the - comment and the real name. That means that if you have a table called + comment and the real name. That means that if you have a database called 'user0001' and add the comment 'MyName' on it, you will see the name 'MyName' used consequently in the left frame and the tool-tip shows the real name of the DB.
    From 6c9e18295c0a9c1db92cb5c963a3044f29c1e6c6 Mon Sep 17 00:00:00 2001 From: Martin Lacina Date: Sat, 14 Jul 2012 15:43:02 +0200 Subject: [PATCH 59/82] Translated using Weblate. --- po/sk.po | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/po/sk.po b/po/sk.po index ceefd6b981..5f1b6728e2 100644 --- a/po/sk.po +++ b/po/sk.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-06-29 16:10+0200\n" -"Last-Translator: Michal Remiš \n" +"PO-Revision-Date: 2012-07-13 13:51+0200\n" +"Last-Translator: Martin Lacina \n" "Language-Team: slovak \n" "Language: sk\n" "MIME-Version: 1.0\n" @@ -1580,7 +1580,6 @@ msgid "Jump to Log table" msgstr "Prejsť na tabuľku so záznamami" #: js/messages.php:184 -#, fuzzy #| msgid "No data" msgid "No data found" msgstr "Žiadne dáta" @@ -1622,15 +1621,13 @@ msgid "Chart" msgstr "Graf" #: js/messages.php:195 -#, fuzzy msgid "Edit chart" -msgstr "Odstrániť index/indexy" +msgstr "Upraviť graf" #: js/messages.php:196 -#, fuzzy #| msgid "Series:" msgid "Series" -msgstr "Série:" +msgstr "Série" #. l10n: A collection of available filters #: js/messages.php:199 @@ -2055,7 +2052,7 @@ msgstr ", posledná stabilná verzia:" #: js/messages.php:370 msgid "up to date" -msgstr "aktuálne" +msgstr "aktuálna" #. l10n: Display text for calendar close link #: js/messages.php:389 @@ -12643,10 +12640,9 @@ msgid "Rate of table open" msgstr "Vytvoriť tabuľku" #: po/advisory_rules.php:181 -#, fuzzy #| msgid "The current number of pending writes." msgid "The rate of opening tables is high." -msgstr "Počet aktuálne prebiehajúcich zápisov." +msgstr "Frekvencia otvárania tabuliek je vysoká." #: po/advisory_rules.php:182 msgid "" From caac80708e6b000565b075dcacd4d45f68935577 Mon Sep 17 00:00:00 2001 From: Martin Lacina Date: Sat, 14 Jul 2012 15:43:17 +0200 Subject: [PATCH 60/82] Translated using Weblate. --- po/sk.po | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/po/sk.po b/po/sk.po index d9516eb497..beef75153f 100644 --- a/po/sk.po +++ b/po/sk.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-06-29 16:10+0200\n" -"Last-Translator: Michal Remiš \n" +"PO-Revision-Date: 2012-07-13 13:53+0200\n" +"Last-Translator: Martin Lacina \n" "Language-Team: slovak \n" "Language: sk\n" "MIME-Version: 1.0\n" @@ -280,16 +280,16 @@ msgid "The database name is empty!" msgstr "Meno databázy je prázdne!" #: db_operations.php:328 -#, fuzzy, php-format +#, php-format #| msgid "Database %s has been renamed to %s" msgid "Database %1$s has been renamed to %2$s" -msgstr "Databáza %s bola premenovaná na %s" +msgstr "Databáza %1$s bola premenovaná na %2$s" #: db_operations.php:332 -#, fuzzy, php-format +#, php-format #| msgid "Database %s has been copied to %s" msgid "Database %1$s has been copied to %2$s" -msgstr "Databáza %s bola skopírovaná do %s" +msgstr "Databáza %1$s bola skopírovaná do %2$s" #: db_operations.php:466 msgid "Rename database to" @@ -995,10 +995,10 @@ msgid "\"DROP DATABASE\" statements are disabled." msgstr "Príkaz \"DROP DATABASE\" je zakázaný." #: js/messages.php:30 -#, fuzzy, php-format +#, php-format #| msgid "Do you really want to " msgid "Do you really want to execute \"%s\"?" -msgstr "Skutočne chcete vykonať príkaz " +msgstr "Skutočne chcete vykonať príkaz \"%s\"?" #: js/messages.php:31 libraries/mult_submits.inc.php:307 sql.php:414 msgid "You are about to DESTROY a complete database!" @@ -1508,7 +1508,6 @@ msgid "Jump to Log table" msgstr "Prejsť na tabuľku so záznamami" #: js/messages.php:180 -#, fuzzy #| msgid "No data" msgid "No data found" msgstr "Žiadne dáta" @@ -1553,15 +1552,13 @@ msgid "Chart" msgstr "Graf" #: js/messages.php:191 -#, fuzzy msgid "Edit chart" -msgstr "Odstrániť index/indexy" +msgstr "Upraviť graf" #: js/messages.php:192 -#, fuzzy #| msgid "Series:" msgid "Series" -msgstr "Série:" +msgstr "Série" #. l10n: A collection of available filters #: js/messages.php:195 @@ -1753,22 +1750,19 @@ msgid "Show indexes" msgstr "Zobraziť indexy" #: js/messages.php:257 libraries/mult_submits.inc.php:317 -#, fuzzy #| msgid "Disable foreign key checks" msgid "Foreign key check:" -msgstr "Vypnúť kontrolu cudzích kľúčov" +msgstr "Kontrola cudzích kľúčov:" #: js/messages.php:258 libraries/mult_submits.inc.php:321 -#, fuzzy #| msgid "Enabled" msgid "(Enabled)" -msgstr "Zapnuté" +msgstr "(Zapnuté)" #: js/messages.php:259 libraries/mult_submits.inc.php:321 -#, fuzzy #| msgid "Disabled" msgid "(Disabled)" -msgstr "Vypnuté" +msgstr "(Vypnuté)" #: js/messages.php:262 msgid "Searching" @@ -1999,20 +1993,18 @@ msgid "Go to link" msgstr "Prejsť na odkaz" #: js/messages.php:358 -#, fuzzy #| msgid "Column names" msgid "Copy column name" -msgstr "Názvy stĺpcov" +msgstr "Kopírovať názov stĺpca" #: js/messages.php:359 msgid "Right-click the column name to copy it to your clipboard." msgstr "" #: js/messages.php:360 -#, fuzzy #| msgid "Update row(s)" msgid "Show data row(s)" -msgstr "Upraviť riadky" +msgstr "Zobraziť riadky" #: js/messages.php:363 msgid "Generate password" @@ -2046,7 +2038,7 @@ msgstr ", posledná stabilná verzia:" #: js/messages.php:374 msgid "up to date" -msgstr "aktuálne" +msgstr "aktuálna" #. l10n: Display text for calendar close link #: js/messages.php:393 @@ -13271,10 +13263,9 @@ msgid "Rate of table open" msgstr "Vytvoriť tabuľku" #: libraries/advisory_rules.txt:323 -#, fuzzy #| msgid "The current number of pending writes." msgid "The rate of opening tables is high." -msgstr "Počet aktuálne prebiehajúcich zápisov." +msgstr "Frekvencia otvárania tabuliek je vysoká." #: libraries/advisory_rules.txt:324 msgid "" From 53d93b85179037df8ea23a9c96b79f31a7834554 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sun, 15 Jul 2012 10:11:04 +0530 Subject: [PATCH 61/82] Modifications in __get __set methods --- libraries/DisplayResults.class.php | 164 +++++++++++++++-------------- 1 file changed, 84 insertions(+), 80 deletions(-) diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index eba7600bfe..9fbde32e25 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -71,81 +71,85 @@ class PMA_DisplayResults // Declare global fields /** PMA_CommonFunctions object */ private $_common_functions; - - /** string Database name */ - private $_db; - - /** string Table name */ - private $_table; - - /** string the URL to go back in case of errors */ - private $_goto; - - /** string the SQL query */ - private $_sql_query; - - /** - * integer the total number of rows returned by the SQL query without any - * appended "LIMIT" clause programmatically - */ - private $_unlim_num_rows; - - /** array meta information about fields */ - private $_fields_meta; - - /** boolean */ - private $_is_count; - - /** integer */ - private $_is_export; - - /** boolean */ - private $_is_func; - - /** integer */ - private $_is_analyse; - - /** integer the total number of rows returned by the SQL query */ - private $_num_rows; - - /** array table definitions */ - private $_showtable; - - /** array column names to highlight */ - private $_highlight_columns; - - /** array informations used with vertical display mode */ - private $_vertical_display; - - /** integer the total number of fields returned by the SQL query */ - private $_fields_cnt; - - /** string */ - private $_printview; - - /** double time taken for execute the SQL query */ - private $_querytime; - - /** string path for theme images directory */ - private $_pma_theme_image; - - /** string */ - private $_text_dir; - - /** string URL query */ - private $_url_query; - - /** boolean */ - private $_is_maint; - - /** boolean */ - private $_is_explain; - - /** boolean */ - private $_is_show; - - /** array mime types information of fields */ - private $_mime_map; + + /** array with properties of the class */ + private $_property_array = array( + + /** string Database name */ + '_db' => null, + + /** string Table name */ + '_table' => null, + + /** string the URL to go back in case of errors */ + '_goto' => null, + + /** string the SQL query */ + '_sql_query' => null, + + /** + * integer the total number of rows returned by the SQL query without any + * appended "LIMIT" clause programmatically + */ + '_unlim_num_rows' => null, + + /** array meta information about fields */ + '_fields_meta' => null, + + /** boolean */ + '_is_count' => null, + + /** integer */ + '_is_export' => null, + + /** boolean */ + '_is_func' => null, + + /** integer */ + '_is_analyse' => null, + + /** integer the total number of rows returned by the SQL query */ + '_num_rows' => null, + + /** integer the total number of fields returned by the SQL query */ + '_fields_cnt' => null, + + /** double time taken for execute the SQL query */ + '_querytime' => null, + + /** string path for theme images directory */ + '_pma_theme_image' => null, + + /** string */ + '_text_dir' => null, + + /** boolean */ + '_is_maint' => null, + + /** boolean */ + '_is_explain' => null, + + /** boolean */ + '_is_show' => null, + + /** array table definitions */ + '_showtable' => null, + + /** string */ + '_printview' => null, + + /** string URL query */ + '_url_query' => null, + + /** array column names to highlight */ + '_highlight_columns' => null, + + /** array informations used with vertical display mode */ + '_vertical_display' => null, + + /** array mime types information of fields */ + '_mime_map' => null + ); /** @@ -157,8 +161,8 @@ class PMA_DisplayResults */ public function __get($property) { - if (property_exists($this, $property)) { - return $this->$property; + if(array_key_exists($property, $this->_property_array)) { + return $this->_property_array[$property]; } } @@ -172,9 +176,9 @@ class PMA_DisplayResults * @return void */ public function __set($property, $value) - { - if (property_exists($this, $property)) { - $this->$property = $value; + { + if(array_key_exists($property, $this->_property_array)) { + $this->_property_array[$property] = $value; } } From 4fe1b0a73677871303de451d8f41fd84335986a5 Mon Sep 17 00:00:00 2001 From: Chanaka Indrajith Date: Sun, 15 Jul 2012 10:55:01 +0530 Subject: [PATCH 62/82] Fixed some errors in tests --- test/classes/PMA_DisplayResults_test.php | 313 ++++++++++------------- 1 file changed, 131 insertions(+), 182 deletions(-) diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index f05325a179..b9c4d5aefb 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -86,8 +86,20 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase */ public function testSetDisplayModeCase1($the_disp_mode, $the_total, $output) { - $GLOBALS['is_count'] = true; - $GLOBALS['is_maint'] = true; + + if (!isset($GLOBALS['fields_meta'])) { + $fields_meta = array(); + $fields_meta[0] = new stdClass(); + $fields_meta[0]->table = 'company'; + } else { + $fields_meta = $GLOBALS['fields_meta']; + } + + $this->object->setProperties( + null, $fields_meta, true, null, null, + null, null, null, null, null, null, + true, null, null, null, null, null + ); $this->assertEquals( $this->_callPrivateFunction( @@ -151,15 +163,22 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase */ public function testSetDisplayModeCase2($the_disp_mode, $the_total, $output) { - - - $GLOBALS['is_count'] = false; - $GLOBALS['is_maint'] = false; - $GLOBALS['is_analyse'] = false; - $GLOBALS['is_explain'] = false; - $GLOBALS['is_show'] = true; - $GLOBALS['sql_query'] = 'SELECT * FROM `pma_bookmark` WHERE 1'; - $GLOBALS['unlim_num_rows'] = 1; + + if (!isset($GLOBALS['fields_meta'])) { + $fields_meta = array(); + $fields_meta[0] = new stdClass(); + $fields_meta[0]->table = 'company'; + } else { + $fields_meta = $GLOBALS['fields_meta']; + } + + $this->object->setProperties( + 1, $fields_meta, false, null, null, + false, null, null, null, null, null, + false, false, true, null, null, null + ); + + $this->object->__set('_sql_query', 'SELECT * FROM `pma_bookmark` WHERE 1'); $this->assertEquals( $this->_callPrivateFunction( @@ -223,12 +242,20 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase */ public function testSetDisplayModeCase3($the_disp_mode, $the_total, $output) { - - $GLOBALS['is_count'] = false; - $GLOBALS['is_maint'] = false; - $GLOBALS['is_analyse'] = false; - $GLOBALS['is_explain'] = false; - $GLOBALS['printview'] = '1'; + + if (!isset($GLOBALS['fields_meta'])) { + $fields_meta = array(); + $fields_meta[0] = new stdClass(); + $fields_meta[0]->table = 'company'; + } else { + $fields_meta = $GLOBALS['fields_meta']; + } + + $this->object->setProperties( + 1, $fields_meta, false, null, null, + false, null, null, null, null, null, + false, false, null, null, '1', null + ); $this->assertEquals( $this->_callPrivateFunction( @@ -282,18 +309,14 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase public function testisSelect() { - $GLOBALS['is_count'] = false; - $GLOBALS['is_export'] = false; - $GLOBALS['is_func'] = false; - $GLOBALS['is_analyse'] = false; - $GLOBALS['analyzed_sql'][0]['select_expr'] = array(); - $GLOBALS['analyzed_sql'][0]['queryflags']['select_from'] = 'pma'; - $GLOBALS['analyzed_sql'][0]['table_ref'] = array('table_ref'); + $analyzed_sql[0]['select_expr'] = array(); + $analyzed_sql[0]['queryflags']['select_from'] = 'pma'; + $analyzed_sql[0]['table_ref'] = array('table_ref'); $this->assertTrue( $this->_callPrivateFunction( '_isSelect', - array() + array($analyzed_sql) ) ); } @@ -345,13 +368,14 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $id_for_direction_dropdown the id for the direction dropdown + * @param boolean $is_innodb the table type is innoDb or not * @param string $output output from the _getTableNavigation * method * * @dataProvider providerForTestGetTableNavigation */ public function testGetTableNavigation( - $pos_next, $pos_prev, $id_for_direction_dropdown, $output + $pos_next, $pos_prev, $id_for_direction_dropdown, $is_innodb, $output ) { $_SESSION['tmp_user_values']['max_rows'] = '20'; @@ -368,7 +392,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase str_word_count( $this->_callPrivateFunction( '_getTableNavigation', - array($pos_next, $pos_prev, $id_for_direction_dropdown) + array( + $pos_next, $pos_prev, $id_for_direction_dropdown, $is_innodb + ) ) ), $output @@ -385,7 +411,8 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase 21, 41, '123', - '526' + false, + '309' ) ); } @@ -427,9 +454,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase $grid_edit_class, $not_null_class, $relation_class, $hide_class, $field_type_class, $row_no, $output ) { + $GLOBALS['cfg']['BrowsePointerEnable'] = true; $GLOBALS['cfg']['BrowseMarkerEnable'] = true; - $GLOBALS['printview'] = 2; $_SESSION['tmp_user_values']['disp_direction'] = PMA_DisplayResults::DISP_DIR_VERTICAL; @@ -496,27 +523,9 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase { return array( array( - array( - 'emptypre' => 4, - 'emptyafter' => 0, - 'textbtn' => " \n \n \n", - 'desc' => array(" \n\nid\n \n", " \n\nname\n \n"), - 'edit' => array('\n
    Edit Edit\n array('\nCopy Copy\n array('\n array( - array('1\n'), - array('cv x c c\n') - ), - 'row_delete' => array(' '), - 'rowdata' => array( - array('1\n'), - array('edit not_null row_0 vpointer vmarker ">cv x c c\n') - ) - ), 'edit', ' -\nEdit Edit\n + ' ) ); @@ -525,19 +534,35 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getOperationLinksForVerticleTable - case 1 * - * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * @param string $output output of _getOperationLinksForVerticleTable * * @dataProvider dataProviderForTestGetOperationLinksForVerticleTableCase1 */ public function testGetOperationLinksForVerticleTableCase1( - $vertical_display, $operation, $output + $operation, $output ) { + + $vertical_display = array( + 'row_delete' => array(), + 'textbtn' => '\n \n \n', + 'edit' => array(), + 'copy' => array( + '\nCopy Copy\n\nCopy Copy\n array( + '\n\n array(" \n\nid\n \n", " \n\nname\n \n"), - 'edit' => array('\nEdit Edit\n array('\nCopy Copy\n array('\n array( - array('1\n'), - array('cv x c c\n') - ), - 'row_delete' => '', - 'rowdata' => array( - array('1\n'), - array('edit not_null row_0 vpointer vmarker ">cv x c c\n') - ) - ), - 'edit', + array( + 'copy', ' - - - -\nEdit Edit\n +\nCopy Copy\n\nCopy Copy\n ' ) ); @@ -584,19 +588,35 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase /** * Test for _getOperationLinksForVerticleTable - case 2 * - * @param array $vertical_display the information to display * @param string $operation edit/copy/delete * @param string $output output of _getOperationLinksForVerticleTable * * @dataProvider dataProviderForTestGetOperationLinksForVerticleTableCase2 */ public function testGetOperationLinksForVerticleTableCase2( - $vertical_display, $operation, $output + $operation, $output ) { + + $vertical_display = array( + 'row_delete' => array(), + 'textbtn' => '\n \n \n', + 'edit' => array(), + 'copy' => array( + '\nCopy Copy\n\nCopy Copy\n array( + '\n\n array(" \n\nid\n \n", " \n\nname\n \n"), - 'edit' => '', - 'copy' => array('\nCopy Copy\n array('\n array( - array('1\n'), - array('cv x c c\n') - ), - 'row_delete' => '', - 'rowdata' => array( - array('1\n'), - array('edit not_null row_0 vpointer vmarker ">cv x c c\n') - ) - ), 'delete', ' - - - -\n +\n\n\n \n \n', + 'edit' => array(), + 'copy' => array( + '\nCopy Copy\n\nCopy Copy\n array( + '\n\n\n \n \n', - 'desc' => array( - '\n\nid\n \n', - '\n\ncars_id\n \n', - '\n\ncustomer_id Ascending Descending array( - '\nEdit Edit\n\nEdit Edit\n\nEdit Edit\n\nEdit Edit\n array( - '\nCopy Copy\n\nCopy Copy\n\nCopy Copy\n\nCopy Copy\n array( - '\n\n\n\n array( - array( - '2\n', - '6\n', - '1\n' - ), - array( - '3\n', - '7\n', - '2\n' - ), - array( - '1\n', - '9\n', - '3\n' - ), - array( - '4\n', - '8\n', - '5\n' - ) - ), - 'row_delete' => array( - ' ', - ' ', - ' ', - ' ' - ), - 'rowdata' => array( - array( - '2\n', - '3\n', - '1\n', - '4\n' - ), - array( - '6\n', - '7\n', - '9\n', - '8\n' - ), - array( - '1\n', - '2\n', - '3\n', - '5\n' - ) - ) - ), '_left', - ' ' + ' ' ) ); } @@ -763,13 +702,23 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase * @dataProvider dataProviderForGetCheckBoxesForMultipleRowOperations */ public function testGetCheckBoxesForMultipleRowOperations( - $vertical_display, $dir, $output + $dir, $output ) { + + $vertical_display = array( + 'row_delete' => array( + ' ', + ' ' + ) + ); + + $this->object->__set('_vertical_display', $vertical_display); + $_SESSION['tmp_user_values']['repeat_cells'] = 0; $this->assertEquals( $this->_callPrivateFunction( '_getCheckBoxesForMultipleRowOperations', - array($vertical_display, $dir) + array($dir) ), $output ); From 91b9c630c33011834de24edf66cf27cccdd1ceca Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Sun, 15 Jul 2012 15:55:39 +0100 Subject: [PATCH 63/82] Fixed bug #3544366 - Event comments not saved --- ChangeLog | 1 + libraries/rte/rte_events.lib.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5d67bba906..ce2004c8b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - bug #3534979 [interface] Copy Database Ajax feedback vanishes long before copying is done - bug #3527531 [interface] GC-maxlifetime warning incorrectly displayed - bug #3526916 [interface] Search fails with JS error when tooltips disabled +- bug #3544366 [interface] Event comments not saved 3.5.2.0 (2012-07-07) - bug #3521416 [interface] JS error when editing index diff --git a/libraries/rte/rte_events.lib.php b/libraries/rte/rte_events.lib.php index 88109fdaa8..c8619a0000 100644 --- a/libraries/rte/rte_events.lib.php +++ b/libraries/rte/rte_events.lib.php @@ -565,6 +565,11 @@ function PMA_EVN_getQueryFromRequest() } } } + if (! empty($_REQUEST['item_comment'])) { + $query .= "COMMENT '" . $common_functions->sqlAddslashes( + $_REQUEST['item_comment'] + ) . "' "; + } $query .= 'DO '; if (! empty($_REQUEST['item_definition'])) { $query .= $_REQUEST['item_definition']; From 218549b0cb0d612a674d750bedb97b3bcdc36692 Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Sun, 15 Jul 2012 16:56:40 +0200 Subject: [PATCH 64/82] Translated using Weblate. --- po/pt_BR.po | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 133ca4ae57..6b2194ab45 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-07-11 04:43+0200\n" +"PO-Revision-Date: 2012-07-15 16:37+0200\n" "Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" @@ -6865,12 +6865,14 @@ msgstr "" #: libraries/import.lib.php:1101 msgid "View a structure's contents by clicking on its name" -msgstr "" +msgstr "Visualize o conteúdo da estrutura clicando neste nome" #: libraries/import.lib.php:1102 msgid "" "Change any of its settings by clicking the corresponding \"Options\" link" msgstr "" +"Altere qualquer uma destas configurações clicando no link \"Opções\" " +"correspondente" #: libraries/import.lib.php:1103 msgid "Edit structure by following the \"Structure\" link" @@ -6908,6 +6910,8 @@ msgid "" "The first line of the file contains the table column names (if this is " "unchecked, the first line will become part of the data)" msgstr "" +"A primeira linha do arquivo contem os nomes da colunas da tabela (se não " +"estiver checado, a primeira linha irá torna-se parte dos dados)" #: libraries/import/csv.php:40 msgid "" @@ -6915,6 +6919,9 @@ msgid "" "database, list the corresponding column names here. Column names must be " "separated by commas and not enclosed in quotations." msgstr "" +"Se os dados em cada linha do arquivo não estiverem na mesma ordem que no " +"banco de dados, liste os nomes correspondestes da colunas aqui. Os nomes das " +"colunas devem estar separados por vírgulas e não deve conter aspas." #: libraries/import/csv.php:42 #| msgid "Column names" From d5aba6710362ad1282473eb74845af8f53d9c785 Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Sun, 15 Jul 2012 16:57:14 +0200 Subject: [PATCH 65/82] Translated using Weblate. --- po/pt_BR.po | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 6a4dfa8e19..36b348f919 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-11 04:43+0200\n" +"PO-Revision-Date: 2012-07-15 16:37+0200\n" "Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" @@ -6938,12 +6938,14 @@ msgstr "" #: libraries/import.lib.php:1172 msgid "View a structure's contents by clicking on its name" -msgstr "" +msgstr "Visualize o conteúdo da estrutura clicando neste nome" #: libraries/import.lib.php:1173 msgid "" "Change any of its settings by clicking the corresponding \"Options\" link" msgstr "" +"Altere qualquer uma destas configurações clicando no link \"Opções\" " +"correspondente" #: libraries/import.lib.php:1174 msgid "Edit structure by following the \"Structure\" link" @@ -7769,6 +7771,8 @@ msgid "" "The first line of the file contains the table column names (if this is " "unchecked, the first line will become part of the data)" msgstr "" +"A primeira linha do arquivo contem os nomes da colunas da tabela (se não " +"estiver checado, a primeira linha irá torna-se parte dos dados)" #: libraries/plugins/import/ImportCsv.class.php:117 msgid "" @@ -7776,6 +7780,9 @@ msgid "" "database, list the corresponding column names here. Column names must be " "separated by commas and not enclosed in quotations." msgstr "" +"Se os dados em cada linha do arquivo não estiverem na mesma ordem que no " +"banco de dados, liste os nomes correspondestes da colunas aqui. Os nomes das " +"colunas devem estar separados por vírgulas e não deve conter aspas." #: libraries/plugins/import/ImportCsv.class.php:126 msgid "Column names: " From c3be803379be550913c54dc658a3bd5b29f263ed Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Mon, 16 Jul 2012 09:15:56 +0200 Subject: [PATCH 66/82] Translated using Weblate. --- po/pt_BR.po | 157 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 66 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 36b348f919..2b7678a573 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-15 16:37+0200\n" +"PO-Revision-Date: 2012-07-15 19:40+0200\n" "Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" @@ -3000,15 +3000,14 @@ msgid "Designer" msgstr "Designer" #: libraries/Menu.class.php:484 -#, fuzzy #| msgid "User" msgid "Users" -msgstr "Usuário" +msgstr "Usuários" #: libraries/Menu.class.php:505 server_synchronize.php:1320 #: server_synchronize.php:1327 msgid "Synchronize" -msgstr "" +msgstr "Sincronizar" #: libraries/Menu.class.php:510 server_binlog.php:73 server_status.php:619 msgid "Binary log" @@ -6876,6 +6875,9 @@ msgid "" "The engine allocates one buffer per thread, but only if the thread is " "required to write a data log." msgstr "" +"Tamanho de buffer usado quando escreve dados no log. O padrão é 256MB. A " +"engine aloca um buffer por thread, mas apenas se a thread requisitar escrita " +"de dados de log." #: libraries/engines/pbxt.lib.php:73 msgid "Data file grow size" @@ -6904,6 +6906,10 @@ msgid "" "will be deleted, otherwise they are renamed and given the next highest " "number." msgstr "" +"Este é o número de arquivos de log de transação (pbxt/system/xlog*.xt) que o " +"sistema irá manter. Se o número de logs exceder esse valor, os arquivos de " +"log antigos serão deletados, ou então eles serão renomeados e terão o " +"próximo número maior." #: libraries/engines/pbxt.lib.php:133 #, php-format @@ -6949,7 +6955,7 @@ msgstr "" #: libraries/import.lib.php:1174 msgid "Edit structure by following the \"Structure\" link" -msgstr "" +msgstr "Edite a estrutura clicando em \"Estrutura\"" #: libraries/import.lib.php:1178 #, php-format @@ -7061,7 +7067,7 @@ msgstr "Nenhuma" #. l10n: This is currently used only in Japanese locales #: libraries/kanji-encoding.lib.php:153 msgid "Convert to Kana" -msgstr "" +msgstr "Converter para Kana" #: libraries/mult_submits.inc.php:279 msgid "From" @@ -7069,7 +7075,7 @@ msgstr "Do" #: libraries/mult_submits.inc.php:282 msgid "To" -msgstr "" +msgstr "Para" #: libraries/mult_submits.inc.php:287 libraries/mult_submits.inc.php:300 #: libraries/sql_query_form.lib.php:423 @@ -7078,7 +7084,7 @@ msgstr "Submeter" #: libraries/mult_submits.inc.php:292 msgid "Add table prefix" -msgstr "" +msgstr "Adicionar prefixo de tabela" #: libraries/mult_submits.inc.php:295 msgid "Add prefix" @@ -7294,7 +7300,7 @@ msgstr "Documentação do phpMyAdmin" #: libraries/navigation_header.inc.php:94 #: libraries/navigation_header.inc.php:95 msgid "Reload navigation frame" -msgstr "" +msgstr "Recarregar frame de navegação" #: libraries/plugin_interface.lib.php:350 msgid "This format has no options" @@ -7444,6 +7450,7 @@ msgstr "Substituir NULL com:" #: libraries/plugins/export/ExportExcel.class.php:52 msgid "Remove carriage return/line feed characters within columns" msgstr "" +"Remover retorno do carro/caractere de alimentação de linha dentro de colunas" #: libraries/plugins/export/ExportExcel.class.php:67 msgid "Excel edition:" @@ -7620,6 +7627,8 @@ msgid "" "Include a timestamp of when databases were created, last updated, and last " "checked" msgstr "" +"Incluir data e hora quando bancos de dados forem criados, atualizados pela " +"última vez e checados pela última vez." #: libraries/plugins/export/ExportSql.class.php:224 msgid "" @@ -7755,7 +7764,7 @@ msgstr "XML" #: libraries/plugins/export/ExportXml.class.php:93 msgid "Object creation options (all are recommended)" -msgstr "" +msgstr "Opções de criação de objeto (todas são recomendadas)" #: libraries/plugins/export/ExportXml.class.php:121 msgid "Views" @@ -7802,6 +7811,8 @@ msgid "" "Invalid column (%s) specified! Ensure that columns names are spelled " "correctly, separated by commas, and not enclosed in quotes." msgstr "" +"Coluna inválida (%s) especificada. Assegure-se que o nome desta coluna está " +"escrito corretamente, separado por vírgulas e entre aspas." #: libraries/plugins/import/ImportCsv.class.php:319 #: libraries/plugins/import/ImportCsv.class.php:594 @@ -7841,11 +7852,11 @@ msgstr "Formato inválido na linha %d da entrada CSV." #: libraries/plugins/import/ImportOds.class.php:73 msgid "Import percentages as proper decimals (ex. 12.00% to .12)" -msgstr "" +msgstr "Importar percentuais com decimais adequados (ex. 12.00% to .12)" #: libraries/plugins/import/ImportOds.class.php:78 msgid "Import currencies (ex. $5.00 to 5.00)" -msgstr "" +msgstr "Importar moedas (ex. R$5.00 para 5.00)" #: libraries/plugins/import/ImportOds.class.php:151 #: libraries/plugins/import/ImportXml.class.php:126 @@ -7854,26 +7865,30 @@ msgid "" "The XML file specified was either malformed or incomplete. Please correct " "the issue and try again." msgstr "" +"O arquivo XML especificado está mal formado ou incompleto. Favor corrigir o " +"problema e tentar novamente." #: libraries/plugins/import/ImportShp.class.php:49 msgid "ESRI Shape File" -msgstr "" +msgstr "Arquivo em formato ESRI" #: libraries/plugins/import/ImportShp.class.php:149 #, php-format msgid "There was an error importing the ESRI shape file: \"%s\"." -msgstr "" +msgstr "Ocorreu um erro ao importar o arquivo do tipo ESRI: \"%s\"." #: libraries/plugins/import/ImportShp.class.php:202 msgid "" "You tried to import an invalid file or the imported file contains invalid " "data" msgstr "" +"Você tentou importar um arquivo inválido ou o arquivo importado contém dados " +"inválidos" #: libraries/plugins/import/ImportShp.class.php:208 #, php-format msgid "MySQL Spatial Extension does not support ESRI type \"%s\"." -msgstr "" +msgstr "Extensão Espacial MySQL não suporta o tipo ESRI \"%s\"." #: libraries/plugins/import/ImportShp.class.php:256 msgid "The imported file does not contain any data" @@ -7885,7 +7900,7 @@ msgstr "Modo de compatibilidade SQL:" #: libraries/plugins/import/ImportSql.class.php:68 msgid "Do not use AUTO_INCREMENT for zero values" -msgstr "" +msgstr "Não use AUTO_INCREMENT para valores zerados" #: libraries/plugins/import/PMA_ShapeRecord.class.php:58 #, php-format @@ -8106,34 +8121,40 @@ msgstr "Tabelas persistentes recentemente usadas" #: libraries/relation.lib.php:227 msgid "Persistent tables' UI preferences" -msgstr "" +msgstr "Persistir tabelas de preferência de UI" #: libraries/relation.lib.php:249 msgid "User preferences" -msgstr "" +msgstr "Preferências do usuário" #: libraries/relation.lib.php:255 msgid "Quick steps to setup advanced features:" -msgstr "" +msgstr "Passos rápidos para a instalação de recursos avançados:" #: libraries/relation.lib.php:259 msgid "" "Create the needed tables with the examples/create_tables.sql." msgstr "" +"Criar tabelas necessárias com o examples/create_tables.sql." #: libraries/relation.lib.php:265 msgid "Create a pma user and give access to these tables." -msgstr "" +msgstr "Criar um usuário pma e dar acesso a essas tabelas." #: libraries/relation.lib.php:270 msgid "" "Enable advanced features in configuration file (config.inc.php), for example by starting from config.sample.inc.php." msgstr "" +"Ativar recursos avançados no arquivo de configuração " +"(config.inc.php), por exemplo iniciando em " +"config.sample.inc.php." #: libraries/relation.lib.php:278 msgid "Re-login to phpMyAdmin to load the updated configuration file." msgstr "" +"Logar novamente no phpMyAdmin para carregar o arquivo de configuração " +"atualizado." #: libraries/relation.lib.php:1393 msgid "no description" @@ -8145,17 +8166,20 @@ msgstr "Desmarcar todos" #: libraries/replication_gui.lib.php:54 msgid "Slave configuration" -msgstr "" +msgstr "Configuração do escravo" #: libraries/replication_gui.lib.php:54 server_replication.php:385 msgid "Change or reconfigure master server" -msgstr "" +msgstr "Alterar ou reconfigurar o servidor mestre" #: libraries/replication_gui.lib.php:55 msgid "" "Make sure, you have unique server-id in your configuration file (my.cnf). If " "not, please add the following line into [mysqld] section:" msgstr "" +"Certifique-se de que você tem um ID de servidor único no seu arquivo de " +"configuração (my.cfn). Senão, favor adicionar a seguinte linha dentro da " +"seção [mysqld]:" #: libraries/replication_gui.lib.php:58 libraries/replication_gui.lib.php:59 #: libraries/replication_gui.lib.php:265 libraries/replication_gui.lib.php:268 @@ -8191,10 +8215,12 @@ msgid "" "Only slaves started with the --report-host=host_name option are visible in " "this list." msgstr "" +"Apenas os escravos iniciados com a opção --report-host=host_name estão " +"visíveis nesta lista." #: libraries/replication_gui.lib.php:256 server_replication.php:224 msgid "Add slave replication user" -msgstr "" +msgstr "Adicionar escravo de replicação de usuário" #: libraries/replication_gui.lib.php:270 server_privileges.php:909 msgid "Any user" @@ -8228,6 +8254,8 @@ msgid "" "When Host table is used, this field is ignored and values stored in Host " "table are used instead." msgstr "" +"Quanto a tabela Host é usada, este campo é ignorado e os valores armazenados " +"na tabela Host são usados no lugar." #: libraries/replication_gui.lib.php:378 msgid "Generate Password" @@ -8323,49 +8351,49 @@ msgstr "Após a conclusão manter" #: libraries/rte/rte_events.lib.php:483 libraries/rte/rte_routines.lib.php:993 #: libraries/rte/rte_triggers.lib.php:368 msgid "Definer" -msgstr "" +msgstr "Definidor" #: libraries/rte/rte_events.lib.php:528 #: libraries/rte/rte_routines.lib.php:1059 #: libraries/rte/rte_triggers.lib.php:407 msgid "The definer must be in the \"username@hostname\" format" -msgstr "" +msgstr "O definidor deve estar no formato \"username@hostname\"" #: libraries/rte/rte_events.lib.php:535 msgid "You must provide an event name" -msgstr "" +msgstr "Você deve informar o nome do evento" #: libraries/rte/rte_events.lib.php:547 msgid "You must provide a valid interval value for the event." -msgstr "" +msgstr "Você deve informar um valor de intervalo válido para o evento." #: libraries/rte/rte_events.lib.php:559 msgid "You must provide a valid execution time for the event." -msgstr "" +msgstr "Você deve informar um tempo de execução válido para o evento." #: libraries/rte/rte_events.lib.php:563 msgid "You must provide a valid type for the event." -msgstr "" +msgstr "Você deve informar um tipo válido para o evento." #: libraries/rte/rte_events.lib.php:582 msgid "You must provide an event definition." -msgstr "" +msgstr "Você deve informar uma definição do evento." #: libraries/rte/rte_footer.lib.php:31 server_privileges.php:2598 msgid "New" -msgstr "" +msgstr "Novo" #: libraries/rte/rte_footer.lib.php:93 msgid "OFF" -msgstr "" +msgstr "Desligado" #: libraries/rte/rte_footer.lib.php:98 msgid "ON" -msgstr "" +msgstr "Ligado" #: libraries/rte/rte_footer.lib.php:110 msgid "Event scheduler status" -msgstr "" +msgstr "Status do agendador de eventos" #: libraries/rte/rte_list.lib.php:55 msgid "Returns" @@ -8418,7 +8446,7 @@ msgstr "Nome das rotinas" #: libraries/rte/rte_routines.lib.php:913 msgid "Parameters" -msgstr "" +msgstr "Parâmetros" #: libraries/rte/rte_routines.lib.php:918 msgid "Direction" @@ -8450,7 +8478,7 @@ msgstr "Opções de retorno" #: libraries/rte/rte_routines.lib.php:989 msgid "Is deterministic" -msgstr "" +msgstr "É determinístico" #: libraries/rte/rte_routines.lib.php:998 msgid "Security type" @@ -8458,16 +8486,16 @@ msgstr "Tipo de segurança" #: libraries/rte/rte_routines.lib.php:1005 msgid "SQL data access" -msgstr "" +msgstr "Acesso de dados SQL" #: libraries/rte/rte_routines.lib.php:1075 msgid "You must provide a routine name" -msgstr "" +msgstr "Você deve informar o nome da rotina" #: libraries/rte/rte_routines.lib.php:1101 #, php-format msgid "Invalid direction \"%s\" given for parameter." -msgstr "" +msgstr "Direção inválida \"%s\" dada para o parâmetro." #: libraries/rte/rte_routines.lib.php:1115 #: libraries/rte/rte_routines.lib.php:1157 @@ -8475,18 +8503,20 @@ msgid "" "You must provide length/values for routine parameters of type ENUM, SET, " "VARCHAR and VARBINARY." msgstr "" +"Você deve informar tamanhos/comprimentos para os parâmetros de rotina do " +"tipo ENUM, SET, VARCHAR and VARBINARY." #: libraries/rte/rte_routines.lib.php:1133 msgid "You must provide a name and a type for each routine parameter." -msgstr "" +msgstr "Você deve informar um nome e um tipo para cada parâmetro de rotina." #: libraries/rte/rte_routines.lib.php:1145 msgid "You must provide a valid return type for the routine." -msgstr "" +msgstr "Você deve informar um tipo de retorno válido para a rotina." #: libraries/rte/rte_routines.lib.php:1191 msgid "You must provide a routine definition." -msgstr "" +msgstr "Você deve informar uma definição da rotina." #: libraries/rte/rte_routines.lib.php:1286 #, php-format @@ -8539,15 +8569,15 @@ msgstr "Tempo" #: libraries/rte/rte_triggers.lib.php:414 msgid "You must provide a trigger name" -msgstr "" +msgstr "Você deve informar o nome da trigger" #: libraries/rte/rte_triggers.lib.php:419 msgid "You must provide a valid timing for the trigger" -msgstr "" +msgstr "Você deve informar um tempo válido para a trigger" #: libraries/rte/rte_triggers.lib.php:424 msgid "You must provide a valid event for the trigger" -msgstr "" +msgstr "Você deve informar um evento válido para a trigger" #: libraries/rte/rte_triggers.lib.php:430 msgid "You must provide a valid table name" @@ -8555,7 +8585,7 @@ msgstr "Você precisa colocar um nome de tabela válido" #: libraries/rte/rte_triggers.lib.php:436 msgid "You must provide a trigger definition." -msgstr "" +msgstr "Você deve informar uma definição para a trigger." #: libraries/rte/rte_words.lib.php:22 msgid "Add routine" @@ -8627,10 +8657,10 @@ msgid "You do not have the necessary privileges to create an event" msgstr "Você não tem permissões suficientes para criar um novo evento" #: libraries/rte/rte_words.lib.php:51 -#, fuzzy, php-format +#, php-format #| msgid "No tables found in database" msgid "No event with name %1$s found in database %2$s" -msgstr "Nenhuma tabela encontrada no banco de dados" +msgstr "Nenhum evento com o nome %1$s foi encontrado no banco de dados %2$s" #: libraries/rte/rte_words.lib.php:52 msgid "There are no events to display." @@ -8666,11 +8696,11 @@ msgstr "Esquema do Banco de Dados \"%s\" - Página %s" #: libraries/schema/Export_Relation_Schema.class.php:206 msgid "This page does not contain any tables!" -msgstr "" +msgstr "Esta página não contem todas tabelas!" #: libraries/schema/Export_Relation_Schema.class.php:232 msgid "SCHEMA ERROR: " -msgstr "" +msgstr "ERRO DE ESQUEMA:" #: libraries/schema/Pdf_Relation_Schema.class.php:940 #: libraries/schema/Pdf_Relation_Schema.class.php:1261 @@ -8702,10 +8732,9 @@ msgid "Page name" msgstr "Numero da página" #: libraries/schema/User_Schema.class.php:158 -#, fuzzy #| msgid "Automatic layout" msgid "Automatic layout based on" -msgstr "Leiaute automático" +msgstr "Leiaute automático baseado em" #: libraries/schema/User_Schema.class.php:161 msgid "Internal relations" @@ -8713,31 +8742,29 @@ msgstr "Relações internas" #: libraries/schema/User_Schema.class.php:171 msgid "FOREIGN KEY" -msgstr "" +msgstr "CHAVE ESTRANGEIRA" #: libraries/schema/User_Schema.class.php:206 msgid "Please choose a page to edit" msgstr "Escolha a página para editar" #: libraries/schema/User_Schema.class.php:211 -#, fuzzy #| msgid "Select Tables" msgid "Select page" -msgstr "Tabelas selecionadas" +msgstr "Selecionar página" #: libraries/schema/User_Schema.class.php:279 msgid "Select Tables" msgstr "Tabelas selecionadas" #: libraries/schema/User_Schema.class.php:417 -#, fuzzy #| msgid "Relational schema" msgid "Display relational schema" -msgstr "Esquema relacional" +msgstr "Mostrar esquema relacional" #: libraries/schema/User_Schema.class.php:427 msgid "Select Export Relational Type" -msgstr "" +msgstr "Selecione o Tipo de Exportação Relacional" #: libraries/schema/User_Schema.class.php:448 msgid "Show grid" @@ -8757,7 +8784,7 @@ msgstr "Mostrar todas as tabelas com o mesmo tamanho" #: libraries/schema/User_Schema.class.php:460 msgid "Only show keys" -msgstr "" +msgstr "Mostrar apenas chaves" #: libraries/schema/User_Schema.class.php:462 msgid "Landscape" @@ -8768,10 +8795,9 @@ msgid "Portrait" msgstr "Retrato" #: libraries/schema/User_Schema.class.php:465 -#, fuzzy #| msgid "Creation" msgid "Orientation" -msgstr "Criação" +msgstr "Orientação" #: libraries/schema/User_Schema.class.php:478 msgid "Paper size" @@ -8801,10 +8827,9 @@ msgid "Unknown language: %1$s." msgstr "Linguagem desconhecida: %1$s." #: libraries/select_server.lib.php:37 libraries/select_server.lib.php:42 -#, fuzzy #| msgid "Server" msgid "Current Server" -msgstr "Servidor" +msgstr "Servidor Atual" #: libraries/server_synchronize.lib.php:1546 server_synchronize.php:1353 #, fuzzy @@ -8814,16 +8839,16 @@ msgstr "Procurar no Banco de Dados" #: libraries/server_synchronize.lib.php:1549 #: libraries/server_synchronize.lib.php:1559 msgid "Current server" -msgstr "" +msgstr "Servidor atual" #: libraries/server_synchronize.lib.php:1551 #: libraries/server_synchronize.lib.php:1561 msgid "Remote server" -msgstr "" +msgstr "Servidor remoto" #: libraries/server_synchronize.lib.php:1555 msgid "Difference" -msgstr "" +msgstr "Diferença" #: libraries/server_synchronize.lib.php:1556 server_synchronize.php:1355 #, fuzzy From d9798a70b561136d1eafb4cfa574843159f39ef4 Mon Sep 17 00:00:00 2001 From: Anderson Diego Kulpa Fachini Date: Mon, 16 Jul 2012 09:42:38 +0200 Subject: [PATCH 67/82] Translated using Weblate. --- po/pt_BR.po | 157 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 66 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 6b2194ab45..29dd991bde 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.2-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-06-04 13:42+0200\n" -"PO-Revision-Date: 2012-07-15 16:37+0200\n" +"PO-Revision-Date: 2012-07-15 19:40+0200\n" "Last-Translator: Anderson Diego Kulpa Fachini \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" @@ -6486,6 +6486,9 @@ msgid "" "The engine allocates one buffer per thread, but only if the thread is " "required to write a data log." msgstr "" +"Tamanho de buffer usado quando escreve dados no log. O padrão é 256MB. A " +"engine aloca um buffer por thread, mas apenas se a thread requisitar escrita " +"de dados de log." #: libraries/engines/pbxt.lib.php:67 msgid "Data file grow size" @@ -6514,6 +6517,10 @@ msgid "" "will be deleted, otherwise they are renamed and given the next highest " "number." msgstr "" +"Este é o número de arquivos de log de transação (pbxt/system/xlog*.xt) que o " +"sistema irá manter. Se o número de logs exceder esse valor, os arquivos de " +"log antigos serão deletados, ou então eles serão renomeados e terão o " +"próximo número maior." #: libraries/engines/pbxt.lib.php:125 #, php-format @@ -6558,6 +6565,7 @@ msgstr "Substituir NULL com:" #: libraries/export/csv.php:29 libraries/export/excel.php:24 msgid "Remove carriage return/line feed characters within columns" msgstr "" +"Remover retorno do carro/caractere de alimentação de linha dentro de colunas" #: libraries/export/excel.php:33 msgid "Excel edition:" @@ -6685,6 +6693,8 @@ msgid "" "Include a timestamp of when databases were created, last updated, and last " "checked" msgstr "" +"Incluir data e hora quando bancos de dados forem criados, atualizados pela " +"última vez e checados pela última vez." #: libraries/export/sql.php:100 msgid "" @@ -6821,7 +6831,7 @@ msgstr "XML" #: libraries/export/xml.php:34 msgid "Object creation options (all are recommended)" -msgstr "" +msgstr "Opções de criação de objeto (todas são recomendadas)" #: libraries/export/xml.php:62 #| msgid "View" @@ -6876,7 +6886,7 @@ msgstr "" #: libraries/import.lib.php:1103 msgid "Edit structure by following the \"Structure\" link" -msgstr "" +msgstr "Edite a estrutura clicando em \"Estrutura\"" #: libraries/import.lib.php:1106 #, php-format @@ -6940,6 +6950,8 @@ msgid "" "Invalid column (%s) specified! Ensure that columns names are spelled " "correctly, separated by commas, and not enclosed in quotes." msgstr "" +"Coluna inválida (%s) especificada. Assegure-se que o nome desta coluna está " +"escrito corretamente, separado por vírgulas e entre aspas." #: libraries/import/csv.php:191 libraries/import/csv.php:451 #, php-format @@ -6972,11 +6984,11 @@ msgstr "Esse plugin não suporta importações comprimidas!" #: libraries/import/ods.php:35 msgid "Import percentages as proper decimals (ex. 12.00% to .12)" -msgstr "" +msgstr "Importar percentuais com decimais adequados (ex. 12.00% to .12)" #: libraries/import/ods.php:36 msgid "Import currencies (ex. $5.00 to 5.00)" -msgstr "" +msgstr "Importar moedas (ex. R$5.00 para 5.00)" #: libraries/import/ods.php:88 libraries/import/xml.php:83 #: libraries/import/xml.php:139 @@ -6984,26 +6996,30 @@ msgid "" "The XML file specified was either malformed or incomplete. Please correct " "the issue and try again." msgstr "" +"O arquivo XML especificado está mal formado ou incompleto. Favor corrigir o " +"problema e tentar novamente." #: libraries/import/shp.php:19 msgid "ESRI Shape File" -msgstr "" +msgstr "Arquivo em formato ESRI" #: libraries/import/shp.php:280 #, php-format msgid "There was an error importing the ESRI shape file: \"%s\"." -msgstr "" +msgstr "Ocorreu um erro ao importar o arquivo do tipo ESRI: \"%s\"." #: libraries/import/shp.php:336 msgid "" "You tried to import an invalid file or the imported file contains invalid " "data" msgstr "" +"Você tentou importar um arquivo inválido ou o arquivo importado contém dados " +"inválidos" #: libraries/import/shp.php:338 #, php-format msgid "MySQL Spatial Extension does not support ESRI type \"%s\"." -msgstr "" +msgstr "Extensão Espacial MySQL não suporta o tipo ESRI \"%s\"." #: libraries/import/shp.php:376 #| msgid "File %s does not contain any key id" @@ -7016,7 +7032,7 @@ msgstr "Modo de compatibilidade SQL:" #: libraries/import/sql.php:43 msgid "Do not use AUTO_INCREMENT for zero values" -msgstr "" +msgstr "Não use AUTO_INCREMENT para valores zerados" #: libraries/kanji-encoding.lib.php:147 #| msgid "None" @@ -7027,7 +7043,7 @@ msgstr "Nenhuma" #. l10n: This is currently used only in Japanese locales #: libraries/kanji-encoding.lib.php:153 msgid "Convert to Kana" -msgstr "" +msgstr "Converter para Kana" #: libraries/mult_submits.inc.php:254 #| msgid "Fri" @@ -7036,7 +7052,7 @@ msgstr "Do" #: libraries/mult_submits.inc.php:257 msgid "To" -msgstr "" +msgstr "Para" #: libraries/mult_submits.inc.php:262 libraries/mult_submits.inc.php:275 #: libraries/sql_query_form.lib.php:403 @@ -7045,7 +7061,7 @@ msgstr "Submeter" #: libraries/mult_submits.inc.php:267 msgid "Add table prefix" -msgstr "" +msgstr "Adicionar prefixo de tabela" #: libraries/mult_submits.inc.php:270 #| msgid "Add index" @@ -7259,7 +7275,7 @@ msgstr "Sair" #: libraries/navigation_header.inc.php:117 #: libraries/navigation_header.inc.php:119 msgid "Reload navigation frame" -msgstr "" +msgstr "Recarregar frame de navegação" #: libraries/plugin_interface.lib.php:309 #| msgid "This format has no options" @@ -7317,34 +7333,40 @@ msgstr "Tabelas persistentes recentemente usadas" #: libraries/relation.lib.php:140 msgid "Persistent tables' UI preferences" -msgstr "" +msgstr "Persistir tabelas de preferência de UI" #: libraries/relation.lib.php:148 msgid "User preferences" -msgstr "" +msgstr "Preferências do usuário" #: libraries/relation.lib.php:152 msgid "Quick steps to setup advanced features:" -msgstr "" +msgstr "Passos rápidos para a instalação de recursos avançados:" #: libraries/relation.lib.php:154 msgid "" "Create the needed tables with the examples/create_tables.sql." msgstr "" +"Criar tabelas necessárias com o examples/create_tables.sql." #: libraries/relation.lib.php:155 msgid "Create a pma user and give access to these tables." -msgstr "" +msgstr "Criar um usuário pma e dar acesso a essas tabelas." #: libraries/relation.lib.php:156 msgid "" "Enable advanced features in configuration file (config.inc.php), for example by starting from config.sample.inc.php." msgstr "" +"Ativar recursos avançados no arquivo de configuração " +"(config.inc.php), por exemplo iniciando em " +"config.sample.inc.php." #: libraries/relation.lib.php:157 msgid "Re-login to phpMyAdmin to load the updated configuration file." msgstr "" +"Logar novamente no phpMyAdmin para carregar o arquivo de configuração " +"atualizado." #: libraries/relation.lib.php:1130 msgid "no description" @@ -7352,17 +7374,20 @@ msgstr "sem Descrição" #: libraries/replication_gui.lib.php:54 msgid "Slave configuration" -msgstr "" +msgstr "Configuração do escravo" #: libraries/replication_gui.lib.php:54 server_replication.php:353 msgid "Change or reconfigure master server" -msgstr "" +msgstr "Alterar ou reconfigurar o servidor mestre" #: libraries/replication_gui.lib.php:55 msgid "" "Make sure, you have unique server-id in your configuration file (my.cnf). If " "not, please add the following line into [mysqld] section:" msgstr "" +"Certifique-se de que você tem um ID de servidor único no seu arquivo de " +"configuração (my.cfn). Senão, favor adicionar a seguinte linha dentro da " +"seção [mysqld]:" #: libraries/replication_gui.lib.php:58 libraries/replication_gui.lib.php:59 #: libraries/replication_gui.lib.php:255 libraries/replication_gui.lib.php:258 @@ -7402,10 +7427,12 @@ msgid "" "Only slaves started with the --report-host=host_name option are visible in " "this list." msgstr "" +"Apenas os escravos iniciados com a opção --report-host=host_name estão " +"visíveis nesta lista." #: libraries/replication_gui.lib.php:246 server_replication.php:192 msgid "Add slave replication user" -msgstr "" +msgstr "Adicionar escravo de replicação de usuário" #: libraries/replication_gui.lib.php:260 server_privileges.php:799 msgid "Any user" @@ -7439,6 +7466,8 @@ msgid "" "When Host table is used, this field is ignored and values stored in Host " "table are used instead." msgstr "" +"Quanto a tabela Host é usada, este campo é ignorado e os valores armazenados " +"na tabela Host são usados no lugar." #: libraries/replication_gui.lib.php:366 msgid "Generate Password" @@ -7550,48 +7579,48 @@ msgstr "Após a conclusão manter" #: libraries/rte/rte_events.lib.php:475 libraries/rte/rte_routines.lib.php:933 #: libraries/rte/rte_triggers.lib.php:360 msgid "Definer" -msgstr "" +msgstr "Definidor" #: libraries/rte/rte_events.lib.php:518 libraries/rte/rte_routines.lib.php:997 #: libraries/rte/rte_triggers.lib.php:398 msgid "The definer must be in the \"username@hostname\" format" -msgstr "" +msgstr "O definidor deve estar no formato \"username@hostname\"" #: libraries/rte/rte_events.lib.php:525 msgid "You must provide an event name" -msgstr "" +msgstr "Você deve informar o nome do evento" #: libraries/rte/rte_events.lib.php:537 msgid "You must provide a valid interval value for the event." -msgstr "" +msgstr "Você deve informar um valor de intervalo válido para o evento." #: libraries/rte/rte_events.lib.php:549 msgid "You must provide a valid execution time for the event." -msgstr "" +msgstr "Você deve informar um tempo de execução válido para o evento." #: libraries/rte/rte_events.lib.php:553 msgid "You must provide a valid type for the event." -msgstr "" +msgstr "Você deve informar um tipo válido para o evento." #: libraries/rte/rte_events.lib.php:572 msgid "You must provide an event definition." -msgstr "" +msgstr "Você deve informar uma definição do evento." #: libraries/rte/rte_footer.lib.php:29 server_privileges.php:2411 msgid "New" -msgstr "" +msgstr "Novo" #: libraries/rte/rte_footer.lib.php:91 msgid "OFF" -msgstr "" +msgstr "Desligado" #: libraries/rte/rte_footer.lib.php:96 msgid "ON" -msgstr "" +msgstr "Ligado" #: libraries/rte/rte_footer.lib.php:108 msgid "Event scheduler status" -msgstr "" +msgstr "Status do agendador de eventos" #: libraries/rte/rte_list.lib.php:54 #| msgid "Return type" @@ -7644,7 +7673,7 @@ msgstr "Nome das rotinas" #: libraries/rte/rte_routines.lib.php:854 msgid "Parameters" -msgstr "" +msgstr "Parâmetros" #: libraries/rte/rte_routines.lib.php:859 #| msgid "Direct links" @@ -7681,7 +7710,7 @@ msgstr "Opções de retorno" #: libraries/rte/rte_routines.lib.php:929 msgid "Is deterministic" -msgstr "" +msgstr "É determinístico" #: libraries/rte/rte_routines.lib.php:938 #| msgid "Security" @@ -7690,16 +7719,16 @@ msgstr "Tipo de segurança" #: libraries/rte/rte_routines.lib.php:945 msgid "SQL data access" -msgstr "" +msgstr "Acesso de dados SQL" #: libraries/rte/rte_routines.lib.php:1010 msgid "You must provide a routine name" -msgstr "" +msgstr "Você deve informar o nome da rotina" #: libraries/rte/rte_routines.lib.php:1036 #, php-format msgid "Invalid direction \"%s\" given for parameter." -msgstr "" +msgstr "Direção inválida \"%s\" dada para o parâmetro." #: libraries/rte/rte_routines.lib.php:1048 #: libraries/rte/rte_routines.lib.php:1086 @@ -7707,18 +7736,20 @@ msgid "" "You must provide length/values for routine parameters of type ENUM, SET, " "VARCHAR and VARBINARY." msgstr "" +"Você deve informar tamanhos/comprimentos para os parâmetros de rotina do " +"tipo ENUM, SET, VARCHAR and VARBINARY." #: libraries/rte/rte_routines.lib.php:1066 msgid "You must provide a name and a type for each routine parameter." -msgstr "" +msgstr "Você deve informar um nome e um tipo para cada parâmetro de rotina." #: libraries/rte/rte_routines.lib.php:1076 msgid "You must provide a valid return type for the routine." -msgstr "" +msgstr "Você deve informar um tipo de retorno válido para a rotina." #: libraries/rte/rte_routines.lib.php:1120 msgid "You must provide a routine definition." -msgstr "" +msgstr "Você deve informar uma definição da rotina." #: libraries/rte/rte_routines.lib.php:1210 #, php-format @@ -7783,15 +7814,15 @@ msgstr "Tempo" #: libraries/rte/rte_triggers.lib.php:405 msgid "You must provide a trigger name" -msgstr "" +msgstr "Você deve informar o nome da trigger" #: libraries/rte/rte_triggers.lib.php:410 msgid "You must provide a valid timing for the trigger" -msgstr "" +msgstr "Você deve informar um tempo válido para a trigger" #: libraries/rte/rte_triggers.lib.php:415 msgid "You must provide a valid event for the trigger" -msgstr "" +msgstr "Você deve informar um evento válido para a trigger" #: libraries/rte/rte_triggers.lib.php:421 #| msgid "Invalid table name" @@ -7800,7 +7831,7 @@ msgstr "Você precisa colocar um nome de tabela válido" #: libraries/rte/rte_triggers.lib.php:427 msgid "You must provide a trigger definition." -msgstr "" +msgstr "Você deve informar uma definição para a trigger." #: libraries/rte/rte_words.lib.php:18 #| msgid "Add index" @@ -7883,10 +7914,10 @@ msgid "You do not have the necessary privileges to create an event" msgstr "Você não tem permissões suficientes para criar um novo evento" #: libraries/rte/rte_words.lib.php:47 -#, fuzzy, php-format +#, php-format #| msgid "No tables found in database" msgid "No event with name %1$s found in database %2$s" -msgstr "Nenhuma tabela encontrada no banco de dados" +msgstr "Nenhum evento com o nome %1$s foi encontrado no banco de dados %2$s" #: libraries/rte/rte_words.lib.php:48 msgid "There are no events to display." @@ -7922,11 +7953,11 @@ msgstr "Esquema do Banco de Dados \"%s\" - Página %s" #: libraries/schema/Export_Relation_Schema.class.php:200 msgid "This page does not contain any tables!" -msgstr "" +msgstr "Esta página não contem todas tabelas!" #: libraries/schema/Export_Relation_Schema.class.php:228 msgid "SCHEMA ERROR: " -msgstr "" +msgstr "ERRO DE ESQUEMA:" #: libraries/schema/Pdf_Relation_Schema.class.php:858 #: libraries/schema/Pdf_Relation_Schema.class.php:1171 @@ -7958,10 +7989,9 @@ msgid "Page name" msgstr "Numero da página" #: libraries/schema/User_Schema.class.php:126 -#, fuzzy #| msgid "Automatic layout" msgid "Automatic layout based on" -msgstr "Leiaute automático" +msgstr "Leiaute automático baseado em" #: libraries/schema/User_Schema.class.php:129 msgid "Internal relations" @@ -7969,31 +7999,29 @@ msgstr "Relações internas" #: libraries/schema/User_Schema.class.php:139 msgid "FOREIGN KEY" -msgstr "" +msgstr "CHAVE ESTRANGEIRA" #: libraries/schema/User_Schema.class.php:173 msgid "Please choose a page to edit" msgstr "Escolha a página para editar" #: libraries/schema/User_Schema.class.php:178 -#, fuzzy #| msgid "Select Tables" msgid "Select page" -msgstr "Tabelas selecionadas" +msgstr "Selecionar página" #: libraries/schema/User_Schema.class.php:244 msgid "Select Tables" msgstr "Tabelas selecionadas" #: libraries/schema/User_Schema.class.php:382 -#, fuzzy #| msgid "Relational schema" msgid "Display relational schema" -msgstr "Esquema relacional" +msgstr "Mostrar esquema relacional" #: libraries/schema/User_Schema.class.php:392 msgid "Select Export Relational Type" -msgstr "" +msgstr "Selecione o Tipo de Exportação Relacional" #: libraries/schema/User_Schema.class.php:413 msgid "Show grid" @@ -8013,7 +8041,7 @@ msgstr "Mostrar todas as tabelas com o mesmo tamanho" #: libraries/schema/User_Schema.class.php:425 msgid "Only show keys" -msgstr "" +msgstr "Mostrar apenas chaves" #: libraries/schema/User_Schema.class.php:427 msgid "Landscape" @@ -8024,10 +8052,9 @@ msgid "Portrait" msgstr "Retrato" #: libraries/schema/User_Schema.class.php:430 -#, fuzzy #| msgid "Creation" msgid "Orientation" -msgstr "Criação" +msgstr "Orientação" #: libraries/schema/User_Schema.class.php:443 msgid "Paper size" @@ -8057,21 +8084,19 @@ msgid "Unknown language: %1$s." msgstr "Linguagem desconhecida: %1$s." #: libraries/select_server.lib.php:32 libraries/select_server.lib.php:37 -#, fuzzy #| msgid "Server" msgid "Current Server" -msgstr "Servidor" +msgstr "Servidor Atual" #: libraries/server_links.inc.php:60 -#, fuzzy #| msgid "User" msgid "Users" -msgstr "Usuário" +msgstr "Usuários" #: libraries/server_links.inc.php:79 server_synchronize.php:1154 #: server_synchronize.php:1162 msgid "Synchronize" -msgstr "" +msgstr "Sincronizar" #: libraries/server_links.inc.php:84 server_binlog.php:77 #: server_status.php:595 @@ -8104,16 +8129,16 @@ msgstr "Procurar no Banco de Dados" #: libraries/server_synchronize.lib.php:1303 #: libraries/server_synchronize.lib.php:1311 msgid "Current server" -msgstr "" +msgstr "Servidor atual" #: libraries/server_synchronize.lib.php:1305 #: libraries/server_synchronize.lib.php:1313 msgid "Remote server" -msgstr "" +msgstr "Servidor remoto" #: libraries/server_synchronize.lib.php:1308 msgid "Difference" -msgstr "" +msgstr "Diferença" #: libraries/server_synchronize.lib.php:1309 server_synchronize.php:1188 #, fuzzy From 354e6b9986f766663afa8905d4c6ebfce16c9d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Jul 2012 14:17:30 +0200 Subject: [PATCH 68/82] Fix order of parameters --- test/libraries/PMA_SQL_parser_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/libraries/PMA_SQL_parser_test.php b/test/libraries/PMA_SQL_parser_test.php index 845701760b..f6b161aa76 100644 --- a/test/libraries/PMA_SQL_parser_test.php +++ b/test/libraries/PMA_SQL_parser_test.php @@ -16,8 +16,8 @@ class PMA_SQL_parser_test extends PHPUnit_Framework_TestCase private function assertParser($sql, $expected, $error = '') { $parsed_sql = PMA_SQP_parse($sql); - $this->assertEquals(PMA_SQP_getErrorString(), $error); - $this->assertEquals($parsed_sql, $expected); + $this->assertEquals($error, PMA_SQP_getErrorString()); + $this->assertEquals($expected, $parsed_sql); } public function testParse_1() From 203e516b912413909a32389c425dd864a8d52602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Jul 2012 14:18:10 +0200 Subject: [PATCH 69/82] Reset SQL parser before trying to test it --- test/libraries/PMA_SQL_parser_test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/libraries/PMA_SQL_parser_test.php b/test/libraries/PMA_SQL_parser_test.php index f6b161aa76..d2f49959e3 100644 --- a/test/libraries/PMA_SQL_parser_test.php +++ b/test/libraries/PMA_SQL_parser_test.php @@ -15,6 +15,7 @@ class PMA_SQL_parser_test extends PHPUnit_Framework_TestCase { private function assertParser($sql, $expected, $error = '') { + PMA_SQP_resetError(); $parsed_sql = PMA_SQP_parse($sql); $this->assertEquals($error, PMA_SQP_getErrorString()); $this->assertEquals($expected, $parsed_sql); From 6f2e982610bbbdd6c728d0250afe71624496d641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Jul 2012 14:35:04 +0200 Subject: [PATCH 70/82] Proper escaping in error message --- libraries/Advisor.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Advisor.class.php b/libraries/Advisor.class.php index c12b749e0d..befe8b7a8c 100644 --- a/libraries/Advisor.class.php +++ b/libraries/Advisor.class.php @@ -324,7 +324,7 @@ class Advisor // Error handling if ($err) { throw new Exception( - strip_tags($err) . '
    Executed code: $value = ' . $expr . ';' + strip_tags($err) . '
    Executed code: $value = ' . htmlspecialchars($expr) . ';' ); } return $value; From 2325b9a3df3fa6c5bc99e22368e6520a979c6694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Jul 2012 14:38:10 +0200 Subject: [PATCH 71/82] Little bit of coding standard --- libraries/Advisor.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Advisor.class.php b/libraries/Advisor.class.php index befe8b7a8c..f4efd8622a 100644 --- a/libraries/Advisor.class.php +++ b/libraries/Advisor.class.php @@ -317,7 +317,7 @@ class Advisor // Actually evaluate the code ob_start(); - eval('$value = '.$expr.';'); + eval('$value = ' . $expr . ';'); $err = ob_get_contents(); ob_end_clean(); From 6e0ce2ff08f28a341ec94e72c1c7ee745c643e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 09:52:44 +0200 Subject: [PATCH 72/82] Use regexp to match as the timestamp will change --- test/classes/PMA_Scripts_test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/classes/PMA_Scripts_test.php b/test/classes/PMA_Scripts_test.php index ef26ed54e3..8ab2adf77b 100644 --- a/test/classes/PMA_Scripts_test.php +++ b/test/classes/PMA_Scripts_test.php @@ -111,12 +111,12 @@ class PMA_Scripts_test extends PHPUnit_Framework_TestCase $this->object->addFile('common.js'); $this->object->addEvent('onClick', 'doSomething'); - $this->assertEquals( - $this->object->getDisplay(), - ' -' + $this->assertRegExp( + '@ +@', + $this->object->getDisplay() ); } From 581a557701bff962f63b5298381ca7e13065c7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 09:56:28 +0200 Subject: [PATCH 73/82] Expected and real were wrongly ordered --- test/classes/PMA_Theme_Manager_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index d9c7bfbec1..e9d9862648 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -89,8 +89,8 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase public function testGetPrintPreviews(){ $tm = new PMA_Theme_Manager(); $this->assertEquals( - $tm->getPrintPreviews(), - '

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ' + '

    Original (2.9)

    Original
    [ take it ]

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ', + $tm->getPrintPreviews() ); } From b9c7e2347face53438bbe550623790d0184133fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 09:58:20 +0200 Subject: [PATCH 74/82] collation_connection can be set before in testsuite --- test/classes/PMA_Theme_Manager_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index e9d9862648..5261fd9b75 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -28,6 +28,7 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase $GLOBALS['server'] = 99; $_SESSION[' PMA_token '] = 'token'; $GLOBALS['PMA_Config'] = new PMA_Config(); + $GLOBALS['collation_connection'] = 'utf8_general_ci'; } public function testCookieName() @@ -89,7 +90,7 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase public function testGetPrintPreviews(){ $tm = new PMA_Theme_Manager(); $this->assertEquals( - '

    Original (2.9)

    Original
    [ take it ]

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ', + '

    Original (2.9)

    Original
    [ take it ]

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ', $tm->getPrintPreviews() ); } From b04f1c079ff8e10b0503b3cca5f2c680f73c1e52 Mon Sep 17 00:00:00 2001 From: Bruno Rafael Date: Tue, 17 Jul 2012 09:58:54 +0200 Subject: [PATCH 75/82] Translated using Weblate. --- po/pt_BR.po | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index 2b7678a573..92c744f385 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 4.0.0-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-07-03 09:19+0200\n" -"PO-Revision-Date: 2012-07-15 19:40+0200\n" -"Last-Translator: Anderson Diego Kulpa Fachini \n" +"PO-Revision-Date: 2012-07-16 22:05+0200\n" +"Last-Translator: Bruno Rafael \n" "Language-Team: brazilian_portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -7710,22 +7710,30 @@ msgstr "" "tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)" #: libraries/plugins/export/ExportSql.class.php:457 +#, fuzzy msgid "" "neither of the above
          Example: INSERT INTO " "tbl_name VALUES (1,2,3)" msgstr "" +"Nenhuma das opções acima
          Exemplo: INSERT " +"INTO tbl_name VALUES (1,2,3)" #: libraries/plugins/export/ExportSql.class.php:478 msgid "" "Dump binary columns in hexadecimal notation (for example, \"abc\" becomes " "0x616263)" msgstr "" +"Esvaziar colunas binárias em notação hexadecimal (por exemplo, \"abc\" " +"seria 0x616263)" #: libraries/plugins/export/ExportSql.class.php:490 msgid "" "Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns to be dumped and " "reloaded between servers in different time zones)" msgstr "" +"Esvaziar colunas TIMESTAMP em UTC (habilitar colunas de TIMESTAMP para " +"serem esvaziadas e recarregadas entre servidores em zonas horárias " +"diferentes)" #: libraries/plugins/export/ExportSql.class.php:544 #: libraries/plugins/export/ExportXml.class.php:104 From b8b4213169bd72c6d4390ab3f5fd2ba0c1568b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 11:15:28 +0200 Subject: [PATCH 76/82] This might be set, reset it for test --- test/classes/PMA_Message_test.php | 1 + 1 file changed, 1 insertion(+) diff --git a/test/classes/PMA_Message_test.php b/test/classes/PMA_Message_test.php index 19db79edfd..444b45f574 100644 --- a/test/classes/PMA_Message_test.php +++ b/test/classes/PMA_Message_test.php @@ -329,6 +329,7 @@ class PMA_Message_test extends PHPUnit_Framework_TestCase $GLOBALS['lang'] = 'en'; $_SESSION[' PMA_token '] = 'token'; unset($GLOBALS['server']); + unset($GLOBALS['collation_connection']); $this->assertEquals($expected, PMA_Message::decodeBB($actual)); } From 4169171c6f61732d9ee288f8987f79b273cd8988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 11:18:44 +0200 Subject: [PATCH 77/82] Remove not needed code from test --- test/libraries/PMA_STR_sub_test.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/test/libraries/PMA_STR_sub_test.php b/test/libraries/PMA_STR_sub_test.php index 73639d0250..3bf3a8c807 100644 --- a/test/libraries/PMA_STR_sub_test.php +++ b/test/libraries/PMA_STR_sub_test.php @@ -6,33 +6,6 @@ * @package PhpMyAdmin-test */ -$match = array(); -preg_match( - '@^([0-9]{1,2})(?:.([0-9]{1,2})(?:.([0-9]{1,2}))?)?@', - phpversion(), - $match -); -if (isset($match) && ! empty($match[1])) { - if (! isset($match[2])) { - $match[2] = 0; - } - if (! isset($match[3])) { - $match[3] = 0; - } - /** - * @ignore - */ - define( - 'PMA_PHP_INT_VERSION', - (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]) - ); -} else { - /** - * @ignore - */ - define('PMA_PHP_INT_VERSION', 0); -} - require_once 'libraries/string.lib.php'; class PMA_STR_sub_test extends PHPUnit_Framework_TestCase From 6a42194e2f3cecd5f3c2d918fc1d657b6c4cb86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 12:02:37 +0200 Subject: [PATCH 78/82] Fix expected/result order --- test/classes/PMA_Error_test.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/classes/PMA_Error_test.php b/test/classes/PMA_Error_test.php index 0965b90546..0cbb642743 100644 --- a/test/classes/PMA_Error_test.php +++ b/test/classes/PMA_Error_test.php @@ -49,7 +49,7 @@ class PMA_Error_test extends PHPUnit_Framework_TestCase */ public function testSetBacktrace(){ $this->object->setBacktrace(array('bt1','bt2')); - $this->assertEquals($this->object->getBacktrace(),array('bt1','bt2')); + $this->assertEquals(array('bt1','bt2'), $this->object->getBacktrace()); } /** @@ -57,7 +57,7 @@ class PMA_Error_test extends PHPUnit_Framework_TestCase */ public function testSetLine(){ $this->object->setLine(15); - $this->assertEquals($this->object->getLine(),15); + $this->assertEquals(15, $this->object->getLine()); } /** @@ -65,7 +65,7 @@ class PMA_Error_test extends PHPUnit_Framework_TestCase */ public function testSetFile(){ $this->object->setFile('/var/www/pma.txt'); - $this->assertEquals($this->object->getFile(),'./../../..'); + $this->assertEquals('./../../..', $this->object->getFile()); } /** @@ -93,13 +93,13 @@ class PMA_Error_test extends PHPUnit_Framework_TestCase * Test for getHtmlTitle */ public function testGetHtmlTitle(){ - $this->assertEquals($this->object->getHtmlTitle(),'Warning: Compile Error'); + $this->assertEquals('Warning: Compile Error', $this->object->getHtmlTitle()); } /** * Test for getTitle */ public function testGetTitle(){ - $this->assertEquals($this->object->getTitle(),'Warning: Compile Error'); + $this->assertEquals('Warning: Compile Error', $this->object->getTitle()); } } From 57728549b29328381ccc06928cb02785578d4dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 12:05:13 +0200 Subject: [PATCH 79/82] Hopefully fix testcase --- test/classes/PMA_Error_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/classes/PMA_Error_test.php b/test/classes/PMA_Error_test.php index 0cbb642743..e1c0569253 100644 --- a/test/classes/PMA_Error_test.php +++ b/test/classes/PMA_Error_test.php @@ -64,8 +64,8 @@ class PMA_Error_test extends PHPUnit_Framework_TestCase * Test for setFile */ public function testSetFile(){ - $this->object->setFile('/var/www/pma.txt'); - $this->assertEquals('./../../..', $this->object->getFile()); + $this->object->setFile('./pma.txt'); + $this->assertEquals('./../../../../..', $this->object->getFile()); } /** From cafe04eb21e4ca71c676c95cfcdb58c627503ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 12:06:42 +0200 Subject: [PATCH 80/82] Language might be defined as well --- test/classes/PMA_Theme_Manager_test.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index 5261fd9b75..f76d49e9aa 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -26,6 +26,7 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['ThemeDefault'] = 'pmahomme'; $GLOBALS['cfg']['ServerDefault'] = 0; $GLOBALS['server'] = 99; + $GLOBALS['lang'] = 'en'; $_SESSION[' PMA_token '] = 'token'; $GLOBALS['PMA_Config'] = new PMA_Config(); $GLOBALS['collation_connection'] = 'utf8_general_ci'; @@ -90,7 +91,7 @@ class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase public function testGetPrintPreviews(){ $tm = new PMA_Theme_Manager(); $this->assertEquals( - '

    Original (2.9)

    Original
    [ take it ]

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ', + '

    Original (2.9)

    Original
    [ take it ]

    pmahomme (1.1)

    pmahomme
    [ take it ]

    ', $tm->getPrintPreviews() ); } From b1fc9ce8bd40b592d8285df286f4ee5d6459ef49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 12:07:13 +0200 Subject: [PATCH 81/82] Fix expected/result order --- test/classes/PMA_Types_MySQL_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/classes/PMA_Types_MySQL_test.php b/test/classes/PMA_Types_MySQL_test.php index 281598e53a..f322b87cdd 100644 --- a/test/classes/PMA_Types_MySQL_test.php +++ b/test/classes/PMA_Types_MySQL_test.php @@ -267,8 +267,8 @@ class PMA_Types_MySQL_test extends PHPUnit_Framework_TestCase } $this->assertEquals( - $this->object->getFunctionsClass($class), - $output + $output, + $this->object->getFunctionsClass($class) ); } From 169bdc8692672c4dd84cd7f37adf1c6e7ed0de68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 17 Jul 2012 12:10:17 +0200 Subject: [PATCH 82/82] Do not cache sprites while running testsuite (we test for different themes) --- libraries/CommonFunctions.class.php | 54 ++++++++++++++++------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/libraries/CommonFunctions.class.php b/libraries/CommonFunctions.class.php index 439a49710e..5d30549d9f 100644 --- a/libraries/CommonFunctions.class.php +++ b/libraries/CommonFunctions.class.php @@ -9,12 +9,12 @@ /** * Misc functions used all over the scripts. - * + * * @package PhpMyAdmin */ class PMA_CommonFunctions { - + /** * PMA_CommonFunctions instance * @@ -23,8 +23,8 @@ class PMA_CommonFunctions * @var object */ private static $_instance; - - + + /** * Creates a new class instance * @@ -33,8 +33,8 @@ class PMA_CommonFunctions private function __construct() { } - - + + /** * Returns the singleton PMA_CommonFunctions object * @@ -47,7 +47,7 @@ class PMA_CommonFunctions } return self::$_instance; } - + /** * Detects which function to use for pow. @@ -168,6 +168,10 @@ class PMA_CommonFunctions public function getImage($image, $alternate = '', $attributes = array()) { static $sprites; // cached list of available sprites (if any) + if (defined(TESTSUITE)) { + // prevent caching in testsuite + unset($sprites); + } $url = ''; $is_sprite = false; @@ -1306,10 +1310,10 @@ class PMA_CommonFunctions $php_link = ' [' . $this->linkOrButton($php_link, $_message) . ']'; if (isset($GLOBALS['show_as_php'])) { - + $runquery_link = 'import.php' . PMA_generate_common_url($url_params); - + $php_link .= ' [' . $this->linkOrButton($runquery_link, __('Submit Query')) . ']'; @@ -2172,7 +2176,7 @@ class PMA_CommonFunctions * would have to check if the error message file is always available * * @param array $params The names of the parameters needed by the calling script - * @param bool $request Whether to include this list in checking for + * @param bool $request Whether to include this list in checking for * special params * * @return void @@ -2348,19 +2352,19 @@ class PMA_CommonFunctions } else { $con_val = '= \'' . $this->sqlAddSlashes($row[$i], false, true) . '\''; - } + } } if ($con_val != null) { $condition .= $con_val . ' AND'; - if ($meta->primary_key > 0) { + if ($meta->primary_key > 0) { $primary_key .= $condition; - $primary_key_array[$con_key] = $con_val; - } elseif ($meta->unique_key > 0) { + $primary_key_array[$con_key] = $con_val; + } elseif ($meta->unique_key > 0) { $unique_key .= $condition; - $unique_key_array[$con_key] = $con_val; + $unique_key_array[$con_key] = $con_val; } $nonprimary_condition .= $condition; @@ -2373,18 +2377,18 @@ class PMA_CommonFunctions // but use conjunction of all values if no primary key $clause_is_unique = true; - if ($primary_key) { + if ($primary_key) { $preferred_condition = $primary_key; $condition_array = $primary_key_array; - } elseif ($unique_key) { + } elseif ($unique_key) { $preferred_condition = $unique_key; $condition_array = $unique_key_array; - } elseif (! $force_unique) { + } elseif (! $force_unique) { $preferred_condition = $nonprimary_condition; $condition_array = $nonprimary_condition_array; - $clause_is_unique = false; + $clause_is_unique = false; } $where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition)); @@ -2636,7 +2640,7 @@ class PMA_CommonFunctions . PMA_generate_common_url($_url_params) . '" target="' . $frame . '">' . $caption1 . ''; - $_url_params['pos'] = $pos - $max_count; + $_url_params['pos'] = $pos - $max_count; $list_navigator_html .= '' . $caption2 . ''; @@ -2758,8 +2762,8 @@ class PMA_CommonFunctions */ public function getExternalBug( $functionality, $component, $minimum_version, $bugref - ) { - $ext_but_html = ''; + ) { + $ext_but_html = ''; if (($component == 'mysql') && (PMA_MYSQL_INT_VERSION < $minimum_version)) { $ext_but_html .= $this->showHint( sprintf( @@ -2768,7 +2772,7 @@ class PMA_CommonFunctions PMA_linkURL('http://bugs.mysql.com/') . $bugref ) ); - } + } return $ext_but_html; } @@ -3447,7 +3451,7 @@ class PMA_CommonFunctions /* Optional escaping */ if (! is_null($escape)) { - foreach ($replace as $key => $val) { + foreach ($replace as $key => $val) { $replace[$key] = ($escape == 'backquote') ? $this->$escape($val) : $escape($val); @@ -4199,7 +4203,7 @@ class PMA_CommonFunctions return $values; } - + } ?>