';
}
/**
* Bad hack on the next line. document.write() conflicts with jQuery,
@@ -2710,11 +2710,13 @@ function PMA_generateSliderEffect($id, $message)
* method maybe by using an additional param, the id of the div to
* append to
*/
- echo '
';
+
+ return '
';
+
}
/**
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 297e64eeed..ded41daa72 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -51,10 +51,11 @@ require_once './libraries/Index.class.php';
*
* @access private
*
- * @see PMA_displayTable()
+ * @see PMA_getTable()
*/
function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
{
+
global $db, $table;
global $unlim_num_rows, $fields_meta;
global $err_url;
@@ -85,7 +86,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$do_display['pview_lnk'] = (string) '0';
} elseif ($GLOBALS['is_count'] || $GLOBALS['is_analyse']
|| $GLOBALS['is_maint'] || $GLOBALS['is_explain']
- ) {
+ ) {
// 2.1 Statement is a "SELECT COUNT", a
// "CHECK/ANALYZE/REPAIR/OPTIMIZE", an "EXPLAIN" one or
// contains a "PROC ANALYSE" part
@@ -101,6 +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..."
/**
@@ -113,7 +115,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$GLOBALS['sql_query'], $which
);
if (isset($which[1])
- && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0
+ && (strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0)
) {
$do_display['edit_lnk'] = 'nn'; // no edit link
$do_display['del_lnk'] = 'kp'; // "kill process" type edit link
@@ -136,14 +138,14 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$prev_table = $fields_meta[0]->table;
$do_display['text_btn'] = (string) '1';
for ($i = 0; $i < $GLOBALS['fields_cnt']; $i++) {
- $is_link = $do_display['edit_lnk'] != 'nn'
- || $do_display['del_lnk'] != 'nn'
- || $do_display['sort_lnk'] != '0'
- || $do_display['ins_row'] != '0';
+ $is_link = ($do_display['edit_lnk'] != 'nn')
+ || ($do_display['del_lnk'] != 'nn')
+ || ($do_display['sort_lnk'] != '0')
+ || ($do_display['ins_row'] != '0');
// 2.3.2 Displays edit/delete/sort/insert links?
if ($is_link
- && ($fields_meta[$i]->table == ''
- || $fields_meta[$i]->table != $prev_table)
+ && (($fields_meta[$i]->table == '')
+ || ($fields_meta[$i]->table != $prev_table))
) {
$do_display['edit_lnk'] = 'nn'; // don't display links
$do_display['del_lnk'] = 'nn';
@@ -167,8 +169,9 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
// 3. Gets the total number of rows if it is unknown
if (isset($unlim_num_rows) && $unlim_num_rows != '') {
$the_total = $unlim_num_rows;
- } elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
- && (strlen($db) && !empty($table))) {
+ } elseif ((($do_display['nav_bar'] == '1') || ($do_display['sort_lnk'] == '1'))
+ && (strlen($db) && !empty($table))
+ ) {
$the_total = PMA_Table::countRecords($db, $table);
}
@@ -195,6 +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
@@ -211,14 +215,14 @@ function PMA_isSelect()
global $analyzed_sql;
return ! ($is_count || $is_export || $is_func || $is_analyse)
- && count($analyzed_sql[0]['select_expr']) == 0
+ && (count($analyzed_sql[0]['select_expr']) == 0)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
- && count($analyzed_sql[0]['table_ref']) == 1;
+ && (count($analyzed_sql[0]['table_ref']) == 1);
}
/**
- * Displays a navigation button
+ * Get a navigation button
*
* @param string $caption iconic caption for button
* @param string $title text for button
@@ -228,7 +232,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,11 +240,12 @@ function PMA_isSelect()
*
* @access private
*
- * @see PMA_displayTableNavigation()
+ * @see PMA_getTableNavigation()
*/
-function PMA_displayTableNavigationOneButton($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;
$caption_output = '';
@@ -248,40 +253,40 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption_output .= $caption;
}
+
// for false or 'both'
- if (false === $GLOBALS['cfg']['NavigationBarIconic']
- || 'both' === $GLOBALS['cfg']['NavigationBarIconic']
+ if (($GLOBALS['cfg']['NavigationBarIconic'] === false)
+ || ($GLOBALS['cfg']['NavigationBarIconic'] === 'both')
) {
$caption_output .= ' ' . $title;
}
- $title_output = ' title="' . $title . '"';
- ?>
-
-
-
-'
+ . '
'
+ . '';
+
+} // 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 +300,18 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
*
* @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,69 +323,61 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
*/
$is_innodb = (isset($showtable['Type']) && $showtable['Type'] == 'InnoDB');
- ?>
-
-
-
-
-
- '
+ . ' '
+ . ' ';
+
// Move to the beginning or to the previous page
if ($_SESSION['tmp_user_values']['pos']
- && $_SESSION['tmp_user_values']['max_rows'] != 'all'
+ && ($_SESSION['tmp_user_values']['max_rows'] != 'all')
) {
- PMA_displayTableNavigationOneButton(
- '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query
- );
- PMA_displayTableNavigationOneButton(
- '<', _pgettext('Previous page', 'Previous'), $pos_prev,
- $html_sql_query
- );
+
+ $table_navigation_html .= PMA_getMoveBackwardButtonsForTableNavigation(
+ $html_sql_query, $pos_prev
+ );
} // end move back
$nbTotalPage = 1;
//page redirection
// (unless we are showing all records)
- if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //if1
+ 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
- ?>
-
- ';
$_url_params = array(
'db' => $db,
'table' => $table,
'sql_query' => $sql_query,
'goto' => $goto,
);
+
//
-
- '
+ . '';
+ } //_if2
} //_if1
// Display the "Show all" button if allowed
@@ -385,148 +385,261 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
&& ($GLOBALS['cfg']['ShowAll']
|| ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows))
) {
- echo "\n";
- ?>
-
-
-
- = $_SESSION['tmp_user_values']['max_rows']
- && $_SESSION['tmp_user_values']['max_rows'] != 'all'
+ if ((($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'])
+ < $unlim_num_rows)
+ && ($num_rows >= $_SESSION['tmp_user_values']['max_rows'])
+ && ($_SESSION['tmp_user_values']['max_rows'] != 'all')
) {
- // display the Next button
- PMA_displayTableNavigationOneButton(
+
+ $table_navigation_html .= PMA_getMoveFarwardButtonsForTableNavigation(
+ $html_sql_query, $pos_next, $is_innodb,
+ $unlim_num_rows, $num_rows
+ );
+
+ } // end move toward
+
+ // show separator if pagination happen
+ if ($nbTotalPage > 1) {
+ $table_navigation_html .= '|
';
+ }
+
+ $table_navigation_html .= ''
+ . ''
+ . ' '
+ . ''
+ . ''
+ . ' ';
+
+ // 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 .= '';
+
+ $table_navigation_html .= ''
+ . ' '
+ . ' '
+ . ' '
+ . '
';
+
+ return $table_navigation_html;
+
+} // end of the 'PMA_getTableNavigation()' function
+
+
+/**
+ * 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
+ *
+ * @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
+ );
+}
+
+
+/**
+ * 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
+ *
+ * @return string html content
+ *
+ * @see PMA_getTableNavigation()
+ */
+function PMA_getShowAllButtonForTableNavigation($db, $table, $html_sql_query, $goto)
+{
+ return "\n"
+ . '
'
+ . ''
+ . ' ';
+}
+
+
+/**
+ * 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
+ *
+ * @return string $buttons_html html content
+ *
+ * @see PMA_getTableNavigation()
+ */
+function PMA_getMoveFarwardButtonsForTableNavigation(
+ $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
);
- // prepare some options for the End button
- if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
- $input_for_real_end = '
';
- // no backquote around this message
- $onclick = '';
- } else {
- $input_for_real_end = $onclick = '';
- }
+ // prepare some options for the End button
+ if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
+ $input_for_real_end = '
';
+ // no backquote around this message
+ $onclick = '';
+ } else {
+ $input_for_real_end = $onclick = '';
+ }
- $onsubmit = 'onsubmit="return '
- . ($_SESSION['tmp_user_values']['pos']
- + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows
- && $num_rows >= $_SESSION['tmp_user_values']['max_rows'])
- ? 'true'
- : 'false' . '"';
- // display the End button
- PMA_displayTableNavigationOneButton(
+ $onsubmit = 'onsubmit="return '
+ . ($_SESSION['tmp_user_values']['pos']
+ + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows
+ && $num_rows >= $_SESSION['tmp_user_values']['max_rows'])
+ ? 'true'
+ : 'false' . '"';
+
+ // 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
+ $html_sql_query, $onsubmit, $input_for_real_end, $onclick
);
- } // end move toward
+
+ return $buttons_html;
+
+}
- // show separator if pagination happen
- if ($nbTotalPage > 1) {
- echo '
|
';
- }
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- '
+ . __('rows')
+ . "\n";
+
+ return $additional_fields_html;
+
+}
/**
- * 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 +650,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 +663,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 = ''
) {
@@ -561,6 +674,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
global $sql_query, $num_rows;
global $vertical_display, $highlight_columns;
+ $table_headers_html = '';
+
// required to generate sort links that will remember whether the
// "Show all" button has been clicked
$sql_md5 = md5($GLOBALS['sql_query']);
@@ -573,6 +688,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
if ($analyzed_sql == '') {
$analyzed_sql = array();
}
+
+ $directionCondition = ($direction == 'horizontal')
+ || ($direction == 'horizontalflipped');
// can the result be sorted?
if ($is_display['sort_lnk'] == '1') {
@@ -591,9 +709,9 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
if (isset($analyzed_sql)
&& isset($analyzed_sql[0])
&& isset($analyzed_sql[0]['querytype'])
- && $analyzed_sql[0]['querytype'] == 'SELECT'
+ && ($analyzed_sql[0]['querytype'] == 'SELECT')
&& isset($analyzed_sql[0]['table_ref'])
- && count($analyzed_sql[0]['table_ref']) == 1
+ && (count($analyzed_sql[0]['table_ref']) == 1)
) {
// grab indexes data:
@@ -601,361 +719,135 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
// do we have any index?
if ($indexes) {
-
- if ($direction == 'horizontal'
- || $direction == 'horizontalflipped'
- ) {
- $span = $fields_cnt;
- if ($is_display['edit_lnk'] != 'nn') {
- $span++;
- }
- if ($is_display['del_lnk'] != 'nn') {
- $span++;
- }
- if ($is_display['del_lnk'] != 'kp'
- && $is_display['del_lnk'] != 'nn'
- ) {
- $span++;
- }
- } else {
- $span = $num_rows + floor(
- $num_rows / $_SESSION['tmp_user_values']['repeat_cells']
- ) + 1;
- }
-
- echo '
' . "\n";
+ $table_headers_html .= PMA_getSortByKeyDropDown(
+ $db, $table, $indexes, $sort_expression,
+ $unsorted_sql_query
+ );
}
}
}
-
// Output data needed for grid editing
- echo '
';
- echo '
';
- echo PMA_generate_common_hidden_inputs($db, $table);
- echo '
';
+ $table_headers_html .= '
'
+ . '
'
+ . PMA_generate_common_hidden_inputs($db, $table)
+ . '
';
+
// Output data needed for column reordering and show/hide column
- if (PMA_isSelect()) {
- // 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);
- if ($col_order) {
- echo '
';
- }
- $col_visib = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_VISIB);
- if ($col_visib) {
- echo '
';
- }
- // generate table create time
- if (! PMA_Table::isView($GLOBALS['table'], $GLOBALS['db'])) {
- echo '
';
- }
+ if (PMA_isSelect()) {
+ $table_headers_html .= PMA_getDataForResettingColumnOrder();
}
-
$vertical_display['emptypre'] = 0;
$vertical_display['emptyafter'] = 0;
$vertical_display['textbtn'] = '';
// Display options (if we are not in print view)
- if (! (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1')) {
- echo '
';
- echo '';
+ $full_or_partial_text_link = PMA_getFullOrPartialTextButtonOrLink(
+ $db, $table, $sql_query, $goto
+ );
}
// Start of form for multi-rows edit/delete/export
-
- if ($is_display['del_lnk'] == 'dr' || $is_display['del_lnk'] == 'kp') {
- echo '
' . "\n";
}
- // 5. ----- Displays the navigation bar at the bottom if required -----
+ $links_html .= "\n";
- if ($is_display['nav_bar'] == '1' && empty($analyzed_sql[0]['limit_clause'])) {
- echo '
' . "\n";
- PMA_displayTableNavigation(
- $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown'
- );
- } elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
- echo "\n" . '
' . "\n";
+ $links_html .= '
' . "\n";
+
+ if (! empty($GLOBALS['url_query'])) {
+ $links_html .= '
' . "\n";
}
- // 6. ----- Displays "Query results operations"
- if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
- PMA_displayResultsOperations($the_disp_mode, $analyzed_sql);
- }
-} // end of the 'PMA_displayTable()' function
+ // fetch last row of the result set
+ PMA_DBI_data_seek($dt_result, $num_rows - 1);
+ $row = PMA_DBI_fetch_row($dt_result);
+
+ // $clause_is_unique is needed by PMA_getTable() to generate the proper param
+ // in the multi-edit and multi-delete form
+ list($where_clause, $clause_is_unique, $condition_array)
+ = PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row);
+
+ // reset to first row for the loop in PMA_getTableBody()
+ PMA_DBI_data_seek($dt_result, 0);
+
+ $links_html .= '
' . "\n";
+
+ $links_html .= '' . "\n";
+
+ return $links_html;
+
+}
+
/**
* replace some html-unfriendly stuff
@@ -3065,12 +4136,15 @@ function PMA_mimeDefaultFunction($buffer)
return $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
@@ -3080,25 +4154,27 @@ 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_getTableBody(), 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;
+ $results_operations_html = '';
$header_shown = false;
$header = '
' . __('Query results operations') . ' ';
- if ($the_disp_mode[6] == '1' || $the_disp_mode[9] == '1') {
+ if (($the_disp_mode[6] == '1') || ($the_disp_mode[9] == '1')) {
// Displays "printable view" link if required
if ($the_disp_mode[9] == '1') {
if (!$header_shown) {
- echo $header;
+ $results_operations_html .= $header;
$header_shown = true;
}
@@ -3110,21 +4186,25 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
);
$url_query = PMA_generate_common_url($_url_params);
- echo PMA_linkOrButton(
- 'sql.php' . $url_query,
- PMA_getIcon('b_print.png', __('Print view'), true),
- '', true, true, 'print_view'
- ) . "\n";
+ $results_operations_html .= PMA_linkOrButton(
+ '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';
- echo 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";
+
+ $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"
@@ -3138,19 +4218,22 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
// (most probably PROCEDURE ANALYSE()) it makes no sense to
// display the Export link).
if (isset($analyzed_sql[0])
- && $analyzed_sql[0]['querytype'] == 'SELECT'
+ && ($analyzed_sql[0]['querytype'] == 'SELECT')
&& ! 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) {
- echo $header;
+ $results_operations_html .= $header;
$header_shown = true;
}
+
$_url_params['unlim_num_rows'] = $unlim_num_rows;
/**
@@ -3169,20 +4252,22 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
}
}
- echo PMA_linkOrButton(
- 'tbl_export.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_tblexport.png', __('Export'), true),
- '', true, true, ''
- ) . "\n";
+ $results_operations_html .= PMA_linkOrButton(
+ 'tbl_export.php' . PMA_generate_common_url($_url_params),
+ PMA_getIcon('b_tblexport.png', __('Export'), true),
+ '', true, true, ''
+ )
+ . "\n";
- // show chart
- echo PMA_linkOrButton(
- 'tbl_chart.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_chart.png', __('Display chart'), 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";
- // show GIS chart
+ // prepare GIS chart
$geometry_found = false;
// If atleast one geometry field is found
foreach ($fields_meta as $meta) {
@@ -3191,12 +4276,14 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
break;
}
}
+
if ($geometry_found) {
- echo PMA_linkOrButton(
- 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true),
- '', true, true, ''
- ) . "\n";
+ $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";
}
}
@@ -3209,23 +4296,32 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql)
* Note: we don't display a Create view link if we found a PROCEDURE clause
*/
if (!$header_shown) {
- echo $header;
+ $results_operations_html .= $header;
$header_shown = true;
}
+
if (!PMA_DRIZZLE && !isset($analyzed_sql[0]['queryflags']['procedure'])) {
+
$ajax_class = $GLOBALS['cfg']['AjaxEnable'] ? ' ajax' : '';
- echo "";
- echo PMA_linkOrButton(
- 'view_create.php' . $url_query,
- PMA_getIcon('b_views.png', __('Create view'), true),
- '', true, true, ''
- ) . " \n";
+
+ $results_operations_html .= ''
+ . PMA_linkOrButton(
+ 'view_create.php' . $url_query,
+ PMA_getIcon('b_views.png', __('Create view'), true),
+ '', true, true, ''
+ )
+ . ' ' . "\n";
}
+
if ($header_shown) {
- echo '';
+ $results_operations_html .= '
';
}
+
+ return $results_operations_html;
+
}
+
/**
* Verifies what to do with non-printable contents (binary or BLOB)
* in Browse mode.
@@ -3240,27 +4336,37 @@ 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;
+
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']
@@ -3268,6 +4374,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
// in this case, restart from the original $content
$result = htmlspecialchars(PMA_replaceBinaryContents($content));
}
+
/* Create link to download */
if (count($url_params) > 0) {
$result = '
';
+ $result = ' class="'
+ . PMA_addClass(
+ $class, $condition_field, $meta, $nowrap,
+ $is_field_truncated, $transform_function, $default_function
+ )
+ . '">';
if (isset($analyzed_sql[0]['select_expr'])
&& is_array($analyzed_sql[0]['select_expr'])
) {
+
foreach ($analyzed_sql[0]['select_expr']
- as $select_expr_position => $select_expr) {
+ as $select_expr_position => $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 ('K' == $_SESSION['tmp_user_values']['relational_display']) {
+ 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) . '"';
}
@@ -3370,6 +4499,7 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. $where_comparison,
);
+
$result .= ' ';
@@ -3378,7 +4508,8 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
// not on the display field
$result .= $transform_function($data, $transform_options, $meta);
} else {
- if ('D' == $_SESSION['tmp_user_values']['relational_display']) {
+
+ if ($_SESSION['tmp_user_values']['relational_display'] == 'D') {
// user chose "relational display field" in the
// display options, so show display field in the cell
$result .= $transform_function($dispval, array(), $meta);
@@ -3386,13 +4517,15 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
// otherwise display data in the cell
$result .= $transform_function($data, array(), $meta);
}
+
}
$result .= ' ';
}
+
} else {
- $result .= ($transform_function != $default_function
+ $result .= ($transform_function != $default_function)
? $transform_function($data, $transform_options, $meta)
- : $transform_function($data, array(), $meta));
+ : $transform_function($data, array(), $meta);
}
// create hidden field if results from structure table
@@ -3420,10 +4553,12 @@ function PMA_prepare_row_data($class, $condition_field, $analyzed_sql, $meta, $m
$result .= '' . "\n";
return $result;
+
}
+
/**
- * 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
@@ -3437,33 +4572,40 @@ 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 = '';
+
if (! empty($del_url) && $is_display['del_lnk'] != 'kp') {
- $ret .= '
'
- . '
'
- . ' ';
+ . '
'
+ . '
'
+ . ' ';
}
+
return $ret;
+
}
+
/**
- * Generates an Edit link
+ * Prepares an Edit link
*
* @param string $edit_url edit url
* @param string $class css classes for td element
@@ -3473,11 +4615,13 @@ 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 = '';
if (! empty($edit_url)) {
+
$ret .= '
'
. PMA_linkOrButton($edit_url, $edit_str, array(), false);
/*
@@ -3490,11 +4634,14 @@ function PMA_generateEditLink($edit_url, $class, $edit_str, $where_clause,
}
$ret .= ' ';
}
+
return $ret;
+
}
+
/**
- * Generates an Copy link
+ * Prepares an Copy link
*
* @param string $copy_url copy url
* @param string $copy_str text for the copy link
@@ -3504,17 +4651,21 @@ 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 = '';
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
@@ -3525,11 +4676,14 @@ function PMA_generateCopyLink($copy_url, $copy_str, $where_clause,
}
$ret .= ' ';
}
+
return $ret;
+
}
+
/**
- * Generates a Delete link
+ * Prepares a Delete link
*
* @param string $del_url delete url
* @param string $del_str text for the delete link
@@ -3538,23 +4692,29 @@ 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)) {
+
$ret .= '
'
. PMA_linkOrButton($del_url, $del_str, $js_conf, false)
. ' ';
}
+
return $ret;
+
}
+
/**
- * 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
@@ -3576,49 +4736,56 @@ 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(
- $del_url, $is_display, $row_no, $where_clause_html, $condition_array,
- $del_query, $id_suffix = '_left', '', '', ''
- );
+
+ $ret .= PMA_getCheckboxForMultiRowSubmissions(
+ $del_url, $is_display, $row_no, $where_clause_html, $condition_array,
+ $del_query, $id_suffix = '_left', '', '', ''
+ );
- $ret .= PMA_generateEditLink(
- $edit_url, $class, $edit_str, $where_clause, $where_clause_html, ''
- );
+ $ret .= PMA_getEditLink(
+ $edit_url, $class, $edit_str, $where_clause, $where_clause_html, ''
+ );
- $ret .= PMA_generateCopyLink(
- $copy_url, $copy_str, $where_clause, $where_clause_html, ''
- );
+ $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(
- $copy_url, $copy_str, $where_clause, $where_clause_html, ''
- );
+ $ret .= PMA_getCopyLink(
+ $copy_url, $copy_str, $where_clause, $where_clause_html, ''
+ );
- $ret .= PMA_generateEditLink(
- $edit_url, $class, $edit_str, $where_clause, $where_clause_html, ''
- );
+ $ret .= PMA_getEditLink(
+ $edit_url, $class, $edit_str, $where_clause, $where_clause_html, ''
+ );
- $ret .= PMA_generateCheckboxForMulti(
- $del_url, $is_display, $row_no, $where_clause_html, $condition_array,
- $del_query, $id_suffix = '_right', '', '', ''
- );
+ $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(
- $del_url, $is_display, $row_no, $where_clause_html, $condition_array,
- $del_query, $id_suffix = '_left', '', '', ''
- );
+
+ $ret .= PMA_getCheckboxForMultiRowSubmissions(
+ $del_url, $is_display, $row_no, $where_clause_html, $condition_array,
+ $del_query, $id_suffix = '_left', '', '', ''
+ );
}
+
return $ret;
+
}
?>
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('');
}
- $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('');
}
- $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('');
}
- $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/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php
index 6159107b09..b1ceb0ee9c 100644
--- a/libraries/schema/User_Schema.class.php
+++ b/libraries/schema/User_Schema.class.php
@@ -199,7 +199,7 @@ class PMA_User_Schema
'0' => __('Edit'),
'1' => __('Delete')
);
- PMA_displayHtmlRadio('action_choose', $choices, '0', false);
+ echo PMA_getRadioFields('action_choose', $choices, '0', false);
unset($choices);
?>
diff --git a/main.php b/main.php
index a5735825a4..9dc61bdf67 100644
--- a/main.php
+++ b/main.php
@@ -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/pmd_pdf.php b/pmd_pdf.php
index e28567fa0f..a8fba19b9d 100644
--- a/pmd_pdf.php
+++ b/pmd_pdf.php
@@ -123,7 +123,7 @@ if (1 == count($choices)) {
echo $choices['create_export'];
echo '
';
} else {
- PMA_displayHtmlRadio('mode', $choices, $checked_choice = '', $line_break = true, $escape_label = false, $class = '');
+ echo PMA_getRadioFields('mode', $choices, $checked_choice = '', $line_break = true, $escape_label = false, $class = '');
}
echo '
';
echo '
' . __('New page name: ') . ' ';
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 '';
}
-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) {
. '
' . "\n"
. ' ' . __('Uncheck All') . ' ' . "\n"
. '
' . __('With selected:') . ' ' . "\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 7c2eb91879..23ae8977a1 100644
--- a/server_privileges.php
+++ b/server_privileges.php
@@ -1580,7 +1580,7 @@ $link_export_all = '
' . "\n"
.'' . __('With selected:') . ' ' . "\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 ' ';
echo ' '
. '
'
@@ -2364,7 +2364,7 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
'1' => __('... delete the old one from the user tables.'),
'2' => __('... revoke all active privileges from the old one and delete it afterwards.'),
'3' => __('... delete the old one from the user tables and reload the privileges afterwards.'));
- PMA_displayHtmlRadio('mode', $choices, '4', true);
+ echo PMA_getRadioFields('mode', $choices, '4', true);
unset($choices);
echo ' ' . "\n"
diff --git a/sql.php b/sql.php
index 151dd46f97..9a33f315f7 100644
--- a/sql.php
+++ b/sql.php
@@ -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();
}
@@ -960,7 +960,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;
}
@@ -987,7 +987,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)) {
@@ -1047,7 +1047,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 b0f9c693a7..4d24a49469 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 934e066f28..053ea71f95 100644
--- a/tbl_alter.php
+++ b/tbl_alter.php
@@ -252,7 +252,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 92c728ad6e..5b42085dea 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 9ec83b39db..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 '
';
@@ -561,7 +561,7 @@ if (isset($possible_row_formats[$tbl_storage_engine])) {
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only'));
- PMA_displayHtmlRadio('what', $choices, 'data', true);
+ echo PMA_getRadioFields('what', $choices, 'data', true);
unset($choices);
?>
@@ -779,7 +779,7 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) {
'OPTIMIZE' => __('Optimize'),
'REBUILD' => __('Rebuild'),
'REPAIR' => __('Repair'));
- PMA_displayHtmlRadio('partition_operation', $choices, '', false);
+ echo PMA_getRadioFields('partition_operation', $choices, '', false);
unset($choices);
echo PMA_showMySQLDocu('partitioning_maintenance', 'partitioning_maintenance');
// I'm not sure of the best way to display that; this link does
diff --git a/tbl_relation.php b/tbl_relation.php
index 3501045c72..b990df4d14 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_select.php b/tbl_select.php
index 611b124e53..22f3cc3817 100644
--- a/tbl_select.php
+++ b/tbl_select.php
@@ -173,7 +173,7 @@ echo PMA_generateHtmlTabs(PMA_tbl_getSubTabs(), $url_params, 'topmenu2');
diff --git a/tbl_structure.php b/tbl_structure.php
index 8611f39cc6..f60f2412dd 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -568,37 +568,37 @@ $checkall_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table);
@@ -710,7 +710,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
'first' => __('At Beginning of Table'),
'after' => sprintf(__('After %s'), '')
);
- PMA_displayHtmlRadio('field_where', $choices, 'last', false);
+ echo PMA_getRadioFields('field_where', $choices, 'last', false);
echo $column_selector;
unset($column_selector, $choices);
?>
@@ -730,7 +730,7 @@ if (! $tbl_is_view
&& ! $db_is_information_schema
&& 'ARCHIVE' != $tbl_storage_engine
) {
- PMA_generateSliderEffect('indexes', __('Indexes'));
+ echo PMA_getDivForSliderEffect('indexes', __('Indexes'));
/**
* Display indexes
*/
diff --git a/tbl_tracking.php b/tbl_tracking.php
index 8a8bf38c3e..b8b92f48c4 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_slider_effect_test.php b/test/libraries/common/PMA_generate_slider_effect_test.php
deleted file mode 100644
index 3f69ebf3ed..0000000000
--- a/test/libraries/common/PMA_generate_slider_effect_test.php
+++ /dev/null
@@ -1,52 +0,0 @@
-expectOutputString('