diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index ded41daa72..331dd86168 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -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()
@@ -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,12 +327,12 @@ 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
);
@@ -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;
-
+
$nbTotalPage = @ceil(
$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
);
-
+
} // end show all
// Move to the next page or to the last one
@@ -398,7 +398,7 @@ 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
@@ -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
- *
+ *
* @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
- );
+ '>',
+ _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']) {
@@ -565,33 +565,33 @@ function PMA_getMoveFarwardButtonsForTableNavigation(
* $_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
- *
+ *
* @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,7 +617,7 @@ function PMA_getAdditionalFieldsForTableNavigation(
'horizontalflipped' => __('horizontal (rotated headers)'),
'vertical' => __('vertical')
);
-
+
$additional_fields_html .= PMA_getDropdown(
'disp_direction', $choices,
$_SESSION['tmp_user_values']['disp_direction'],
@@ -632,9 +632,9 @@ function PMA_getAdditionalFieldsForTableNavigation(
. '" class="textfield" /> '
. __('rows')
. "\n";
-
+
return $additional_fields_html;
-
+
}
@@ -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');
@@ -722,7 +722,7 @@ function PMA_getTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
$table_headers_html .= PMA_getSortByKeyDropDown(
$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
- *
+ *
* @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
- *
+ *
* @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
- *
+ *
* @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
- *
+ *
* @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
- *
+ *
* @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
- *
+ *
* @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
- *
+ *
* @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)
@@ -1561,31 +1561,31 @@ function PMA_getSortingUrlParams(
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
- *
+ *
* @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'
@@ -1622,13 +1622,13 @@ function PMA_getSortOrderLink(
$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
@@ -1637,16 +1637,16 @@ function PMA_getSortOrderLink(
* @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
@@ -1692,16 +1692,16 @@ function PMA_getDraggableClassForSortableColumns(
* @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 = '
';
-
+
return $draggable_html;
-
+
}
@@ -1821,7 +1821,7 @@ function PMA_buildEmptyDisplay($class, $condition_field, $meta, $align = '')
function PMA_addClass($class, $condition_field, $meta, $nowrap,
$is_field_truncated = false, $transform_function = '', $default_function = ''
) {
-
+
// Define classes to be added to this data field based on the type of data
$enum_class = '';
if (strpos($meta->flags, 'enum') !== false) {
@@ -1847,7 +1847,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap,
. ' ' . ($is_field_truncated ? ' truncated' : '')
. ($transform_function != $default_function ? ' transformed' : '')
. $enum_class . $set_class . $bit_class . $mime_type_class;
-
+
}
@@ -1880,7 +1880,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap,
*/
function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
{
-
+
global $db, $table, $goto;
global $sql_query, $fields_meta, $fields_cnt;
global $vertical_display, $highlight_columns;
@@ -1892,11 +1892,11 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// query without conditions to shorten URLs when needed, 200 is just
// guess, it should depend on remaining URL length
$url_sql_query = PMA_getUrlSqlQuery($analyzed_sql, $sql_query);
-
+
if (! is_array($map)) {
$map = array();
}
-
+
$row_no = 0;
$vertical_display['edit'] = array();
$vertical_display['copy'] = array();
@@ -1924,9 +1924,9 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$odd_row = true;
$directionCondition = ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal')
|| ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped');
-
+
while ($row = PMA_DBI_fetch_row($dt_result)) {
-
+
// "vertical display" mode stuff
$table_body_html .= PMA_getVerticalDisplaySupportSegments(
$vertical_display, $row_no, $directionCondition
@@ -1966,24 +1966,24 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// 1.2.1 Modify link(s)
if ($is_display['edit_lnk'] == 'ur') { // update row case
-
+
list($edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class)
= PMA_getModifiedLinks(
$db, $table, $where_clause,
$clause_is_unique, $url_sql_query
);
-
+
} // end if (1.2.1)
// 1.2.2 Delete/Kill link(s)
if (($is_display['del_lnk'] == 'dr') || ($is_display['del_lnk'] == 'kp')) {
-
+
list($del_query, $del_url, $del_str, $js_conf)
= PMA_getDeleteAndKillLinks(
$db, $table, $where_clause, $clause_is_unique,
$url_sql_query, $goto, $is_display['del_lnk']
);
-
+
} // end if (1.2.2)
// 1.3 Displays the links at left if required
@@ -1991,32 +1991,32 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
|| ($GLOBALS['cfg']['RowActionLinks'] == 'both'))
&& $directionCondition
) {
-
+
$table_body_html .= PMA_getPlacedLinks(
'left', $del_url, $is_display, $row_no, $where_clause,
$where_clause_html, $condition_array, $del_query, 'l',
$edit_url, $copy_url, $edit_anchor_class, $edit_str,
$copy_str, $del_str, $js_conf
- );
-
+ );
+
} elseif (($GLOBALS['cfg']['RowActionLinks'] == 'none')
&& $directionCondition
) {
-
+
$table_body_html .= PMA_getPlacedLinks(
'none', $del_url, $is_display, $row_no, $where_clause,
$where_clause_html, $condition_array, $del_query, 'l',
$edit_url, $copy_url, $edit_anchor_class, $edit_str,
$copy_str, $del_str, $js_conf
);
-
+
} // end if (1.3)
} // end if (1)
// 2. Displays the rows' values
for ($j = 0; $j < $fields_cnt; ++$j) {
-
+
// assign $i with appropriate column order
$i = $col_order ? $col_order[$j] : $j;
@@ -2028,10 +2028,10 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
&& ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical'))
? 'hide'
: '';
-
+
// handle datetime-related class, for grid editing
$field_type_class = PMA_getClassForDateTimeRelatedFields($meta->type);
-
+
$pointer = $i;
$is_field_truncated = false;
//If the previous column had blob data, we need to reset the class
@@ -2057,18 +2057,18 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
if ($GLOBALS['cfgRelation']['mimework']
&& $GLOBALS['cfg']['BrowseMIME']
) {
-
+
if (isset($GLOBALS['mime_map'][$meta->name]['mimetype'])
&& isset($GLOBALS['mime_map'][$meta->name]['transformation'])
&& !empty($GLOBALS['mime_map'][$meta->name]['transformation'])
) {
-
+
$include_file = PMA_securePath(
$GLOBALS['mime_map'][$meta->name]['transformation']
);
-
+
if (file_exists('./libraries/transformations/' . $include_file)) {
-
+
$transformfunction_name = str_replace(
'.inc.php', '',
$GLOBALS['mime_map'][$meta->name]['transformation']
@@ -2077,16 +2077,16 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
include_once './libraries/transformations/' . $include_file;
if (function_exists('PMA_transformation_' . $transformfunction_name)) {
-
+
$transform_function = 'PMA_transformation_'
. $transformfunction_name;
-
+
$transform_options = PMA_transformation_getOptions(
isset($GLOBALS['mime_map'][$meta->name]['transformation_options'])
? $GLOBALS['mime_map'][$meta->name]['transformation_options']
: ''
);
-
+
$meta->mimetype = str_replace(
'_', '/',
$GLOBALS['mime_map'][$meta->name]['mimetype']
@@ -2116,7 +2116,7 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// with self-join queries, for example), using $meta->name
// will show both fields NULL even if only one is NULL,
// so use the $pointer
-
+
$vertical_display['data'][$row_no][$i]
= PMA_getDataCellForNumericFeilds(
$row[$i], $class, $condition_field, $meta,
@@ -2126,25 +2126,25 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// b l o b
} elseif (stristr($meta->type, 'BLOB')) {
-
+
// PMA_mysql_fetch_fields returns BLOB in place of
// TEXT fields type so we have to ensure it's really a BLOB
$field_flags = PMA_DBI_field_flags($dt_result, $i);
-
+
$vertical_display['data'][$row_no][$i]
= PMA_getDataCellForBlobField(
$row[$i], $class, $meta, $_url_params, $field_flags,
$transform_function, $default_function,
$transform_options, $condition_field, $is_field_truncated
);
-
+
// g e o m e t r y
} elseif ($meta->type == 'geometry') {
// Remove 'grid_edit' from $class as we do not allow to inline-edit
// geometry data.
$class = str_replace('grid_edit', '', $class);
-
+
$vertical_display['data'][$row_no][$i]
= PMA_getDataCellForGeometryFields(
$row[$i], $class, $meta, $map, $_url_params,
@@ -2154,7 +2154,7 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
// n o t n u m e r i c a n d n o t B L O B
} else {
-
+
$vertical_display['data'][$row_no][$i]
= PMA_getDataCellForNonNumericAndNonBlobFields(
$row[$i], $class, $meta, $map, $_url_params,
@@ -2162,7 +2162,7 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$transform_options, $is_field_truncated, $analyzed_sql,
$dt_result, $i
);
-
+
}
// output stored cell
@@ -2184,14 +2184,14 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
|| ($GLOBALS['cfg']['RowActionLinks'] == 'both'))
&& $directionCondition
) {
-
+
$table_body_html .= PMA_getPlacedLinks(
'right', $del_url, $is_display, $row_no, $where_clause,
$where_clause_html, $condition_array, $del_query, 'r',
$edit_url, $copy_url, $edit_anchor_class, $edit_str,
$copy_str, $del_str, $js_conf
);
-
+
} // end if (3)
if ($directionCondition) {
@@ -2206,30 +2206,30 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$vertical_display['delete'][$row_no] = '';
$vertical_display['row_delete'][$row_no] = '';
}
-
+
$vertical_class = ' row_' . $row_no;
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
$vertical_class .= ' vpointer';
}
-
+
if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) {
$vertical_class .= ' vmarker';
}
if (!empty($del_url) && ($is_display['del_lnk'] != 'kp')) {
-
+
$vertical_display['row_delete'][$row_no] .= PMA_getCheckboxForMultiRowSubmissions(
$del_url, $is_display, $row_no, $where_clause_html,
$condition_array, $del_query, '[%_PMA_CHECKBOX_DIR_%]',
$alternating_color_class . $vertical_class
);
-
+
} else {
unset($vertical_display['row_delete'][$row_no]);
}
if (isset($edit_url)) {
-
+
$vertical_display['edit'][$row_no] .= PMA_getEditLink(
$edit_url,
$alternating_color_class . ' ' . $edit_anchor_class
@@ -2237,60 +2237,60 @@ function PMA_getTableBody(&$dt_result, &$is_display, $map, $analyzed_sql)
$where_clause,
$where_clause_html
);
-
+
} else {
unset($vertical_display['edit'][$row_no]);
}
if (isset($copy_url)) {
-
+
$vertical_display['copy'][$row_no] .= PMA_getCopyLink(
$copy_url, $copy_str, $where_clause, $where_clause_html,
$alternating_color_class . $vertical_class
);
-
+
} else {
unset($vertical_display['copy'][$row_no]);
}
if (isset($del_url)) {
-
+
if (! isset($js_conf)) {
$js_conf = '';
}
-
+
$vertical_display['delete'][$row_no] .= PMA_getDeleteLink(
$del_url, $del_str, $js_conf,
$alternating_color_class . $vertical_class
);
-
+
} else {
unset($vertical_display['delete'][$row_no]);
}
- $table_body_html .= $directionCondition ? "\n" : '';
+ $table_body_html .= $directionCondition ? "\n" : '';
$row_no++;
-
+
} // end while
-
+
return $table_body_html;
-
+
} // end of the 'PMA_getTableBody()' function
/**
* Get url sql query without conditions to shorten URLs
- *
+ *
* @param array $analyzed_sql analyzed query
* @param string $sql_query the SQL query
- *
+ *
* @return string $url_sql analyzed sql query
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getUrlSqlQuery($analyzed_sql, $sql_query)
{
-
+
if (isset($analyzed_sql)
&& isset($analyzed_sql[0])
&& isset($analyzed_sql[0]['querytype'])
@@ -2302,29 +2302,29 @@ function PMA_getUrlSqlQuery($analyzed_sql, $sql_query)
if (isset($analyzed_sql[0]['queryflags']['distinct'])) {
$url_sql_query .= ' DISTINCT ';
}
-
+
$url_sql_query .= $analyzed_sql[0]['select_expr_clause'];
if (!empty($analyzed_sql[0]['from_clause'])) {
$url_sql_query .= ' FROM ' . $analyzed_sql[0]['from_clause'];
}
-
+
return $url_sql_query;
}
-
+
return $sql_query;
-
+
}
/**
* Get column order and column visibility
- *
+ *
* @return array 2 element array - $col_order, $col_visib
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getColumnParams()
-{
+{
if (PMA_isSelect()) {
$pmatable = new PMA_Table($GLOBALS['table'], $GLOBALS['db']);
$col_order = $pmatable->getUiProp(PMA_Table::PROP_COLUMN_ORDER);
@@ -2333,29 +2333,29 @@ function PMA_getColumnParams()
$col_order = false;
$col_visib = false;
}
-
- return array($col_order, $col_visib);
+
+ return array($col_order, $col_visib);
}
/**
* Prepare vertical display mode necessay HTML stuff
- *
+ *
* @param array $vertical_display informations used with vertical
* display mode
* @param integer $row_no the index of current row
* @param boolean $directionCondition the directional condition
- *
+ *
* @return string $vertical_disp_html html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getVerticalDisplaySupportSegments(
$vertical_display, $row_no, $directionCondition
) {
-
+
$support_html = '';
-
+
if ((($row_no != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0))
&& !($row_no % $_SESSION['tmp_user_values']['repeat_cells'])
&& $directionCondition
@@ -2383,30 +2383,30 @@ function PMA_getVerticalDisplaySupportSegments(
}
$support_html .= '' . "\n";
} // end if
-
+
return $support_html;
-
+
}
/**
* Get modified links
- *
+ *
* @param string $db the database name
* @param string $table the table name
* @param string $where_clause the where clause of the sql
* @param boolean $clause_is_unique the unique condition of clause
* @param string $url_sql_query the analyzed sql query
- *
+ *
* @return array 5 element array - $edit_url, $copy_url,
* $edit_str, $copy_str, $edit_anchor_class
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getModifiedLinks(
$db, $table, $where_clause, $clause_is_unique, $url_sql_query
) {
-
+
$_url_params = array(
'db' => $db,
'table' => $table,
@@ -2434,15 +2434,15 @@ function PMA_getModifiedLinks(
if ( $clause_is_unique == 0) {
$edit_anchor_class .= ' nonunique';
}
-
+
return array($edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class);
-
+
}
/**
* Get delete and kill links
- *
+ *
* @param string $db the database name
* @param string $table the table name
* @param string $where_clause the where clause of the sql
@@ -2450,16 +2450,16 @@ function PMA_getModifiedLinks(
* @param string $url_sql_query the analyzed sql query
* @param string $goto the URL to go back in case of errors
* @param string $del_lnk the delete link of current row
- *
+ *
* @return array 4 element array - $del_query,
* $del_url, $del_str, $js_conf
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getDeleteAndKillLinks(
$db, $table, $where_clause, $clause_is_unique, $url_sql_query, $goto, $del_lnk
) {
-
+
if ($del_lnk == 'dr') { // delete row case
$_url_params = array(
@@ -2518,15 +2518,15 @@ function PMA_getDeleteAndKillLinks(
$js_conf = 'KILL ' . $row[0];
$del_str = PMA_getIcon('b_drop.png', __('Kill'));
}
-
+
return array($del_query, $del_url, $del_str, $js_conf);
-
+
}
/**
* Prepare placed links
- *
+ *
* @param string $dir the direction of links should place
* @param string $del_url the url for delete row
* @param array $is_display which elements to display
@@ -2543,17 +2543,17 @@ function PMA_getDeleteAndKillLinks(
* @param string $copy_str the label for copy row
* @param string $del_str the label for delete row
* @param string $js_conf text for the JS confirmation
- *
+ *
* @return string html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getPlacedLinks(
$dir, $del_url, $is_display, $row_no, $where_clause, $where_clause_html,
$condition_array, $del_query, $dir_letter, $edit_url, $copy_url,
- $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf
+ $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf
) {
-
+
if (! isset($js_conf)) {
$js_conf = '';
}
@@ -2564,32 +2564,32 @@ function PMA_getPlacedLinks(
$del_query, 'l', $edit_url, $copy_url, $edit_anchor_class,
$edit_str, $copy_str, $del_str, $js_conf
);
-
+
}
/**
* Get resetted class for inline edit columns
- *
+ *
* @param string $grid_edit_class the class for all editable columns
* @param string $not_null_class the class for not null columns
* @param string $relation_class the class for relations in a column
* @param string $hide_class the class for visibility of a column
* @param string $field_type_class the class related to type of the field
* @param integer $row_no the row index
- *
+ *
* @return string $class the resetted class
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getResettedClassForInlineEdit(
$grid_edit_class, $not_null_class, $relation_class,
$hide_class, $field_type_class, $row_no
) {
-
+
$class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' '
. $relation_class . ' ' . $hide_class . ' ' . $field_type_class;
-
+
if (($_SESSION['tmp_user_values']['disp_direction'] == 'vertical')
&& (! isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))
) {
@@ -2603,23 +2603,23 @@ function PMA_getResettedClassForInlineEdit(
$class .= ' vmarker';
}
}
-
+
return $class;
-
+
}
/**
* Get class for datetime related fields
- *
+ *
* @param string $type the type of the column field
- *
+ *
* @return string $field_type_class the class for the column
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getClassForDateTimeRelatedFields($type)
-{
+{
if ((substr($type, 0, 9) == 'timestamp') || ($type == 'datetime')) {
$field_type_class = 'datetimefield';
} else if ($type == 'date') {
@@ -2627,33 +2627,33 @@ function PMA_getClassForDateTimeRelatedFields($type)
} else {
$field_type_class = '';
}
- return $field_type_class;
+ return $field_type_class;
}
/**
* Prepare data cell for numeric type fields
- *
+ *
* @param string $column the relavent column in data row
* @param string $class the html class for column
* @param boolean $condition_field the column should highlighted or not
- * @param object $meta the meta-information about this field
+ * @param object $meta the meta-information about this field
* @param array $map the list of relations
* @param boolean $is_field_truncated the condition for blob data replacements
* @param array $analyzed_sql the analyzed query
* @param string $transform_function the name of transformation function
- * @param string $default_function the default transformation function
+ * @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
- *
+ *
* @return string $cell the prepared cell, html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getDataCellForNumericFeilds(
$column, $class, $condition_field, $meta, $map, $is_field_truncated,
- $analyzed_sql, $transform_function, $default_function, $transform_options
+ $analyzed_sql, $transform_function, $default_function, $transform_options
) {
-
+
if (! isset($column) || is_null($column)) {
$cell = PMA_buildNullDisplay(
@@ -2679,35 +2679,35 @@ function PMA_getDataCellForNumericFeilds(
'right '.$class, $condition_field, $meta, ''
);
}
-
+
return $cell;
-
+
}
/**
* Get data cell for blob type fields
- *
+ *
* @param string $column the relavent column in data row
* @param string $class the html class for column
* @param object $meta the meta-information about this field
* @param array $_url_params the parameters for generate url
* @param string $field_flags field flags for column(blob, primary etc)
* @param string $transform_function the name of transformation function
- * @param string $default_function the default transformation function
+ * @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param boolean $condition_field the column should highlighted or not
* @param boolean $is_field_truncated the condition for blob data replacements
- *
+ *
* @return string $cell the prepared cell, html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getDataCellForBlobField(
- $column, $class, $meta, $_url_params, $field_flags, $transform_function,
+ $column, $class, $meta, $_url_params, $field_flags, $transform_function,
$default_function, $transform_options, $condition_field, $is_field_truncated
) {
-
+
if (stristr($field_flags, 'BINARY')) {
// remove 'grid_edit' from $class as we can't edit binary data.
@@ -2765,15 +2765,15 @@ function PMA_getDataCellForBlobField(
$cell = PMA_buildEmptyDisplay($class, $condition_field, $meta);
}
}
-
+
return $cell;
-
+
}
/**
* Get data cell for geometry type fields
- *
+ *
* @param string $column the relavent column in data row
* @param string $class the html class for column
* @param object $meta the meta-information about this field
@@ -2781,21 +2781,21 @@ function PMA_getDataCellForBlobField(
* @param array $_url_params the parameters for generate url
* @param boolean $condition_field the column should highlighted or not
* @param string $transform_function the name of transformation function
- * @param string $default_function the default transformation function
+ * @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param boolean $is_field_truncated the condition for blob data replacements
* @param array $analyzed_sql the analyzed query
- *
+ *
* @return string $cell the prepared data cell, html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getDataCellForGeometryFields(
$column, $class, $meta, $map, $_url_params, $condition_field,
$transform_function, $default_function, $transform_options,
- $is_field_truncated, $analyzed_sql
+ $is_field_truncated, $analyzed_sql
) {
-
+
if (! isset($column) || is_null($column)) {
$cell = PMA_buildNullDisplay($class, $condition_field, $meta);
@@ -2886,15 +2886,15 @@ function PMA_getDataCellForGeometryFields(
} else {
$cell = PMA_buildEmptyDisplay($class, $condition_field, $meta);
}
-
+
return $cell;
-
+
}
/**
* Get data cell for non numeric and non blob type fields
- *
+ *
* @param string $column the relavent column in data row
* @param string $class the html class for column
* @param object $meta the meta-information about this field
@@ -2902,16 +2902,16 @@ function PMA_getDataCellForGeometryFields(
* @param array $_url_params the parameters for generate url
* @param boolean $condition_field the column should highlighted or not
* @param string $transform_function the name of transformation function
- * @param string $default_function the default transformation function
+ * @param string $default_function the default transformation function
* @param string $transform_options the transformation parameters
* @param boolean $is_field_truncated the condition for blob data replacements
* @param array $analyzed_sql the analyzed query
* @param integer &$dt_result the link id associated to the query
* which results have to be displayed
* @param integer $col_index the column index
- *
+ *
* @return string $cell the prepared data cell, html content
- *
+ *
* @see PMA_getTableBody()
*/
function PMA_getDataCellForNonNumericAndNonBlobFields(
@@ -2919,7 +2919,7 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
$transform_function, $default_function, $transform_options,
$is_field_truncated, $analyzed_sql, &$dt_result, $col_index
) {
-
+
if (! isset($column) || is_null($column)) {
$cell = PMA_buildNullDisplay($class, $condition_field, $meta);
@@ -3011,15 +3011,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;
-
+
}
@@ -3036,9 +3036,9 @@ function PMA_getDataCellForNonNumericAndNonBlobFields(
*/
function PMA_getVerticalTable()
{
-
+
global $vertical_display;
-
+
$vertical_table_html = '';
// Prepares "multi row delete" link at top if required
@@ -3047,14 +3047,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'
@@ -3102,7 +3102,7 @@ function PMA_getVerticalTable()
// 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 +3112,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 +3122,7 @@ function PMA_getVerticalTable()
$vertical_table_html .= $subval;
$cell_displayed++;
-
+
} // end while
$vertical_table_html .= '
'
. 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 +4676,9 @@ function PMA_getCopyLink($copy_url, $copy_str, $where_clause,
}
$ret .= '