diff options
author | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-05-11 14:35:55 +0400 |
---|---|---|
committer | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-05-11 14:35:55 +0400 |
commit | bf15800089d11e83dc7998e5064dafcf2280c118 (patch) | |
tree | 3fbc3e8efb1b064b663a9ba7ee143011516339ac | |
parent | 61360750cacb245ef61b62f0134788af7bd8295b (diff) |
Remove HTML rendering inside the functions in display_tbl.lib.php file itselves
33 files changed, 445 insertions, 445 deletions
diff --git a/db_create.php b/db_create.php index d3e5062414..0dff8e4553 100644 --- a/db_create.php +++ b/db_create.php @@ -85,7 +85,7 @@ if (! $result) { * @global array $GLOBALS['extra_data'] * @name $extra_data */ - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query, 'success'); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query, 'success'); //Construct the html for the new database, so that it can be appended to // the list of databases on server_databases.php diff --git a/db_operations.php b/db_operations.php index 427a102ea0..5a04bde59c 100644 --- a/db_operations.php +++ b/db_operations.php @@ -341,7 +341,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { */ if ( $GLOBALS['is_ajax_request'] == true) { $extra_data['newname'] = $newname; - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); }; } @@ -375,7 +375,7 @@ if (empty($is_info)) { echo "\n"; if (isset($message)) { - PMA_showMessage($message, $sql_query); + echo PMA_getMessage($message, $sql_query); unset($message); } } diff --git a/db_tracking.php b/db_tracking.php index 4077f75748..e151977baf 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -225,7 +225,7 @@ if (count($data['ddlog']) > 0) { foreach ($data['ddlog'] as $entry) { $log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n" . $entry['statement'] . "\n"; } - PMA_showMessage(__('Database Log'), $log); + echo PMA_getMessage(__('Database Log'), $log); } /** diff --git a/js/db_operations.js b/js/db_operations.js index c9c0289232..170ff1ec0e 100644 --- a/js/db_operations.js +++ b/js/db_operations.js @@ -60,7 +60,7 @@ $(function() { .end() .after(data.sql_query); - //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage() + //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage() var $notice_class = $("#floating_menubar").next("div").find('.notice'); if ($notice_class.text() == '') { $notice_class.remove(); diff --git a/js/server_privileges.js b/js/server_privileges.js index 050ec45d79..fa2cc53119 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -188,7 +188,7 @@ $(function() { .end() .after(data.sql_query); - //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage() + //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage() var $notice_class = $("#floating_menubar").next("div").find('.notice'); if ($notice_class.text() == '') { $notice_class.remove(); diff --git a/js/tbl_change.js b/js/tbl_change.js index 05132d3664..04c5247fac 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -345,7 +345,7 @@ $(function() { .end() .after(data.sql_query); - //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage() + //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage() var $notice_class = $("#floating_menubar").next("div").find('.notice'); if ($notice_class.text() == '') { $notice_class.remove(); diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index 3e00bbf4e6..60fdbd0c8f 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -89,7 +89,7 @@ class PMA_Menu echo $this->_getBreadcrumbs(); echo $this->_getMenu(); if (! empty($GLOBALS['message'])) { - PMA_showMessage($GLOBALS['message']); + echo PMA_getMessage($GLOBALS['message']); unset($GLOBALS['message']); } } diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 556fc1787d..4ae968ad8a 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -965,7 +965,7 @@ if (typeof(window.parent) != 'undefined' } /** - * displays the message and the query + * Prepare the message and the query * usually the message is the result of the query executed * * @param string $message the message to display @@ -977,7 +977,7 @@ if (typeof(window.parent) != 'undefined' * * @access public */ -function PMA_showMessage( +function PMA_getMessage( $message, $sql_query = null, $type = 'notice', @@ -1337,7 +1337,7 @@ function PMA_showMessage( return $retval; -} // end of the 'PMA_showMessage()' function +} // end of the 'PMA_getMessage()' function /** * Verifies if current MySQL server supports profiling diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 10806345c0..3b12c07a53 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -51,7 +51,7 @@ require_once './libraries/Index.class.php'; * * @access private * - * @see PMA_displayTable() + * @see PMA_getTable() */ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) { @@ -218,7 +218,7 @@ function PMA_isSelect() /** - * Displays a navigation button + * Get a navigation button * * @param string $caption iconic caption for button * @param string $title text for button @@ -228,7 +228,7 @@ function PMA_isSelect() * @param string $input_for_real_end optional hidden field for special treatment * @param string $onclick optional onclick clause * - * @return void + * @return string html content * * @global string $db the database name * @global string $table the table name @@ -236,9 +236,9 @@ function PMA_isSelect() * * @access private * - * @see PMA_displayTableNavigation() + * @see PMA_getTableNavigation() */ -function PMA_displayTableNavigationButton($caption, $title, $pos, $html_sql_query, +function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '' ) { global $db, $table, $goto; @@ -254,34 +254,32 @@ function PMA_displayTableNavigationButton($caption, $title, $pos, $html_sql_quer ) { $caption_output .= ' ' . $title; } - $title_output = ' title="' . $title . '"'; - ?> -<td> - <form action="sql.php" method="post" <?php echo $onsubmit; ?>> - <?php echo PMA_generate_common_hidden_inputs($db, $table); ?> - <input type="hidden" name="sql_query" value="<?php - echo $html_sql_query; ?>" /> - <input type="hidden" name="pos" value="<?php echo $pos; ?>" /> - <input type="hidden" name="goto" value="<?php echo $goto; ?>" /> - <?php echo $input_for_real_end; ?> - <input type="submit" name="navig" <?php - echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : '' ); - ?> value="<?php echo $caption_output; ?>"<?php - echo $title_output . $onclick; ?> /> - </form> -</td> -<?php -} // end function PMA_displayTableNavigationButton() + $title_output = ' title="' . $title . '"'; + + return '<td>' + . '<form action="sql.php" method="post" ' . $onsubmit . '>' + . PMA_generate_common_hidden_inputs($db, $table) + . '<input type="hidden" name="sql_query" value="' . $html_sql_query . '" />' + . '<input type="hidden" name="pos" value="' . $pos . '" />' + . '<input type="hidden" name="goto" value="' . $goto . '" />' + . $input_for_real_end + . '<input type="submit" name="navig"' + . ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax" ' : '' ) + . 'value="' . $caption_output . '" ' . $title_output . $onclick . ' />' + . '</form>' + . '</td>'; + +} // end function PMA_getTableNavigationButton() /** - * Displays a navigation bar to browse among the results of a SQL query + * Get a navigation bar to browse among the results of a SQL query * * @param integer $pos_next the offset for the "next" page * @param integer $pos_prev the offset for the "previous" page * @param string $sql_query the URL-encoded query * @param string $id_for_direction_dropdown the id for the direction dropdown * - * @return void + * @return string html content * * @global string $db the database name * @global string $table the table name @@ -295,15 +293,17 @@ function PMA_displayTableNavigationButton($caption, $title, $pos, $html_sql_quer * * @access private * - * @see PMA_displayTable() + * @see PMA_getTable() */ -function PMA_displayTableNavigation($pos_next, $pos_prev, $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 // contains accented characters @@ -315,24 +315,22 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, */ $is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB'); - ?> - -<!-- Navigation bar --> -<table class="navigation nospacing nopadding"> -<tr> - <td class="navigation_separator"></td> - <?php + // Navigation bar + $table_navigation_html .= '<table class="navigation nospacing nopadding">' + . '<tr>' + . '<td class="navigation_separator"></td>'; + // Move to the beginning or to the previous page if ($_SESSION['tmp_user_values']['pos'] && $_SESSION['tmp_user_values']['max_rows'] != 'all' ) { - PMA_displayTableNavigationButton( - '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query - ); - PMA_displayTableNavigationButton( - '<', _pgettext('Previous page', 'Previous'), $pos_prev, - $html_sql_query - ); + $table_navigation_html .= PMA_getTableNavigationButton( + '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query + ); + $table_navigation_html .= PMA_getTableNavigationButton( + '<', _pgettext('Previous page', 'Previous'), $pos_prev, + $html_sql_query + ); } // end move back @@ -341,18 +339,17 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, // (unless we are showing all records) if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //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 - ?> - <td> - <?php + + $table_navigation_html .= '<td>'; $_url_params = array( 'db' => $db, 'table' => $table, @@ -361,22 +358,18 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, ); //<form> to keep the form alignment of button < and << // and also to know what to execute when the selector changes - echo '<form action="sql.php' . PMA_generate_common_url($_url_params) + $table_navigation_html .= '<form action="sql.php' + . PMA_generate_common_url($_url_params) . '" method="post">'; - echo PMA_pageselector( - $_SESSION['tmp_user_values']['max_rows'], - $pageNow, - $nbTotalPage, - 200, - 5, - 5, - 20, - 10 - ); - ?> - </form> - </td> - <?php + + $table_navigation_html .= PMA_pageselector( + $_SESSION['tmp_user_values']['max_rows'], + $pageNow, $nbTotalPage, 200, 5, 5, 20, 10 + ); + + $table_navigation_html .= '</form>' + . '</td>'; + } //_if2 } //_if1 @@ -385,21 +378,19 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, && ($GLOBALS['cfg']['ShowAll'] || ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows)) ) { - echo "\n"; - ?> - <td> - <form action="sql.php" method="post"> - <?php echo PMA_generate_common_hidden_inputs($db, $table); ?> - <input type="hidden" name="sql_query" value="<?php - echo $html_sql_query; ?>" /> - <input type="hidden" name="pos" value="0" /> - <input type="hidden" name="session_max_rows" value="all" /> - <input type="hidden" name="goto" value="<?php echo $goto; ?>" /> - <input type="submit" name="navig" value="<?php - echo __('Show all'); ?>" /> - </form> - </td> - <?php + $table_navigation_html .= "\n"; + + $table_navigation_html .= '<td>' + . '<form action="sql.php" method="post">' + . PMA_generate_common_hidden_inputs($db, $table) + . '<input type="hidden" name="sql_query" value="' . $html_sql_query . '" />' + . '<input type="hidden" name="pos" value="0" />' + . '<input type="hidden" name="session_max_rows" value="all" />' + . '<input type="hidden" name="goto" value="' . $goto . '" />' + . '<input type="submit" name="navig" value="' . __('Show all') . '" />' + . '</form>' + . '</td>'; + } // end show all // Move to the next page or to the last one @@ -408,12 +399,12 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, && $_SESSION['tmp_user_values']['max_rows'] != 'all' ) { // display the Next button - PMA_displayTableNavigationButton( - '>', - _pgettext('Next page', 'Next'), - $pos_next, - $html_sql_query - ); + $table_navigation_html .= PMA_getTableNavigationButton( + '>', + _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']) { @@ -432,101 +423,111 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, ? 'true' : 'false' . '"'; // display the End button - PMA_displayTableNavigationButton( - '>>', - _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 - ); + $table_navigation_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 + ); } // end move toward // show separator if pagination happen if ($nbTotalPage > 1) { - echo '<td><div class="navigation_separator">|</div></td>'; - } - ?> - <td> - <div class="save_edited hide"> - <input type="submit" value="<?php echo __('Save edited data'); ?>" /> - <div class="navigation_separator">|</div> - </div> - </td> - <td> - <div class="restore_column hide"> - <input type="submit" value="<?php echo __('Restore column order'); ?>" /> - <div class="navigation_separator">|</div> - </div> - </td> - -<?php // if displaying a VIEW, $unlim_num_rows could be zero because - // of $cfg['MaxExactCountViews']; in this case, avoid passing - // the 5th parameter to checkFormElementInRange() - // (this means we can't validate the upper limit ?> - <td class="navigation_goto"> - <form action="sql.php" method="post" - onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php - echo str_replace('\'', '\\\'', __('%d is not valid row number.')); - ?>', 1) && checkFormElementInRange(this, 'pos', '<?php - echo str_replace('\'', '\\\'', __('%d is not valid row number.')); - ?>', 0<?php echo $unlim_num_rows > 0 ? ',' . $unlim_num_rows - 1 : ''; ?>))"> - <?php echo PMA_generate_common_hidden_inputs($db, $table); ?> - <input type="hidden" name="sql_query" value="<?php - echo $html_sql_query; ?>" /> - <input type="hidden" name="goto" value="<?php echo $goto; ?>" /> - <input type="submit" name="navig" <?php - echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : ''); - ?> value="<?php echo __('Show'); ?> :" /> - <?php echo __('Start row') . ': ' . "\n"; ?> - <input type="text" name="pos" size="3" value="<?php - echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" - class="textfield" onfocus="this.select()" /> - <?php echo __('Number of rows') . ': ' . "\n"; ?> - <input type="text" name="session_max_rows" size="3" value="<?php - echo (($_SESSION['tmp_user_values']['max_rows'] != 'all') - ? $_SESSION['tmp_user_values']['max_rows'] - : $GLOBALS['cfg']['MaxRows']); ?>" - class="textfield" onfocus="this.select()" /> - <?php - if ($GLOBALS['cfg']['ShowDisplayDirection']) { - // Display mode (horizontal/vertical and repeat headers) - echo __('Mode') . ': ' . "\n"; - $choices = array( - 'horizontal' => __('horizontal'), - 'horizontalflipped' => __('horizontal (rotated headers)'), - 'vertical' => __('vertical') - ); - echo PMA_generate_html_dropdown( + $table_navigation_html .= '<td><div class="navigation_separator">|</div></td>'; + } + + $table_navigation_html .= '<td>' + . '<div class="save_edited hide">' + . '<input type="submit" value="' . __('Save edited data') . '" />' + . '<div class="navigation_separator">|</div>' + . '</div>' + . '</td>' + . '<td>' + . '<div class="restore_column hide">' + . '<input type="submit" value="' . __('Restore column order') . '" />' + . '<div class="navigation_separator">|</div>' + . '</div>' + . '</td>'; + + // if displaying a VIEW, $unlim_num_rows could be zero because + // of $cfg['MaxExactCountViews']; in this case, avoid passing + // the 5th parameter to checkFormElementInRange() + // (this means we can't validate the upper limit + $table_navigation_html .= '<td class="navigation_goto">'; + + $table_navigation_html .= '<form action="sql.php" method="post" ' + . 'onsubmit="return ' + . '(checkFormElementInRange(' + . 'this, ' + . '\'session_max_rows\', ' + . '\'' . str_replace('\'', '\\\'', __('%d is not valid row number.')) . '\', ' + . '1)' + . ' && ' + . 'checkFormElementInRange(' + . 'this, ' + . '\'pos\', ' + . '\'' . str_replace('\'', '\\\'', __('%d is not valid row number.')) . '\', ' + . '0' + . ($unlim_num_rows > 0 ? ', ' . ($unlim_num_rows - 1) : '') . ')' + . ')' + .'">'; + + $table_navigation_html .= PMA_generate_common_hidden_inputs($db, $table); + + $table_navigation_html .= '<input type="hidden" name="sql_query" ' + . 'value="' . $html_sql_query . '" />' + . '<input type="hidden" name="goto" value="' . $goto . '" />' + . '<input type="submit" name="navig"' + . ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '') + . ' value="' . __('Show') . ' :" />' + . __('Start row') . ': ' . "\n" + . '<input type="text" name="pos" size="3" value="' + . (($pos_next >= $unlim_num_rows) ? 0 : $pos_next) + . '" class="textfield" onfocus="this.select()" />' + . __('Number of rows') . ': ' . "\n" + . '<input type="text" name="session_max_rows" size="3" value="' + . (($_SESSION['tmp_user_values']['max_rows'] != 'all') + ? $_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) + $table_navigation_html .= __('Mode') . ': ' . "\n"; + $choices = array( + 'horizontal' => __('horizontal'), + 'horizontalflipped' => __('horizontal (rotated headers)'), + 'vertical' => __('vertical') + ); + $table_navigation_html .= PMA_getDropdown( 'disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], $id_for_direction_dropdown ); - unset($choices); - } + unset($choices); + } - printf( - __('Headers every %s rows'), - '<input type="text" size="3" name="repeat_cells" value="' - . $_SESSION['tmp_user_values']['repeat_cells'] - . '" class="textfield" />' - ); - echo "\n"; - ?> - </form> - </td> - <td class="navigation_separator"></td> -</tr> -</table> + $table_navigation_html .= __('Headers every') + . ' <input type="text" size="3" name="repeat_cells" value="' + . $_SESSION['tmp_user_values']['repeat_cells'] + . '" class="textfield" /> ' + . __('rows') + . "\n"; - <?php -} // end of the 'PMA_displayTableNavigation()' function + $table_navigation_html .= '</form>' + . '</td>' + . '<td class="navigation_separator"></td>' + . '</tr>' + . '</table>'; + + return $table_navigation_html; + +} // end of the 'PMA_getTableNavigation()' function /** - * Displays the headers of the results table + * Get the headers of the results table * * @param array &$is_display which elements to display * @param array &$fields_meta the list of fields properties @@ -537,7 +538,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, * @param string $sort_expression_nodirection sort expression without direction * @param string $sort_direction sort direction * - * @return boolean $clause_is_unique + * @return string html content * * @global string $db the database name * @global string $table the table name @@ -550,9 +551,9 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, * * @access private * - * @see PMA_displayTable() + * @see PMA_getTable() */ -function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, +function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $analyzed_sql = '', $sort_expression = '', $sort_expression_nodirection = '', $sort_direction = '' ) { @@ -1350,11 +1351,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, } - // render all HTML content related to table headers - echo $table_headers_html; - - return true; -} // end of the 'PMA_displayTableHeaders()' function + return $table_headers_html; +} // end of the 'PMA_getTableHeaders()' function /** @@ -1404,10 +1402,9 @@ function PMA_buildNullDisplay($class, $condition_field, $meta, $align = '') */ function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '') { - $nowrap = ' nowrap'; return '<td ' . $align . ' class="' . PMA_addClass( - $class, $condition_field, $meta, $nowrap + $class, $condition_field, $meta, ' nowrap' ) . '"></td>'; } @@ -1455,7 +1452,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, . $enum_class . $set_class . $bit_class . $mime_type_class; } /** - * Displays the body of the results table + * Prepare the body of the results table * * @param integer &$dt_result the link id associated to the query * which results have to be displayed @@ -1463,7 +1460,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, * @param array $map the list of relations * @param array $analyzed_sql the analyzed query * - * @return boolean always true + * @return array ($table_body_html, $clause_is_unique) * * @global string $db the database name * @global string $table the table name @@ -1479,9 +1476,9 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, * * @access private * - * @see PMA_displayTable() + * @see PMA_getTable() */ -function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) +function PMA_getTableBodyParams(&$dt_result, &$is_display, $map, $analyzed_sql) { global $db, $table, $goto; global $sql_query, $fields_meta, $fields_cnt; @@ -1704,7 +1701,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) if (! isset($js_conf)) { $js_conf = ''; } - $table_body_html .= PMA_generateCheckboxAndLinks( + $table_body_html .= PMA_getCheckboxAndLinks( 'left', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $condition_array, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, @@ -1717,7 +1714,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) if (! isset($js_conf)) { $js_conf = ''; } - $table_body_html .= PMA_generateCheckboxAndLinks( + $table_body_html .= PMA_getCheckboxAndLinks( 'none', $del_url, $is_display, $row_no, $where_clause, $where_clause_html, $condition_array, $del_query, 'l', $edit_url, $copy_url, $edit_anchor_class, @@ -1853,7 +1850,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $where_comparison = ' = ' . $row[$i]; $vertical_display['data'][$row_no][$i] = '<td ' - . PMA_prepare_row_data( + . PMA_getRowData( 'right '.$class, $condition_field, $analyzed_sql, $meta, $map, $row[$i], $transform_function, $default_function, $nowrap, @@ -1880,7 +1877,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $vertical_display['data'][$row_no][$i] = PMA_buildNullDisplay($class, $condition_field, $meta); } else { - $blobtext = PMA_handle_non_printable_contents( + $blobtext = PMA_handleNonPrintableContents( 'BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta, $_url_params @@ -1937,7 +1934,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } elseif ($row[$i] != '') { // Display as [GEOMETRY - (size)] if ('GEOM' == $_SESSION['tmp_user_values']['geometry_display']) { - $geometry_text = PMA_handle_non_printable_contents( + $geometry_text = PMA_handleNonPrintableContents( 'GEOMETRY', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta @@ -1946,7 +1943,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $class, $condition_field, $geometry_text ); - // Display in Well Known Text(WKT) format. + // Prepare in Well Known Text(WKT) format. } elseif ('WKT' == $_SESSION['tmp_user_values']['geometry_display']) { $where_comparison = ' = ' . $row[$i]; @@ -1962,14 +1959,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } $vertical_display['data'][$row_no][$i] = '<td ' - . PMA_prepare_row_data( + . PMA_getRowData( $class, $condition_field, $analyzed_sql, $meta, $map, $wktval, $transform_function, $default_function, '', $where_comparison, $transform_options, $is_field_truncated ); - // Display in Well Known Binary(WKB) format. + // Prepare in Well Known Binary(WKB) format. } else { if ($_SESSION['tmp_user_values']['display_binary']) { $where_comparison = ' = ' . $row[$i]; @@ -1993,7 +1990,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } $vertical_display['data'][$row_no][$i] = '<td ' - . PMA_prepare_row_data( + . PMA_getRowData( $class, $condition_field, $analyzed_sql, $meta, $map, $wkbval, $transform_function, $default_function, '', @@ -2001,7 +1998,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $is_field_truncated ); } else { - $wkbval = PMA_handle_non_printable_contents( + $wkbval = PMA_handleNonPrintableContents( 'BINARY', $row[$i], $transform_function, $transform_options, $default_function, $meta, $_url_params @@ -2064,7 +2061,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } else { // we show the BINARY message and field's size // (or maybe use a transformation) - $row[$i] = PMA_handle_non_printable_contents( + $row[$i] = PMA_handleNonPrintableContents( 'BINARY', $row[$i], $transform_function, $transform_options, $default_function, $meta, $_url_params @@ -2093,7 +2090,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $where_comparison = ' = \'' . PMA_sqlAddSlashes($row[$i]) . '\''; $vertical_display['data'][$row_no][$i] = '<td ' - . PMA_prepare_row_data( + . PMA_getRowData( $class, $condition_field, $analyzed_sql, $meta, $map, $row[$i], $transform_function, $default_function, $nowrap, @@ -2132,7 +2129,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) if (! isset($js_conf)) { $js_conf = ''; } - $table_body_html .= PMA_generateCheckboxAndLinks( + $table_body_html .= PMA_getCheckboxAndLinks( '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, @@ -2163,7 +2160,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } if (!empty($del_url) && $is_display['del_lnk'] != 'kp') { - $vertical_display['row_delete'][$row_no] .= PMA_generateCheckboxForMulti( + $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 @@ -2173,7 +2170,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } if (isset($edit_url)) { - $vertical_display['edit'][$row_no] .= PMA_generateEditLink( + $vertical_display['edit'][$row_no] .= PMA_getEditLink( $edit_url, $alternating_color_class . ' ' . $edit_anchor_class . $vertical_class, $edit_str, @@ -2185,7 +2182,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) } if (isset($copy_url)) { - $vertical_display['copy'][$row_no] .= PMA_generateCopyLink( + $vertical_display['copy'][$row_no] .= PMA_getCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, $alternating_color_class . $vertical_class ); @@ -2197,7 +2194,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) if (! isset($js_conf)) { $js_conf = ''; } - $vertical_display['delete'][$row_no] .= PMA_generateDeleteLink( + $vertical_display['delete'][$row_no] .= PMA_getDeleteLink( $del_url, $del_str, $js_conf, $alternating_color_class . $vertical_class ); @@ -2212,33 +2209,30 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) $row_no++; } // end while - // render the html content of table body - echo $table_body_html; - - // this is needed by PMA_displayTable() to generate the proper param + // $clause_is_unique is needed by PMA_getTable() to generate the proper param // in the multi-edit and multi-delete form - return $clause_is_unique; -} // end of the 'PMA_displayTableBody()' function + return array($table_body_html, $clause_is_unique); +} // end of the 'PMA_getTableBodyParams()' function /** - * Do display the result table with the vertical direction mode. + * Get the resulted table with the vertical direction mode. * - * @return boolean always true + * @return string html content * * @global array $vertical_display the information to display * * @access private * - * @see PMA_displayTable() + * @see PMA_getTable() */ -function PMA_displayVerticalTable() +function PMA_getVerticalTable() { global $vertical_display; $vertical_table_html = ''; - // Displays "multi row delete" link at top if required + // Prepares "multi row delete" link at top if required if ($GLOBALS['cfg']['RowActionLinks'] != 'right' && is_array($vertical_display['row_delete']) && (count($vertical_display['row_delete']) > 0 @@ -2269,7 +2263,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "edit" link at top if required + // Prepares "edit" link at top if required if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['edit']) @@ -2286,7 +2280,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "copy" link at top if required + // Prepares "copy" link at top if required if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['copy']) @@ -2303,7 +2297,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "delete" link at top if required + // Prepares "delete" link at top if required if (($GLOBALS['cfg']['RowActionLinks'] == 'left' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['delete']) @@ -2332,7 +2326,7 @@ function PMA_displayVerticalTable() $col_visib = false; } - // Displays data + // Prepares data foreach ($vertical_display['desc'] AS $j => $val) { // assign appropriate key with current column order $key = $col_order ? $col_order[$j] : $j; @@ -2357,7 +2351,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end while - // Displays "multi row delete" link at bottom if required + // Prepares "multi row delete" link at bottom if required if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['row_delete']) @@ -2384,7 +2378,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "edit" link at bottom if required + // Prepares "edit" link at bottom if required if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['edit']) @@ -2401,7 +2395,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "copy" link at bottom if required + // Prepares "copy" link at bottom if required if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['copy']) @@ -2418,7 +2412,7 @@ function PMA_displayVerticalTable() $vertical_table_html .= '</tr>' . "\n"; } // end if - // Displays "delete" link at bottom if required + // Prepares "delete" link at bottom if required if (($GLOBALS['cfg']['RowActionLinks'] == 'right' || $GLOBALS['cfg']['RowActionLinks'] == 'both') && is_array($vertical_display['delete']) @@ -2436,12 +2430,9 @@ function PMA_displayVerticalTable() } // end while $vertical_table_html .= '</tr>' . "\n"; } - - // render HTML content of verticle table - echo $vertical_table_html; - return true; -} // end of the 'PMA_displayVerticalTable' function + return $vertical_table_html; +} // end of the 'PMA_getVerticalTable' function /** * Checks the posted options for viewing query resutls @@ -2454,16 +2445,16 @@ function PMA_displayVerticalTable() * * @return void */ -function PMA_displayTable_checkConfigParams() +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']; @@ -2625,13 +2616,15 @@ function PMA_displayTable_checkConfigParams() } /** - * Displays a table of results returned by a SQL query. + * Prepare a table of results returned by a SQL query. * This function is called by the "sql.php" script. * * @param integer &$dt_result the link id associated to the query * 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 @@ -2653,22 +2646,24 @@ function PMA_displayTable_checkConfigParams() * * @access private * - * @see PMA_showMessage(), PMA_setDisplayMode(), - * PMA_displayTableNavigation(), PMA_displayTableHeaders(), - * PMA_displayTableBody(), PMA_displayResultsOperations() + * @see PMA_getMessage(), PMA_setDisplayMode(), + * PMA_getTableNavigation(), PMA_getTableHeaders(), + * PMA_getTableBodyParams(), PMA_getResultsOperations() * * @return void */ -function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) +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) - //PMA_displayTable_checkConfigParams(); + //PMA_setConfigParamsForDisplayTable(); /** * @todo move this to a central place @@ -2685,10 +2680,10 @@ function PMA_displayTable(&$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 = ''; @@ -2723,8 +2718,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // even if there are many table references if (! empty($analyzed_sql[0]['order_by_clause'])) { $sort_expression = trim( - str_replace(' ', ' ', $analyzed_sql[0]['order_by_clause']) - ); + str_replace(' ', ' ', $analyzed_sql[0]['order_by_clause']) + ); /** * Get rid of ASC|DESC */ @@ -2769,33 +2764,33 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) // 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_handle_non_printable_contents( - $meta->type, $row[$sorted_column_index], $transform_function, - $transform_options, $default_function, $meta, null - ); + $column_for_first_row = PMA_handleNonPrintableContents( + $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_handle_non_printable_contents( - $meta->type, $row[$sorted_column_index], $transform_function, - $transform_options, $default_function, $meta, null - ); + $column_for_last_row = PMA_handleNonPrintableContents( + $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']) - ); - // reset to first row for the loop in PMA_displayTableBody() + substr($column_for_last_row, 0, $GLOBALS['cfg']['LimitChars']) + ); + // reset to first row for the loop in PMA_getTableBodyParams() PMA_DBI_data_seek($dt_result, 0); // we could also use here $sort_expression_nodirection $sorted_column_message = ' [' . htmlspecialchars($sort_column) @@ -2807,9 +2802,9 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) unset($sorted_column_index, $sort_table, $sort_column); } - // 2. ----- Displays the top of the page ----- + // 2. ----- Prepare to display the top of the page ----- - // 2.1 Displays a messages with position informations + // 2.1 Prepares a messages with position informations if ($is_display['nav_bar'] == '1' && isset($pos_next)) { if (isset($unlim_num_rows) && $unlim_num_rows != $total) { $selectstring = ', ' . $unlim_num_rows . ' ' . __('in query'); @@ -2838,8 +2833,8 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) && $total == $GLOBALS['cfg']['MaxExactCountViews'] ) { $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]'); $message_view_warning = PMA_showHint($message); @@ -2873,16 +2868,16 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) $message->addMessage($sorted_column_message, ''); } - PMA_showMessage($message, $sql_query, 'success'); + $table_html .= PMA_getMessage($message, $sql_query, 'success'); } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { - PMA_showMessage( - __('Your SQL query has been executed successfully'), - $sql_query, 'success' - ); + $table_html .= PMA_getMessage( + __('Your SQL query has been executed successfully'), + $sql_query, 'success' + ); } - // 2.3 Displays the navigation bars + // 2.3 Prepare the navigation bars if (! strlen($table)) { if (isset($analyzed_sql[0]['query_type']) && $analyzed_sql[0]['query_type'] == 'SELECT' @@ -2897,12 +2892,12 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) } if ($is_display['nav_bar'] == '1' && empty($analyzed_sql[0]['limit_clause'])) { - PMA_displayTableNavigation( - $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown' - ); - echo "\n"; + $table_html .= PMA_getTableNavigation( + $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown' + ) + . "\n"; } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { - echo "\n" . '<br /><br />' . "\n"; + $table_html .= "\n" . '<br /><br />' . "\n"; } // 2b ----- Get field references from Database ----- @@ -2936,40 +2931,42 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) 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'], - $display_field, - $rel['foreign_db'] - ); + $rel['foreign_table'], + $rel['foreign_field'], + $display_field, + $rel['foreign_db'] + ); } // end while } // end if } // end if // end 2b - // 3. ----- Displays the results table ----- - PMA_displayTableHeaders( - $is_display, $fields_meta, $fields_cnt, $analyzed_sql, - $sort_expression, $sort_expression_nodirection, $sort_direction - ); - $url_query = ''; - echo '<tbody>' . "\n"; - $clause_is_unique = PMA_displayTableBody( - $dt_result, $is_display, $map, $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 + ) + . '<tbody>' . "\n"; + + $url_query = ''; + list($table_body_html, $clause_is_unique) = PMA_getTableBodyParams( + $dt_result, $is_display, $map, $analyzed_sql + ); + + $table_html .= $table_body_html; + // vertical output case if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') { - PMA_displayVerticalTable(); + $table_html .= PMA_getVerticalTable(); } // end if unset($vertical_display); - echo '</tbody>' . "\n"; - ?> -</table> - - <?php - // 4. ----- Displays the link for multi-fields edit and delete + $table_html .= '</tbody>' . "\n" + . '</table>'; + + // 4. ----- Prepares the link for multi-fields edit and delete if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') { @@ -2998,68 +2995,71 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql) = 'if (unMarkAllRows(\'resultsForm\')) return false;'; } $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') { - echo '<img class="selectallarrow" width="38" height="22"' - .' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' + $table_html .= '<img class="selectallarrow" width="38" height="22"' + . ' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"' - .' alt="' . __('With selected:') . '" />'; + . ' alt="' . __('With selected:') . '" />'; } - echo $checkall_link . "\n" - .' / ' . "\n" - .$uncheckall_link . "\n" - .'<i>' . __('With selected:') . '</i>' . "\n"; - - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_change', - __('Change'), 'b_edit.png', 'edit' - ); - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_delete', - $delete_text, 'b_drop.png', 'delete' - ); - if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') { - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' + $table_html .= $checkall_link . "\n" + . ' / ' . "\n" + . $uncheckall_link . "\n" + . '<i>' . __('With selected:') . '</i>' . "\n"; + + $table_html .= PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_change', + __('Change'), 'b_edit.png', 'edit' ); + $table_html .= PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_delete', + $delete_text, 'b_drop.png', 'delete' + ); + if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') { + $table_html .= PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_export', + __('Export'), 'b_tblexport.png', 'export' + ); } - echo "\n"; + $table_html .= "\n"; - echo '<input type="hidden" name="sql_query"' + $table_html .= '<input type="hidden" name="sql_query"' .' value="' . htmlspecialchars($sql_query) . '" />' . "\n"; if (! empty($GLOBALS['url_query'])) { - echo '<input type="hidden" name="url_query"' + $table_html .= '<input type="hidden" name="url_query"' .' value="' . $GLOBALS['url_query'] . '" />' . "\n"; } - echo '<input type="hidden" name="clause_is_unique"' + $table_html .= '<input type="hidden" name="clause_is_unique"' .' value="' . $clause_is_unique . '" />' . "\n"; - echo '</form>' . "\n"; + $table_html .= '</form>' . "\n"; } - // 5. ----- Displays the navigation bar at the bottom if required ----- + // 5. ----- Get the navigation bar at the bottom if required ----- if ($is_display['nav_bar'] == '1' && empty($analyzed_sql[0]['limit_clause'])) { - echo '<br />' . "\n"; - PMA_displayTableNavigation( - $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown' - ); + $table_html .= '<br />' . "\n"; + $table_html .= PMA_getTableNavigation( + $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown' + ); } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { - echo "\n" . '<br /><br />' . "\n"; + $table_html .= "\n" . '<br /><br />' . "\n"; } - // 6. ----- Displays "Query results operations" + // 6. ----- Prepare "Query results operations" if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') { - PMA_displayResultsOperations($the_disp_mode, $analyzed_sql); + $table_html .= PMA_getResultsOperations($the_disp_mode, $analyzed_sql); } -} // end of the 'PMA_displayTable()' function + + return $table_html; + +} // end of the 'PMA_getTable()' function /** * replace some html-unfriendly stuff @@ -3078,11 +3078,13 @@ function PMA_mimeDefaultFunction($buffer) } /** - * Displays operations that are available on results. + * 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 @@ -3092,13 +3094,13 @@ function PMA_mimeDefaultFunction($buffer) * * @access private * - * @see PMA_showMessage(), PMA_setDisplayMode(), - * PMA_displayTableNavigation(), PMA_displayTableHeaders(), - * PMA_displayTableBody(), PMA_displayResultsOperations() + * @see PMA_getMessage(), PMA_setDisplayMode(), + * PMA_getTableNavigation(), PMA_getTableHeaders(), + * PMA_getTableBodyParams(), PMA_getResultsOperations() * * @return void */ -function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) +function PMA_getResultsOperations($the_disp_mode, $analyzed_sql) { global $db, $table, $sql_query, $unlim_num_rows, $fields_meta; @@ -3191,7 +3193,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) ) . "\n"; - // show chart + // prepare chart $results_operations_html .= PMA_linkOrButton( 'tbl_chart.php' . PMA_generate_common_url($_url_params), PMA_getIcon('b_chart.png', __('Display chart'), true), @@ -3199,7 +3201,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) ) . "\n"; - // show GIS chart + // prepare GIS chart $geometry_found = false; // If atleast one geometry field is found foreach ($fields_meta as $meta) { @@ -3244,9 +3246,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) $results_operations_html .= '</fieldset><br />'; } - // render HTML content of results operations - echo $results_operations_html; - + return $results_operations_html; } /** @@ -3263,7 +3263,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) * * @return mixed string or float */ -function PMA_handle_non_printable_contents($category, $content, $transform_function, +function PMA_handleNonPrintableContents($category, $content, $transform_function, $transform_options, $default_function, $meta, $url_params = array() ) { $result = '[' . $category; @@ -3320,7 +3320,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct * * @return string formatted data */ -function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $map, +function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map, $data, $transform_function, $default_function, $nowrap, $where_comparison, $transform_options, $is_field_truncated ) { @@ -3448,7 +3448,7 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m } /** - * Generates a checkbox for multi-row submits + * Prepares a checkbox for multi-row submits * * @param string $del_url delete url * @param array $is_display array with explicit indexes for all @@ -3463,7 +3463,7 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m * @return string the generated HTML */ -function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, +function PMA_getCheckboxForMultiRowSubmissions($del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix, $class ) { $ret = ''; @@ -3489,7 +3489,7 @@ function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, } /** - * Generates an Edit link + * Prepares an Edit link * * @param string $edit_url edit url * @param string $class css classes for td element @@ -3499,7 +3499,7 @@ function PMA_generateCheckboxForMulti($del_url, $is_display, $row_no, * * @return string the generated HTML */ -function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, +function PMA_getEditLink($edit_url, $class, $edit_str, $where_clause, $where_clause_html ) { $ret = ''; @@ -3520,7 +3520,7 @@ function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, } /** - * Generates an Copy link + * Prepares an Copy link * * @param string $copy_url copy url * @param string $copy_str text for the copy link @@ -3530,7 +3530,7 @@ function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause, * * @return string the generated HTML */ -function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, +function PMA_getCopyLink($copy_url, $copy_str, $where_clause, $where_clause_html, $class ) { $ret = ''; @@ -3555,7 +3555,7 @@ function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, } /** - * Generates a Delete link + * Prepares a Delete link * * @param string $del_url delete url * @param string $del_str text for the delete link @@ -3564,7 +3564,7 @@ function PMA_generateCopyLink($copy_url, $copy_str, $where_clause, * * @return string the generated HTML */ -function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class) +function PMA_getDeleteLink($del_url, $del_str, $js_conf, $class) { $ret = ''; if (! empty($del_url)) { @@ -3580,7 +3580,7 @@ function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class) } /** - * Generates checkbox and links at some position (left or right) + * Prepare checkbox and links at some position (left or right) * (only called for horizontal mode) * * @param string $position the position of the checkbox and links @@ -3602,45 +3602,45 @@ function PMA_generateDeleteLink($del_url, $del_str, $js_conf, $class) * * @return string the generated HTML */ -function PMA_generateCheckboxAndLinks($position, $del_url, $is_display, $row_no, +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_generateCheckboxForMulti( + $ret .= PMA_getCheckboxForMultiRowSubmissions( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix = '_left', '', '', '' ); - $ret .= PMA_generateEditLink( + $ret .= PMA_getEditLink( $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' ); - $ret .= PMA_generateCopyLink( + $ret .= PMA_getCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, '' ); - $ret .= PMA_generateDeleteLink($del_url, $del_str, $js_conf, '', ''); + $ret .= PMA_getDeleteLink($del_url, $del_str, $js_conf, '', ''); } elseif ($position == 'right') { - $ret .= PMA_generateDeleteLink($del_url, $del_str, $js_conf, '', ''); + $ret .= PMA_getDeleteLink($del_url, $del_str, $js_conf, '', ''); - $ret .= PMA_generateCopyLink( + $ret .= PMA_getCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, '' ); - $ret .= PMA_generateEditLink( + $ret .= PMA_getEditLink( $edit_url, $class, $edit_str, $where_clause, $where_clause_html, '' ); - $ret .= PMA_generateCheckboxForMulti( + $ret .= PMA_getCheckboxForMultiRowSubmissions( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix = '_right', '', '', '' ); } else { // $position == 'none' - $ret .= PMA_generateCheckboxForMulti( + $ret .= PMA_getCheckboxForMultiRowSubmissions( $del_url, $is_display, $row_no, $where_clause_html, $condition_array, $del_query, $id_suffix = '_left', '', '', '' ); diff --git a/libraries/rte/rte_events.lib.php b/libraries/rte/rte_events.lib.php index 9d315f8b39..de8bbf5e03 100644 --- a/libraries/rte/rte_events.lib.php +++ b/libraries/rte/rte_events.lib.php @@ -146,7 +146,7 @@ function PMA_EVN_handleEditor() $message->addString('</ul>'); } - $output = PMA_showMessage($message, $sql_query); + $output = PMA_getMessage($message, $sql_query); if ($GLOBALS['is_ajax_request']) { $extra_data = array(); if ($message->isSuccess()) { diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php index 07e10e87f9..69cda0d833 100644 --- a/libraries/rte/rte_routines.lib.php +++ b/libraries/rte/rte_routines.lib.php @@ -299,7 +299,7 @@ function PMA_RTN_handleEditor() $message->addString('</ul>'); } - $output = PMA_showMessage($message, $sql_query); + $output = PMA_getMessage($message, $sql_query); if ($GLOBALS['is_ajax_request']) { $extra_data = array(); if ($message->isSuccess()) { diff --git a/libraries/rte/rte_triggers.lib.php b/libraries/rte/rte_triggers.lib.php index 1683ddf6c2..11a4592bb5 100644 --- a/libraries/rte/rte_triggers.lib.php +++ b/libraries/rte/rte_triggers.lib.php @@ -119,7 +119,7 @@ function PMA_TRI_handleEditor() $message->addString('</ul>'); } - $output = PMA_showMessage($message, $sql_query); + $output = PMA_getMessage($message, $sql_query); if ($GLOBALS['is_ajax_request']) { $extra_data = array(); if ($message->isSuccess()) { @@ -30,7 +30,7 @@ require_once 'libraries/header.inc.php'; // Any message to display? if (! empty($message)) { - PMA_showMessage($message); + echo PMA_getMessage($message); unset($message); } diff --git a/server_binlog.php b/server_binlog.php index 1b21133643..679674bc57 100644 --- a/server_binlog.php +++ b/server_binlog.php @@ -106,7 +106,7 @@ if (count($binary_logs) > 1) { echo '</form>'; } -PMA_showMessage(PMA_Message::success()); +echo PMA_getMessage(PMA_Message::success()); /** * Displays the page diff --git a/server_databases.php b/server_databases.php index e3a032764b..143e1f1c39 100644 --- a/server_databases.php +++ b/server_databases.php @@ -293,7 +293,7 @@ if ($databases_count > 0) { . '<a href="server_databases.php' . $common_url_query . '" onclick="if (unMarkAllRows(\'tabledatabases\')) return false;">' . "\n" . ' ' . __('Uncheck All') . '</a>' . "\n" . '<i>' . __('With selected:') . '</i>' . "\n"; - PMA_buttonOrImage('drop_selected_dbs', 'mult_submit' . ($cfg['AjaxEnable'] ? ' ajax' : ''), 'drop_selected_dbs', __('Drop'), 'b_deltbl.png'); + echo PMA_getButtonOrImage('drop_selected_dbs', 'mult_submit' . ($cfg['AjaxEnable'] ? ' ajax' : ''), 'drop_selected_dbs', __('Drop'), 'b_deltbl.png'); } if (empty($dbstats)) { diff --git a/server_privileges.php b/server_privileges.php index cc2dde43ad..10a1d0f481 100644 --- a/server_privileges.php +++ b/server_privileges.php @@ -1580,7 +1580,7 @@ $link_export_all = '<a class="export_user_anchor ' . $conditional_class . '" hre if ($GLOBALS['is_ajax_request'] && ! isset($_REQUEST['export']) && (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export') && (! isset($_REQUEST['adduser']) || $_add_user_error) && (! isset($_REQUEST['initial']) || empty($_REQUEST['initial'])) && ! isset($_REQUEST['showall']) && ! isset($_REQUEST['edit_user_dialog']) && ! isset($_REQUEST['db_specific'])) { if (isset($sql_query)) { - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); } if (isset($_REQUEST['adduser_submit']) || isset($_REQUEST['change_copy'])) { @@ -1657,7 +1657,7 @@ if (isset($viewing_mode) && $viewing_mode == 'db') { echo "\n"; } else { if (! empty($GLOBALS['message'])) { - PMA_showMessage($GLOBALS['message']); + echo PMA_getMessage($GLOBALS['message']); unset($GLOBALS['message']); } } @@ -1927,10 +1927,10 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs . __('Uncheck All') . '</a>' . "\n" .'<i>' . __('With selected:') . '</i>' . "\n"; - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_export', - __('Export'), 'b_tblexport.png', 'export' - ); + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_export', + __('Export'), 'b_tblexport.png', 'export' + ); echo '<input type="hidden" name="initial" value="' . (isset($initial) ? $initial : '') . '" />'; echo '</div>' . '<div class="clear_both" style="clear:both"></div>' @@ -293,7 +293,7 @@ if (! defined('PMA_CHK_DROP') } // end if require_once 'libraries/display_tbl.lib.php'; -PMA_displayTable_checkConfigParams(); +PMA_setConfigParamsForDisplayTable(); /** * Need to find the real end of rows? @@ -817,7 +817,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { if ($GLOBALS['is_ajax_request'] == true) { if ($cfg['ShowSQL']) { - $extra_data['sql_query'] = PMA_showMessage($message, $GLOBALS['sql_query'], 'success'); + $extra_data['sql_query'] = PMA_getMessage($message, $GLOBALS['sql_query'], 'success'); } if (isset($GLOBALS['reload']) && $GLOBALS['reload'] == 1) { $extra_data['reload'] = 1; @@ -898,9 +898,9 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { if (isset($message)) { $message = PMA_Message::success($message); - echo PMA_showMessage($message, $GLOBALS['sql_query'], 'success'); + echo PMA_getMessage($message, $GLOBALS['sql_query'], 'success'); } - PMA_displayTable($result, $disp_mode, $analyzed_sql); + echo PMA_getTable($result, $disp_mode, $analyzed_sql); exit(); } @@ -931,7 +931,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { } } else { include_once 'libraries/header.inc.php'; - //we don't need to buffer the output in PMA_showMessage here. + //we don't need to buffer the output in PMA_getMessage here. //set a global variable and check against it in the function $GLOBALS['buffer_message'] = false; } @@ -958,7 +958,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) { // Display previous update query (from tbl_replace) if (isset($disp_query) && $cfg['ShowSQL'] == true) { - PMA_showMessage($disp_message, $disp_query, 'success'); + echo PMA_getMessage($disp_message, $disp_query, 'success'); } if (isset($profiling_results)) { @@ -1018,7 +1018,7 @@ $(makeProfilingChart); $message->display(); } - PMA_displayTable($result, $disp_mode, $analyzed_sql); + echo PMA_getTable($result, $disp_mode, $analyzed_sql); PMA_DBI_free_result($result); // BEGIN INDEX CHECK See if indexes should be checked. diff --git a/tbl_addfield.php b/tbl_addfield.php index ff7db7c9d4..c84eff11fa 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -191,7 +191,7 @@ if (isset($_REQUEST['do_save_data'])) { $message->addParam($table); if ( $GLOBALS['is_ajax_request'] == true) { - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_alter.php b/tbl_alter.php index 3bd39f075f..ef8a7f2d3b 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -254,7 +254,7 @@ if (isset($_REQUEST['do_save_data'])) { } if ( $_REQUEST['ajax_request'] == true) { - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_change.php b/tbl_change.php index d6b46b51a4..54c89cdc48 100644 --- a/tbl_change.php +++ b/tbl_change.php @@ -133,7 +133,7 @@ if (! empty($disp_message)) { if (! isset($disp_query)) { $disp_query = null; } - PMA_showMessage($disp_message, $disp_query); + echo PMA_getMessage($disp_message, $disp_query); } /** @@ -176,7 +176,7 @@ if (isset($where_clause)) { // No row returned if (! $rows[$key_id]) { unset($rows[$key_id], $where_clause_array[$key_id]); - PMA_showMessage(__('MySQL returned an empty result set (i.e. zero rows).'), $local_query); + echo PMA_getMessage(__('MySQL returned an empty result set (i.e. zero rows).'), $local_query); echo "\n"; include 'libraries/footer.inc.php'; } else { // end if (no row returned) diff --git a/tbl_export.php b/tbl_export.php index 7e3d4ed727..57e2364e6d 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -76,7 +76,7 @@ if (! empty($sql_query)) { // Just crop LIMIT clause $sql_query = $analyzed_sql[0]['section_before_limit'] . $analyzed_sql[0]['section_after_limit']; } - PMA_showMessage(PMA_Message::success()); + echo PMA_getMessage(PMA_Message::success()); } $export_type = 'table'; diff --git a/tbl_indexes.php b/tbl_indexes.php index 020210f9f5..af268a61ae 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -107,7 +107,7 @@ if (isset($_REQUEST['do_save_data'])) { if ( $GLOBALS['is_ajax_request'] == true) { $extra_data['index_table'] = PMA_Index::getView($table, $db); - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_move_copy.php b/tbl_move_copy.php index 1d966daca9..6779754a59 100644 --- a/tbl_move_copy.php +++ b/tbl_move_copy.php @@ -69,7 +69,7 @@ if (PMA_isValid($_REQUEST['new_name'])) { } if ( $_REQUEST['ajax_request'] == true) { - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); $extra_data['db'] = $GLOBALS['db']; PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_operations.php b/tbl_operations.php index f654fc65cb..9baa8c5d2a 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -232,7 +232,7 @@ if (isset($result) && empty($message_to_show)) { // $result should exist, regardless of $_message $_type = $result ? 'success' : 'error'; if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { - $extra_data['sql_query'] = PMA_showMessage(null, $sql_query); + $extra_data['sql_query'] = PMA_getMessage(null, $sql_query); PMA_ajaxResponse($_message, $_message->isSuccess(), $extra_data); } } @@ -246,7 +246,7 @@ if (isset($result) && empty($message_to_show)) { unset($warning_messages); } - PMA_showMessage($_message, $sql_query, $_type); + echo PMA_getMessage($_message, $sql_query, $_type); unset($_message, $_type); } @@ -520,7 +520,7 @@ if (isset($possible_row_formats[$tbl_storage_engine])) { $current_row_format = strtoupper($showtable['Row_format']); echo '<tr><td><label for="new_row_format">ROW_FORMAT</label></td>'; echo '<td>'; - echo PMA_generate_html_dropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format'); + echo PMA_getDropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format'); unset($possible_row_formats, $current_row_format); echo '</td>'; echo '</tr>'; diff --git a/tbl_relation.php b/tbl_relation.php index e640687cc5..a82f23f3d0 100644 --- a/tbl_relation.php +++ b/tbl_relation.php @@ -181,7 +181,7 @@ if (isset($destination) && $cfgRelation['relwork']) { // (for now, one index name only; we keep the definitions if the // foreign db is not the same) // I use $sql_query to be able to display directly the query via -// PMA_showMessage() +// PMA_getMessage() if (isset($_REQUEST['destination_foreign'])) { $display_query = ''; @@ -285,9 +285,9 @@ if (isset($_REQUEST['destination_foreign'])) { } // end foreach if (!empty($display_query)) { if ($seen_error) { - PMA_showMessage(__('Error'), null, 'error'); + echo PMA_getMessage(__('Error'), null, 'error'); } else { - PMA_showMessage(__('Your SQL query has been executed successfully'), null, 'success'); + echo PMA_getMessage(__('Your SQL query has been executed successfully'), null, 'success'); } } } // end if isset($destination_foreign) diff --git a/tbl_replace.php b/tbl_replace.php index f7e0f9e263..e24eeeddcc 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -544,7 +544,7 @@ if ($GLOBALS['is_ajax_request'] == true) { /**Get the total row count of the table*/ $extra_data['row_count'] = PMA_Table::countRecords($_REQUEST['db'], $_REQUEST['table']); - $extra_data['sql_query'] = PMA_showMessage($message, $GLOBALS['display_query']); + $extra_data['sql_query'] = PMA_getMessage($message, $GLOBALS['display_query']); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); } diff --git a/tbl_structure.php b/tbl_structure.php index ebe727d099..870c4480f1 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -568,37 +568,37 @@ $checkall_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table); <i><?php echo __('With selected:'); ?></i> <?php -PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_browse', - __('Browse'), 'b_browse.png', 'browse' -); +echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_browse', + __('Browse'), 'b_browse.png', 'browse' + ); if (! $tbl_is_view && ! $db_is_information_schema) { - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_change', - __('Change'), 'b_edit.png', 'change' - ); - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_drop', - __('Drop'), 'b_drop.png', 'drop' - ); - if ('ARCHIVE' != $tbl_storage_engine) { - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_primary', - __('Primary'), 'b_primary.png', 'primary' - ); - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_unique', - __('Unique'), 'b_unique.png', 'unique' + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_change', + __('Change'), 'b_edit.png', 'change' ); - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_index', - __('Index'), 'b_index.png', 'index' + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_drop', + __('Drop'), 'b_drop.png', 'drop' ); + if ('ARCHIVE' != $tbl_storage_engine) { + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_primary', + __('Primary'), 'b_primary.png', 'primary' + ); + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_unique', + __('Unique'), 'b_unique.png', 'unique' + ); + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_index', + __('Index'), 'b_index.png', 'index' + ); } if (! empty($tbl_storage_engine) && $tbl_storage_engine == 'MYISAM') { - PMA_buttonOrImage( + echo PMA_getButtonOrImage( 'submit_mult', 'mult_submit', 'submit_mult_spatial', __('Spatial'), 'b_spatial.png', 'spatial' ); @@ -608,10 +608,10 @@ if (! $tbl_is_view && ! $db_is_information_schema) { || $tbl_storage_engine == 'ARIA' || $tbl_storage_engine == 'MARIA') ) { - PMA_buttonOrImage( - 'submit_mult', 'mult_submit', 'submit_mult_fulltext', - __('Fulltext'), 'b_ftext.png', 'ftext' - ); + echo PMA_getButtonOrImage( + 'submit_mult', 'mult_submit', 'submit_mult_fulltext', + __('Fulltext'), 'b_ftext.png', 'ftext' + ); } } ?> diff --git a/tbl_tracking.php b/tbl_tracking.php index 4740d135b2..1fd887e8d1 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -289,7 +289,7 @@ if (isset($_REQUEST['snapshot'])) { $drop_create_statements .= $data['ddlog'][1]['statement']; } // Print SQL code - PMA_showMessage(sprintf(__('Version %s snapshot (SQL code)'), htmlspecialchars($_REQUEST['version'])), $drop_create_statements); + echo PMA_getMessage(sprintf(__('Version %s snapshot (SQL code)'), htmlspecialchars($_REQUEST['version'])), $drop_create_statements); // Unserialize snapshot $temp = unserialize($data['schema_snapshot']); diff --git a/test/libraries/common/PMA_generate_html_dropdown_test.php b/test/libraries/common/PMA_generate_html_dropdown_test.php index c31ed5e928..ef7a6f3614 100644 --- a/test/libraries/common/PMA_generate_html_dropdown_test.php +++ b/test/libraries/common/PMA_generate_html_dropdown_test.php @@ -23,7 +23,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase $result = '<select name="' . htmlspecialchars($name) . '" id="' . htmlspecialchars($id) . '"></select>'; - $this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id)); + $this->assertEquals($result, PMA_getDropdown($name, $choices, $active_choice, $id)); } function testGenerateHtmlDropdown() @@ -43,7 +43,7 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase } $result .= '</select>'; - $this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id)); + $this->assertEquals($result, PMA_getDropdown($name, $choices, $active_choice, $id)); } function testGenerateHtmlDropdownWithActive() @@ -63,6 +63,6 @@ class PMA_generate_html_dropdown_test extends PHPUnit_Framework_TestCase } $result .= '</select>'; - $this->assertEquals($result, PMA_generate_html_dropdown($name, $choices, $active_choice, $id)); + $this->assertEquals($result, PMA_getDropdown($name, $choices, $active_choice, $id)); } }
\ No newline at end of file diff --git a/test/libraries/common/PMA_showMessage_test_disabled.php b/test/libraries/common/PMA_showMessage_test_disabled.php index 7aed63527b..2b25cfc80d 100644 --- a/test/libraries/common/PMA_showMessage_test_disabled.php +++ b/test/libraries/common/PMA_showMessage_test_disabled.php @@ -1,7 +1,7 @@ <?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** - * Test for PMA_showMessage from common.lib + * Test for PMA_getMessage from common.lib * * @package PhpMyAdmin-test * @group common.lib-tests @@ -60,9 +60,9 @@ class PMA_showMessage_test extends PHPUnit_Framework_TestCase ]</div></div>" ); - echo PMA_showMessage("msg"); + echo PMA_getMessage("msg"); - //$this->assertEquals("",PMA_showMessage("msg")); + //$this->assertEquals("",PMA_getMessage("msg")); $this->assertTrue(true); } }
\ No newline at end of file diff --git a/user_password.php b/user_password.php index f1b632c889..8a9937eb00 100644 --- a/user_password.php +++ b/user_password.php @@ -82,7 +82,7 @@ function PMA_getChangePassMessage($change_password_message, $sql_query = '') if ($change_password_message['error']) { PMA_ajaxResponse($change_password_message['msg'], false); } else { - $extra_data['sql_query'] = PMA_showMessage($change_password_message['msg'], $sql_query, 'success'); + $extra_data['sql_query'] = PMA_getMessage($change_password_message['msg'], $sql_query, 'success'); PMA_ajaxResponse($change_password_message['msg'], true, $extra_data); } } @@ -205,7 +205,7 @@ function PMA_changePassDisplayPage($message, $sql_query, $_url_params) { include_once './libraries/header.inc.php'; echo '<h1>' . __('Change password') . '</h1>' . "\n\n"; - PMA_showMessage($message, $sql_query, 'success'); + echo PMA_getMessage($message, $sql_query, 'success'); echo '<a href="index.php'.PMA_generate_common_url($_url_params).' target="_parent">'. "\n" .'<strong>'.__('Back').'</strong></a>'; include './libraries/footer.inc.php'; diff --git a/view_create.php b/view_create.php index 385890c2f5..2808144638 100644 --- a/view_create.php +++ b/view_create.php @@ -68,7 +68,7 @@ if (isset($_REQUEST['createview'])) { include './' . $cfg['DefaultTabDatabase']; exit(); } else { - PMA_ajaxResponse(PMA_showMessage(PMA_Message::success(), $sql_query), 1); + PMA_ajaxResponse(PMA_getMessage(PMA_Message::success(), $sql_query), 1); } } else { if ($GLOBALS['is_ajax_request'] != true) { diff --git a/view_operations.php b/view_operations.php index 45a74b7ebf..2f2ab4c1ac 100644 --- a/view_operations.php +++ b/view_operations.php @@ -62,7 +62,7 @@ if (isset($result)) { $_message->isError(true); unset($warning_messages); } - PMA_showMessage($_message, $sql_query, $_type, $is_view = true); + echo PMA_getMessage($_message, $sql_query, $_type, $is_view = true); unset($_message, $_type); } |