in SESSION, userconf renamed to tmp_user_values to avoid confusion with the future db-based user preferences

This commit is contained in:
Marc Delisle
2009-06-20 16:36:58 +00:00
parent e29115a326
commit 38fea0cc9e
10 changed files with 190 additions and 190 deletions

View File

@@ -554,7 +554,7 @@ class PMA_Config
*/
function getThemeUniqueValue()
{
return intval((null !== $_SESSION['PMA_Config']->get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : (isset($_COOKIE['pma_fontsize']) ? $_COOKIE['pma_fontsize'] : 0))) + ($this->source_mtime + $this->default_source_mtime + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info) . (isset($_SESSION['userconf']['custom_color']) ? substr($_SESSION['userconf']['custom_color'],1,6) : '');
return intval((null !== $_SESSION['PMA_Config']->get('fontsize') ? $_SESSION['PMA_Config']->get('fontsize') : (isset($_COOKIE['pma_fontsize']) ? $_COOKIE['pma_fontsize'] : 0))) + ($this->source_mtime + $this->default_source_mtime + $_SESSION['PMA_Theme']->mtime_info + $_SESSION['PMA_Theme']->filesize_info) . (isset($_SESSION['tmp_user_values']['custom_color']) ? substr($_SESSION['tmp_user_values']['custom_color'],1,6) : '');
}
/**

View File

@@ -653,11 +653,11 @@ unset($default_server);
/* setup themes LABEL_theme_setup */
if (isset($_REQUEST['custom_color_reset'])) {
unset($_SESSION['userconf']['custom_color']);
unset($_SESSION['userconf']['custom_color_rgb']);
unset($_SESSION['tmp_user_values']['custom_color']);
unset($_SESSION['tmp_user_values']['custom_color_rgb']);
} elseif (isset($_REQUEST['custom_color'])) {
$_SESSION['userconf']['custom_color'] = $_REQUEST['custom_color'];
$_SESSION['userconf']['custom_color_rgb'] = $_REQUEST['custom_color_rgb'];
$_SESSION['tmp_user_values']['custom_color'] = $_REQUEST['custom_color'];
$_SESSION['tmp_user_values']['custom_color_rgb'] = $_REQUEST['custom_color_rgb'];
}
/**
* @global PMA_Theme_Manager $_SESSION['PMA_Theme_Manager']
@@ -943,10 +943,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
/**
* some resetting has to be done when switching servers
*/
if (isset($_SESSION['userconf']['previous_server']) && $_SESSION['userconf']['previous_server'] != $GLOBALS['server']) {
unset($_SESSION['userconf']['navi_limit_offset']);
if (isset($_SESSION['tmp_user_values']['previous_server']) && $_SESSION['tmp_user_values']['previous_server'] != $GLOBALS['server']) {
unset($_SESSION['tmp_user_values']['navi_limit_offset']);
}
$_SESSION['userconf']['previous_server'] = $GLOBALS['server'];
$_SESSION['tmp_user_values']['previous_server'] = $GLOBALS['server'];
} // end server connecting

View File

@@ -957,7 +957,7 @@ function PMA_reloadNavigation()
// in this case, get rid of the table limit offset, otherwise
// we have a problem when dropping a table on the last page
// and the offset becomes greater than the total number of tables
unset($_SESSION['userconf']['table_limit_offset']);
unset($_SESSION['tmp_user_values']['table_limit_offset']);
echo "\n";
$reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&');
?>

View File

@@ -46,14 +46,14 @@ require_once './libraries/common.inc.php';
/**
* limits for table list
*/
if (! isset($_SESSION['userconf']['table_limit_offset']) || $_SESSION['userconf']['table_limit_offset_db'] != $db) {
$_SESSION['userconf']['table_limit_offset'] = 0;
$_SESSION['userconf']['table_limit_offset_db'] = $db;
if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
$_SESSION['tmp_user_values']['table_limit_offset'] = 0;
$_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
}
if (isset($_REQUEST['pos'])) {
$_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos'];
$_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
}
$pos = $_SESSION['userconf']['table_limit_offset'];
$pos = $_SESSION['tmp_user_values']['table_limit_offset'];
/**
* fills given tooltip arrays

View File

@@ -239,10 +239,10 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
/**
* Displays a navigation bar to browse among the results of a SQL query
*
* @uses $_SESSION['userconf']['disp_direction']
* @uses $_SESSION['userconf']['repeat_cells']
* @uses $_SESSION['userconf']['max_rows']
* @uses $_SESSION['userconf']['pos']
* @uses $_SESSION['tmp_user_values']['disp_direction']
* @uses $_SESSION['tmp_user_values']['repeat_cells']
* @uses $_SESSION['tmp_user_values']['max_rows']
* @uses $_SESSION['tmp_user_values']['pos']
* @param integer the offset for the "next" page
* @param integer the offset for the "previous" page
* @param string the URL-encoded query
@@ -286,7 +286,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di
<tr>
<?php
// Move to the beginning or to the previous page
if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
if ($_SESSION['tmp_user_values']['pos'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
PMA_displayTableNavigationOneButton('&lt;&lt;', $GLOBALS['strPos1'], 0, $html_sql_query);
PMA_displayTableNavigationOneButton('&lt;', $GLOBALS['strPrevious'], $pos_prev, $html_sql_query);
@@ -306,7 +306,7 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
<input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
<input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />
<input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['userconf']['max_rows'] != 'all') ? $_SESSION['userconf']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
<input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['tmp_user_values']['max_rows'] != 'all') ? $_SESSION['tmp_user_values']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
<?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>
<input type="text" name="pos" size="6" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />
<br />
@@ -316,10 +316,10 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
'horizontal' => $GLOBALS['strRowsModeHorizontal'],
'horizontalflipped' => $GLOBALS['strRowsModeFlippedHorizontal'],
'vertical' => $GLOBALS['strRowsModeVertical']);
$param1 = PMA_generate_html_dropdown('disp_direction', $choices, $_SESSION['userconf']['disp_direction'], $id_for_direction_dropdown);
$param1 = PMA_generate_html_dropdown('disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], $id_for_direction_dropdown);
unset($choices);
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['userconf']['repeat_cells'] . '" class="textfield" />' . "\n"
$param2 = ' <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['tmp_user_values']['repeat_cells'] . '" class="textfield" />' . "\n"
. ' ';
echo ' ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
?>
@@ -330,8 +330,8 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
</td>
<?php
// Move to the next page or to the last one
if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
&& $_SESSION['userconf']['max_rows'] != 'all') {
if (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['tmp_user_values']['max_rows']
&& $_SESSION['tmp_user_values']['max_rows'] != 'all') {
// display the Next button
PMA_displayTableNavigationOneButton('&gt;',
@@ -351,9 +351,9 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
// display the End button
PMA_displayTableNavigationOneButton('&gt;&gt;',
$GLOBALS['strEnd'],
@((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']),
@((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']),
$html_sql_query,
'onsubmit="return ' . (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false') . '"',
'onsubmit="return ' . (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['tmp_user_values']['max_rows']) ? 'true' : 'false') . '"',
$input_for_real_end,
$onclick
);
@@ -362,9 +362,9 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
//page redirection
// (unless we are showing all records)
if ('all' != $_SESSION['userconf']['max_rows']) { //if1
$pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;
$nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);
if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //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
?>
@@ -383,7 +383,7 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
);
echo PMA_pageselector(
'sql.php' . PMA_generate_common_url($_url_params) . PMA_get_arg_separator('js'),
$_SESSION['userconf']['max_rows'],
$_SESSION['tmp_user_values']['max_rows'],
$pageNow,
$nbTotalPage,
200,
@@ -431,11 +431,11 @@ onsubmit="return (checkFormElementInRange(this, 'session_max_rows', '<?php echo
/**
* Displays the headers of the results table
*
* @uses $_SESSION['userconf']['disp_direction']
* @uses $_SESSION['userconf']['repeat_cells']
* @uses $_SESSION['userconf']['max_rows']
* @uses $_SESSION['userconf']['display_text']
* @uses $_SESSION['userconf']['display_binary']
* @uses $_SESSION['tmp_user_values']['disp_direction']
* @uses $_SESSION['tmp_user_values']['repeat_cells']
* @uses $_SESSION['tmp_user_values']['max_rows']
* @uses $_SESSION['tmp_user_values']['display_text']
* @uses $_SESSION['tmp_user_values']['display_binary']
* @param array which elements to display
* @param array the list of fields properties
* @param integer the total number of fields returned by the SQL query
@@ -490,8 +490,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// do we have any index?
if ($indexes) {
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
$span = $fields_cnt;
if ($is_display['edit_lnk'] != 'nn') {
$span++;
@@ -503,7 +503,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$span++;
}
} else {
$span = $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1;
$span = $num_rows + floor($num_rows/$_SESSION['tmp_user_values']['repeat_cells']) + 1;
}
echo '<form action="sql.php" method="post">' . "\n";
@@ -559,11 +559,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
'P' => $GLOBALS['strPartialText'],
'F' => $GLOBALS['strFullText']
);
PMA_display_html_radio('display_text', $choices, $_SESSION['userconf']['display_text']);
PMA_display_html_radio('display_text', $choices, $_SESSION['tmp_user_values']['display_text']);
echo '</div>';
// prepare full/partial text button or link
if ($_SESSION['userconf']['display_text']=='F') {
if ($_SESSION['tmp_user_values']['display_text']=='F') {
// currently in fulltext mode so show the opposite link
$tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_partialtext.png';
$tmp_txt = $GLOBALS['strPartialText'];
@@ -586,14 +586,14 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
'K' => $GLOBALS['strRelationalKey'],
'D' => $GLOBALS['strRelationalDisplayField']
);
PMA_display_html_radio('relational_display', $choices, $_SESSION['userconf']['relational_display']);
PMA_display_html_radio('relational_display', $choices, $_SESSION['tmp_user_values']['relational_display']);
echo '</div>';
}
echo '<div class="formelement">';
PMA_display_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['userconf']['display_binary']), false);
PMA_display_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['tmp_user_values']['display_binary']), false);
echo '<br />';
PMA_display_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['userconf']['display_blob']), false);
PMA_display_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['tmp_user_values']['display_blob']), false);
echo '</div>';
// I would have preferred to name this "display_transformation".
@@ -601,7 +601,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// per SQL query, and at the same time have a default that displays
// the transformations.
echo '<div class="formelement">';
PMA_display_html_checkbox('hide_transformation', $GLOBALS['strHide'] . ' ' . $GLOBALS['strMIME_transformation'], ! empty($_SESSION['userconf']['hide_transformation']), false);
PMA_display_html_checkbox('hide_transformation', $GLOBALS['strHide'] . ' ' . $GLOBALS['strMIME_transformation'], ! empty($_SESSION['tmp_user_values']['hide_transformation']), false);
echo '</div>';
echo '<div class="clearfloat"></div>';
@@ -623,14 +623,14 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
}
echo '<table id="table_results" class="data">' . "\n";
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo '<thead><tr>' . "\n";
}
// 1. Displays the full/partial text button (part 1)...
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
$colspan = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
? ' colspan="3"'
: '';
@@ -644,8 +644,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
&& $is_display['text_btn'] == '1') {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>
<th colspan="<?php echo $fields_cnt; ?>"></th>
</tr>
@@ -655,7 +655,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
else {
?>
<tr>
<th colspan="<?php echo $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1; ?>"></th>
<th colspan="<?php echo $num_rows + floor($num_rows/$_SESSION['tmp_user_values']['repeat_cells']) + 1; ?>"></th>
</tr>
<?php
} // end vertical mode
@@ -665,8 +665,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// and required
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>
<th <?php echo $colspan; ?>><?php echo $full_or_partial_text_link;?></th>
<?php
@@ -682,8 +682,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>
<td<?php echo $colspan; ?>></td>
<?php
@@ -700,7 +700,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
// Do not show comments, if using horizontalflipped mode, because of space usage
if ($GLOBALS['cfg']['ShowBrowseComments']
&& $_SESSION['userconf']['disp_direction'] != 'horizontalflipped') {
&& $_SESSION['tmp_user_values']['disp_direction'] != 'horizontalflipped') {
$comments_map = array();
if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
foreach ($analyzed_sql[0]['table_ref'] as $tbl) {
@@ -711,7 +711,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
}
}
if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] && ! $_SESSION['userconf']['hide_transformation']) {
if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] && ! $_SESSION['tmp_user_values']['hide_transformation']) {
require_once './libraries/transformations.lib.php';
$GLOBALS['mime_map'] = PMA_getMIME($db, $table);
}
@@ -847,21 +847,21 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
$order_link_params['onmouseout'] = 'if(document.getElementById(\'soimg' . $i . '\')){ document.getElementById(\'soimg' . $i . '\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
}
}
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
$order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
}
$order_link_params['title'] = $GLOBALS['strSort'];
$order_link_content = ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name));
$order_link_content = ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped' && $GLOBALS['cfg']['HeaderFlipType'] == 'fake' ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), "<br />\n") : htmlspecialchars($fields_meta[$i]->name));
$order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true);
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo '<th';
if ($condition_field) {
echo ' class="condition"';
}
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo ' valign="bottom"';
}
echo '>' . $order_link . $comments . '</th>';
@@ -873,21 +873,21 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
// 2.2 Results can't be sorted
else {
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo '<th';
if ($condition_field) {
echo ' class="condition"';
}
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo ' valign="bottom"';
}
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
echo ' style="direction: ltr; writing-mode: tb-rl;"';
}
echo '>';
if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
&& $GLOBALS['cfg']['HeaderFlipType'] == 'fake') {
echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '<br />');
} else {
@@ -908,8 +908,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
&& $is_display['text_btn'] == '1') {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo "\n";
?>
<th <?php echo $colspan; ?>><?php echo $full_or_partial_text_link;?>
@@ -929,8 +929,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
&& (!$GLOBALS['is_header_sent'])) {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo "\n";
?>
<td<?php echo $colspan; ?>></td>
@@ -941,8 +941,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
} // end vertical mode
}
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>
</tr>
</thead>
@@ -957,12 +957,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
/**
* Displays the body of the results table
*
* @uses $_SESSION['userconf']['disp_direction']
* @uses $_SESSION['userconf']['repeat_cells']
* @uses $_SESSION['userconf']['max_rows']
* @uses $_SESSION['userconf']['display_text']
* @uses $_SESSION['userconf']['display_binary']
* @uses $_SESSION['userconf']['display_blob']
* @uses $_SESSION['tmp_user_values']['disp_direction']
* @uses $_SESSION['tmp_user_values']['repeat_cells']
* @uses $_SESSION['tmp_user_values']['max_rows']
* @uses $_SESSION['tmp_user_values']['display_text']
* @uses $_SESSION['tmp_user_values']['display_binary']
* @uses $_SESSION['tmp_user_values']['display_blob']
* @param integer the link id associated to the query which results have
* to be displayed
* @param array which elements to display
@@ -1036,9 +1036,9 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$odd_row = true;
while ($row = PMA_DBI_fetch_row($dt_result)) {
// lem9: "vertical display" mode stuff
if ($row_no != 0 && $_SESSION['userconf']['repeat_cells'] != 0 && !($row_no % $_SESSION['userconf']['repeat_cells'])
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped'))
if ($row_no != 0 && $_SESSION['tmp_user_values']['repeat_cells'] != 0 && !($row_no % $_SESSION['tmp_user_values']['repeat_cells'])
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'))
{
echo '<tr>' . "\n";
if ($vertical_display['emptypre'] > 0) {
@@ -1059,8 +1059,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$class = $odd_row ? 'odd' : 'even';
$odd_row = ! $odd_row;
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
// loic1: pointer code part
echo ' <tr class="' . $class . '">' . "\n";
$class = '';
@@ -1172,8 +1172,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// 1.3 Displays the links at left if required
if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
$doWriteModifyAt = 'left';
require './libraries/display_tbl_links.lib.php';
} // end if (1.3)
@@ -1192,7 +1192,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
}
$mouse_events = '';
if ($_SESSION['userconf']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
$mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
. ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
@@ -1323,7 +1323,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$vertical_display['data'][$row_no][$i] = ' <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
} elseif ($row[$i] != '') {
// garvin: if a transform function for blob is set, none of these replacements will be made
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['userconf']['display_text'] == 'P') {
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P') {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
// loic1: displays all space characters, 4 space
@@ -1345,7 +1345,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
// lem9: (unless it's a link-type transformation)
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['userconf']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
$row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
}
@@ -1354,7 +1354,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
$row[$i] = PMA_printable_bit_value($row[$i], $meta->length);
} elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string') {
if ($_SESSION['userconf']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
if ($_SESSION['tmp_user_values']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
// user asked to see the real contents of BINARY
// fields, or we detected a PROCEDURE ANALYSE in
// the query (results are reported as being
@@ -1382,8 +1382,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
}
// lem9: output stored cell
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
echo $vertical_display['data'][$row_no][$i];
}
@@ -1396,14 +1396,14 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
&& ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
$doWriteModifyAt = 'right';
require './libraries/display_tbl_links.lib.php';
} // end if (3)
if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
|| $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
|| $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
?>
</tr>
<?php
@@ -1454,7 +1454,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
unset($vertical_display['delete'][$row_no]);
}
echo (($_SESSION['userconf']['disp_direction'] == 'horizontal' || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? "\n" : '');
echo (($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') ? "\n" : '');
$row_no++;
} // end while
@@ -1468,7 +1468,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
*
* @return boolean always true
*
* @uses $_SESSION['userconf']['repeat_cells']
* @uses $_SESSION['tmp_user_values']['repeat_cells']
* @global array $vertical_display the information to display
*
* @access private
@@ -1485,7 +1485,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn'];
$foo_counter = 0;
foreach ($vertical_display['row_delete'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
@@ -1503,7 +1503,7 @@ function PMA_displayVerticalTable()
}
$foo_counter = 0;
foreach ($vertical_display['edit'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo ' <th></th>' . "\n";
}
@@ -1521,7 +1521,7 @@ function PMA_displayVerticalTable()
}
$foo_counter = 0;
foreach ($vertical_display['delete'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
@@ -1539,7 +1539,7 @@ function PMA_displayVerticalTable()
$foo_counter = 0;
foreach ($vertical_display['rowdata'][$key] as $subval) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) and !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) and !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo $val;
}
@@ -1556,7 +1556,7 @@ function PMA_displayVerticalTable()
echo $vertical_display['textbtn'];
$foo_counter = 0;
foreach ($vertical_display['row_delete'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
@@ -1574,7 +1574,7 @@ function PMA_displayVerticalTable()
}
$foo_counter = 0;
foreach ($vertical_display['edit'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
@@ -1592,7 +1592,7 @@ function PMA_displayVerticalTable()
}
$foo_counter = 0;
foreach ($vertical_display['delete'] as $val) {
if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
echo '<th></th>' . "\n";
}
@@ -1607,24 +1607,24 @@ function PMA_displayVerticalTable()
/**
*
* @uses $_SESSION['userconf']['disp_direction']
* @uses $_SESSION['tmp_user_values']['disp_direction']
* @uses $_REQUEST['disp_direction']
* @uses $GLOBALS['cfg']['DefaultDisplay']
* @uses $_SESSION['userconf']['repeat_cells']
* @uses $_SESSION['tmp_user_values']['repeat_cells']
* @uses $_REQUEST['repeat_cells']
* @uses $GLOBALS['cfg']['RepeatCells']
* @uses $_SESSION['userconf']['max_rows']
* @uses $_SESSION['tmp_user_values']['max_rows']
* @uses $_REQUEST['session_max_rows']
* @uses $GLOBALS['cfg']['MaxRows']
* @uses $_SESSION['userconf']['pos']
* @uses $_SESSION['tmp_user_values']['pos']
* @uses $_REQUEST['pos']
* @uses $_SESSION['userconf']['display_text']
* @uses $_SESSION['tmp_user_values']['display_text']
* @uses $_REQUEST['display_text']
* @uses $_SESSION['userconf']['relational_display']
* @uses $_SESSION['tmp_user_values']['relational_display']
* @uses $_REQUEST['relational_display']
* @uses $_SESSION['userconf']['display_binary']
* @uses $_SESSION['tmp_user_values']['display_binary']
* @uses $_REQUEST['display_binary']
* @uses $_SESSION['userconf']['display_blob']
* @uses $_SESSION['tmp_user_values']['display_blob']
* @uses $_REQUEST['display_blob']
* @uses PMA_isValid()
* @uses $GLOBALS['sql_query']
@@ -1637,107 +1637,107 @@ function PMA_displayTable_checkConfigParams()
{
$sql_key = md5($GLOBALS['sql_query']);
$_SESSION['userconf']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
$_SESSION['tmp_user_values']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
if (PMA_isValid($_REQUEST['disp_direction'], array('horizontal', 'vertical', 'horizontalflipped'))) {
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
$_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
unset($_REQUEST['disp_direction']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['disp_direction'])) {
$_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
}
if (PMA_isValid($_REQUEST['repeat_cells'], 'numeric')) {
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
$_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
unset($_REQUEST['repeat_cells']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['repeat_cells'])) {
$_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
}
if (PMA_isValid($_REQUEST['session_max_rows'], 'numeric') || $_REQUEST['session_max_rows'] == 'all') {
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
$_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
unset($_REQUEST['session_max_rows']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['max_rows'])) {
$_SESSION['userconf']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
}
if (PMA_isValid($_REQUEST['pos'], 'numeric')) {
$_SESSION['userconf']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
$_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
unset($_REQUEST['pos']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['pos'])) {
$_SESSION['userconf']['query'][$sql_key]['pos'] = 0;
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['pos'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = 0;
}
if (PMA_isValid($_REQUEST['display_text'], array('P', 'F'))) {
$_SESSION['userconf']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
$_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
unset($_REQUEST['display_text']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['display_text'])) {
$_SESSION['userconf']['query'][$sql_key]['display_text'] = 'P';
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['display_text'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = 'P';
}
if (PMA_isValid($_REQUEST['relational_display'], array('K', 'D'))) {
$_SESSION['userconf']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
$_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
unset($_REQUEST['relational_display']);
} elseif (empty($_SESSION['userconf']['query'][$sql_key]['relational_display'])) {
$_SESSION['userconf']['query'][$sql_key]['relational_display'] = 'K';
} elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'])) {
$_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = 'K';
}
if (isset($_REQUEST['display_binary'])) {
$_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
unset($_REQUEST['display_binary']);
} elseif (isset($_REQUEST['display_options_form'])) {
// we know that the checkbox was unchecked
unset($_SESSION['userconf']['query'][$sql_key]['display_binary']);
unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']);
} else {
// selected by default because some operations like OPTIMIZE TABLE
// and all queries involving functions return "binary" contents,
// according to low-level field flags
$_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
$_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
}
if (isset($_REQUEST['display_blob'])) {
$_SESSION['userconf']['query'][$sql_key]['display_blob'] = true;
$_SESSION['tmp_user_values']['query'][$sql_key]['display_blob'] = true;
unset($_REQUEST['display_blob']);
} elseif (isset($_REQUEST['display_options_form'])) {
// we know that the checkbox was unchecked
unset($_SESSION['userconf']['query'][$sql_key]['display_blob']);
unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']);
}
if (isset($_REQUEST['hide_transformation'])) {
$_SESSION['userconf']['query'][$sql_key]['hide_transformation'] = true;
$_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation'] = true;
unset($_REQUEST['hide_transformation']);
} elseif (isset($_REQUEST['display_options_form'])) {
// we know that the checkbox was unchecked
unset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']);
unset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']);
}
// move current query to the last position, to be removed last
// so only least executed query will be removed if maximum remembered queries
// limit is reached
$tmp = $_SESSION['userconf']['query'][$sql_key];
unset($_SESSION['userconf']['query'][$sql_key]);
$_SESSION['userconf']['query'][$sql_key] = $tmp;
$tmp = $_SESSION['tmp_user_values']['query'][$sql_key];
unset($_SESSION['tmp_user_values']['query'][$sql_key]);
$_SESSION['tmp_user_values']['query'][$sql_key] = $tmp;
// do not exceed a maximum number of queries to remember
if (count($_SESSION['userconf']['query']) > 10) {
array_shift($_SESSION['userconf']['query']);
if (count($_SESSION['tmp_user_values']['query']) > 10) {
array_shift($_SESSION['tmp_user_values']['query']);
//echo 'deleting one element ...';
}
// populate query configuration
$_SESSION['userconf']['display_text'] = $_SESSION['userconf']['query'][$sql_key]['display_text'];
$_SESSION['userconf']['relational_display'] = $_SESSION['userconf']['query'][$sql_key]['relational_display'];
$_SESSION['userconf']['display_binary'] = isset($_SESSION['userconf']['query'][$sql_key]['display_binary']) ? true : false;
$_SESSION['userconf']['display_blob'] = isset($_SESSION['userconf']['query'][$sql_key]['display_blob']) ? true : false;
$_SESSION['userconf']['hide_transformation'] = isset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']) ? true : false;
$_SESSION['userconf']['pos'] = $_SESSION['userconf']['query'][$sql_key]['pos'];
$_SESSION['userconf']['max_rows'] = $_SESSION['userconf']['query'][$sql_key]['max_rows'];
$_SESSION['userconf']['repeat_cells'] = $_SESSION['userconf']['query'][$sql_key]['repeat_cells'];
$_SESSION['userconf']['disp_direction'] = $_SESSION['userconf']['query'][$sql_key]['disp_direction'];
$_SESSION['tmp_user_values']['display_text'] = $_SESSION['tmp_user_values']['query'][$sql_key]['display_text'];
$_SESSION['tmp_user_values']['relational_display'] = $_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'];
$_SESSION['tmp_user_values']['display_binary'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']) ? true : false;
$_SESSION['tmp_user_values']['display_blob'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']) ? true : false;
$_SESSION['tmp_user_values']['hide_transformation'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']) ? true : false;
$_SESSION['tmp_user_values']['pos'] = $_SESSION['tmp_user_values']['query'][$sql_key]['pos'];
$_SESSION['tmp_user_values']['max_rows'] = $_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'];
$_SESSION['tmp_user_values']['repeat_cells'] = $_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'];
$_SESSION['tmp_user_values']['disp_direction'] = $_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'];
/*
* debugging
echo '<pre>';
var_dump($_SESSION['userconf']);
var_dump($_SESSION['tmp_user_values']);
echo '</pre>';
*/
}
@@ -1751,7 +1751,7 @@ function PMA_displayTable_checkConfigParams()
* @param array the display mode
* @param array the analyzed query
*
* @uses $_SESSION['userconf']['pos']
* @uses $_SESSION['tmp_user_values']['pos']
* @global string $db the database name
* @global string $table the table name
* @global string $goto the URL to go back in case of errors
@@ -1814,12 +1814,12 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
// 1.2 Defines offsets for the next and previous pages
if ($is_display['nav_bar'] == '1') {
if ($_SESSION['userconf']['max_rows'] == 'all') {
if ($_SESSION['tmp_user_values']['max_rows'] == 'all') {
$pos_next = 0;
$pos_prev = 0;
} else {
$pos_next = $_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'];
$pos_prev = $_SESSION['userconf']['pos'] - $_SESSION['userconf']['max_rows'];
$pos_next = $_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'];
$pos_prev = $_SESSION['tmp_user_values']['pos'] - $_SESSION['tmp_user_values']['max_rows'];
if ($pos_prev < 0) {
$pos_prev = 0;
}
@@ -1884,7 +1884,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
} else {
$selectstring = '';
}
$last_shown_rec = ($_SESSION['userconf']['max_rows'] == 'all' || $pos_next > $total)
$last_shown_rec = ($_SESSION['tmp_user_values']['max_rows'] == 'all' || $pos_next > $total)
? $total - 1
: $pos_next - 1;
@@ -1899,7 +1899,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
}
$message = PMA_Message::success('strShowingRecords');
$message->addMessage($_SESSION['userconf']['pos']);
$message->addMessage($_SESSION['tmp_user_values']['pos']);
if ($message_view_warning) {
$message->addMessage('...', ' - ');
$message->addMessage($message_view_warning);
@@ -1986,7 +1986,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
echo '<tbody>' . "\n";
PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
// vertical output case
if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
PMA_displayVerticalTable();
} // end if
unset($vertical_display);
@@ -2012,7 +2012,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
$_url_params['checkall'] = '1';
$checkall_url = 'sql.php' . PMA_generate_common_url($_url_params);
if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
$checkall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', true)) return false;';
$uncheckall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', false)) return false;';
} else {
@@ -2021,7 +2021,7 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
}
$checkall_link = PMA_linkOrButton($checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false);
$uncheckall_link = PMA_linkOrButton($uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false);
if ($_SESSION['userconf']['disp_direction'] != 'vertical') {
if ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical') {
echo '<img class="selectallarrow" width="38" height="22"'
.' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"'
.' alt="' . $GLOBALS['strWithChecked'] . '" />';
@@ -2079,8 +2079,8 @@ function default_function($buffer) {
* @param array the display mode
* @param array the analyzed query
*
* @uses $_SESSION['userconf']['pos']
* @uses $_SESSION['userconf']['display_text']
* @uses $_SESSION['tmp_user_values']['pos']
* @uses $_SESSION['tmp_user_values']['display_text']
* @global string $db the database name
* @global string $table the table name
* @global string $sql_query the current SQL query
@@ -2122,7 +2122,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
PMA_getIcon('b_print.png', $GLOBALS['strPrintView'], false, true),
'', true, true, 'print_view') . "\n";
if ($_SESSION['userconf']['display_text']) {
if ($_SESSION['tmp_user_values']['display_text']) {
$_url_params['display_text'] = 'F';
echo PMA_linkOrButton(
'sql.php' . PMA_generate_common_url($_url_params),
@@ -2216,7 +2216,7 @@ function PMA_handle_non_printable_contents($category, $content, $transform_funct
$result = $transform_function($result, $transform_options, $meta);
} else {
$result = $default_function($result, array(), $meta);
if (stristr($meta->type, 'BLOB') && $_SESSION['userconf']['display_blob']) {
if (stristr($meta->type, 'BLOB') && $_SESSION['tmp_user_values']['display_blob']) {
// in this case, restart from the original $content
$result = PMA_replace_binary_contents($content);
}
@@ -2294,7 +2294,7 @@ function PMA_prepare_row_data($mouse_events, $class, $condition_field, $analyzed
$result .= ($transform_function != $default_function ? $transform_function($data, $transform_options, $meta) : $transform_function($data, array(), $meta)) . ' <code>[-&gt;' . $dispval . ']</code>';
} else {
if ('K' == $_SESSION['userconf']['relational_display']) {
if ('K' == $_SESSION['tmp_user_values']['relational_display']) {
// user chose "relational key" in the display options, so
// the title contains the display field
$title = (! empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : '';
@@ -2319,7 +2319,7 @@ function PMA_prepare_row_data($mouse_events, $class, $condition_field, $analyzed
// not on the display field
$result .= $transform_function($data, $transform_options, $meta);
} else {
if ('D' == $_SESSION['userconf']['relational_display']) {
if ('D' == $_SESSION['tmp_user_values']['relational_display']) {
// user chose "relational display field" in the
// display options, so show display field in the cell
$result .= $transform_function($dispval, array(), $meta);

View File

@@ -63,23 +63,23 @@ function PMA_exitNavigationFrame()
}
// keep the offset of the db list in session before closing it
if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
$_SESSION['userconf']['navi_limit_offset'] = 0;
if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
$_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
}
if (! isset($_SESSION['userconf']['table_limit_offset']) || $_SESSION['userconf']['table_limit_offset_db'] != $db) {
$_SESSION['userconf']['table_limit_offset'] = 0;
$_SESSION['userconf']['table_limit_offset_db'] = $db;
if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
$_SESSION['tmp_user_values']['table_limit_offset'] = 0;
$_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
}
if (isset($_REQUEST['pos'])) {
if (isset($_REQUEST['tpos'])) {
$_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos'];
$_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
}
else {
$_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
$_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
}
}
$pos = $_SESSION['userconf']['navi_limit_offset'];
$tpos = $_SESSION['userconf']['table_limit_offset'];
$pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
$tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
// free the session file, for the other frames to be loaded
// but only if debugging is not enabled
if (empty($_SESSION['debug'])) {
@@ -219,7 +219,7 @@ if (! $GLOBALS['server']) {
<label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
<?php
echo PMA_generate_common_hidden_inputs() . "\n";
echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
echo '<noscript>' . "\n"
.'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
.'</noscript>' . "\n"
@@ -228,7 +228,7 @@ if (! $GLOBALS['server']) {
if (! empty($db)) {
echo '<div id="databaseList">' . "\n";
}
echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
}
$_url_params = array('pos' => $pos);
PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
@@ -336,7 +336,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
echo '</div>' . "\n";
$common_url_query = PMA_generate_common_url();
PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
}
/**

View File

@@ -97,7 +97,7 @@ PMA_displayTable_checkConfigParams();
*/
if (isset($find_real_end) && $find_real_end) {
$unlim_num_rows = PMA_Table::countRecords($db, $table, true, true);
$_SESSION['userconf']['pos'] = @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']) - 1) * $_SESSION['userconf']['max_rows']);
$_SESSION['tmp_user_values']['pos'] = @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']) - 1) * $_SESSION['tmp_user_values']['max_rows']);
}
@@ -252,13 +252,13 @@ if ($is_select) { // see line 141
}
// Do append a "LIMIT" clause?
if ((! $cfg['ShowAll'] || $_SESSION['userconf']['max_rows'] != 'all')
if ((! $cfg['ShowAll'] || $_SESSION['tmp_user_values']['max_rows'] != 'all')
&& ! ($is_count || $is_export || $is_func || $is_analyse)
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& ! isset($analyzed_sql[0]['queryflags']['offset'])
&& empty($analyzed_sql[0]['limit_clause'])
) {
$sql_limit_to_append = ' LIMIT ' . $_SESSION['userconf']['pos'] . ', ' . $_SESSION['userconf']['max_rows'] . " ";
$sql_limit_to_append = ' LIMIT ' . $_SESSION['tmp_user_values']['pos'] . ', ' . $_SESSION['tmp_user_values']['max_rows'] . " ";
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . "\n" . $sql_limit_to_append . $analyzed_sql[0]['section_after_limit'];
/**
@@ -373,7 +373,7 @@ if (isset($GLOBALS['show_as_php']) || !empty($GLOBALS['validatequery'])) {
$unlim_num_rows = $num_rows;
// if we did not append a limit, set this to get a correct
// "Showing rows..." message
//$_SESSION['userconf']['max_rows'] = 'all';
//$_SESSION['tmp_user_values']['max_rows'] = 'all';
} elseif ($is_select) {
// c o u n t q u e r y

View File

@@ -30,7 +30,7 @@ body {
padding: 0;
margin: 0.5em;
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
background: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['MainBackground']); ?>;
background: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['MainBackground']); ?>;
}
<?php if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>

View File

@@ -27,7 +27,7 @@ body {
<?php if (! empty($GLOBALS['cfg']['FontFamily'])) { ?>
font-family: <?php echo $GLOBALS['cfg']['FontFamily']; ?>;
<?php } ?>
background: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
background: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
color: <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
margin: 0;
padding: 0.2em 0.2em 0.2em 0.2em;
@@ -86,7 +86,7 @@ button {
div#pmalogo {
<?php //better echo $GLOBALS['cfg']['logoBGC']; ?>
background-color: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
background-color: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
padding:.3em;
}
div#pmalogo,
@@ -160,7 +160,7 @@ div#left_tableList ul {
margin: 0;
padding: 0;
font-size: 80%;
background: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
background: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['NaviBackground']); ?>;
}
div#left_tableList ul ul {

View File

@@ -31,7 +31,7 @@ body {
padding: 0;
margin: 0.5em;
color: <?php echo $GLOBALS['cfg']['MainColor']; ?>;
background: <?php echo (isset($_SESSION['userconf']['custom_color']) ? $_SESSION['userconf']['custom_color'] : $GLOBALS['cfg']['MainBackground']); ?>;
background: <?php echo (isset($_SESSION['tmp_user_values']['custom_color']) ? $_SESSION['tmp_user_values']['custom_color'] : $GLOBALS['cfg']['MainBackground']); ?>;
}
<?php if (! empty($GLOBALS['cfg']['FontFamilyFixed'])) { ?>