diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index ded41daa72..cfab6d420c 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -41,12 +41,12 @@ require_once './libraries/Index.class.php';
* @return array an array with explicit indexes for all the display
* elements
*
- * @global string the database name
- * @global string the table name
- * @global integer the total number of rows returned by the SQL query
+ * @global string the database name
+ * @global string the table name
+ * @global integer the total number of rows returned by the SQL query
* without any programmatically appended "LIMIT" clause
- * @global array the properties of the fields returned by the query
- * @global string the URL to return to in case of error in a SQL
+ * @global array the properties of the fields returned by the query
+ * @global string the URL to return to in case of error in a SQL
* statement
*
* @access private
@@ -55,7 +55,7 @@ require_once './libraries/Index.class.php';
*/
function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
{
-
+
global $db, $table;
global $unlim_num_rows, $fields_meta;
global $err_url;
@@ -102,7 +102,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$do_display['text_btn'] = (string) '0';
}
$do_display['pview_lnk'] = (string) '1';
-
+
} elseif ($GLOBALS['is_show']) {
// 2.2 Statement is a "SHOW..."
/**
@@ -198,7 +198,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
$the_disp_mode = join('', $do_display);
return $do_display;
-
+
} // end of the 'PMA_setDisplayMode()' function
@@ -245,7 +245,7 @@ function PMA_isSelect()
function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query,
$onsubmit = '', $input_for_real_end = '', $onclick = ''
) {
-
+
global $db, $table, $goto;
$caption_output = '';
@@ -253,15 +253,15 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query,
if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption_output .= $caption;
}
-
+
// for false or 'both'
if (($GLOBALS['cfg']['NavigationBarIconic'] === false)
|| ($GLOBALS['cfg']['NavigationBarIconic'] === 'both')
) {
$caption_output .= ' ' . $title;
}
- $title_output = ' title="' . $title . '"';
-
+ $title_output = ' title="' . $title . '"';
+
return '
'
. ''
. '
';
-
+
} // end function PMA_getTableNavigationButton()
@@ -288,15 +288,15 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query,
*
* @return string html content
*
- * @global string $db the database name
- * @global string $table the table name
- * @global string $goto the URL to go back in case of errors
- * @global integer $num_rows the total number of rows returned by the
+ * @global string $db the database name
+ * @global string $table the table name
+ * @global string $goto the URL to go back in case of errors
+ * @global integer $num_rows the total number of rows returned by the
* SQL query
- * @global integer $unlim_num_rows the total number of rows returned by the
+ * @global integer $unlim_num_rows the total number of rows returned by the
* SQL any programmatically appended "LIMIT" clause
- * @global boolean $is_innodb whether its InnoDB or not
- * @global array $showtable table definitions
+ * @global boolean $is_innodb whether its InnoDB or not
+ * @global array $showtable table definitions
*
* @access private
*
@@ -305,12 +305,12 @@ function PMA_getTableNavigationButton($caption, $title, $pos, $html_sql_query,
function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
$id_for_direction_dropdown
) {
-
+
global $db, $table, $goto;
global $num_rows, $unlim_num_rows;
global $is_innodb;
global $showtable;
-
+
$table_navigation_html = '';
// here, using htmlentities() would cause problems if the query
@@ -327,15 +327,15 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
$table_navigation_html .= '
'
. '
'
. '
';
-
+
// Move to the beginning or to the previous page
if ($_SESSION['tmp_user_values']['pos']
&& ($_SESSION['tmp_user_values']['max_rows'] != 'all')
) {
-
+
$table_navigation_html .= PMA_getMoveBackwardButtonsForTableNavigation(
- $html_sql_query, $pos_prev
- );
+ $html_sql_query, $pos_prev
+ );
} // end move back
@@ -343,41 +343,41 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
//page redirection
// (unless we are showing all records)
if ($_SESSION['tmp_user_values']['max_rows'] != 'all') { //if1
-
+
$pageNow = @floor(
- $_SESSION['tmp_user_values']['pos']
- / $_SESSION['tmp_user_values']['max_rows']
- ) + 1;
-
+ $_SESSION['tmp_user_values']['pos']
+ / $_SESSION['tmp_user_values']['max_rows']
+ ) + 1;
+
$nbTotalPage = @ceil(
- $unlim_num_rows
- / $_SESSION['tmp_user_values']['max_rows']
- );
+ $unlim_num_rows
+ / $_SESSION['tmp_user_values']['max_rows']
+ );
if ($nbTotalPage > 1) { //if2
-
- $table_navigation_html .= '
';
- } //_if2
+ . '';
+ } //_if2
} //_if1
// Display the "Show all" button if allowed
@@ -385,11 +385,11 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
&& ($GLOBALS['cfg']['ShowAll']
|| ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows))
) {
-
+
$table_navigation_html .= PMA_getShowAllButtonForTableNavigation(
- $db, $table, $html_sql_query, $goto
- );
-
+ $db, $table, $html_sql_query, $goto
+ );
+
} // end show all
// Move to the next page or to the last one
@@ -398,11 +398,11 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
&& ($num_rows >= $_SESSION['tmp_user_values']['max_rows'])
&& ($_SESSION['tmp_user_values']['max_rows'] != 'all')
) {
-
- $table_navigation_html .= PMA_getMoveFarwardButtonsForTableNavigation(
- $html_sql_query, $pos_next, $is_innodb,
- $unlim_num_rows, $num_rows
- );
+
+ $table_navigation_html .= PMA_getMoveForwardButtonsForTableNavigation(
+ $html_sql_query, $pos_next, $is_innodb,
+ $unlim_num_rows, $num_rows
+ );
} // end move toward
@@ -410,7 +410,7 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
if ($nbTotalPage > 1) {
$table_navigation_html .= '
|
';
}
-
+
$table_navigation_html .= '
'
. '
'
. ''
@@ -427,9 +427,9 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
// 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
+ // (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
@@ -467,40 +467,40 @@ function PMA_getTableNavigation($pos_next, $pos_prev, $sql_query,
/**
* Prepare move backward buttons - previous and first
- *
- * @param string $html_sql_query the sql encoded by html special characters
- * @param integer $pos_prev the offset for the "previous" page
- *
+ *
+ * @param string $html_sql_query the sql encoded by html special characters
+ * @param integer $pos_prev the offset for the "previous" page
+ *
* @return string html content
- *
+ *
* @see PMA_getTableNavigation()
*/
function PMA_getMoveBackwardButtonsForTableNavigation($html_sql_query, $pos_prev)
-{
+{
return PMA_getTableNavigationButton(
- '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query
- )
- . PMA_getTableNavigationButton(
- '<', _pgettext('Previous page', 'Previous'), $pos_prev,
- $html_sql_query
- );
+ '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query
+ )
+ . PMA_getTableNavigationButton(
+ '<', _pgettext('Previous page', 'Previous'), $pos_prev,
+ $html_sql_query
+ );
}
/**
* Prepare Show All button for table navigation
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param string $html_sql_query the sql encoded by html special characters
- * @param string $goto the URL to go back in case of errors
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $html_sql_query the sql encoded by html special characters
+ * @param string $goto the URL to go back in case of errors
+ *
* @return string html content
- *
+ *
* @see PMA_getTableNavigation()
*/
function PMA_getShowAllButtonForTableNavigation($db, $table, $html_sql_query, $goto)
-{
+{
return "\n"
. '
'
. ''
- . '
';
+ . '';
}
/**
* Prepare move farward buttons - next and last
- *
- * @param string $html_sql_query the sql encoded by html special characters
- * @param integer $pos_prev the offset for the "previous" page
- * @param boolean $is_innodb whether its InnoDB or not
- * @param integer $unlim_num_rows the total number of rows returned by the
- * @param integer $num_rows the total number of rows returned by the
- *
+ *
+ * @param string $html_sql_query the sql encoded by html special characters
+ * @param integer $pos_next the offset for the "next" page
+ * @param boolean $is_innodb whether its InnoDB or not
+ * @param integer $unlim_num_rows the total number of rows returned by the
+ * @param integer $num_rows the total number of rows returned by the
+ *
* @return string $buttons_html html content
- *
+ *
* @see PMA_getTableNavigation()
*/
-function PMA_getMoveFarwardButtonsForTableNavigation(
+function PMA_getMoveForwardButtonsForTableNavigation(
$html_sql_query, $pos_next, $is_innodb, $unlim_num_rows, $num_rows
) {
-
+
// display the Next button
$buttons_html = PMA_getTableNavigationButton(
- '>',
- _pgettext('Next page', 'Next'),
- $pos_next,
- $html_sql_query
- );
+ '>',
+ _pgettext('Next page', 'Next'),
+ $pos_next,
+ $html_sql_query
+ );
// prepare some options for the End button
if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
@@ -559,39 +559,39 @@ function PMA_getMoveFarwardButtonsForTableNavigation(
// display the End button
$buttons_html .= PMA_getTableNavigationButton(
- '>>',
- _pgettext('Last page', 'End'),
- @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1)
- * $_SESSION['tmp_user_values']['max_rows']),
- $html_sql_query, $onsubmit, $input_for_real_end, $onclick
- );
-
+ '>>',
+ _pgettext('Last page', 'End'),
+ @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1)
+ * $_SESSION['tmp_user_values']['max_rows']),
+ $html_sql_query, $onsubmit, $input_for_real_end, $onclick
+ );
+
return $buttons_html;
-
+
}
/**
* Prepare feilds followed by Show button for table navigation
* Start row, Number of rows, Headers every
- *
- * @param string $html_sql_query the sql encoded by html special characters
- * @param string $goto the URL to go back in case of errors
- * @param integer $pos_next the offset for the "next" page
- * @param integer $unlim_num_rows the total number of rows returned by the
- * @param string $id_for_direction_dropdown the id for the direction dropdown
- *
+ *
+ * @param string $html_sql_query the sql encoded by html special characters
+ * @param string $goto the URL to go back in case of errors
+ * @param integer $pos_next the offset for the "next" page
+ * @param integer $unlim_num_rows the total number of rows returned by the
+ * @param string $id_for_direction_dropdown the id for the direction dropdown
+ *
* @return string $additional_fields_html html content
- *
+ *
* @see PMA_getTableNavigation()
*/
function PMA_getAdditionalFieldsForTableNavigation(
$html_sql_query, $goto, $pos_next,
$unlim_num_rows, $id_for_direction_dropdown
) {
-
+
$additional_fields_html = '';
-
+
$additional_fields_html .= ''
. ''
@@ -608,7 +608,7 @@ function PMA_getAdditionalFieldsForTableNavigation(
? $_SESSION['tmp_user_values']['max_rows']
: $GLOBALS['cfg']['MaxRows'])
. '" class="textfield" onfocus="this.select()" />';
-
+
if ($GLOBALS['cfg']['ShowDisplayDirection']) {
// Display mode (horizontal/vertical and repeat headers)
$additional_fields_html .= __('Mode') . ': ' . "\n";
@@ -617,12 +617,12 @@ function PMA_getAdditionalFieldsForTableNavigation(
'horizontalflipped' => __('horizontal (rotated headers)'),
'vertical' => __('vertical')
);
-
+
$additional_fields_html .= PMA_getDropdown(
- 'disp_direction', $choices,
- $_SESSION['tmp_user_values']['disp_direction'],
- $id_for_direction_dropdown
- );
+ 'disp_direction', $choices,
+ $_SESSION['tmp_user_values']['disp_direction'],
+ $id_for_direction_dropdown
+ );
unset($choices);
}
@@ -632,9 +632,9 @@ function PMA_getAdditionalFieldsForTableNavigation(
. '" class="textfield" /> '
. __('rows')
. "\n";
-
+
return $additional_fields_html;
-
+
}
@@ -652,13 +652,13 @@ function PMA_getAdditionalFieldsForTableNavigation(
*
* @return string html content
*
- * @global string $db the database name
- * @global string $table the table name
- * @global string $goto the URL to go back in case of errors
- * @global string $sql_query the SQL query
- * @global integer $num_rows the total number of rows returned by the
+ * @global string $db the database name
+ * @global string $table the table name
+ * @global string $goto the URL to go back in case of errors
+ * @global string $sql_query the SQL query
+ * @global integer $num_rows the total number of rows returned by the
* SQL query
- * @global array $vertical_display informations used with vertical display
+ * @global array $vertical_display informations used with vertical display
* mode
*
* @access private
@@ -688,7 +688,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
if ($analyzed_sql == '') {
$analyzed_sql = array();
}
-
+
$directionCondition = ($direction == 'horizontal')
|| ($direction == 'horizontalflipped');
@@ -720,9 +720,9 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
// do we have any index?
if ($indexes) {
$table_headers_html .= PMA_getSortByKeyDropDown(
- $db, $table, $indexes, $sort_expression,
- $unsorted_sql_query
- );
+ $db, $table, $indexes, $sort_expression,
+ $unsorted_sql_query
+ );
}
}
}
@@ -733,10 +733,10 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
. '
' . "\n";
} // end vertical mode
}
- if ($directionCondition) {
+ if ($directionCondition) {
$table_headers_html .= ''
- . '';
+ . '';
}
-
+
return $table_headers_html;
-
+
} // end of the 'PMA_getTableHeaders()' function
/**
* Prepare sort by key dropdown - html code segment
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param array $indexes the indexes of the table for sort criteria
- * @param string $sort_expression the sort expression
- * @param string $unsorted_sql_query the unsorted sql query
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param array $indexes the indexes of the table for sort criteria
+ * @param string $sort_expression the sort expression
+ * @param string $unsorted_sql_query the unsorted sql query
+ *
* @return string $drop_down_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getSortByKeyDropDown(
$db, $table, $indexes, $sort_expression, $unsorted_sql_query
) {
-
+
$drop_down_html = '';
-
+
$drop_down_html .= '' . "\n";
-
+
return $drop_down_html;
-
+
}
/**
* Prepare data for column restoring and show/hide
- *
+ *
* @return string $data_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getDataForResettingColumnOrder()
{
-
+
$data_html = '';
-
+
// generate the column order, if it is set
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
@@ -1209,29 +1209,29 @@ function PMA_getDataForResettingColumnOrder()
$GLOBALS['db'], $GLOBALS['table'], 'Create_time'
) . '" />';
}
-
+
return $data_html;
-
+
}
/**
* Prepare option fields block
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param string $sql_query the SQL query
- * @param string $goto the URL to go back in case of errors
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $sql_query the SQL query
+ * @param string $goto the URL to go back in case of errors
+ *
* @return string $options_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getOptionsBlock($db, $table, $sql_query, $goto)
{
-
+
$options_html = '';
-
+
$options_html .= '';
-
+
return $options_html;
-
+
}
/**
* Get full/partial text button or link
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param string $sql_query the SQL query
- * @param string $goto the URL to go back in case of errors
- *
- * @return string html content
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $sql_query the SQL query
+ * @param string $goto the URL to go back in case of errors
+ *
+ * @return string html content
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getFullOrPartialTextButtonOrLink($db, $table, $sql_query, $goto)
{
-
+
$url_params_full_text = array(
'db' => $db,
'table' => $table,
@@ -1375,37 +1375,37 @@ function PMA_getFullOrPartialTextButtonOrLink($db, $table, $sql_query, $goto)
$tmp_image = '';
$tmp_url = 'sql.php' . PMA_generate_common_url($url_params_full_text);
-
+
return PMA_linkOrButton($tmp_url, $tmp_image, array(), false);
-
+
}
/**
* Prepare html form for multi row operations
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param string $del_lnk the delete link of current row
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $del_lnk the delete link of current row
+ *
* @return string $form_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getFormForMultiRowOperations($db, $table, $del_lnk)
{
-
+
$form_html = '';
-
+
if (($del_lnk == 'dr') || ($del_lnk == 'kp')) {
-
+
$form_html .= '' . "\n";
@@ -1416,20 +1416,20 @@ function PMA_getFormForMultiRowOperations($db, $table, $del_lnk)
$form_html .= ' ajax';
}
$form_html .= '">' . "\n";
-
+
return $form_html;
-
+
}
/**
* Get comment for row
- *
- * @param array $comments_map comments array
- * @param array $fields_meta set of field properties
- *
+ *
+ * @param array $comments_map comments array
+ * @param array $fields_meta set of field properties
+ *
* @return string $comment html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getCommentForRow($comments_map, $fields_meta)
@@ -1445,27 +1445,27 @@ function PMA_getCommentForRow($comments_map, $fields_meta)
)
. '';
}
- return $comments;
+ return $comments;
}
/**
* Check whether the column is sorted
- *
- * @param string $sort_expression sort expression
- * @param string $sort_expression_nodirection sort expression without direction
- * @param string $sort_tbl the table name
- * @param string $name_to_use_in_sort the sorting column name
- *
+ *
+ * @param string $sort_expression sort expression
+ * @param string $sort_expression_nodirection sort expression without direction
+ * @param string $sort_tbl the table name
+ * @param string $name_to_use_in_sort the sorting column name
+ *
* @return boolean $is_in_sort the column sorted or not
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_isInSorted(
$sort_expression, $sort_expression_nodirection, $sort_tbl,
$name_to_use_in_sort
) {
-
+
if (empty($sort_expression)) {
$is_in_sort = false;
} else {
@@ -1497,29 +1497,29 @@ function PMA_isInSorted(
$is_in_sort = true;
}
}
-
+
return $is_in_sort;
-
+
}
/**
* Get sort url paramaeters - sort order and order image
- *
- * @param boolean $is_in_sort the column sorted or not
- * @param string $sort_direction the sort direction
- * @param array $fields_meta set of field properties
- * @param string $sort_order the sorting order
- * @param integer $column_index the index of the column
- *
+ *
+ * @param boolean $is_in_sort the column sorted or not
+ * @param string $sort_direction the sort direction
+ * @param array $fields_meta set of field properties
+ * @param string $sort_order the sorting order
+ * @param integer $column_index the index of the column
+ *
* @return array 2 element array - $sort_order, $order_img
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getSortingUrlParams(
$is_in_sort, $sort_direction, $fields_meta, $sort_order, $column_index
) {
-
+
if (! $is_in_sort) {
// patch #455484 ("Smart" order)
@@ -1527,9 +1527,9 @@ function PMA_getSortingUrlParams(
if ($GLOBALS['cfg']['Order'] === 'SMART') {
$sort_order .= (preg_match(
- '@time|date@i',
- $fields_meta->type
- )) ? 'DESC' : 'ASC';
+ '@time|date@i',
+ $fields_meta->type
+ )) ? 'DESC' : 'ASC';
} else {
$sort_order .= $GLOBALS['cfg']['Order'];
}
@@ -1539,53 +1539,53 @@ function PMA_getSortingUrlParams(
$sort_order .= ' ASC';
$order_img = ' ' . PMA_getImage(
- 's_desc.png', __('Descending'),
- array('class' => "soimg$column_index", 'title' => '')
- );
+ 's_desc.png', __('Descending'),
+ array('class' => "soimg$column_index", 'title' => '')
+ );
$order_img .= ' ' . PMA_getImage(
- 's_asc.png', __('Ascending'),
- array('class' => "soimg$column_index hide", 'title' => '')
- );
+ 's_asc.png', __('Ascending'),
+ array('class' => "soimg$column_index hide", 'title' => '')
+ );
} else {
$sort_order .= ' DESC';
$order_img = ' ' . PMA_getImage(
- 's_asc.png', __('Ascending'),
- array('class' => "soimg$column_index", 'title' => '')
- );
+ 's_asc.png', __('Ascending'),
+ array('class' => "soimg$column_index", 'title' => '')
+ );
$order_img .= ' ' . PMA_getImage(
- 's_desc.png', __('Descending'),
- array('class' => "soimg$column_index hide", 'title' => '')
- );
+ 's_desc.png', __('Descending'),
+ array('class' => "soimg$column_index hide", 'title' => '')
+ );
}
-
+
return array($sort_order, $order_img);
-
+
}
/**
* Get sort order link
- *
- * @param string $order_img the sort order image
- * @param integer $col_index the index of the column
- * @param string $direction the display direction
- * @param array $fields_meta set of field properties
- * @param string $order_url the url for sort
- *
+ *
+ * @param string $order_img the sort order image
+ * @param integer $col_index the index of the column
+ * @param string $direction the display direction
+ * @param array $fields_meta set of field properties
+ * @param string $order_url the url for sort
+ *
* @return string the sort order link
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getSortOrderLink(
$order_img, $col_index, $direction, $fields_meta, $order_url
) {
-
+
$order_link_params = array();
-
+
if (isset($order_img) && ($order_img != '')) {
if (strstr($order_img, 'asc')) {
$order_link_params['onmouseover'] = "$('.soimg$col_index').toggle()";
@@ -1595,11 +1595,11 @@ function PMA_getSortOrderLink(
$order_link_params['onmouseout'] = "$('.soimg$col_index').toggle()";
}
}
-
+
if ($GLOBALS['cfg']['HeaderFlipType'] == 'auto') {
$GLOBALS['cfg']['HeaderFlipType']
- = (PMA_USR_BROWSER_AGENT == 'IE') ? 'css' : 'fake';
+ = (PMA_USR_BROWSER_AGENT == 'IE') ? 'css' : 'fake';
}
if ($direction == 'horizontalflipped'
@@ -1619,34 +1619,34 @@ function PMA_getSortOrderLink(
: htmlspecialchars($fields_meta->name);
return PMA_linkOrButton(
- $order_url, $order_link_content . $order_img,
- $order_link_params, false, true
- );
-
+ $order_url, $order_link_content . $order_img,
+ $order_link_params, false, true
+ );
+
}
/**
* Prepare columns to draggable effect for sortable columns
- *
- * @param boolean $col_visib the column is visible (false)
- * array the column is not visible (string array)
- * @param string $col_visib_j element of $col_visib array
- * @param boolean $condition_field whether to add CSS class condition
- * @param string $direction the display direction
- * @param array $fields_meta set of field properties
- * @param string $order_link the order link
- * @param string $comments the comment for the column
- *
+ *
+ * @param boolean $col_visib the column is visible (false)
+ * array the column is not visible (string array)
+ * @param string $col_visib_j element of $col_visib array
+ * @param boolean $condition_field whether to add CSS class condition
+ * @param string $direction the display direction
+ * @param array $fields_meta set of field properties
+ * @param string $order_link the order link
+ * @param string $comments the comment for the column
+ *
* @return string $draggable_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getDraggableClassForSortableColumns(
$col_visib, $col_visib_j, $condition_field, $direction, $fields_meta,
$order_link, $comments
) {
-
+
$draggable_html = '
name)
. '">' . $order_link . $comments . '
';
-
+
return $draggable_html;
-
+
}
/**
* Prepare columns to draggable effect for non sortable columns
- *
- * @param boolean $col_visib the column is visible (false)
- * array the column is not visible (string array)
- * @param string $col_visib_j element of $col_visib array
- * @param boolean $condition_field whether to add CSS class condition
- * @param string $direction the display direction
- * @param array $fields_meta set of field properties
- * @param string $comments the comment for the column
- *
+ *
+ * @param boolean $col_visib the column is visible (false)
+ * array the column is not visible (string array)
+ * @param string $col_visib_j element of $col_visib array
+ * @param boolean $condition_field whether to add CSS class condition
+ * @param string $direction the display direction
+ * @param array $fields_meta set of field properties
+ * @param string $comments the comment for the column
+ *
* @return string $draggable_html html content
- *
+ *
* @see PMA_getTableHeaders()
*/
function PMA_getDraggableClassForNonSortableColumns(
$col_visib, $col_visib_j, $condition_field,
$direction, $fields_meta, $comments
) {
-
+
$draggable_html = '
_type) && $meta->_type === MYSQLI_TYPE_BIT) {
$column = PMA_printableBitValue(
- $column, $meta->length
- );
+ $column, $meta->length
+ );
// some results of PROCEDURE ANALYSE() are reported as
// being BINARY but they are quite readable,
@@ -2965,18 +2962,18 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
$column = bin2hex($column);
} else {
$column = htmlspecialchars(
- PMA_replaceBinaryContents($column)
- );
+ PMA_replaceBinaryContents($column)
+ );
}
} else {
// we show the BINARY message and field's size
// (or maybe use a transformation)
$column = PMA_handleNonPrintableContents(
- 'BINARY', $column, $transform_function,
- $transform_options, $default_function,
- $meta, $_url_params
- );
+ 'BINARY', $column, $transform_function,
+ $transform_options, $default_function,
+ $meta, $_url_params
+ );
$formatted = true;
}
}
@@ -2984,8 +2981,8 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
if ($formatted) {
$cell = PMA_buildValueDisplay(
- $class, $condition_field, $column
- );
+ $class, $condition_field, $column
+ );
} else {
@@ -3011,15 +3008,15 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
$transform_function, $default_function, $nowrap,
$where_comparison, $transform_options,
$is_field_truncated
- );
+ );
}
} else {
$cell = PMA_buildEmptyDisplay($class, $condition_field, $meta);
}
-
+
return $cell;
-
+
}
@@ -3028,7 +3025,7 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
*
* @return string html content
*
- * @global array $vertical_display the information to display
+ * @global array $vertical_display the information to display
*
* @access private
*
@@ -3036,9 +3033,9 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
*/
function PMA_getVerticalTable()
{
-
+
global $vertical_display;
-
+
$vertical_table_html = '';
// Prepares "multi row delete" link at top if required
@@ -3047,14 +3044,14 @@ function PMA_getVerticalTable()
&& ((count($vertical_display['row_delete']) > 0)
|| !empty($vertical_display['textbtn']))
) {
-
+
$vertical_table_html .= '
' . "\n";
if ($GLOBALS['cfg']['RowActionLinks'] == 'none') {
// if we are not showing the RowActionLinks, then we need to show
// the Multi-Row-Action checkboxes
$vertical_table_html .= '
' . "\n";
}
-
+
$vertical_table_html .= $vertical_display['textbtn']
. PMA_getCheckBoxesForMultipleRowOperations(
$vertical_display, '_left'
@@ -3070,8 +3067,8 @@ function PMA_getVerticalTable()
|| !empty($vertical_display['textbtn']))
) {
$vertical_table_html .= PMA_getOperationLinksForVerticleTable(
- $vertical_display ,'edit'
- );
+ $vertical_display, 'edit'
+ );
} // end if
// Prepares "copy" link at top if required
@@ -3082,8 +3079,8 @@ function PMA_getVerticalTable()
|| !empty($vertical_display['textbtn']))
) {
$vertical_table_html .= PMA_getOperationLinksForVerticleTable(
- $vertical_display ,'copy'
- );
+ $vertical_display, 'copy'
+ );
} // end if
// Prepares "delete" link at top if required
@@ -3094,15 +3091,15 @@ function PMA_getVerticalTable()
|| !empty($vertical_display['textbtn']))
) {
$vertical_table_html .= PMA_getOperationLinksForVerticleTable(
- $vertical_display, 'delete'
- );
+ $vertical_display, 'delete'
+ );
} // end if
list($col_order, $col_visib) = PMA_getColumnParams();
// Prepares data
foreach ($vertical_display['desc'] AS $j => $val) {
-
+
// assign appropriate key with current column order
$key = $col_order ? $col_order[$j] : $j;
@@ -3112,7 +3109,7 @@ function PMA_getVerticalTable()
$cell_displayed = 0;
foreach ($vertical_display['rowdata'][$key] as $subval) {
-
+
if (($cell_displayed != 0)
&& ($_SESSION['tmp_user_values']['repeat_cells'] != 0)
&& !($cell_displayed % $_SESSION['tmp_user_values']['repeat_cells'])
@@ -3122,7 +3119,7 @@ function PMA_getVerticalTable()
$vertical_table_html .= $subval;
$cell_displayed++;
-
+
} // end while
$vertical_table_html .= '
' . "\n";
-
+
return $link_html;
-
+
}
/**
* Get checkboxes for multiple row data operations
- *
- * @param array $vertical_display the information to display
- * @param string $dir _left / _right
- *
- * @return $checkBoxes_html html content
- *
+ *
+ * @param array $vertical_display the information to display
+ * @param string $dir _left / _right
+ *
+ * @return $checkBoxes_html html content
+ *
* @see PMA_getVerticalTable()
*/
-function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) {
-
+function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir)
+{
+
$checkBoxes_html = '';
$cell_displayed = 0;
-
+
foreach ($vertical_display['row_delete'] as $val) {
if (($cell_displayed != 0)
@@ -3257,9 +3255,9 @@ function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) {
$checkBoxes_html .= str_replace('[%_PMA_CHECKBOX_DIR_%]', $dir, $val);
$cell_displayed++;
} // end while
-
+
return $checkBoxes_html;
-
+
}
@@ -3276,16 +3274,16 @@ function PMA_getCheckBoxesForMultipleRowOperations($vertical_display, $dir) {
*/
function PMA_setConfigParamsForDisplayTable()
{
-
+
$sql_md5 = md5($GLOBALS['sql_query']);
$_SESSION['tmp_user_values']['query'][$sql_md5]['sql'] = $GLOBALS['sql_query'];
$valid_disp_dir = PMA_isValid(
- $_REQUEST['disp_direction'],
- array('horizontal', 'vertical', 'horizontalflipped')
- );
-
+ $_REQUEST['disp_direction'],
+ array('horizontal', 'vertical', 'horizontalflipped')
+ );
+
if ($valid_disp_dir) {
$_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction']
= $_REQUEST['disp_direction'];
@@ -3444,7 +3442,7 @@ function PMA_setConfigParamsForDisplayTable()
= $_SESSION['tmp_user_values']['query'][$sql_md5]['repeat_cells'];
$_SESSION['tmp_user_values']['disp_direction']
= $_SESSION['tmp_user_values']['query'][$sql_md5]['disp_direction'];
-
+
}
@@ -3456,26 +3454,26 @@ function PMA_setConfigParamsForDisplayTable()
* which results have to be displayed
* @param array &$the_disp_mode the display mode
* @param array $analyzed_sql the analyzed query
- *
+ *
* @return sting Generated HTML content for resulted table
*
- * @global string $db the database name
- * @global string $table the table name
- * @global string $goto the URL to go back in case of errors
- * @global string $sql_query the current SQL query
- * @global integer $num_rows the total number of rows returned by the
+ * @global string $db the database name
+ * @global string $table the table name
+ * @global string $goto the URL to go back in case of errors
+ * @global string $sql_query the current SQL query
+ * @global integer $num_rows the total number of rows returned by the
* SQL query
- * @global integer $unlim_num_rows the total number of rows returned by the
+ * @global integer $unlim_num_rows the total number of rows returned by the
* SQL query without any programmatically
* appended "LIMIT" clause
- * @global array $fields_meta the list of fields properties
- * @global integer $fields_cnt the total number of fields returned by
+ * @global array $fields_meta the list of fields properties
+ * @global integer $fields_cnt the total number of fields returned by
* the SQL query
- * @global array $vertical_display informations used with vertical display
+ * @global array $vertical_display informations used with vertical display
* mode
- * @global array $highlight_columns column names to highlight
- * @global array $cfgRelation the relation settings
- * @global array $showtable table definitions
+ * @global array $highlight_columns column names to highlight
+ * @global array $cfgRelation the relation settings
+ * @global array $showtable table definitions
*
* @access private
*
@@ -3487,13 +3485,13 @@ function PMA_setConfigParamsForDisplayTable()
*/
function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
{
-
+
global $db, $table, $goto;
global $sql_query, $num_rows, $unlim_num_rows, $fields_meta, $fields_cnt;
global $vertical_display, $highlight_columns;
global $cfgRelation;
global $showtable;
-
+
$table_html = '';
// why was this called here? (already called from sql.php)
@@ -3514,10 +3512,10 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// "j u s t b r o w s i n g"
$pre_count = '~';
$after_count = PMA_showHint(
- PMA_sanitize(
- __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')
- )
- );
+ PMA_sanitize(
+ __('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]')
+ )
+ );
} else {
$pre_count = '';
$after_count = '';
@@ -3537,43 +3535,43 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// 1.3 Find the sort expression
// we need $sort_expression and $sort_expression_nodirection
- // even if there are many table references
+ // even if there are many table references
list($sort_expression, $sort_expression_nodirection, $sort_direction)
= PMA_getSortParams($analyzed_sql[0]['order_by_clause']);
-
-
+
+
// 1.4 Prepares display of first and last value of the sorted column
$sorted_column_message = PMA_getSortedColumnMessage(
- $dt_result, $fields_meta, $num_rows,
- $sort_expression_nodirection, $table
- );
-
+ $dt_result, $fields_meta, $num_rows,
+ $sort_expression_nodirection, $table
+ );
+
// 2. ----- Prepare to display the top of the page -----
// 2.1 Prepares a messages with position informations
- if (($is_display['nav_bar'] == '1') && isset($pos_next)) {
+ if (($is_display['nav_bar'] == '1') && isset($pos_next)) {
$message = PMA_setMessageInformation(
- $db, $table, $sorted_column_message,
- $analyzed_sql[0]['limit_clause'], $unlim_num_rows,
- $total, $pos_next, $pre_count, $after_count
- );
+ $db, $table, $sorted_column_message,
+ $analyzed_sql[0]['limit_clause'], $unlim_num_rows,
+ $total, $pos_next, $pre_count, $after_count
+ );
$table_html .= PMA_getMessage($message, $sql_query, 'success');
} elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) {
-
+
$table_html .= PMA_getMessage(
- __('Your SQL query has been executed successfully'),
- $sql_query, 'success'
- );
+ __('Your SQL query has been executed successfully'),
+ $sql_query, 'success'
+ );
}
// 2.3 Prepare the navigation bars
if (! strlen($table)) {
-
+
if (isset($analyzed_sql[0]['query_type'])
&& ($analyzed_sql[0]['query_type'] == 'SELECT')
) {
@@ -3584,16 +3582,16 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
} else {
$table = '';
}
-
+
}
if (($is_display['nav_bar'] == '1') && empty($analyzed_sql[0]['limit_clause'])) {
-
+
$table_html .= PMA_getTableNavigation(
- $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown'
- )
- . "\n";
-
+ $pos_next, $pos_prev, $sql_query, 'top_direction_dropdown'
+ )
+ . "\n";
+
} elseif (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1')) {
$table_html .= "\n" . '
' . "\n";
}
@@ -3609,20 +3607,20 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
if (isset($analyzed_sql[0]['table_ref'])
&& is_array($analyzed_sql[0]['table_ref'])
) {
-
+
foreach ($analyzed_sql[0]['table_ref']
as $table_ref_position => $table_ref) {
$target[] = $analyzed_sql[0]['table_ref'][$table_ref_position]['table_true_name'];
}
-
+
}
-
+
$tabs = '(\'' . join('\',\'', $target) . '\')';
if (! strlen($table)) {
$exist_rel = false;
} else {
-
+
// To be able to later display a link to the related table,
// we verify both types of relations: either those that are
// native foreign keys or those defined in the phpMyAdmin
@@ -3630,15 +3628,15 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// to use the "column to display" notion (for example show
// the name related to a numeric id).
$exist_rel = PMA_getForeigners($db, $table, '', 'both');
-
+
if ($exist_rel) {
-
+
foreach ($exist_rel as $master_field => $rel) {
-
+
$display_field = PMA_getDisplayField(
- $rel['foreign_db'], $rel['foreign_table']
- );
-
+ $rel['foreign_db'], $rel['foreign_table']
+ );
+
$map[$master_field] = array(
$rel['foreign_table'],
$rel['foreign_field'],
@@ -3652,45 +3650,45 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// 3. ----- Prepare the results table -----
$table_html .= PMA_getTableHeaders(
- $is_display, $fields_meta, $fields_cnt, $analyzed_sql,
- $sort_expression, $sort_expression_nodirection, $sort_direction
- )
- . '' . "\n";
-
- $url_query = '';
+ $is_display, $fields_meta, $fields_cnt, $analyzed_sql,
+ $sort_expression, $sort_expression_nodirection, $sort_direction
+ )
+ . '' . "\n";
+
+ $url_query = '';
$table_html .= PMA_getTableBody(
- $dt_result, $is_display, $map, $analyzed_sql
- );
-
+ $dt_result, $is_display, $map, $analyzed_sql
+ );
+
// vertical output case
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
$table_html .= PMA_getVerticalTable();
} // end if
-
+
unset($vertical_display);
$table_html .= '' . "\n"
. '';
-
+
// 4. ----- Prepares the link for multi-fields edit and delete
if ($is_display['del_lnk'] == 'dr' && $is_display['del_lnk'] != 'kp') {
$table_html .= PMA_getMultiRowOperationLinks(
- $dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql,
- $db, $table, $sql_query, $goto, $is_display['del_lnk']
- );
+ $dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql,
+ $db, $table, $sql_query, $goto, $is_display['del_lnk']
+ );
}
// 5. ----- Get the navigation bar at the bottom if required -----
if ($is_display['nav_bar'] == '1' && empty($analyzed_sql[0]['limit_clause'])) {
-
+
$table_html .= ' ' . "\n";
$table_html .= PMA_getTableNavigation(
- $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown'
- );
-
+ $pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown'
+ );
+
} elseif (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
$table_html .= "\n" . '
' . "\n";
}
@@ -3699,22 +3697,22 @@ function PMA_getTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
if (! isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
$table_html .= PMA_getResultsOperations($the_disp_mode, $analyzed_sql);
}
-
+
return $table_html;
-
+
} // end of the 'PMA_getTable()' function
/**
* Get offsets for next page and previous page
- *
+ *
* @return array array with two elements - $pos_next, $pos_prev
- *
+ *
* @see PMA_getTable()
*/
function PMA_getOffsets()
{
-
+
if ($_SESSION['tmp_user_values']['max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
@@ -3730,73 +3728,73 @@ function PMA_getOffsets()
$pos_prev = 0;
}
}
-
+
return array($pos_next, $pos_prev);
-
+
}
/**
* Get sort parameters
- *
- * @param string $order_by_clause
- *
+ *
+ * @param string $order_by_clause
+ *
* @return array 3 element array: $sort_expression,
* $sort_expression_nodirection, $sort_direction
- *
+ *
* @see PMA_getTable()
*/
function PMA_getSortParams($order_by_clause)
{
-
+
if (! empty($order_by_clause)) {
-
+
$sort_expression = trim(
- str_replace(' ', ' ', $order_by_clause)
- );
+ str_replace(' ', ' ', $order_by_clause)
+ );
/**
* Get rid of ASC|DESC
*/
preg_match('@(.*)([[:space:]]*(ASC|DESC))@si', $sort_expression, $matches);
-
+
$sort_expression_nodirection = isset($matches[1])
? trim($matches[1])
: $sort_expression;
-
+
$sort_direction = isset($matches[2]) ? trim($matches[2]) : '';
unset($matches);
-
+
} else {
$sort_expression = $sort_expression_nodirection = $sort_direction = '';
}
-
+
return array($sort_expression, $sort_expression_nodirection, $sort_direction);
-
+
}
/**
* Prepare sorted column message
- *
- * @param integer &$dt_result the link id associated to the query
+ *
+ * @param integer &$dt_result the link id associated to the query
* which results have to be displayed
- * @param array $fields_meta the list of fields properties
- * @param integer $num_rows the total number of rows returned
+ * @param array $fields_meta the list of fields properties
+ * @param integer $num_rows the total number of rows returned
* by the SQL query
- * @param string $sort_expression_nodirection sort expression without direction
- * @param string $table the table name
- *
+ * @param string $sort_expression_nodirection sort expression without direction
+ * @param string $table the table name
+ *
* @return string html content
* null if not found sorted column
- *
+ *
* @see PMA_getTable()
*/
function PMA_getSortedColumnMessage(&$dt_result, $fields_meta,
$num_rows, $sort_expression_nodirection, $table
) {
-
+
if (! empty($sort_expression_nodirection)) {
-
+
if (strpos($sort_expression_nodirection, '.') === false) {
$sort_table = $table;
$sort_column = $sort_expression_nodirection;
@@ -3804,111 +3802,111 @@ function PMA_getSortedColumnMessage(&$dt_result, $fields_meta,
list($sort_table, $sort_column)
= explode('.', $sort_expression_nodirection);
}
-
+
$sort_table = PMA_unQuote($sort_table);
$sort_column = PMA_unQuote($sort_column);
-
+
// find the sorted column index in row result
// (this might be a multi-table query)
$sorted_column_index = false;
-
+
foreach ($fields_meta as $key => $meta) {
if (($meta->table == $sort_table) && ($meta->name == $sort_column)) {
$sorted_column_index = $key;
break;
}
}
-
+
if ($sorted_column_index !== false) {
-
+
// fetch first row of the result set
$row = PMA_DBI_fetch_row($dt_result);
-
+
// initializing default arguments
$default_function = 'PMA_mimeDefaultFunction';
$transform_function = $default_function;
$transform_options = array();
-
+
// check for non printable sorted row data
$meta = $fields_meta[$sorted_column_index];
-
+
if (stristr($meta->type, 'BLOB') || ($meta->type == 'geometry')) {
-
+
$column_for_first_row = PMA_handleNonPrintableContents(
- $meta->type, $row[$sorted_column_index], $transform_function,
- $transform_options, $default_function, $meta, null
- );
-
+ $meta->type, $row[$sorted_column_index], $transform_function,
+ $transform_options, $default_function, $meta, null
+ );
+
} else {
$column_for_first_row = $row[$sorted_column_index];
}
-
+
$column_for_first_row = strtoupper(
- substr($column_for_first_row, 0, $GLOBALS['cfg']['LimitChars'])
- );
-
+ substr($column_for_first_row, 0, $GLOBALS['cfg']['LimitChars'])
+ );
+
// fetch last row of the result set
PMA_DBI_data_seek($dt_result, $num_rows - 1);
$row = PMA_DBI_fetch_row($dt_result);
-
+
// check for non printable sorted row data
$meta = $fields_meta[$sorted_column_index];
if (stristr($meta->type, 'BLOB') || ($meta->type == 'geometry')) {
-
+
$column_for_last_row = PMA_handleNonPrintableContents(
- $meta->type, $row[$sorted_column_index], $transform_function,
- $transform_options, $default_function, $meta, null
- );
-
+ $meta->type, $row[$sorted_column_index], $transform_function,
+ $transform_options, $default_function, $meta, null
+ );
+
} else {
$column_for_last_row = $row[$sorted_column_index];
}
-
+
$column_for_last_row = strtoupper(
- substr($column_for_last_row, 0, $GLOBALS['cfg']['LimitChars'])
- );
-
+ substr($column_for_last_row, 0, $GLOBALS['cfg']['LimitChars'])
+ );
+
// reset to first row for the loop in PMA_getTableBody()
PMA_DBI_data_seek($dt_result, 0);
-
+
// we could also use here $sort_expression_nodirection
return ' [' . htmlspecialchars($sort_column)
. ': ' . htmlspecialchars($column_for_first_row) . ' - '
. htmlspecialchars($column_for_last_row) . ']';
}
}
-
+
return null;
-
+
}
/**
* Set the content need to be show in message
- *
- * @param string $db the database name
- * @param string $table the table name
- * @param string $sorted_column_message the message for sorted column
- * @param string $limit_clause the limit clause of analyzed query
- * @param integer $unlim_num_rows the total number of rows returned by
- * the SQL query without any appended
- * "LIMIT" clause programmatically
- * @param integer $total the total number of rows returned by
- * the SQL query without any
- * programmatically appended LIMIT clause
- * @param integer $pos_next the offset for next page
- * @param string $pre_count the string renders before row count
- * @param string $after_count the string renders after row count
- *
- * @return PMA_Message $message an object of PMA_Message
- *
+ *
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $sorted_column_message the message for sorted column
+ * @param string $limit_clause the limit clause of analyzed query
+ * @param integer $unlim_num_rows the total number of rows returned by
+ * the SQL query without any appended
+ * "LIMIT" clause programmatically
+ * @param integer $total the total number of rows returned by
+ * the SQL query without any
+ * programmatically appended LIMIT clause
+ * @param integer $pos_next the offset for next page
+ * @param string $pre_count the string renders before row count
+ * @param string $after_count the string renders after row count
+ *
+ * @return PMA_Message $message an object of PMA_Message
+ *
* @see PMA_getTable()
*/
function PMA_setMessageInformation(
$db, $table, $sorted_column_message, $limit_clause, $unlim_num_rows,
$total, $pos_next, $pre_count, $after_count
) {
-
+
if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) {
$selectstring = ', ' . $unlim_num_rows . ' ' . __('in query');
} else {
@@ -3945,8 +3943,8 @@ function PMA_setMessageInformation(
) {
$message = PMA_Message::notice(
- __('This view has at least this number of rows. Please refer to %sdocumentation%s.')
- );
+ __('This view has at least this number of rows. Please refer to %sdocumentation%s.')
+ );
$message->addParam('[a@./Documentation.html#cfg_MaxExactCount@_blank]');
$message->addParam('[/a]');
@@ -3988,38 +3986,38 @@ function PMA_setMessageInformation(
if (! is_null($sorted_column_message)) {
$message->addMessage($sorted_column_message, '');
}
-
+
return $message;
-
+
}
/**
* Prepare multi field edit/delete links
- *
- * @param integer &$dt_result the link id associated to the query
- * which results have to be displayed
- * @param integer $fields_cnt the total number of fields returned by
- * the SQL query
- * @param array $fields_meta the list of fields properties
- * @param integer $num_rows the total number of rows returned
- * by the SQL query
- * @param array $analyzed_sql the analyzed query
- * @param string $db the database name
- * @param string $table the table name
- * @param string $sql_query the current SQL query
- * @param string $goto the URL to go back in case of errors
- * @param string $del_link the display element - 'del_link'
- *
- * @return string $links_html html content
- *
+ *
+ * @param integer &$dt_result the link id associated to the query
+ * which results have to be displayed
+ * @param integer $fields_cnt the total number of fields returned by
+ * the SQL query
+ * @param array $fields_meta the list of fields properties
+ * @param integer $num_rows the total number of rows returned
+ * by the SQL query
+ * @param array $analyzed_sql the analyzed query
+ * @param string $db the database name
+ * @param string $table the table name
+ * @param string $sql_query the current SQL query
+ * @param string $goto the URL to go back in case of errors
+ * @param string $del_link the display element - 'del_link'
+ *
+ * @return string $links_html html content
+ *
* @see PMA_getTable()
*/
function PMA_getMultiRowOperationLinks(
&$dt_result, $fields_cnt, $fields_meta, $num_rows, $analyzed_sql,
$db, $table, $sql_query, $goto, $del_link
) {
-
+
$links_html = '';
$delete_text = ($del_link == 'dr') ? __('Delete') : __('Kill');
@@ -4051,12 +4049,12 @@ function PMA_getMultiRowOperationLinks(
}
$checkall_link = PMA_linkOrButton(
- $checkall_url, __('Check All'), $checkall_params, false
- );
+ $checkall_url, __('Check All'), $checkall_params, false
+ );
$uncheckall_link = PMA_linkOrButton(
- $uncheckall_url, __('Uncheck All'), $uncheckall_params, false
- );
+ $uncheckall_url, __('Uncheck All'), $uncheckall_params, false
+ );
if ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical') {
@@ -4072,20 +4070,20 @@ function PMA_getMultiRowOperationLinks(
. '' . __('With selected:') . '' . "\n";
$links_html .= PMA_getButtonOrImage(
- 'submit_mult', 'mult_submit', 'submit_mult_change',
- __('Change'), 'b_edit.png', 'edit'
- );
+ 'submit_mult', 'mult_submit', 'submit_mult_change',
+ __('Change'), 'b_edit.png', 'edit'
+ );
$links_html .= PMA_getButtonOrImage(
- 'submit_mult', 'mult_submit', 'submit_mult_delete',
- $delete_text, 'b_drop.png', 'delete'
- );
+ 'submit_mult', 'mult_submit', 'submit_mult_delete',
+ $delete_text, 'b_drop.png', 'delete'
+ );
if (isset($analyzed_sql[0]) && $analyzed_sql[0]['querytype'] == 'SELECT') {
$links_html .= PMA_getButtonOrImage(
- 'submit_mult', 'mult_submit', 'submit_mult_export',
- __('Export'), 'b_tblexport.png', 'export'
- );
+ 'submit_mult', 'mult_submit', 'submit_mult_export',
+ __('Export'), 'b_tblexport.png', 'export'
+ );
}
$links_html .= "\n";
@@ -4114,14 +4112,18 @@ function PMA_getMultiRowOperationLinks(
.' value="' . $clause_is_unique . '" />' . "\n";
$links_html .= '' . "\n";
-
+
return $links_html;
-
+
}
/**
* replace some html-unfriendly stuff
+ *
+ * @param string $buffer String to process
+ *
+ * @return Escaped and cleaned up text suitable for html.
*/
function PMA_mimeDefaultFunction($buffer)
{
@@ -4140,17 +4142,17 @@ function PMA_mimeDefaultFunction($buffer)
/**
* Get operations that are available on results.
*
- * @param array $the_disp_mode the display mode
- * @param array $analyzed_sql the analyzed query
+ * @param array $the_disp_mode the display mode
+ * @param array $analyzed_sql the analyzed query
*
* @return string html content
- *
- * @global string $db the database name
- * @global string $table the table name
- * @global string $sql_query the current SQL query
- * @global integer $unlim_num_rows the total number of rows returned by the
- * SQL query without any programmatically
- * appended "LIMIT" clause
+ *
+ * @global string $db the database name
+ * @global string $table the table name
+ * @global string $sql_query the current SQL query
+ * @global integer $unlim_num_rows the total number of rows returned by the
+ * SQL query without any programmatically
+ * appended "LIMIT" clause
*
* @access private
*
@@ -4162,7 +4164,7 @@ function PMA_mimeDefaultFunction($buffer)
*/
function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
{
-
+
global $db, $table, $sql_query, $unlim_num_rows, $fields_meta;
$results_operations_html = '';
@@ -4187,24 +4189,24 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
$url_query = PMA_generate_common_url($_url_params);
$results_operations_html .= PMA_linkOrButton(
- 'sql.php' . $url_query,
- PMA_getIcon('b_print.png', __('Print view'), true),
+ 'sql.php' . $url_query,
+ PMA_getIcon('b_print.png', __('Print view'), true),
+ '', true, true, 'print_view'
+ )
+ . "\n";
+
+ if ($_SESSION['tmp_user_values']['display_text']) {
+
+ $_url_params['display_text'] = 'F';
+
+ $results_operations_html .= PMA_linkOrButton(
+ 'sql.php' . PMA_generate_common_url($_url_params),
+ PMA_getIcon(
+ 'b_print.png', __('Print view (with full texts)'), true
+ ),
'', true, true, 'print_view'
)
. "\n";
-
- if ($_SESSION['tmp_user_values']['display_text']) {
-
- $_url_params['display_text'] = 'F';
-
- $results_operations_html .= PMA_linkOrButton(
- 'sql.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon(
- 'b_print.png', __('Print view (with full texts)'), true
- ),
- '', true, true, 'print_view'
- )
- . "\n";
unset($_url_params['display_text']);
}
} // end displays "printable view"
@@ -4222,18 +4224,18 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
&& ! isset($printview)
&& ! isset($analyzed_sql[0]['queryflags']['procedure'])
) {
-
+
if (isset($analyzed_sql[0]['table_ref'][0]['table_true_name'])
&& ! isset($analyzed_sql[0]['table_ref'][1]['table_true_name'])
) {
$_url_params['single_table'] = 'true';
}
-
+
if (!$header_shown) {
$results_operations_html .= $header;
$header_shown = true;
}
-
+
$_url_params['unlim_num_rows'] = $unlim_num_rows;
/**
@@ -4253,19 +4255,19 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
}
$results_operations_html .= PMA_linkOrButton(
- 'tbl_export.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_tblexport.png', __('Export'), true),
- '', true, true, ''
- )
- . "\n";
+ 'tbl_export.php' . PMA_generate_common_url($_url_params),
+ PMA_getIcon('b_tblexport.png', __('Export'), true),
+ '', true, true, ''
+ )
+ . "\n";
// prepare chart
$results_operations_html .= PMA_linkOrButton(
- 'tbl_chart.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_chart.png', __('Display chart'), true),
- '', true, true, ''
- )
- . "\n";
+ 'tbl_chart.php' . PMA_generate_common_url($_url_params),
+ PMA_getIcon('b_chart.png', __('Display chart'), true),
+ '', true, true, ''
+ )
+ . "\n";
// prepare GIS chart
$geometry_found = false;
@@ -4276,14 +4278,14 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
break;
}
}
-
+
if ($geometry_found) {
$results_operations_html .= PMA_linkOrButton(
- 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true),
- '', true, true, ''
- )
- . "\n";
+ 'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params),
+ PMA_getIcon('b_globe.gif', __('Visualize GIS data'), true),
+ '', true, true, ''
+ )
+ . "\n";
}
}
@@ -4299,11 +4301,11 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
$results_operations_html .= $header;
$header_shown = true;
}
-
+
if (!PMA_DRIZZLE && !isset($analyzed_sql[0]['queryflags']['procedure'])) {
-
+
$ajax_class = $GLOBALS['cfg']['AjaxEnable'] ? ' ajax' : '';
-
+
$results_operations_html .= ''
. PMA_linkOrButton(
'view_create.php' . $url_query,
@@ -4312,13 +4314,13 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
)
. '' . "\n";
}
-
+
if ($header_shown) {
$results_operations_html .= ' ';
}
-
+
return $results_operations_html;
-
+
}
@@ -4339,34 +4341,34 @@ function PMA_getResultsOperations($the_disp_mode, $analyzed_sql)
function PMA_handleNonPrintableContents($category, $content, $transform_function,
$transform_options, $default_function, $meta, $url_params = array()
) {
-
+
$result = '[' . $category;
-
+
if (is_null($content)) {
-
+
$result .= ' - NULL';
$size = 0;
-
+
} elseif (isset($content)) {
-
+
$size = strlen($content);
$display_size = PMA_formatByteDown($size, 3, 1);
$result .= ' - '. $display_size[0] . ' ' . $display_size[1];
-
+
}
-
+
$result .= ']';
if (strpos($transform_function, 'octetstream')) {
$result = $content;
}
-
+
if ($size > 0) {
-
+
if ($default_function != $transform_function) {
$result = $transform_function($result, $transform_options, $meta);
} else {
-
+
$result = $default_function($result, array(), $meta);
if (stristr($meta->type, 'BLOB')
&& $_SESSION['tmp_user_values']['display_blob']
@@ -4374,7 +4376,7 @@ function PMA_handleNonPrintableContents($category, $content, $transform_function
// in this case, restart from the original $content
$result = htmlspecialchars(PMA_replaceBinaryContents($content));
}
-
+
/* Create link to download */
if (count($url_params) > 0) {
$result = ' $select_expr
) {
-
+
$alias = $analyzed_sql[0]['select_expr'][$select_expr_position]['alias'];
-
+
if (isset($alias) && strlen($alias)) {
$true_column = $analyzed_sql[0]['select_expr'][$select_expr_position]['column'];
-
+
if ($alias == $meta->name) {
// this change in the parameter does not matter
// outside of the function
$meta->name = $true_column;
} // end if
-
+
} // end if
} // end foreach
} // end if
if (isset($map[$meta->name])) {
-
+
// Field to display from the foreign table?
if (isset($map[$meta->name][2]) && strlen($map[$meta->name][2])) {
-
+
$dispsql = 'SELECT ' . PMA_backquote($map[$meta->name][2])
. ' FROM ' . PMA_backquote($map[$meta->name][3])
. '.' . PMA_backquote($map[$meta->name][0])
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. $where_comparison;
-
+
$dispresult = PMA_DBI_try_query($dispsql, null, PMA_DBI_QUERY_STORE);
-
+
if ($dispresult && PMA_DBI_num_rows($dispresult) > 0) {
list($dispval) = PMA_DBI_fetch_row($dispresult, 0);
} else {
$dispval = __('Link not found');
}
-
+
@PMA_DBI_free_result($dispresult);
-
+
} else {
$dispval = '';
} // end if... else...
if (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1') {
-
+
$result .= ($transform_function != $default_function
? $transform_function($data, $transform_options, $meta)
: $transform_function($data, array(), $meta))
. ' [->' . $dispval . ']';
-
+
} else {
if ($_SESSION['tmp_user_values']['relational_display'] == 'K') {
-
+
// user chose "relational key" in the display options, so
// the title contains the display field
$title = (! empty($dispval))? ' title="' . htmlspecialchars($dispval)
. '"' : '';
-
+
} else {
$title = ' title="' . htmlspecialchars($data) . '"';
}
@@ -4499,7 +4501,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map,
. ' WHERE ' . PMA_backquote($map[$meta->name][1])
. $where_comparison,
);
-
+
$result .= '';
@@ -4508,7 +4510,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map,
// not on the display field
$result .= $transform_function($data, $transform_options, $meta);
} else {
-
+
if ($_SESSION['tmp_user_values']['relational_display'] == 'D') {
// user chose "relational display field" in the
// display options, so show display field in the cell
@@ -4517,11 +4519,11 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map,
// otherwise display data in the cell
$result .= $transform_function($data, array(), $meta);
}
-
+
}
$result .= '';
}
-
+
} else {
$result .= ($transform_function != $default_function)
? $transform_function($data, $transform_options, $meta)
@@ -4553,7 +4555,7 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map,
$result .= '' . "\n";
return $result;
-
+
}
@@ -4575,16 +4577,16 @@ function PMA_getRowData($class, $condition_field, $analyzed_sql, $meta, $map,
function PMA_getCheckboxForMultiRowSubmissions($del_url, $is_display, $row_no,
$where_clause_html, $condition_array, $del_query, $id_suffix, $class
) {
-
+
$ret = '';
-
+
if (! empty($del_url) && $is_display['del_lnk'] != 'kp') {
-
- $ret .= '
'
. PMA_linkOrButton($copy_url, $copy_str, array(), false);
-
+
/*
* Where clause for selecting this row uniquely is provided as
* a hidden input. Used by jQuery scripts for handling grid editing
@@ -4676,9 +4678,9 @@ function PMA_getCopyLink($copy_url, $copy_str, $where_clause,
}
$ret .= '