diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index ded41daa72..cfab6d420c 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -41,12 +41,12 @@ require_once './libraries/Index.class.php'; * @return array an array with explicit indexes for all the display * elements * - * @global string the database name - * @global string the table name - * @global integer the total number of rows returned by the SQL query + * @global string the database name + * @global string the table name + * @global integer the total number of rows returned by the SQL query * without any programmatically appended "LIMIT" clause - * @global array the properties of the fields returned by the query - * @global string the URL to return to in case of error in a SQL + * @global array the properties of the fields returned by the query + * @global string the URL to return to in case of error in a SQL * statement * * @access private @@ -55,7 +55,7 @@ require_once './libraries/Index.class.php'; */ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) { - + global $db, $table; global $unlim_num_rows, $fields_meta; global $err_url; @@ -102,7 +102,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) $do_display['text_btn'] = (string) '0'; } $do_display['pview_lnk'] = (string) '1'; - + } elseif ($GLOBALS['is_show']) { // 2.2 Statement is a "SHOW..." /** @@ -198,7 +198,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) $the_disp_mode = join('', $do_display); return $do_display; - + } // end of the 'PMA_setDisplayMode()' function @@ -245,7 +245,7 @@ function PMA_isSelect() function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '' ) { - + global $db, $table, $goto; $caption_output = ''; @@ -253,15 +253,15 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption_output .= $caption; } - + // for false or 'both' if (($GLOBALS['cfg']['NavigationBarIconic'] === false) || ($GLOBALS['cfg']['NavigationBarIconic'] === 'both') ) { $caption_output .= ' ' . $title; } - $title_output = ' title="' . $title . '"'; - + $title_output = ' title="' . $title . '"'; + return '' . '
' . PMA_generate_common_hidden_inputs($db, $table) @@ -274,7 +274,7 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, . 'value="' . $caption_output . '" ' . $title_output . $onclick . ' />' . '
' . ''; - + } // end function PMA_getTableNavigationButton() @@ -288,15 +288,15 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, * * @return string html content * - * @global string $db the database name - * @global string $table the table name - * @global string $goto the URL to go back in case of errors - * @global integer $num_rows the total number of rows returned by the + * @global string $db the database name + * @global string $table the table name + * @global string $goto the URL to go back in case of errors + * @global integer $num_rows the total number of rows returned by the * SQL query - * @global integer $unlim_num_rows the total number of rows returned by the + * @global integer $unlim_num_rows the total number of rows returned by the * SQL any programmatically appended "LIMIT" clause - * @global boolean $is_innodb whether its InnoDB or not - * @global array $showtable table definitions + * @global boolean $is_innodb whether its InnoDB or not + * @global array $showtable table definitions * * @access private * @@ -305,12 +305,12 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_direction_dropdown ) { - + global $db, $table, $goto; global $num_rows, $unlim_num_rows; global $is_innodb; global $showtable; - + $table_navigation_html = ''; // here, using htmlentities() would cause problems if the query @@ -327,15 +327,15 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, $table_navigation_html .= '' . '' . ''; - + // Move to the beginning or to the previous page if ($_SESSION['tmp_user_values']['pos'] && ($_SESSION['tmp_user_values']['max_rows'] != 'all') ) { - + $table_navigation_html .= PMA_getMoveBackwardButtonsForTableNavigation( - $html_sql_query, $pos_prev - ); + $html_sql_query, $pos_prev + ); } // end move back @@ -343,41 +343,41 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, //page redirection // (unless we are showing all records) if ($_SESSION['tmp_user_values']['max_rows'] != 'all') { //if1 - + $pageNow = @floor( - $_SESSION['tmp_user_values']['pos'] - / $_SESSION['tmp_user_values']['max_rows'] - ) + 1; - + $_SESSION['tmp_user_values']['pos'] + / $_SESSION['tmp_user_values']['max_rows'] + ) + 1; + $nbTotalPage = @ceil( - $unlim_num_rows - / $_SESSION['tmp_user_values']['max_rows'] - ); + $unlim_num_rows + / $_SESSION['tmp_user_values']['max_rows'] + ); if ($nbTotalPage > 1) { //if2 - - $table_navigation_html .= ''; - } //_if2 + . ''; + } //_if2 } //_if1 // Display the "Show all" button if allowed @@ -385,11 +385,11 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, && ($GLOBALS['cfg']['ShowAll'] || ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows)) ) { - + $table_navigation_html .= PMA_getShowAllButtonForTableNavigation( - $db, $table, $html_sql_query, $goto - ); - + $db, $table, $html_sql_query, $goto + ); + } // end show all // Move to the next page or to the last one @@ -398,11 +398,11 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, && ($num_rows >= $_SESSION['tmp_user_values']['max_rows']) && ($_SESSION['tmp_user_values']['max_rows'] != 'all') ) { - - $table_navigation_html .= PMA_getMoveFarwardButtonsForTableNavigation( - $html_sql_query, $pos_next, $is_innodb, - $unlim_num_rows, $num_rows - ); + + $table_navigation_html .= PMA_getMoveForwardButtonsForTableNavigation( + $html_sql_query, $pos_next, $is_innodb, + $unlim_num_rows, $num_rows + ); } // end move toward @@ -410,7 +410,7 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, if ($nbTotalPage > 1) { $table_navigation_html .= ''; } - + $table_navigation_html .= '' . '' . '' . ''; - + return $table_navigation_html; } // end of the 'PMA_getTableNavigation()' function @@ -467,40 +467,40 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query, /** * Prepare move backward buttons - previous and first - * - * @param string $html_sql_query the sql encoded by html special characters - * @param integer $pos_prev the offset for the "previous" page - * + * + * @param string $html_sql_query the sql encoded by html special characters + * @param integer $pos_prev the offset for the "previous" page + * * @return string html content - * + * * @see PMA_getTableNavigation() */ function PMA_getMoveBackwardButtonsForTableNavigation($html_sql_query, $pos_prev) -{ +{ return PMA_getTableNavigationButton( - '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query - ) - . PMA_getTableNavigationButton( - '<', _pgettext('Previous page', 'Previous'), $pos_prev, - $html_sql_query - ); + '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query + ) + . PMA_getTableNavigationButton( + '<', _pgettext('Previous page', 'Previous'), $pos_prev, + $html_sql_query + ); } /** * Prepare Show All button for table navigation - * - * @param string $db the database name - * @param string $table the table name - * @param string $html_sql_query the sql encoded by html special characters - * @param string $goto the URL to go back in case of errors - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $html_sql_query the sql encoded by html special characters + * @param string $goto the URL to go back in case of errors + * * @return string html content - * + * * @see PMA_getTableNavigation() */ function PMA_getShowAllButtonForTableNavigation($db, $table, $html_sql_query, $goto) -{ +{ return "\n" . '' . '
' @@ -511,34 +511,34 @@ function PMA_getShowAllButtonForTableNavigation($db, $table, $html_sql_query, $g . '' . '' . '
' - . ''; + . ''; } /** * Prepare move farward buttons - next and last - * - * @param string $html_sql_query the sql encoded by html special characters - * @param integer $pos_prev the offset for the "previous" 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 - * + * + * @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 - * + * * @see PMA_getTableNavigation() */ -function PMA_getMoveFarwardButtonsForTableNavigation( +function PMA_getMoveForwardButtonsForTableNavigation( $html_sql_query, $pos_next, $is_innodb, $unlim_num_rows, $num_rows ) { - + // display the Next button $buttons_html = PMA_getTableNavigationButton( - '>', - _pgettext('Next page', 'Next'), - $pos_next, - $html_sql_query - ); + '>', + _pgettext('Next page', 'Next'), + $pos_next, + $html_sql_query + ); // prepare some options for the End button if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) { @@ -559,39 +559,39 @@ function PMA_getMoveFarwardButtonsForTableNavigation( // display the End button $buttons_html .= PMA_getTableNavigationButton( - '>>', - _pgettext('Last page', 'End'), - @((ceil($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 - ); - + '>>', + _pgettext('Last page', 'End'), + @((ceil($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 + ); + return $buttons_html; - + } /** * Prepare feilds followed by Show button for table navigation * Start row, Number of rows, Headers every - * - * @param string $html_sql_query the sql encoded by html special characters - * @param string $goto the URL to go back in case of errors - * @param integer $pos_next the offset for the "next" page - * @param integer $unlim_num_rows the total number of rows returned by the - * @param string $id_for_direction_dropdown the id for the direction dropdown - * + * + * @param string $html_sql_query the sql encoded by html special characters + * @param string $goto the URL to go back in case of errors + * @param integer $pos_next the offset for the "next" page + * @param integer $unlim_num_rows the total number of rows returned by the + * @param string $id_for_direction_dropdown the id for the direction dropdown + * * @return string $additional_fields_html html content - * + * * @see PMA_getTableNavigation() */ function PMA_getAdditionalFieldsForTableNavigation( $html_sql_query, $goto, $pos_next, $unlim_num_rows, $id_for_direction_dropdown ) { - + $additional_fields_html = ''; - + $additional_fields_html .= '' . '' @@ -608,7 +608,7 @@ function PMA_getAdditionalFieldsForTableNavigation( ? $_SESSION['tmp_user_values']['max_rows'] : $GLOBALS['cfg']['MaxRows']) . '" class="textfield" onfocus="this.select()" />'; - + if ($GLOBALS['cfg']['ShowDisplayDirection']) { // Display mode (horizontal/vertical and repeat headers) $additional_fields_html .= __('Mode') . ': ' . "\n"; @@ -617,12 +617,12 @@ function PMA_getAdditionalFieldsForTableNavigation( 'horizontalflipped' => __('horizontal (rotated headers)'), 'vertical' => __('vertical') ); - + $additional_fields_html .= PMA_getDropdown( - 'disp_direction', $choices, - $_SESSION['tmp_user_values']['disp_direction'], - $id_for_direction_dropdown - ); + 'disp_direction', $choices, + $_SESSION['tmp_user_values']['disp_direction'], + $id_for_direction_dropdown + ); unset($choices); } @@ -632,9 +632,9 @@ function PMA_getAdditionalFieldsForTableNavigation( . '" class="textfield" /> ' . __('rows') . "\n"; - + return $additional_fields_html; - + } @@ -652,13 +652,13 @@ function PMA_getAdditionalFieldsForTableNavigation( * * @return string html content * - * @global string $db the database name - * @global string $table the table name - * @global string $goto the URL to go back in case of errors - * @global string $sql_query the SQL query - * @global integer $num_rows the total number of rows returned by the + * @global string $db the database name + * @global string $table the table name + * @global string $goto the URL to go back in case of errors + * @global string $sql_query the SQL query + * @global integer $num_rows the total number of rows returned by the * SQL query - * @global array $vertical_display informations used with vertical display + * @global array $vertical_display informations used with vertical display * mode * * @access private @@ -688,7 +688,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, if ($analyzed_sql == '') { $analyzed_sql = array(); } - + $directionCondition = ($direction == 'horizontal') || ($direction == 'horizontalflipped'); @@ -720,9 +720,9 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, // do we have any index? if ($indexes) { $table_headers_html .= PMA_getSortByKeyDropDown( - $db, $table, $indexes, $sort_expression, - $unsorted_sql_query - ); + $db, $table, $indexes, $sort_expression, + $unsorted_sql_query + ); } } } @@ -733,10 +733,10 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, . '
' . PMA_generate_common_hidden_inputs($db, $table) . '
'; - + // Output data needed for column reordering and show/hide column - if (PMA_isSelect()) { - $table_headers_html .= PMA_getDataForResettingColumnOrder(); + if (PMA_isSelect()) { + $table_headers_html .= PMA_getDataForResettingColumnOrder(); } $vertical_display['emptypre'] = 0; @@ -745,30 +745,30 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, // Display options (if we are not in print view) if (! (isset($GLOBALS['printview']) && ($GLOBALS['printview'] == '1'))) { - + $table_headers_html .= PMA_getOptionsBlock($db, $table, $sql_query, $goto); - + // prepare full/partial text button or link $full_or_partial_text_link = PMA_getFullOrPartialTextButtonOrLink( - $db, $table, $sql_query, $goto - ); + $db, $table, $sql_query, $goto + ); } // Start of form for multi-rows edit/delete/export $table_headers_html .= PMA_getFormForMultiRowOperations( - $db, $table, $is_display['del_lnk'] - ); - + $db, $table, $is_display['del_lnk'] + ); + // 1. Displays the full/partial text button (part 1)... if ($directionCondition) { - + $table_headers_html .= '' . "\n"; - + $colspan = (($is_display['edit_lnk'] != 'nn') && ($is_display['del_lnk'] != 'nn')) ? ' colspan="4"' : ''; - + } else { $rowspan = (($is_display['edit_lnk'] != 'nn') && ($is_display['del_lnk'] != 'nn')) @@ -780,24 +780,24 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, if ((($is_display['edit_lnk'] == 'nn') && ($is_display['del_lnk'] == 'nn')) && ($is_display['text_btn'] == '1') ) { - + $vertical_display['emptypre'] = (($is_display['edit_lnk'] != 'nn') && ($is_display['del_lnk'] != 'nn')) ? 4 : 0; - + if ($directionCondition) { - + $table_headers_html .= '' . '' . ''; - + // end horizontal/horizontalflipped mode } else { - - $table_headers_html .= '' - . '' - . ''; - + + $span = $num_rows + 1 + floor( + $num_rows / $_SESSION['tmp_user_values']['repeat_cells'] + ); + $table_headers_html .= ''; + } // end vertical mode } elseif ((($GLOBALS['cfg']['RowActionLinks'] == 'left') @@ -809,15 +809,15 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $vertical_display['emptypre'] = (($is_display['edit_lnk'] != 'nn') && ($is_display['del_lnk'] != 'nn')) ? 4 : 0; - + if ($directionCondition) { - + $table_headers_html .= '' - . $full_or_partial_text_link . ''; + . $full_or_partial_text_link . ''; // end horizontal/horizontalflipped mode - + } else { - + $vertical_display['textbtn'] = ' ' . "\n" . ' ' . "\n" @@ -832,11 +832,11 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $vertical_display['emptypre'] = (($is_display['edit_lnk'] != 'nn') && ($is_display['del_lnk'] != 'nn')) ? 4 : 0; - + if ($directionCondition) { - + $table_headers_html .= ''; - + // end horizontal/horizontalfipped mode } else { $vertical_display['textbtn'] = ' ' . "\n"; @@ -900,22 +900,22 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, } list($col_order, $col_visib) = PMA_getColumnParams(); - + for ($j = 0; $j < $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($highlight_columns[$fields_meta[$i]->name]) || isset($highlight_columns[PMA_backquote($fields_meta[$i]->name)])) ? true : false; - + // 2.0 Prepare comment-HTML-wrappers for each row, if defined/enabled. $comments = PMA_getCommentForRow($comments_map, $fields_meta[$i]); - + // 2.1 Results can be sorted if ($is_display['sort_lnk'] == '1') { @@ -924,7 +924,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, // 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)) ? PMA_backquote($fields_meta[$i]->table) . '.' @@ -942,17 +942,17 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $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 = PMA_isInSorted( - $sort_expression, $sort_expression_nodirection, - $sort_tbl, $name_to_use_in_sort - ); - + $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`)' @@ -968,20 +968,20 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, unset($is_orgname); // 2.1.4 Do define the sorting URL - + list($sort_order, $order_img) = PMA_getSortingUrlParams( - $is_in_sort, $sort_direction, $fields_meta[$i], - $sort_order, $i - ); - + $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) - ) { + . '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' => $db, 'table' => $table, @@ -991,18 +991,18 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $order_url = 'sql.php' . PMA_generate_common_url($_url_params); // 2.1.5 Displays the sorting URL - // enable sort order swapping for image + // enable sort order swapping for image $order_link = PMA_getSortOrderLink( - $order_img, $i, $direction, $fields_meta[$i], $order_url - ); + $order_img, $i, $direction, $fields_meta[$i], $order_url + ); - if ($directionCondition) { + if ($directionCondition) { $table_headers_html .= PMA_getDraggableClassForSortableColumns( - $col_visib, $col_visib[$j], $condition_field, - $direction, $fields_meta[$i], $order_link, $comments - ); + $col_visib, $col_visib[$j], $condition_field, + $direction, $fields_meta[$i], $order_link, $comments + ); } - + $vertical_display['desc'][] = ' ' . $full_or_partial_text_link . ''; - + // end horizontal/horizontalflipped mode } else { $vertical_display['textbtn'] = ' '; - + // end horizontal/horizontalflipped mode } else { $vertical_display['textbtn'] = ' ' . "\n"; } // end vertical mode } - if ($directionCondition) { + if ($directionCondition) { $table_headers_html .= '' - . ''; + . ''; } - + return $table_headers_html; - + } // end of the 'PMA_getTableHeaders()' function /** * Prepare sort by key dropdown - html code segment - * - * @param string $db the database name - * @param string $table the table name - * @param array $indexes the indexes of the table for sort criteria - * @param string $sort_expression the sort expression - * @param string $unsorted_sql_query the unsorted sql query - * + * + * @param string $db the database name + * @param string $table the table name + * @param array $indexes the indexes of the table for sort criteria + * @param string $sort_expression the sort expression + * @param string $unsorted_sql_query the unsorted sql query + * * @return string $drop_down_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getSortByKeyDropDown( $db, $table, $indexes, $sort_expression, $unsorted_sql_query ) { - + $drop_down_html = ''; - + $drop_down_html .= '
' . "\n" . PMA_generate_common_hidden_inputs($db, $table) . __('Sort by key') @@ -1129,8 +1129,8 @@ function PMA_getSortByKeyDropDown( if (preg_match( '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|' . 'FOR UPDATE|LOCK IN SHARE MODE))@is', - $unsorted_sql_query, $my_reg) - ) { + $unsorted_sql_query, $my_reg + )) { $unsorted_sql_query_first_part = $my_reg[1]; $unsorted_sql_query_second_part = $my_reg[2]; } else { @@ -1168,24 +1168,24 @@ function PMA_getSortByKeyDropDown( . '' . '' . "\n" . '
' . "\n"; - + return $drop_down_html; - + } /** * Prepare data for column restoring and show/hide - * + * * @return string $data_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getDataForResettingColumnOrder() { - + $data_html = ''; - + // generate the column order, if it is set $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); @@ -1209,29 +1209,29 @@ function PMA_getDataForResettingColumnOrder() $GLOBALS['db'], $GLOBALS['table'], 'Create_time' ) . '" />'; } - + return $data_html; - + } /** * Prepare option fields block - * - * @param string $db the database name - * @param string $table the table name - * @param string $sql_query the SQL query - * @param string $goto the URL to go back in case of errors - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $sql_query the SQL query + * @param string $goto the URL to go back in case of errors + * * @return string $options_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getOptionsBlock($db, $table, $sql_query, $goto) { - + $options_html = ''; - + $options_html .= '
'; - + 'display_text', $choices, + $_SESSION['tmp_user_values']['display_text'] + ) + . ''; + if ($GLOBALS['cfgRelation']['relwork'] && $GLOBALS['cfgRelation']['displaywork'] ) { @@ -1275,10 +1275,10 @@ function PMA_getOptionsBlock($db, $table, $sql_query, $goto) ); $options_html .= PMA_getRadioFields( - 'relational_display', $choices, - $_SESSION['tmp_user_values']['relational_display'] - ) - . ''; + 'relational_display', $choices, + $_SESSION['tmp_user_values']['relational_display'] + ) + . ''; } $options_html .= '
' @@ -1295,7 +1295,7 @@ function PMA_getOptionsBlock($db, $table, $sql_query, $goto) . PMA_getCheckbox( 'display_binary_as_hex', __('Show binary contents as HEX'), ! empty($_SESSION['tmp_user_values']['display_binary_as_hex']), false - ) + ) . '
'; // I would have preferred to name this "display_transformation". @@ -1318,9 +1318,9 @@ function PMA_getOptionsBlock($db, $table, $sql_query, $goto) ); $options_html .= PMA_getRadioFields( - 'geometry_display', $choices, - $_SESSION['tmp_user_values']['geometry_display'] - ) + 'geometry_display', $choices, + $_SESSION['tmp_user_values']['geometry_display'] + ) . ''; } @@ -1332,27 +1332,27 @@ function PMA_getOptionsBlock($db, $table, $sql_query, $goto) . '' . '' . '
'; - + return $options_html; - + } /** * Get full/partial text button or link - * - * @param string $db the database name - * @param string $table the table name - * @param string $sql_query the SQL query - * @param string $goto the URL to go back in case of errors - * - * @return string html content - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $sql_query the SQL query + * @param string $goto the URL to go back in case of errors + * + * @return string html content + * * @see PMA_getTableHeaders() */ function PMA_getFullOrPartialTextButtonOrLink($db, $table, $sql_query, $goto) { - + $url_params_full_text = array( 'db' => $db, 'table' => $table, @@ -1375,37 +1375,37 @@ function PMA_getFullOrPartialTextButtonOrLink($db, $table, $sql_query, $goto) $tmp_image = ''
                  . $tmp_txt . ''; $tmp_url = 'sql.php' . PMA_generate_common_url($url_params_full_text); - + return PMA_linkOrButton($tmp_url, $tmp_image, array(), false); - + } /** * Prepare html form for multi row operations - * - * @param string $db the database name - * @param string $table the table name - * @param string $del_lnk the delete link of current row - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $del_lnk the delete link of current row + * * @return string $form_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getFormForMultiRowOperations($db, $table, $del_lnk) { - + $form_html = ''; - + if (($del_lnk == 'dr') || ($del_lnk == 'kp')) { - + $form_html .= '
' . "\n"; @@ -1416,20 +1416,20 @@ function PMA_getFormForMultiRowOperations($db, $table, $del_lnk) $form_html .= ' ajax'; } $form_html .= '">' . "\n"; - + return $form_html; - + } /** * Get comment for row - * - * @param array $comments_map comments array - * @param array $fields_meta set of field properties - * + * + * @param array $comments_map comments array + * @param array $fields_meta set of field properties + * * @return string $comment html content - * + * * @see PMA_getTableHeaders() */ function PMA_getCommentForRow($comments_map, $fields_meta) @@ -1445,27 +1445,27 @@ function PMA_getCommentForRow($comments_map, $fields_meta) ) . ''; } - return $comments; + return $comments; } /** * Check whether the column is sorted - * - * @param string $sort_expression sort expression - * @param string $sort_expression_nodirection sort expression without direction - * @param string $sort_tbl the table name - * @param string $name_to_use_in_sort the sorting column name - * + * + * @param string $sort_expression sort expression + * @param string $sort_expression_nodirection sort expression without direction + * @param string $sort_tbl the table name + * @param string $name_to_use_in_sort the sorting column name + * * @return boolean $is_in_sort the column sorted or not - * + * * @see PMA_getTableHeaders() */ function PMA_isInSorted( $sort_expression, $sort_expression_nodirection, $sort_tbl, $name_to_use_in_sort ) { - + if (empty($sort_expression)) { $is_in_sort = false; } else { @@ -1497,29 +1497,29 @@ function PMA_isInSorted( $is_in_sort = true; } } - + return $is_in_sort; - + } /** * Get sort url paramaeters - sort order and order image - * - * @param boolean $is_in_sort the column sorted or not - * @param string $sort_direction the sort direction - * @param array $fields_meta set of field properties - * @param string $sort_order the sorting order - * @param integer $column_index the index of the column - * + * + * @param boolean $is_in_sort the column sorted or not + * @param string $sort_direction the sort direction + * @param array $fields_meta set of field properties + * @param string $sort_order the sorting order + * @param integer $column_index the index of the column + * * @return array 2 element array - $sort_order, $order_img - * + * * @see PMA_getTableHeaders() */ function PMA_getSortingUrlParams( $is_in_sort, $sort_direction, $fields_meta, $sort_order, $column_index ) { - + if (! $is_in_sort) { // patch #455484 ("Smart" order) @@ -1527,9 +1527,9 @@ function PMA_getSortingUrlParams( if ($GLOBALS['cfg']['Order'] === 'SMART') { $sort_order .= (preg_match( - '@time|date@i', - $fields_meta->type - )) ? 'DESC' : 'ASC'; + '@time|date@i', + $fields_meta->type + )) ? 'DESC' : 'ASC'; } else { $sort_order .= $GLOBALS['cfg']['Order']; } @@ -1539,53 +1539,53 @@ function PMA_getSortingUrlParams( $sort_order .= ' ASC'; $order_img = ' ' . PMA_getImage( - 's_desc.png', __('Descending'), - array('class' => "soimg$column_index", 'title' => '') - ); + 's_desc.png', __('Descending'), + array('class' => "soimg$column_index", 'title' => '') + ); $order_img .= ' ' . PMA_getImage( - 's_asc.png', __('Ascending'), - array('class' => "soimg$column_index hide", 'title' => '') - ); + 's_asc.png', __('Ascending'), + array('class' => "soimg$column_index hide", 'title' => '') + ); } else { $sort_order .= ' DESC'; $order_img = ' ' . PMA_getImage( - 's_asc.png', __('Ascending'), - array('class' => "soimg$column_index", 'title' => '') - ); + 's_asc.png', __('Ascending'), + array('class' => "soimg$column_index", 'title' => '') + ); $order_img .= ' ' . PMA_getImage( - 's_desc.png', __('Descending'), - array('class' => "soimg$column_index hide", 'title' => '') - ); + 's_desc.png', __('Descending'), + array('class' => "soimg$column_index hide", 'title' => '') + ); } - + return array($sort_order, $order_img); - + } /** * Get sort order link - * - * @param string $order_img the sort order image - * @param integer $col_index the index of the column - * @param string $direction the display direction - * @param array $fields_meta set of field properties - * @param string $order_url the url for sort - * + * + * @param string $order_img the sort order image + * @param integer $col_index the index of the column + * @param string $direction the display direction + * @param array $fields_meta set of field properties + * @param string $order_url the url for sort + * * @return string the sort order link - * + * * @see PMA_getTableHeaders() */ function PMA_getSortOrderLink( $order_img, $col_index, $direction, $fields_meta, $order_url ) { - + $order_link_params = array(); - + if (isset($order_img) && ($order_img != '')) { if (strstr($order_img, 'asc')) { $order_link_params['onmouseover'] = "$('.soimg$col_index').toggle()"; @@ -1595,11 +1595,11 @@ function PMA_getSortOrderLink( $order_link_params['onmouseout'] = "$('.soimg$col_index').toggle()"; } } - + if ($GLOBALS['cfg']['HeaderFlipType'] == 'auto') { $GLOBALS['cfg']['HeaderFlipType'] - = (PMA_USR_BROWSER_AGENT == 'IE') ? 'css' : 'fake'; + = (PMA_USR_BROWSER_AGENT == 'IE') ? 'css' : 'fake'; } if ($direction == 'horizontalflipped' @@ -1619,34 +1619,34 @@ function PMA_getSortOrderLink( : htmlspecialchars($fields_meta->name); return PMA_linkOrButton( - $order_url, $order_link_content . $order_img, - $order_link_params, false, true - ); - + $order_url, $order_link_content . $order_img, + $order_link_params, false, true + ); + } /** * Prepare columns to draggable effect for sortable columns - * - * @param boolean $col_visib the column is visible (false) - * array the column is not visible (string array) - * @param string $col_visib_j element of $col_visib array - * @param boolean $condition_field whether to add CSS class condition - * @param string $direction the display direction - * @param array $fields_meta set of field properties - * @param string $order_link the order link - * @param string $comments the comment for the column - * + * + * @param boolean $col_visib the column is visible (false) + * array the column is not visible (string array) + * @param string $col_visib_j element of $col_visib array + * @param boolean $condition_field whether to add CSS class condition + * @param string $direction the display direction + * @param array $fields_meta set of field properties + * @param string $order_link the order link + * @param string $comments the comment for the column + * * @return string $draggable_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getDraggableClassForSortableColumns( $col_visib, $col_visib_j, $condition_field, $direction, $fields_meta, $order_link, $comments ) { - + $draggable_html = 'name) . '">' . $order_link . $comments . ''; - + return $draggable_html; - + } /** * Prepare columns to draggable effect for non sortable columns - * - * @param boolean $col_visib the column is visible (false) - * array the column is not visible (string array) - * @param string $col_visib_j element of $col_visib array - * @param boolean $condition_field whether to add CSS class condition - * @param string $direction the display direction - * @param array $fields_meta set of field properties - * @param string $comments the comment for the column - * + * + * @param boolean $col_visib the column is visible (false) + * array the column is not visible (string array) + * @param string $col_visib_j element of $col_visib array + * @param boolean $condition_field whether to add CSS class condition + * @param string $direction the display direction + * @param array $fields_meta set of field properties + * @param string $comments the comment for the column + * * @return string $draggable_html html content - * + * * @see PMA_getTableHeaders() */ function PMA_getDraggableClassForNonSortableColumns( $col_visib, $col_visib_j, $condition_field, $direction, $fields_meta, $comments ) { - + $draggable_html = 'name), '
' - ); + htmlspecialchars($fields_meta->name), '
' + ); } else { $draggable_html .= htmlspecialchars($fields_meta->name); } $draggable_html .= "\n" . $comments . ''; - + return $draggable_html; - + } @@ -1821,7 +1821,7 @@ function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_truncated = false, $transform_function = '', $default_function = '' ) { - + // Define classes to be added to this data field based on the type of data $enum_class = ''; if (strpos($meta->flags, 'enum') !== false) { @@ -1847,32 +1847,32 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, . ' ' . ($is_field_truncated ? ' truncated' : '') . ($transform_function != $default_function ? ' transformed' : '') . $enum_class . $set_class . $bit_class . $mime_type_class; - + } /** * Prepare the body of the results table * - * @param integer &$dt_result the link id associated to the query - * which results have to be displayed - * @param array &$is_display which elements to display - * @param array $map the list of relations - * @param array $analyzed_sql the analyzed query + * @param integer &$dt_result the link id associated to the query + * which results have to be displayed + * @param array &$is_display which elements to display + * @param array $map the list of relations + * @param array $analyzed_sql the analyzed query * - * @return string $table_body_html html content + * @return string $table_body_html html content * - * @global string $db the database name - * @global string $table the table name - * @global string $goto the URL to go back in case of errors - * @global string $sql_query the SQL query - * @global array $fields_meta the list of fields properties - * @global integer $fields_cnt the total number of fields returned by - * the SQL query - * @global array $vertical_display informations used with vertical display - * mode - * @global array $highlight_columns column names to highlight - * @global array $row current row data + * @global string $db the database name + * @global string $table the table name + * @global string $goto the URL to go back in case of errors + * @global string $sql_query the SQL query + * @global array $fields_meta the list of fields properties + * @global integer $fields_cnt the total number of fields returned by + * the SQL query + * @global array $vertical_display informations used with vertical display + * mode + * @global array $highlight_columns column names to highlight + * @global array $row current row data * * @access private * @@ -1880,7 +1880,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, */ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { - + global $db, $table, $goto; global $sql_query, $fields_meta, $fields_cnt; global $vertical_display, $highlight_columns; @@ -1892,11 +1892,11 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) // query without conditions to shorten URLs when needed, 200 is just // guess, it should depend on remaining URL length $url_sql_query = PMA_getUrlSqlQuery($analyzed_sql, $sql_query); - + if (! is_array($map)) { $map = array(); } - + $row_no = 0; $vertical_display['edit'] = array(); $vertical_display['copy'] = array(); @@ -1924,13 +1924,13 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $odd_row = true; $directionCondition = ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal') || ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'); - + while ($row = PMA_DBI_fetch_row($dt_result)) { - + // "vertical display" mode stuff $table_body_html .= PMA_getVerticalDisplaySupportSegments( - $vertical_display, $row_no, $directionCondition - ); + $vertical_display, $row_no, $directionCondition + ); $alternating_color_class = ($odd_row ? 'odd' : 'even'); $odd_row = ! $odd_row; @@ -1966,24 +1966,24 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) // 1.2.1 Modify link(s) if ($is_display['edit_lnk'] == 'ur') { // update row case - + list($edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class) = PMA_getModifiedLinks( $db, $table, $where_clause, $clause_is_unique, $url_sql_query ); - + } // end if (1.2.1) // 1.2.2 Delete/Kill link(s) if (($is_display['del_lnk'] == 'dr') || ($is_display['del_lnk'] == 'kp')) { - + list($del_query, $del_url, $del_str, $js_conf) = PMA_getDeleteAndKillLinks( $db, $table, $where_clause, $clause_is_unique, $url_sql_query, $goto, $is_display['del_lnk'] ); - + } // end if (1.2.2) // 1.3 Displays the links at left if required @@ -1991,32 +1991,32 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) || ($GLOBALS['cfg']['RowActionLinks'] == 'both')) && $directionCondition ) { - + $table_body_html .= PMA_getPlacedLinks( - 'left', $del_url, $is_display, $row_no, $where_clause, - $where_clause_html, $condition_array, $del_query, 'l', - $edit_url, $copy_url, $edit_anchor_class, $edit_str, - $copy_str, $del_str, $js_conf - ); - + 'left', $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, 'l', + $edit_url, $copy_url, $edit_anchor_class, $edit_str, + $copy_str, $del_str, $js_conf + ); + } elseif (($GLOBALS['cfg']['RowActionLinks'] == 'none') && $directionCondition ) { - + $table_body_html .= PMA_getPlacedLinks( - 'none', $del_url, $is_display, $row_no, $where_clause, - $where_clause_html, $condition_array, $del_query, 'l', - $edit_url, $copy_url, $edit_anchor_class, $edit_str, - $copy_str, $del_str, $js_conf - ); - + 'none', $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, 'l', + $edit_url, $copy_url, $edit_anchor_class, $edit_str, + $copy_str, $del_str, $js_conf + ); + } // end if (1.3) } // end if (1) // 2. Displays the rows' values for ($j = 0; $j < $fields_cnt; ++$j) { - + // assign $i with appropriate column order $i = $col_order ? $col_order[$j] : $j; @@ -2028,18 +2028,18 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) && ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical')) ? 'hide' : ''; - + // handle datetime-related class, for grid editing $field_type_class = PMA_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 = PMA_getResettedClassForInlineEdit( - $grid_edit_class, $not_null_class, $relation_class, - $hide_class, $field_type_class, $row_no - ); + $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. @@ -2057,40 +2057,40 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) 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']) ) { - + $include_file = PMA_securePath( + $GLOBALS['mime_map'][$meta->name]['transformation'] + ); + + if (file_exists('./libraries/transformations/' . $include_file)) { + + $transformfunction_name = str_replace( + '.inc.php', '', $GLOBALS['mime_map'][$meta->name]['transformation'] ); - - if (file_exists('./libraries/transformations/' . $include_file)) { - - $transformfunction_name = str_replace( - '.inc.php', '', - $GLOBALS['mime_map'][$meta->name]['transformation'] - ); include_once './libraries/transformations/' . $include_file; if (function_exists('PMA_transformation_' . $transformfunction_name)) { - + $transform_function = 'PMA_transformation_' . $transformfunction_name; - + $transform_options = PMA_transformation_getOptions( - isset($GLOBALS['mime_map'][$meta->name]['transformation_options']) - ? $GLOBALS['mime_map'][$meta->name]['transformation_options'] - : '' - ); - + 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'] - ); + '_', '/', + $GLOBALS['mime_map'][$meta->name]['mimetype'] + ); } } // end if file_exists } // end if transformation is set @@ -2109,14 +2109,14 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $transform_options['wrapper_link'] = PMA_generate_common_url($_url_params); - // n u m e r i c 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 - + $vertical_display['data'][$row_no][$i] = PMA_getDataCellForNumericFeilds( $row[$i], $class, $condition_field, $meta, @@ -2124,27 +2124,27 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $default_function, $transform_options, $is_field_truncated ); - // b l o b } elseif (stristr($meta->type, 'BLOB')) { - + // 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); - + $vertical_display['data'][$row_no][$i] = PMA_getDataCellForBlobField( $row[$i], $class, $meta, $_url_params, $field_flags, $transform_function, $default_function, $transform_options, $condition_field, $is_field_truncated ); - - // g e o m e t r y + } elseif ($meta->type == 'geometry') { + // 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); - + $vertical_display['data'][$row_no][$i] = PMA_getDataCellForGeometryFields( $row[$i], $class, $meta, $map, $_url_params, @@ -2152,9 +2152,9 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $transform_options, $is_field_truncated, $analyzed_sql ); - // n o t n u m e r i c a n d n o t B L O B } else { - + // n o t n u m e r i c a n d n o t B L O B + $vertical_display['data'][$row_no][$i] = PMA_getDataCellForNonNumericAndNonBlobFields( $row[$i], $class, $meta, $map, $_url_params, @@ -2162,7 +2162,7 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $transform_options, $is_field_truncated, $analyzed_sql, $dt_result, $i ); - + } // output stored cell @@ -2184,14 +2184,14 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) || ($GLOBALS['cfg']['RowActionLinks'] == 'both')) && $directionCondition ) { - + $table_body_html .= PMA_getPlacedLinks( - 'right', $del_url, $is_display, $row_no, $where_clause, - $where_clause_html, $condition_array, $del_query, 'r', - $edit_url, $copy_url, $edit_anchor_class, $edit_str, - $copy_str, $del_str, $js_conf - ); - + 'right', $del_url, $is_display, $row_no, $where_clause, + $where_clause_html, $condition_array, $del_query, 'r', + $edit_url, $copy_url, $edit_anchor_class, $edit_str, + $copy_str, $del_str, $js_conf + ); + } // end if (3) if ($directionCondition) { @@ -2206,91 +2206,91 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $vertical_display['delete'][$row_no] = ''; $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'] != 'kp')) { - + $vertical_display['row_delete'][$row_no] .= PMA_getCheckboxForMultiRowSubmissions( - $del_url, $is_display, $row_no, $where_clause_html, - $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', - $alternating_color_class . $vertical_class - ); - + $del_url, $is_display, $row_no, $where_clause_html, + $condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]', + $alternating_color_class . $vertical_class + ); + } else { unset($vertical_display['row_delete'][$row_no]); } if (isset($edit_url)) { - + $vertical_display['edit'][$row_no] .= PMA_getEditLink( - $edit_url, - $alternating_color_class . ' ' . $edit_anchor_class - . $vertical_class, $edit_str, - $where_clause, - $where_clause_html - ); - + $edit_url, + $alternating_color_class . ' ' . $edit_anchor_class + . $vertical_class, $edit_str, + $where_clause, + $where_clause_html + ); + } else { unset($vertical_display['edit'][$row_no]); } if (isset($copy_url)) { - + $vertical_display['copy'][$row_no] .= PMA_getCopyLink( - $copy_url, $copy_str, $where_clause, $where_clause_html, - $alternating_color_class . $vertical_class - ); - + $copy_url, $copy_str, $where_clause, $where_clause_html, + $alternating_color_class . $vertical_class + ); + } else { unset($vertical_display['copy'][$row_no]); } if (isset($del_url)) { - + if (! isset($js_conf)) { $js_conf = ''; } - + $vertical_display['delete'][$row_no] .= PMA_getDeleteLink( - $del_url, $del_str, $js_conf, - $alternating_color_class . $vertical_class - ); - + $del_url, $del_str, $js_conf, + $alternating_color_class . $vertical_class + ); + } else { unset($vertical_display['delete'][$row_no]); } - $table_body_html .= $directionCondition ? "\n" : ''; + $table_body_html .= $directionCondition ? "\n" : ''; $row_no++; - + } // end while - + return $table_body_html; - + } // end of the 'PMA_getTableBody()' function /** * Get url sql query without conditions to shorten URLs - * - * @param array $analyzed_sql analyzed query - * @param string $sql_query the SQL query - * + * + * @param array $analyzed_sql analyzed query + * @param string $sql_query the SQL query + * * @return string $url_sql analyzed sql query - * + * * @see PMA_getTableBody() */ function PMA_getUrlSqlQuery($analyzed_sql, $sql_query) { - + if (isset($analyzed_sql) && isset($analyzed_sql[0]) && isset($analyzed_sql[0]['querytype']) @@ -2302,29 +2302,29 @@ function PMA_getUrlSqlQuery($analyzed_sql, $sql_query) if (isset($analyzed_sql[0]['queryflags']['distinct'])) { $url_sql_query .= ' DISTINCT '; } - + $url_sql_query .= $analyzed_sql[0]['select_expr_clause']; if (!empty($analyzed_sql[0]['from_clause'])) { $url_sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause']; } - + return $url_sql_query; } - + return $sql_query; - + } /** * Get column order and column visibility - * + * * @return array 2 element array - $col_order, $col_visib - * + * * @see PMA_getTableBody() */ function PMA_getColumnParams() -{ +{ if (PMA_isSelect()) { $pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']); $col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER); @@ -2333,29 +2333,29 @@ function PMA_getColumnParams() $col_order = false; $col_visib = false; } - - return array($col_order, $col_visib); + + return array($col_order, $col_visib); } /** * Prepare vertical display mode necessay HTML stuff - * - * @param array $vertical_display informations used with vertical - * display mode - * @param integer $row_no the index of current row - * @param boolean $directionCondition the directional condition - * + * + * @param array $vertical_display informations used with vertical + * display mode + * @param integer $row_no the index of current row + * @param boolean $directionCondition the directional condition + * * @return string $vertical_disp_html html content - * + * * @see PMA_getTableBody() */ function PMA_getVerticalDisplaySupportSegments( $vertical_display, $row_no, $directionCondition ) { - + $support_html = ''; - + if ((($row_no != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0)) && !($row_no % $_SESSION['tmp_user_values']['repeat_cells']) && $directionCondition @@ -2383,30 +2383,30 @@ function PMA_getVerticalDisplaySupportSegments( } $support_html .= '' . "\n"; } // end if - + return $support_html; - + } /** * Get modified links - * - * @param string $db the database name - * @param string $table the table name - * @param string $where_clause the where clause of the sql - * @param boolean $clause_is_unique the unique condition of clause - * @param string $url_sql_query the analyzed sql query - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $where_clause the where clause of the sql + * @param boolean $clause_is_unique the unique condition of clause + * @param string $url_sql_query the analyzed sql query + * * @return array 5 element array - $edit_url, $copy_url, * $edit_str, $copy_str, $edit_anchor_class - * + * * @see PMA_getTableBody() */ function PMA_getModifiedLinks( $db, $table, $where_clause, $clause_is_unique, $url_sql_query ) { - + $_url_params = array( 'db' => $db, 'table' => $table, @@ -2434,32 +2434,32 @@ function PMA_getModifiedLinks( if ( $clause_is_unique == 0) { $edit_anchor_class .= ' nonunique'; } - + return array($edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class); - + } /** * Get delete and kill links - * - * @param string $db the database name - * @param string $table the table name - * @param string $where_clause the where clause of the sql - * @param boolean $clause_is_unique the unique condition of clause - * @param string $url_sql_query the analyzed sql query - * @param string $goto the URL to go back in case of errors - * @param string $del_lnk the delete link of current row - * + * + * @param string $db the database name + * @param string $table the table name + * @param string $where_clause the where clause of the sql + * @param boolean $clause_is_unique the unique condition of clause + * @param string $url_sql_query the analyzed sql query + * @param string $goto the URL to go back in case of errors + * @param string $del_lnk the delete link of current row + * * @return array 4 element array - $del_query, * $del_url, $del_str, $js_conf - * + * * @see PMA_getTableBody() */ function PMA_getDeleteAndKillLinks( $db, $table, $where_clause, $clause_is_unique, $url_sql_query, $goto, $del_lnk ) { - + if ($del_lnk == 'dr') { // delete row case $_url_params = array( @@ -2518,78 +2518,78 @@ function PMA_getDeleteAndKillLinks( $js_conf = 'KILL ' . $row[0]; $del_str = PMA_getIcon('b_drop.png', __('Kill')); } - + return array($del_query, $del_url, $del_str, $js_conf); - + } /** * Prepare placed links - * - * @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 - * @param integer $row_no the index of current row - * @param string $where_clause the where clause of the sql - * @param string $where_clause_html the html encoded where clause - * @param array $condition_array array of keys (primary, unique, condition) - * @param string $del_query the query for delete row - * @param string $dir_letter the letter denoted the direction - * @param string $edit_url the url for edit row - * @param string $copy_url the url for copy 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_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 $dir the direction of links should place + * @param string $del_url the url for delete row + * @param array $is_display which elements to display + * @param integer $row_no the index of current row + * @param string $where_clause the where clause of the sql + * @param string $where_clause_html the html encoded where clause + * @param array $condition_array array of keys (primary, unique, condition) + * @param string $del_query the query for delete row + * @param string $dir_letter the letter denoted the direction + * @param string $edit_url the url for edit row + * @param string $copy_url the url for copy 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_str the label for copy row + * @param string $del_str the label for delete row + * @param string $js_conf text for the JS confirmation + * * @return string html content - * + * * @see PMA_getTableBody() */ function PMA_getPlacedLinks( $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 + $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf ) { - + if (! isset($js_conf)) { $js_conf = ''; } return PMA_getCheckboxAndLinks( - $dir, $del_url, $is_display, - $row_no, $where_clause, $where_clause_html, $condition_array, - $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, - $edit_str, $copy_str, $del_str, $js_conf - ); - + $dir, $del_url, $is_display, + $row_no, $where_clause, $where_clause_html, $condition_array, + $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf + ); + } /** * Get resetted class for inline edit columns - * - * @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 - * @param string $hide_class the class for visibility of a column - * @param string $field_type_class the class related to type of the field - * @param integer $row_no the row index - * - * @return string $class the resetted class - * + * + * @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 + * @param string $hide_class the class for visibility of a column + * @param string $field_type_class the class related to type of the field + * @param integer $row_no the row index + * + * @return string $class the resetted class + * * @see PMA_getTableBody() */ function PMA_getResettedClassForInlineEdit( $grid_edit_class, $not_null_class, $relation_class, $hide_class, $field_type_class, $row_no ) { - + $class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' ' . $relation_class . ' ' . $hide_class . ' ' . $field_type_class; - + if (($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') && (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) ) { @@ -2603,23 +2603,23 @@ function PMA_getResettedClassForInlineEdit( $class .= ' vmarker'; } } - + return $class; - + } /** * Get class for datetime related fields - * - * @param string $type the type of the column field - * + * + * @param string $type the type of the column field + * * @return string $field_type_class the class for the column - * + * * @see PMA_getTableBody() */ function PMA_getClassForDateTimeRelatedFields($type) -{ +{ if ((substr($type, 0, 9) == 'timestamp') || ($type == 'datetime')) { $field_type_class = 'datetimefield'; } else if ($type == 'date') { @@ -2627,87 +2627,86 @@ function PMA_getClassForDateTimeRelatedFields($type) } else { $field_type_class = ''; } - return $field_type_class; + return $field_type_class; } /** * Prepare data cell for numeric type fields - * - * @param string $column the relavent column in data row - * @param string $class the html class for column - * @param boolean $condition_field the column should highlighted or not - * @param object $meta the meta-information about this field - * @param array $map the list of relations - * @param boolean $is_field_truncated the condition for blob data replacements - * @param array $analyzed_sql the analyzed query - * @param string $transform_function the name of transformation function - * @param string $default_function the default transformation function - * @param string $transform_options the transformation parameters - * + * + * @param string $column the relavent column in data row + * @param string $class the html class for column + * @param boolean $condition_field the column should highlighted or not + * @param object $meta the meta-information about this field + * @param array $map the list of relations + * @param boolean $is_field_truncated the condition for blob data replacements + * @param array $analyzed_sql the analyzed query + * @param string $transform_function the name of transformation function + * @param string $default_function the default transformation function + * @param string $transform_options the transformation parameters + * * @return string $cell the prepared cell, html content - * + * * @see PMA_getTableBody() */ function PMA_getDataCellForNumericFeilds( $column, $class, $condition_field, $meta, $map, $is_field_truncated, - $analyzed_sql, $transform_function, $default_function, $transform_options + $analyzed_sql, $transform_function, $default_function, $transform_options ) { - + if (! isset($column) || is_null($column)) { $cell = PMA_buildNullDisplay( - 'right '.$class, $condition_field, $meta, '' - ); + 'right '.$class, $condition_field, $meta, '' + ); } elseif ($column != '') { $nowrap = ' nowrap'; $where_comparison = ' = ' . $column; - $cell = ' $GLOBALS['cfg']['LimitChars']) @@ -2864,21 +2862,20 @@ function PMA_getDataCellForGeometryFields( $is_field_truncated = true; } - $cell = '_type) && $meta->_type === MYSQLI_TYPE_BIT) { $column = PMA_printableBitValue( - $column, $meta->length - ); + $column, $meta->length + ); // some results of PROCEDURE ANALYSE() are reported as // being BINARY but they are quite readable, @@ -2965,18 +2962,18 @@ function PMA_getDataCellForNonNumericAndNonBlobFields( $column = bin2hex($column); } else { $column = htmlspecialchars( - PMA_replaceBinaryContents($column) - ); + PMA_replaceBinaryContents($column) + ); } } else { // we show the BINARY message and field's size // (or maybe use a transformation) $column = PMA_handleNonPrintableContents( - 'BINARY', $column, $transform_function, - $transform_options, $default_function, - $meta, $_url_params - ); + 'BINARY', $column, $transform_function, + $transform_options, $default_function, + $meta, $_url_params + ); $formatted = true; } } @@ -2984,8 +2981,8 @@ function PMA_getDataCellForNonNumericAndNonBlobFields( if ($formatted) { $cell = PMA_buildValueDisplay( - $class, $condition_field, $column - ); + $class, $condition_field, $column + ); } else { @@ -3011,15 +3008,15 @@ function PMA_getDataCellForNonNumericAndNonBlobFields( $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated - ); + ); } } else { $cell = PMA_buildEmptyDisplay($class, $condition_field, $meta); } - + return $cell; - + } @@ -3028,7 +3025,7 @@ function PMA_getDataCellForNonNumericAndNonBlobFields( * * @return string html content * - * @global array $vertical_display the information to display + * @global array $vertical_display the information to display * * @access private * @@ -3036,9 +3033,9 @@ function PMA_getDataCellForNonNumericAndNonBlobFields( */ function PMA_getVerticalTable() { - + global $vertical_display; - + $vertical_table_html = ''; // Prepares "multi row delete" link at top if required @@ -3047,14 +3044,14 @@ function PMA_getVerticalTable() && ((count($vertical_display['row_delete']) > 0) || !empty($vertical_display['textbtn'])) ) { - + $vertical_table_html .= '' . "\n"; if ($GLOBALS['cfg']['RowActionLinks'] == 'none') { // if we are not showing the RowActionLinks, then we need to show // the Multi-Row-Action checkboxes $vertical_table_html .= '' . "\n"; } - + $vertical_table_html .= $vertical_display['textbtn'] . PMA_getCheckBoxesForMultipleRowOperations( $vertical_display, '_left' @@ -3070,8 +3067,8 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display ,'edit' - ); + $vertical_display, 'edit' + ); } // end if // Prepares "copy" link at top if required @@ -3082,8 +3079,8 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display ,'copy' - ); + $vertical_display, 'copy' + ); } // end if // Prepares "delete" link at top if required @@ -3094,15 +3091,15 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display, 'delete' - ); + $vertical_display, 'delete' + ); } // end if list($col_order, $col_visib) = PMA_getColumnParams(); // Prepares data foreach ($vertical_display['desc'] AS $j => $val) { - + // assign appropriate key with current column order $key = $col_order ? $col_order[$j] : $j; @@ -3112,7 +3109,7 @@ function PMA_getVerticalTable() $cell_displayed = 0; foreach ($vertical_display['rowdata'][$key] as $subval) { - + if (($cell_displayed != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells']) @@ -3122,7 +3119,7 @@ function PMA_getVerticalTable() $vertical_table_html .= $subval; $cell_displayed++; - + } // end while $vertical_table_html .= '' . "\n"; @@ -3135,7 +3132,7 @@ function PMA_getVerticalTable() && ((count($vertical_display['row_delete']) > 0) || !empty($vertical_display['textbtn'])) ) { - + $vertical_table_html .= '' . "\n" . $vertical_display['textbtn'] . PMA_getCheckBoxesForMultipleRowOperations( $vertical_display, '_right' @@ -3151,8 +3148,8 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display, 'edit' - ); + $vertical_display, 'edit' + ); } // end if // Prepares "copy" link at bottom if required @@ -3163,8 +3160,8 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display, 'copy' - ); + $vertical_display, 'copy' + ); } // end if // Prepares "delete" link at bottom if required @@ -3175,69 +3172,70 @@ function PMA_getVerticalTable() || !empty($vertical_display['textbtn'])) ) { $vertical_table_html .= PMA_getOperationLinksForVerticleTable( - $vertical_display, 'delete' - ); + $vertical_display, 'delete' + ); } return $vertical_table_html; - + } // end of the 'PMA_getVerticalTable' function /** * Prepare edit, copy and delete links for verticle table - * - * @param array $vertical_display the information to display - * @param string $operation edit/copy/delete - * + * + * @param array $vertical_display the information to display + * @param string $operation edit/copy/delete + * * @return string $links_html html content - * + * * @see PMA_getVerticalTable() */ function PMA_getOperationLinksForVerticleTable($vertical_display, $operation) { - + $link_html = '' . "\n"; - + if (! is_array($vertical_display['row_delete'])) { - - if (($operation == 'edit') || ($operation == 'copy')) { + + if (($operation == 'edit') || ($operation == 'copy')) { $link_html .= $vertical_display['textbtn']; - + } elseif ($operation == 'delete') { - + if (! is_array($vertical_display['edit'])) { $link_html .= $vertical_display['textbtn']; } - } + } } foreach ($vertical_display[$operation] as $val) { $link_html .= $val; } // end while - + $link_html .= '' . "\n"; - + return $link_html; - + } /** * 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 - * + * + * @param array $vertical_display the information to display + * @param string $dir _left / _right + * + * @return $checkBoxes_html html content + * * @see PMA_getVerticalTable() */ -function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) { - +function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) +{ + $checkBoxes_html = ''; $cell_displayed = 0; - + foreach ($vertical_display['row_delete'] as $val) { if (($cell_displayed != 0) @@ -3257,9 +3255,9 @@ function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) { $checkBoxes_html .= str_replace('[%_PMA_CHECKBOX_DIR_%]', $dir, $val); $cell_displayed++; } // end while - + return $checkBoxes_html; - + } @@ -3276,16 +3274,16 @@ function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) { */ function PMA_setConfigParamsForDisplayTable() { - + $sql_md5 = md5($GLOBALS['sql_query']); $_SESSION['tmp_user_values']['query'][$sql_md5]['sql'] = $GLOBALS['sql_query']; $valid_disp_dir = PMA_isValid( - $_REQUEST['disp_direction'], - array('horizontal', 'vertical', 'horizontalflipped') - ); - + $_REQUEST['disp_direction'], + array('horizontal', 'vertical', 'horizontalflipped') + ); + if ($valid_disp_dir) { $_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction'] = $_REQUEST['disp_direction']; @@ -3444,7 +3442,7 @@ function PMA_setConfigParamsForDisplayTable() = $_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells']; $_SESSION['tmp_user_values']['disp_direction'] = $_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction']; - + } @@ -3456,26 +3454,26 @@ function PMA_setConfigParamsForDisplayTable() * which results have to be displayed * @param array &$the_disp_mode the display mode * @param array $analyzed_sql the analyzed query - * + * * @return sting Generated HTML content for resulted table * - * @global string $db the database name - * @global string $table the table name - * @global string $goto the URL to go back in case of errors - * @global string $sql_query the current SQL query - * @global integer $num_rows the total number of rows returned by the + * @global string $db the database name + * @global string $table the table name + * @global string $goto the URL to go back in case of errors + * @global string $sql_query the current SQL query + * @global integer $num_rows the total number of rows returned by the * SQL query - * @global integer $unlim_num_rows the total number of rows returned by the + * @global integer $unlim_num_rows the total number of rows returned by the * SQL query without any programmatically * appended "LIMIT" clause - * @global array $fields_meta the list of fields properties - * @global integer $fields_cnt the total number of fields returned by + * @global array $fields_meta the list of fields properties + * @global integer $fields_cnt the total number of fields returned by * the SQL query - * @global array $vertical_display informations used with vertical display + * @global array $vertical_display informations used with vertical display * mode - * @global array $highlight_columns column names to highlight - * @global array $cfgRelation the relation settings - * @global array $showtable table definitions + * @global array $highlight_columns column names to highlight + * @global array $cfgRelation the relation settings + * @global array $showtable table definitions * * @access private * @@ -3487,13 +3485,13 @@ function PMA_setConfigParamsForDisplayTable() */ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) { - + global $db, $table, $goto; global $sql_query, $num_rows, $unlim_num_rows, $fields_meta, $fields_cnt; global $vertical_display, $highlight_columns; global $cfgRelation; global $showtable; - + $table_html = ''; // why was this called here? (already called from sql.php) @@ -3514,10 +3512,10 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // "j u s t b r o w s i n g" $pre_count = '~'; $after_count = PMA_showHint( - PMA_sanitize( - __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]') - ) - ); + PMA_sanitize( + __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]') + ) + ); } else { $pre_count = ''; $after_count = ''; @@ -3537,43 +3535,43 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // 1.3 Find the sort expression // we need $sort_expression and $sort_expression_nodirection - // even if there are many table references + // even if there are many table references list($sort_expression, $sort_expression_nodirection, $sort_direction) = PMA_getSortParams($analyzed_sql[0]['order_by_clause']); - - + + // 1.4 Prepares display of first and last value of the sorted column $sorted_column_message = PMA_getSortedColumnMessage( - $dt_result, $fields_meta, $num_rows, - $sort_expression_nodirection, $table - ); - + $dt_result, $fields_meta, $num_rows, + $sort_expression_nodirection, $table + ); + // 2. ----- Prepare to display the top of the page ----- // 2.1 Prepares a messages with position informations - if (($is_display['nav_bar'] == '1') && isset($pos_next)) { + if (($is_display['nav_bar'] == '1') && isset($pos_next)) { $message = PMA_setMessageInformation( - $db, $table, $sorted_column_message, - $analyzed_sql[0]['limit_clause'], $unlim_num_rows, - $total, $pos_next, $pre_count, $after_count - ); + $db, $table, $sorted_column_message, + $analyzed_sql[0]['limit_clause'], $unlim_num_rows, + $total, $pos_next, $pre_count, $after_count + ); $table_html .= PMA_getMessage($message, $sql_query, 'success'); } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { - + $table_html .= PMA_getMessage( - __('Your SQL query has been executed successfully'), - $sql_query, 'success' - ); + __('Your SQL query has been executed successfully'), + $sql_query, 'success' + ); } // 2.3 Prepare the navigation bars if (! strlen($table)) { - + if (isset($analyzed_sql[0]['query_type']) && ($analyzed_sql[0]['query_type'] == 'SELECT') ) { @@ -3584,16 +3582,16 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) } else { $table = ''; } - + } if (($is_display['nav_bar'] == '1') && empty($analyzed_sql[0]['limit_clause'])) { - + $table_html .= PMA_getTableNavigation( - $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown' - ) - . "\n"; - + $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown' + ) + . "\n"; + } elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) { $table_html .= "\n" . '

' . "\n"; } @@ -3609,20 +3607,20 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) if (isset($analyzed_sql[0]['table_ref']) && is_array($analyzed_sql[0]['table_ref']) ) { - + foreach ($analyzed_sql[0]['table_ref'] as $table_ref_position => $table_ref) { $target[] = $analyzed_sql[0]['table_ref'][$table_ref_position]['table_true_name']; } - + } - + $tabs = '(\'' . join('\',\'', $target) . '\')'; if (! strlen($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 @@ -3630,15 +3628,15 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // to use the "column to display" notion (for example show // the name related to a numeric id). $exist_rel = PMA_getForeigners($db, $table, '', 'both'); - + if ($exist_rel) { - + foreach ($exist_rel as $master_field => $rel) { - + $display_field = PMA_getDisplayField( - $rel['foreign_db'], $rel['foreign_table'] - ); - + $rel['foreign_db'], $rel['foreign_table'] + ); + $map[$master_field] = array( $rel['foreign_table'], $rel['foreign_field'], @@ -3652,45 +3650,45 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // 3. ----- Prepare the results table ----- $table_html .= PMA_getTableHeaders( - $is_display, $fields_meta, $fields_cnt, $analyzed_sql, - $sort_expression, $sort_expression_nodirection, $sort_direction - ) - . '' . "\n"; - - $url_query = ''; + $is_display, $fields_meta, $fields_cnt, $analyzed_sql, + $sort_expression, $sort_expression_nodirection, $sort_direction + ) + . '' . "\n"; + + $url_query = ''; $table_html .= PMA_getTableBody( - $dt_result, $is_display, $map, $analyzed_sql - ); - + $dt_result, $is_display, $map, $analyzed_sql + ); + // vertical output case if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') { $table_html .= PMA_getVerticalTable(); } // end if - + unset($vertical_display); $table_html .= '' . "\n" . ''; - + // 4. ----- Prepares the link for multi-fields edit and delete if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') { $table_html .= PMA_getMultiRowOperationLinks( - $dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql, - $db, $table, $sql_query, $goto, $is_display['del_lnk'] - ); + $dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql, + $db, $table, $sql_query, $goto, $is_display['del_lnk'] + ); } // 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 .= PMA_getTableNavigation( - $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown' - ); - + $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown' + ); + } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { $table_html .= "\n" . '

' . "\n"; } @@ -3699,22 +3697,22 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql) if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { $table_html .= PMA_getResultsOperations($the_disp_mode, $analyzed_sql); } - + return $table_html; - + } // end of the 'PMA_getTable()' function /** * Get offsets for next page and previous page - * + * * @return array array with two elements - $pos_next, $pos_prev - * + * * @see PMA_getTable() */ function PMA_getOffsets() { - + if ($_SESSION['tmp_user_values']['max_rows'] == 'all') { $pos_next = 0; $pos_prev = 0; @@ -3730,73 +3728,73 @@ function PMA_getOffsets() $pos_prev = 0; } } - + return array($pos_next, $pos_prev); - + } /** * Get sort parameters - * - * @param string $order_by_clause - * + * + * @param string $order_by_clause + * * @return array 3 element array: $sort_expression, * $sort_expression_nodirection, $sort_direction - * + * * @see PMA_getTable() */ function PMA_getSortParams($order_by_clause) { - + if (! empty($order_by_clause)) { - + $sort_expression = trim( - str_replace(' ', ' ', $order_by_clause) - ); + str_replace(' ', ' ', $order_by_clause) + ); /** * Get rid of ASC|DESC */ preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches); - + $sort_expression_nodirection = isset($matches[1]) ? trim($matches[1]) : $sort_expression; - + $sort_direction = isset($matches[2]) ? trim($matches[2]) : ''; unset($matches); - + } else { $sort_expression = $sort_expression_nodirection = $sort_direction = ''; } - + return array($sort_expression, $sort_expression_nodirection, $sort_direction); - + } /** * Prepare sorted column message - * - * @param integer &$dt_result the link id associated to the query + * + * @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 + * @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 - * @param string $table the table name - * + * @param string $sort_expression_nodirection sort expression without direction + * @param string $table the table name + * * @return string html content * null if not found sorted column - * + * * @see PMA_getTable() */ function PMA_getSortedColumnMessage(&$dt_result, $fields_meta, $num_rows, $sort_expression_nodirection, $table ) { - + if (! empty($sort_expression_nodirection)) { - + if (strpos($sort_expression_nodirection, '.') === false) { $sort_table = $table; $sort_column = $sort_expression_nodirection; @@ -3804,111 +3802,111 @@ function PMA_getSortedColumnMessage(&$dt_result, $fields_meta, list($sort_table, $sort_column) = explode('.', $sort_expression_nodirection); } - + $sort_table = PMA_unQuote($sort_table); $sort_column = PMA_unQuote($sort_column); - + // find the sorted column index in row result // (this might be a multi-table query) $sorted_column_index = false; - + foreach ($fields_meta as $key => $meta) { if (($meta->table == $sort_table) && ($meta->name == $sort_column)) { $sorted_column_index = $key; break; } } - + if ($sorted_column_index !== false) { - + // fetch first row of the result set $row = PMA_DBI_fetch_row($dt_result); - + // initializing default arguments $default_function = 'PMA_mimeDefaultFunction'; $transform_function = $default_function; $transform_options = array(); - + // check for non printable sorted row data $meta = $fields_meta[$sorted_column_index]; - + if (stristr($meta->type, 'BLOB') || ($meta->type == 'geometry')) { - + $column_for_first_row = PMA_handleNonPrintableContents( - $meta->type, $row[$sorted_column_index], $transform_function, - $transform_options, $default_function, $meta, null - ); - + $meta->type, $row[$sorted_column_index], $transform_function, + $transform_options, $default_function, $meta, null + ); + } else { $column_for_first_row = $row[$sorted_column_index]; } - + $column_for_first_row = strtoupper( - substr($column_for_first_row, 0, $GLOBALS['cfg']['LimitChars']) - ); - + substr($column_for_first_row, 0, $GLOBALS['cfg']['LimitChars']) + ); + // fetch last row of the result set PMA_DBI_data_seek($dt_result, $num_rows - 1); $row = PMA_DBI_fetch_row($dt_result); - + // check for non printable sorted row data $meta = $fields_meta[$sorted_column_index]; if (stristr($meta->type, 'BLOB') || ($meta->type == 'geometry')) { - + $column_for_last_row = PMA_handleNonPrintableContents( - $meta->type, $row[$sorted_column_index], $transform_function, - $transform_options, $default_function, $meta, null - ); - + $meta->type, $row[$sorted_column_index], $transform_function, + $transform_options, $default_function, $meta, null + ); + } else { $column_for_last_row = $row[$sorted_column_index]; } - + $column_for_last_row = strtoupper( - substr($column_for_last_row, 0, $GLOBALS['cfg']['LimitChars']) - ); - + substr($column_for_last_row, 0, $GLOBALS['cfg']['LimitChars']) + ); + // reset to first row for the loop in PMA_getTableBody() PMA_DBI_data_seek($dt_result, 0); - + // we could also use here $sort_expression_nodirection return ' [' . htmlspecialchars($sort_column) . ': ' . htmlspecialchars($column_for_first_row) . ' - ' . htmlspecialchars($column_for_last_row) . ']'; } } - + return null; - + } /** * Set the content need to be show in message - * - * @param string $db the database name - * @param string $table the table name - * @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 - * @param integer $pos_next the offset for next page - * @param string $pre_count the string renders before row count - * @param string $after_count the string renders after row count - * - * @return PMA_Message $message an object of PMA_Message - * + * + * @param string $db the database name + * @param string $table the table name + * @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 + * @param integer $pos_next the offset for next page + * @param string $pre_count the string renders before row count + * @param string $after_count the string renders after row count + * + * @return PMA_Message $message an object of PMA_Message + * * @see PMA_getTable() */ function PMA_setMessageInformation( $db, $table, $sorted_column_message, $limit_clause, $unlim_num_rows, $total, $pos_next, $pre_count, $after_count ) { - + if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) { $selectstring = ', ' . $unlim_num_rows . ' ' . __('in query'); } else { @@ -3945,8 +3943,8 @@ function PMA_setMessageInformation( ) { $message = PMA_Message::notice( - __('This view has at least this number of rows. Please refer to %sdocumentation%s.') - ); + __('This view has at least this number of rows. Please refer to %sdocumentation%s.') + ); $message->addParam('[a@./Documentation.html#cfg_MaxExactCount@_blank]'); $message->addParam('[/a]'); @@ -3988,38 +3986,38 @@ function PMA_setMessageInformation( if (! is_null($sorted_column_message)) { $message->addMessage($sorted_column_message, ''); } - + return $message; - + } /** * Prepare multi field edit/delete links - * - * @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 $db the database name - * @param string $table the table name - * @param string $sql_query the current SQL query - * @param string $goto the URL to go back in case of errors - * @param string $del_link the display element - 'del_link' - * - * @return string $links_html html content - * + * + * @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 $db the database name + * @param string $table the table name + * @param string $sql_query the current SQL query + * @param string $goto the URL to go back in case of errors + * @param string $del_link the display element - 'del_link' + * + * @return string $links_html html content + * * @see PMA_getTable() */ function PMA_getMultiRowOperationLinks( &$dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql, $db, $table, $sql_query, $goto, $del_link ) { - + $links_html = ''; $delete_text = ($del_link == 'dr') ? __('Delete') : __('Kill'); @@ -4051,12 +4049,12 @@ function PMA_getMultiRowOperationLinks( } $checkall_link = PMA_linkOrButton( - $checkall_url, __('Check All'), $checkall_params, false - ); + $checkall_url, __('Check All'), $checkall_params, false + ); $uncheckall_link = PMA_linkOrButton( - $uncheckall_url, __('Uncheck All'), $uncheckall_params, false - ); + $uncheckall_url, __('Uncheck All'), $uncheckall_params, false + ); if ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical') { @@ -4072,20 +4070,20 @@ function PMA_getMultiRowOperationLinks( . '' . __('With selected:') . '' . "\n"; $links_html .= PMA_getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_change', - __('Change'), 'b_edit.png', 'edit' - ); + 'submit_mult', 'mult_submit', 'submit_mult_change', + __('Change'), 'b_edit.png', 'edit' + ); $links_html .= PMA_getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_delete', - $delete_text, 'b_drop.png', 'delete' - ); + 'submit_mult', 'mult_submit', 'submit_mult_delete', + $delete_text, 'b_drop.png', 'delete' + ); if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') { $links_html .= PMA_getButtonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' - ); + 'submit_mult', 'mult_submit', 'submit_mult_export', + __('Export'), 'b_tblexport.png', 'export' + ); } $links_html .= "\n"; @@ -4114,14 +4112,18 @@ function PMA_getMultiRowOperationLinks( .' value="' . $clause_is_unique . '" />' . "\n"; $links_html .= '' . "\n"; - + return $links_html; - + } /** * replace some html-unfriendly stuff + * + * @param string $buffer String to process + * + * @return Escaped and cleaned up text suitable for html. */ function PMA_mimeDefaultFunction($buffer) { @@ -4140,17 +4142,17 @@ function PMA_mimeDefaultFunction($buffer) /** * Get operations that are available on results. * - * @param array $the_disp_mode the display mode - * @param array $analyzed_sql the analyzed query + * @param array $the_disp_mode the display mode + * @param array $analyzed_sql the analyzed query * * @return string html content - * - * @global string $db the database name - * @global string $table the table name - * @global string $sql_query the current SQL query - * @global integer $unlim_num_rows the total number of rows returned by the - * SQL query without any programmatically - * appended "LIMIT" clause + * + * @global string $db the database name + * @global string $table the table name + * @global string $sql_query the current SQL query + * @global integer $unlim_num_rows the total number of rows returned by the + * SQL query without any programmatically + * appended "LIMIT" clause * * @access private * @@ -4162,7 +4164,7 @@ function PMA_mimeDefaultFunction($buffer) */ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) { - + global $db, $table, $sql_query, $unlim_num_rows, $fields_meta; $results_operations_html = ''; @@ -4187,24 +4189,24 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) $url_query = PMA_generate_common_url($_url_params); $results_operations_html .= PMA_linkOrButton( - 'sql.php' . $url_query, - PMA_getIcon('b_print.png', __('Print view'), true), + 'sql.php' . $url_query, + PMA_getIcon('b_print.png', __('Print view'), true), + '', true, true, 'print_view' + ) + . "\n"; + + if ($_SESSION['tmp_user_values']['display_text']) { + + $_url_params['display_text'] = 'F'; + + $results_operations_html .= PMA_linkOrButton( + 'sql.php' . PMA_generate_common_url($_url_params), + PMA_getIcon( + 'b_print.png', __('Print view (with full texts)'), true + ), '', true, true, 'print_view' ) . "\n"; - - if ($_SESSION['tmp_user_values']['display_text']) { - - $_url_params['display_text'] = 'F'; - - $results_operations_html .= PMA_linkOrButton( - 'sql.php' . PMA_generate_common_url($_url_params), - PMA_getIcon( - 'b_print.png', __('Print view (with full texts)'), true - ), - '', true, true, 'print_view' - ) - . "\n"; unset($_url_params['display_text']); } } // end displays "printable view" @@ -4222,18 +4224,18 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) && ! isset($printview) && ! isset($analyzed_sql[0]['queryflags']['procedure']) ) { - + if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name']) && ! isset($analyzed_sql[0]['table_ref'][1]['table_true_name']) ) { $_url_params['single_table'] = 'true'; } - + if (!$header_shown) { $results_operations_html .= $header; $header_shown = true; } - + $_url_params['unlim_num_rows'] = $unlim_num_rows; /** @@ -4253,19 +4255,19 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) } $results_operations_html .= PMA_linkOrButton( - 'tbl_export.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_tblexport.png', __('Export'), true), - '', true, true, '' - ) - . "\n"; + 'tbl_export.php' . PMA_generate_common_url($_url_params), + PMA_getIcon('b_tblexport.png', __('Export'), true), + '', true, true, '' + ) + . "\n"; // prepare chart $results_operations_html .= PMA_linkOrButton( - 'tbl_chart.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_chart.png', __('Display chart'), true), - '', true, true, '' - ) - . "\n"; + 'tbl_chart.php' . PMA_generate_common_url($_url_params), + PMA_getIcon('b_chart.png', __('Display chart'), true), + '', true, true, '' + ) + . "\n"; // prepare GIS chart $geometry_found = false; @@ -4276,14 +4278,14 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) break; } } - + if ($geometry_found) { $results_operations_html .= PMA_linkOrButton( - 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params), - PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true), - '', true, true, '' - ) - . "\n"; + 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params), + PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true), + '', true, true, '' + ) + . "\n"; } } @@ -4299,11 +4301,11 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) $results_operations_html .= $header; $header_shown = true; } - + if (!PMA_DRIZZLE && !isset($analyzed_sql[0]['queryflags']['procedure'])) { - + $ajax_class = $GLOBALS['cfg']['AjaxEnable'] ? ' ajax' : ''; - + $results_operations_html .= '' . PMA_linkOrButton( 'view_create.php' . $url_query, @@ -4312,13 +4314,13 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) ) . '' . "\n"; } - + if ($header_shown) { $results_operations_html .= '
'; } - + return $results_operations_html; - + } @@ -4339,34 +4341,34 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) function PMA_handleNonPrintableContents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array() ) { - + $result = '[' . $category; - + if (is_null($content)) { - + $result .= ' - NULL'; $size = 0; - + } elseif (isset($content)) { - + $size = strlen($content); $display_size = PMA_formatByteDown($size, 3, 1); $result .= ' - '. $display_size[0] . ' ' . $display_size[1]; - + } - + $result .= ']'; if (strpos($transform_function, 'octetstream')) { $result = $content; } - + if ($size > 0) { - + if ($default_function != $transform_function) { $result = $transform_function($result, $transform_options, $meta); } else { - + $result = $default_function($result, array(), $meta); if (stristr($meta->type, 'BLOB') && $_SESSION['tmp_user_values']['display_blob'] @@ -4374,7 +4376,7 @@ function PMA_handleNonPrintableContents($category, $content, $transform_function // in this case, restart from the original $content $result = htmlspecialchars(PMA_replaceBinaryContents($content)); } - + /* Create link to download */ if (count($url_params) > 0) { $result = ' $select_expr ) { - + $alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias']; - + if (isset($alias) && strlen($alias)) { $true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column']; - + if ($alias == $meta->name) { // this change in the parameter does not matter // outside of the function $meta->name = $true_column; } // end if - + } // end if } // end foreach } // end if if (isset($map[$meta->name])) { - + // Field to display from the foreign table? if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) { - + $dispsql = 'SELECT ' . PMA_backquote($map[$meta->name][2]) . ' FROM ' . PMA_backquote($map[$meta->name][3]) . '.' . PMA_backquote($map[$meta->name][0]) . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . $where_comparison; - + $dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE); - + if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) { list($dispval) = PMA_DBI_fetch_row($dispresult, 0); } else { $dispval = __('Link not found'); } - + @PMA_DBI_free_result($dispresult); - + } else { $dispval = ''; } // end if... else... if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') { - + $result .= ($transform_function != $default_function ? $transform_function($data, $transform_options, $meta) : $transform_function($data, array(), $meta)) . ' [->' . $dispval . ']'; - + } else { if ($_SESSION['tmp_user_values']['relational_display'] == 'K') { - + // user chose "relational key" in the display options, so // the title contains the display field $title = (! empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : ''; - + } else { $title = ' title="' . htmlspecialchars($data) . '"'; } @@ -4499,7 +4501,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, . ' WHERE ' . PMA_backquote($map[$meta->name][1]) . $where_comparison, ); - + $result .= ''; @@ -4508,7 +4510,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, // not on the display field $result .= $transform_function($data, $transform_options, $meta); } else { - + if ($_SESSION['tmp_user_values']['relational_display'] == 'D') { // user chose "relational display field" in the // display options, so show display field in the cell @@ -4517,11 +4519,11 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, // otherwise display data in the cell $result .= $transform_function($data, array(), $meta); } - + } $result .= ''; } - + } else { $result .= ($transform_function != $default_function) ? $transform_function($data, $transform_options, $meta) @@ -4553,7 +4555,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, $result .= '' . "\n"; return $result; - + } @@ -4575,16 +4577,16 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, function PMA_getCheckboxForMultiRowSubmissions($del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix, $class ) { - + $ret = ''; - + if (! empty($del_url) && $is_display['del_lnk'] != 'kp') { - - $ret .= '' . '' - . ' '; + . ' '; } - + return $ret; - + } @@ -4618,10 +4620,10 @@ function PMA_getCheckboxForMultiRowSubmissions($del_url, $is_display, $row_no, function PMA_getEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html ) { - + $ret = ''; if (! empty($edit_url)) { - + $ret .= '' . PMA_linkOrButton($edit_url, $edit_str, array(), false); /* @@ -4634,9 +4636,9 @@ function PMA_getEditLink($edit_url, $class, $edit_str, $where_clause, } $ret .= ''; } - + return $ret; - + } @@ -4654,18 +4656,18 @@ function PMA_getEditLink($edit_url, $class, $edit_str, $where_clause, function PMA_getCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class ) { - + $ret = ''; if (! empty($copy_url)) { - + $ret .= '' . PMA_linkOrButton($copy_url, $copy_str, array(), false); - + /* * Where clause for selecting this row uniquely is provided as * a hidden input. Used by jQuery scripts for handling grid editing @@ -4676,9 +4678,9 @@ function PMA_getCopyLink($copy_url, $copy_str, $where_clause, } $ret .= ''; } - + return $ret; - + } @@ -4694,22 +4696,22 @@ function PMA_getCopyLink($copy_url, $copy_str, $where_clause, */ function PMA_getDeleteLink($del_url, $del_str, $js_conf, $class) { - + $ret = ''; if (! empty($del_url)) { - + $ret .= '' . PMA_linkOrButton($del_url, $del_str, $js_conf, false) . ''; } - + return $ret; - + } @@ -4740,52 +4742,52 @@ function PMA_getCheckboxAndLinks($position, $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $condition_array, $del_query, $id_suffix, $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf ) { - + $ret = ''; if ($position == 'left') { - + $ret .= PMA_getCheckboxForMultiRowSubmissions( - $del_url, $is_display, $row_no, $where_clause_html, $condition_array, - $del_query, $id_suffix = '_left', '', '', '' - ); + $del_url, $is_display, $row_no, $where_clause_html, $condition_array, + $del_query, $id_suffix = '_left', '', '', '' + ); $ret .= PMA_getEditLink( - $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' - ); + $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' + ); $ret .= PMA_getCopyLink( - $copy_url, $copy_str, $where_clause, $where_clause_html, '' - ); + $copy_url, $copy_str, $where_clause, $where_clause_html, '' + ); $ret .= PMA_getDeleteLink($del_url, $del_str, $js_conf, '', ''); } elseif ($position == 'right') { - + $ret .= PMA_getDeleteLink($del_url, $del_str, $js_conf, '', ''); $ret .= PMA_getCopyLink( - $copy_url, $copy_str, $where_clause, $where_clause_html, '' - ); + $copy_url, $copy_str, $where_clause, $where_clause_html, '' + ); $ret .= PMA_getEditLink( - $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' - ); + $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' + ); $ret .= PMA_getCheckboxForMultiRowSubmissions( - $del_url, $is_display, $row_no, $where_clause_html, $condition_array, - $del_query, $id_suffix = '_right', '', '', '' - ); - + $del_url, $is_display, $row_no, $where_clause_html, $condition_array, + $del_query, $id_suffix = '_right', '', '', '' + ); + } else { // $position == 'none' - + $ret .= PMA_getCheckboxForMultiRowSubmissions( - $del_url, $is_display, $row_no, $where_clause_html, $condition_array, - $del_query, $id_suffix = '_left', '', '', '' - ); + $del_url, $is_display, $row_no, $where_clause_html, $condition_array, + $del_query, $id_suffix = '_left', '', '', '' + ); } - + return $ret; - + } ?>