~ubuntu-branches/ubuntu/lucid/phpmyadmin/lucid

« back to all changes in this revision

Viewing changes to libraries/display_tbl.lib.php

  • Committer: Bazaar Package Importer
  • Author(s): Michal Čihař
  • Date: 2010-03-08 15:25:00 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100308152500-6e8hmuqc5co39de5
Tags: 4:3.3.0-1
* New upstream version.
* Rediff debian/patches.
* Fix permissions on mediawiki export extension.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        $the_total = $unlim_num_rows;
161
161
    } elseif (($do_display['nav_bar'] == '1' || $do_display['sort_lnk'] == '1')
162
162
             && (strlen($db) && !empty($table))) {
163
 
        $the_total   = PMA_Table::countRecords($db, $table, true);
 
163
        $the_total   = PMA_Table::countRecords($db, $table);
164
164
    }
165
165
 
166
166
    // 4. If navigation bar or sorting fields names URLs should be
187
187
 
188
188
 
189
189
/**
 
190
 * Displays a navigation button 
 
191
 *
 
192
 * @uses    $GLOBALS['cfg']['NavigationBarIconic']
 
193
 * @uses    PMA_generate_common_hidden_inputs() 
 
194
 *
 
195
 * @param   string   iconic caption for button
 
196
 * @param   string   text for button 
 
197
 * @param   integer  position for next query 
 
198
 * @param   string   query ready for display 
 
199
 * @param   string   optional onsubmit clause 
 
200
 * @param   string   optional hidden field for special treatment
 
201
 * @param   string   optional onclick clause
 
202
 *
 
203
 * @global  string   $db             the database name
 
204
 * @global  string   $table          the table name
 
205
 * @global  string   $goto           the URL to go back in case of errors
 
206
 *
 
207
 * @access  private
 
208
 *
 
209
 * @see     PMA_displayTableNavigation()
 
210
 */
 
211
function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_query, $onsubmit = '', $input_for_real_end = '', $onclick = '') {
 
212
 
 
213
    global $db, $table, $goto;
 
214
 
 
215
    $caption_output = '';
 
216
    // for true or 'both'
 
217
    if ($GLOBALS['cfg']['NavigationBarIconic']) {
 
218
        $caption_output .= $caption;
 
219
    }
 
220
    // for false or 'both'
 
221
    if (false === $GLOBALS['cfg']['NavigationBarIconic'] || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) {
 
222
        $caption_output .= ' ' . $title;
 
223
    }
 
224
    $title_output = ' title="' . $title . '"';
 
225
        ?>
 
226
<td>
 
227
    <form action="sql.php" method="post" <?php echo $onsubmit; ?>>
 
228
        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
 
229
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
 
230
        <input type="hidden" name="pos" value="<?php echo $pos; ?>" />
 
231
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
 
232
        <?php echo $input_for_real_end; ?>
 
233
        <input type="submit" name="navig" value="<?php echo $caption_output; ?>"<?php echo $title_output . $onclick; ?> />
 
234
    </form>
 
235
</td>
 
236
<?php
 
237
} // end function PMA_displayTableNavigationOneButton()
 
238
 
 
239
/**
190
240
 * Displays a navigation bar to browse among the results of a SQL query
191
241
 *
192
 
 * @uses    $_SESSION['userconf']['disp_direction']
193
 
 * @uses    $_SESSION['userconf']['repeat_cells']
194
 
 * @uses    $_SESSION['userconf']['max_rows']
195
 
 * @uses    $_SESSION['userconf']['pos']
 
242
 * @uses    $_SESSION['tmp_user_values']['disp_direction']
 
243
 * @uses    $_SESSION['tmp_user_values']['repeat_cells']
 
244
 * @uses    $_SESSION['tmp_user_values']['max_rows']
 
245
 * @uses    $_SESSION['tmp_user_values']['pos']
196
246
 * @param   integer  the offset for the "next" page
197
247
 * @param   integer  the offset for the "previous" page
198
248
 * @param   string   the URL-encoded query
 
249
 * @param   string   the id for the direction dropdown 
199
250
 *
200
251
 * @global  string   $db             the database name
201
252
 * @global  string   $table          the table name
211
262
 *
212
263
 * @see     PMA_displayTable()
213
264
 */
214
 
function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query)
 
265
function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_direction_dropdown)
215
266
{
216
267
    global $db, $table, $goto;
217
268
    global $num_rows, $unlim_num_rows;
235
286
<tr>
236
287
    <?php
237
288
    // Move to the beginning or to the previous page
238
 
    if ($_SESSION['userconf']['pos'] && $_SESSION['userconf']['max_rows'] != 'all') {
239
 
        // loic1: patch #474210 from Gosha Sakovich - part 1
240
 
        if ($GLOBALS['cfg']['NavigationBarIconic']) {
241
 
            $caption1 = '&lt;&lt;';
242
 
            $caption2 = ' &lt; ';
243
 
            $title1   = ' title="' . $GLOBALS['strPos1'] . '"';
244
 
            $title2   = ' title="' . $GLOBALS['strPrevious'] . '"';
245
 
        } else {
246
 
            $caption1 = $GLOBALS['strPos1'] . ' &lt;&lt;';
247
 
            $caption2 = $GLOBALS['strPrevious'] . ' &lt;';
248
 
            $title1   = '';
249
 
            $title2   = '';
250
 
        } // end if... else...
251
 
        ?>
252
 
<td>
253
 
    <form action="sql.php" method="post">
254
 
        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
255
 
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
256
 
        <input type="hidden" name="pos" value="0" />
257
 
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
258
 
        <input type="submit" name="navig" value="<?php echo $caption1; ?>"<?php echo $title1; ?> />
259
 
    </form>
260
 
</td>
261
 
<td>
262
 
    <form action="sql.php" method="post">
263
 
        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
264
 
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
265
 
        <input type="hidden" name="pos" value="<?php echo $pos_prev; ?>" />
266
 
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
267
 
        <input type="submit" name="navig" value="<?php echo $caption2; ?>"<?php echo $title2; ?> />
268
 
    </form>
269
 
</td>
270
 
        <?php
 
289
    if ($_SESSION['tmp_user_values']['pos'] && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
 
290
        PMA_displayTableNavigationOneButton('&lt;&lt;', $GLOBALS['strPos1'], 0, $html_sql_query);
 
291
        PMA_displayTableNavigationOneButton('&lt;', $GLOBALS['strPrevious'], $pos_prev, $html_sql_query);
 
292
 
271
293
    } // end move back
272
294
    ?>
273
295
<td>
284
306
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
285
307
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
286
308
        <input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?> :" />
287
 
        <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()" />
 
309
        <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()" />
288
310
        <?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>
289
311
        <input type="text" name="pos" size="6" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />
290
312
        <br />
291
313
    <?php
292
314
    // Display mode (horizontal/vertical and repeat headers)
293
 
    $param1 = '            <select name="disp_direction">' . "\n"
294
 
            . '                <option value="horizontal"' . (($_SESSION['userconf']['disp_direction'] == 'horizontal') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeHorizontal'] . '</option>' . "\n"
295
 
            . '                <option value="horizontalflipped"' . (($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeFlippedHorizontal'] . '</option>' . "\n"
296
 
            . '                <option value="vertical"' . (($_SESSION['userconf']['disp_direction'] == 'vertical') ? ' selected="selected"': '') . '>' . $GLOBALS['strRowsModeVertical'] . '</option>' . "\n"
297
 
            . '            </select>' . "\n"
298
 
            . '           ';
299
 
    $param2 = '            <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['userconf']['repeat_cells'] . '" class="textfield" />' . "\n"
 
315
    $choices = array(
 
316
        'horizontal'        => $GLOBALS['strRowsModeHorizontal'],
 
317
        'horizontalflipped' => $GLOBALS['strRowsModeFlippedHorizontal'],
 
318
        'vertical'          => $GLOBALS['strRowsModeVertical']);
 
319
    $param1 = PMA_generate_html_dropdown('disp_direction', $choices, $_SESSION['tmp_user_values']['disp_direction'], $id_for_direction_dropdown);
 
320
    unset($choices);
 
321
 
 
322
    $param2 = '            <input type="text" size="3" name="repeat_cells" value="' . $_SESSION['tmp_user_values']['repeat_cells'] . '" class="textfield" />' . "\n"
300
323
            . '           ';
301
324
    echo '    ' . sprintf($GLOBALS['strRowsModeOptions'], "\n" . $param1, "\n" . $param2) . "\n";
302
325
    ?>
307
330
</td>
308
331
    <?php
309
332
    // Move to the next page or to the last one
310
 
    if (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['userconf']['max_rows']
311
 
        && $_SESSION['userconf']['max_rows'] != 'all') {
312
 
        // loic1: patch #474210 from Gosha Sakovich - part 2
313
 
        if ($GLOBALS['cfg']['NavigationBarIconic']) {
314
 
            $caption3 = ' &gt; ';
315
 
            $caption4 = '&gt;&gt;';
316
 
            $title3   = ' title="' . $GLOBALS['strNext'] . '"';
317
 
            $title4   = ' title="' . $GLOBALS['strEnd'] . '"';
318
 
        } else {
319
 
            $caption3 = '&gt; ' . $GLOBALS['strNext'];
320
 
            $caption4 = '&gt;&gt; ' . $GLOBALS['strEnd'];
321
 
            $title3   = '';
322
 
            $title4   = '';
323
 
        } // end if... else...
324
 
        echo "\n";
325
 
        ?>
326
 
<td>
327
 
    <form action="sql.php" method="post">
328
 
        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
329
 
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
330
 
        <input type="hidden" name="pos" value="<?php echo $pos_next; ?>" />
331
 
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
332
 
        <input type="submit" name="navig" value="<?php echo $caption3; ?>"<?php echo $title3; ?> />
333
 
    </form>
334
 
</td>
335
 
<td>
336
 
    <form action="sql.php" method="post"
337
 
        onsubmit="return <?php echo (($_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'] < $unlim_num_rows && $num_rows >= $_SESSION['userconf']['max_rows']) ? 'true' : 'false'); ?>">
338
 
        <?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
339
 
        <input type="hidden" name="sql_query" value="<?php echo $html_sql_query; ?>" />
340
 
        <input type="hidden" name="pos" value="<?php echo @((ceil($unlim_num_rows / $_SESSION['userconf']['max_rows'])- 1) * $_SESSION['userconf']['max_rows']); ?>" />
341
 
        <?php
 
333
    if (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows) && $num_rows >= $_SESSION['tmp_user_values']['max_rows']
 
334
        && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
 
335
 
 
336
        // display the Next button
 
337
        PMA_displayTableNavigationOneButton('&gt;', 
 
338
            $GLOBALS['strNext'], 
 
339
            $pos_next, 
 
340
            $html_sql_query);
 
341
 
 
342
        // prepare some options for the End button
342
343
        if ($is_innodb && $unlim_num_rows > $GLOBALS['cfg']['MaxExactCount']) {
343
 
            echo '<input type="hidden" name="find_real_end" value="1" />' . "\n";
 
344
            $input_for_real_end = '<input type="hidden" name="find_real_end" value="1" />';
344
345
            // no backquote around this message
345
346
            $onclick = ' onclick="return confirmAction(\'' . PMA_jsFormat($GLOBALS['strLongOperation'], false) . '\')"';
 
347
        } else {
 
348
            $input_for_real_end = $onclick = '';
346
349
        }
347
 
        ?>
348
 
        <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
349
 
        <input type="submit" name="navig" value="<?php echo $caption4; ?>"<?php echo $title4; ?> <?php echo (empty($onclick) ? '' : $onclick); ?>/>
350
 
    </form>
351
 
</td>
352
 
        <?php
 
350
 
 
351
        // display the End button
 
352
        PMA_displayTableNavigationOneButton('&gt;&gt;', 
 
353
            $GLOBALS['strEnd'], 
 
354
            @((ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows'])- 1) * $_SESSION['tmp_user_values']['max_rows']), 
 
355
            $html_sql_query,
 
356
            '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') . '"',
 
357
            $input_for_real_end,
 
358
            $onclick
 
359
            );
353
360
    } // end move toward
354
361
 
355
362
 
356
363
    //page redirection
357
364
    // (unless we are showing all records)
358
 
    if ('all' != $_SESSION['userconf']['max_rows']) { //if1
359
 
        $pageNow = @floor($_SESSION['userconf']['pos'] / $_SESSION['userconf']['max_rows']) + 1;
360
 
        $nbTotalPage = @ceil($unlim_num_rows / $_SESSION['userconf']['max_rows']);
 
365
    if ('all' != $_SESSION['tmp_user_values']['max_rows']) { //if1
 
366
        $pageNow = @floor($_SESSION['tmp_user_values']['pos'] / $_SESSION['tmp_user_values']['max_rows']) + 1;
 
367
        $nbTotalPage = @ceil($unlim_num_rows / $_SESSION['tmp_user_values']['max_rows']);
361
368
 
362
369
        if ($nbTotalPage > 1){ //if2
363
370
       ?>
376
383
            );
377
384
            echo PMA_pageselector(
378
385
                     'sql.php' . PMA_generate_common_url($_url_params) . PMA_get_arg_separator('js'),
379
 
                     $_SESSION['userconf']['max_rows'],
 
386
                     $_SESSION['tmp_user_values']['max_rows'],
380
387
                    $pageNow,
381
388
                    $nbTotalPage,
382
389
                    200,
424
431
/**
425
432
 * Displays the headers of the results table
426
433
 *
427
 
 * @uses    $_SESSION['userconf']['disp_direction']
428
 
 * @uses    $_SESSION['userconf']['repeat_cells']
429
 
 * @uses    $_SESSION['userconf']['max_rows']
430
 
 * @uses    $_SESSION['userconf']['display_text']
431
 
 * @uses    $_SESSION['userconf']['display_binary']
 
434
 * @uses    $_SESSION['tmp_user_values']['disp_direction']
 
435
 * @uses    $_SESSION['tmp_user_values']['repeat_cells']
 
436
 * @uses    $_SESSION['tmp_user_values']['max_rows']
 
437
 * @uses    $_SESSION['tmp_user_values']['display_text']
 
438
 * @uses    $_SESSION['tmp_user_values']['display_binary']
 
439
 * @uses    $_SESSION['tmp_user_values']['display_binary_as_hex']
432
440
 * @param   array    which elements to display
433
441
 * @param   array    the list of fields properties
434
442
 * @param   integer  the total number of fields returned by the SQL query
435
443
 * @param   array    the analyzed query
436
444
 *
437
 
 * @return  boolean  always true
 
445
 * @return  boolean  $clause_is_unique 
438
446
 *
439
447
 * @global  string   $db               the database name
440
448
 * @global  string   $table            the table name
483
491
            // do we have any index?
484
492
            if ($indexes) {
485
493
 
486
 
                if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
487
 
                 || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
494
                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
495
                 || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
488
496
                    $span = $fields_cnt;
489
497
                    if ($is_display['edit_lnk'] != 'nn') {
490
498
                        $span++;
496
504
                        $span++;
497
505
                    }
498
506
                } else {
499
 
                    $span = $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1;
 
507
                    $span = $num_rows + floor($num_rows/$_SESSION['tmp_user_values']['repeat_cells']) + 1;
500
508
                }
501
509
 
502
510
                echo '<form action="sql.php" method="post">' . "\n";
552
560
            'P'   => $GLOBALS['strPartialText'],
553
561
            'F'   => $GLOBALS['strFullText']
554
562
        );
555
 
        PMA_generate_html_radio('display_text', $choices, $_SESSION['userconf']['display_text']);
 
563
        PMA_display_html_radio('display_text', $choices, $_SESSION['tmp_user_values']['display_text']);
556
564
        echo '</div>';
557
565
 
 
566
        // prepare full/partial text button or link
 
567
        if ($_SESSION['tmp_user_values']['display_text']=='F') { 
 
568
            // currently in fulltext mode so show the opposite link
 
569
            $tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_partialtext.png';
 
570
            $tmp_txt = $GLOBALS['strPartialText'];
 
571
            $url_params['display_text'] = 'P';
 
572
        } else {
 
573
            $tmp_image_file = $GLOBALS['pmaThemeImage'] . 's_fulltext.png';
 
574
            $tmp_txt = $GLOBALS['strFullText'];
 
575
            $url_params['display_text'] = 'F';
 
576
        }
 
577
 
 
578
        $tmp_image = '<img class="fulltext" width="50" height="20"  src="' . $tmp_image_file . '" alt="' . $tmp_txt . '" title="' . $tmp_txt . '" />';
 
579
        $tmp_url = 'sql.php' . PMA_generate_common_url($url_params);
 
580
        $full_or_partial_text_link = PMA_linkOrButton($tmp_url, $tmp_image, array(), false);
 
581
        unset($tmp_image_file, $tmp_txt, $tmp_url, $tmp_image);
 
582
 
 
583
 
558
584
        if ($GLOBALS['cfgRelation']['relwork'] && $GLOBALS['cfgRelation']['displaywork']) {
559
585
            echo '<div class="formelement">';
560
586
            $choices = array(
561
587
                'K'   => $GLOBALS['strRelationalKey'],
562
588
                'D'   => $GLOBALS['strRelationalDisplayField']
563
589
            );
564
 
            PMA_generate_html_radio('relational_display', $choices, $_SESSION['userconf']['relational_display']);
 
590
            PMA_display_html_radio('relational_display', $choices, $_SESSION['tmp_user_values']['relational_display']);
565
591
            echo '</div>';
566
592
        }
567
593
 
568
594
        echo '<div class="formelement">';
569
 
        PMA_generate_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['userconf']['display_binary']), false);
570
 
        echo '<br />';
571
 
        PMA_generate_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['userconf']['display_blob']), false);
 
595
        PMA_display_html_checkbox('display_binary', $GLOBALS['strShowBinaryContents'], ! empty($_SESSION['tmp_user_values']['display_binary']), false);
 
596
        echo '<br />';
 
597
        PMA_display_html_checkbox('display_blob', $GLOBALS['strShowBLOBContents'], ! empty($_SESSION['tmp_user_values']['display_blob']), false);
 
598
        echo '<br />';
 
599
        PMA_display_html_checkbox('display_binary_as_hex', $GLOBALS['strShowBinaryContentsAsHex'], ! empty($_SESSION['tmp_user_values']['display_binary_as_hex']), false);
572
600
        echo '</div>';
573
601
 
574
602
        // I would have preferred to name this "display_transformation".
576
604
        // per SQL query, and at the same time have a default that displays
577
605
        // the transformations.
578
606
        echo '<div class="formelement">';
579
 
        PMA_generate_html_checkbox('hide_transformation', $GLOBALS['strHide'] . ' ' . $GLOBALS['strMIME_transformation'], ! empty($_SESSION['userconf']['hide_transformation']), false);
 
607
        PMA_display_html_checkbox('hide_transformation', $GLOBALS['strHide'] . ' ' . $GLOBALS['strMIME_transformation'], ! empty($_SESSION['tmp_user_values']['hide_transformation']), false);
580
608
        echo '</div>';
581
609
 
582
610
        echo '<div class="clearfloat"></div>';
598
626
    }
599
627
 
600
628
    echo '<table id="table_results" class="data">' . "\n";
601
 
    if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
602
 
     || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
629
    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
630
     || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
603
631
        echo '<thead><tr>' . "\n";
604
632
    }
605
633
 
606
634
    // 1. Displays the full/partial text button (part 1)...
607
 
    if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
608
 
     || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
635
    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
636
     || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
609
637
        $colspan  = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
610
638
                  ? ' colspan="3"'
611
639
                  : '';
619
647
    if (($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
620
648
        && $is_display['text_btn'] == '1') {
621
649
        $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
622
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
623
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
650
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
651
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
624
652
            ?>
625
653
    <th colspan="<?php echo $fields_cnt; ?>"></th>
626
654
</tr>
630
658
        else {
631
659
            ?>
632
660
<tr>
633
 
    <th colspan="<?php echo $num_rows + floor($num_rows/$_SESSION['userconf']['repeat_cells']) + 1; ?>"></th>
 
661
    <th colspan="<?php echo $num_rows + floor($num_rows/$_SESSION['tmp_user_values']['repeat_cells']) + 1; ?>"></th>
634
662
</tr>
635
663
            <?php
636
664
        } // end vertical mode
640
668
    //     and required
641
669
    elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
642
670
        $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
643
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
644
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
671
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
672
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
645
673
            ?>
646
 
    <th <?php echo $colspan; ?>></th>
 
674
                <th <?php echo $colspan; ?>><?php echo $full_or_partial_text_link;?></th>
647
675
            <?php
648
676
        } // end horizontal/horizontalflipped mode
649
677
        else {
657
685
    elseif ($GLOBALS['cfg']['ModifyDeleteAtLeft']
658
686
             && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
659
687
        $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 0;
660
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
661
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
688
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
689
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
662
690
            ?>
663
691
    <td<?php echo $colspan; ?>></td>
664
692
            <?php
675
703
    // 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
676
704
    //       Do not show comments, if using horizontalflipped mode, because of space usage
677
705
    if ($GLOBALS['cfg']['ShowBrowseComments']
678
 
     && $_SESSION['userconf']['disp_direction'] != 'horizontalflipped') {
 
706
     && $_SESSION['tmp_user_values']['disp_direction'] != 'horizontalflipped') {
679
707
        $comments_map = array();
680
708
        if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
681
709
            foreach ($analyzed_sql[0]['table_ref'] as $tbl) {
686
714
        }
687
715
    }
688
716
 
689
 
    if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] && ! $_SESSION['userconf']['hide_transformation']) {
 
717
    if ($GLOBALS['cfgRelation']['commwork'] && $GLOBALS['cfgRelation']['mimework'] && $GLOBALS['cfg']['BrowseMIME'] && ! $_SESSION['tmp_user_values']['hide_transformation']) {
690
718
        require_once './libraries/transformations.lib.php';
691
719
        $GLOBALS['mime_map'] = PMA_getMIME($db, $table);
692
720
    }
825
853
                    $order_link_params['onmouseout']  = 'if(document.getElementById(\'soimg' . $i . '\')){ document.getElementById(\'soimg' . $i . '\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }';
826
854
                }
827
855
            }
828
 
            if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
 
856
            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
829
857
             && $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
830
858
                $order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
831
859
            }
832
860
            $order_link_params['title'] = $GLOBALS['strSort'];
833
 
            $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));
 
861
            $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));
834
862
            $order_link = PMA_linkOrButton($order_url, $order_link_content . $order_img, $order_link_params, false, true);
835
863
 
836
 
            if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
837
 
             || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
864
            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
865
             || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
838
866
                echo '<th';
839
867
                if ($condition_field) {
840
868
                    echo ' class="condition"';
841
869
                }
842
 
                if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
870
                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
843
871
                    echo ' valign="bottom"';
844
872
                }
845
873
                echo '>' . $order_link . $comments . '</th>';
851
879
 
852
880
        // 2.2 Results can't be sorted
853
881
        else {
854
 
            if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
855
 
             || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
882
            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
883
             || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
856
884
                echo '<th';
857
885
                if ($condition_field) {
858
886
                    echo ' class="condition"';
859
887
                }
860
 
                if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
888
                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
861
889
                    echo ' valign="bottom"';
862
890
                }
863
 
                if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
 
891
                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
864
892
                 && $GLOBALS['cfg']['HeaderFlipType'] == 'css') {
865
893
                    echo ' style="direction: ltr; writing-mode: tb-rl;"';
866
894
                }
867
895
                echo '>';
868
 
                if ($_SESSION['userconf']['disp_direction'] == 'horizontalflipped'
 
896
                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
869
897
                 && $GLOBALS['cfg']['HeaderFlipType'] == 'fake') {
870
898
                    echo PMA_flipstring(htmlspecialchars($fields_meta[$i]->name), '<br />');
871
899
                } else {
886
914
        && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
887
915
        && $is_display['text_btn'] == '1') {
888
916
        $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
889
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
890
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
917
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
918
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
891
919
            echo "\n";
892
920
            ?>
893
 
<th <?php echo $colspan; ?>>
 
921
        <th <?php echo $colspan; ?>><?php echo $full_or_partial_text_link;?>
894
922
</th>
895
923
            <?php
896
924
        } // end horizontal/horizontalflipped mode
907
935
             && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')
908
936
             && (!$GLOBALS['is_header_sent'])) {
909
937
        $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 3 : 1;
910
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
911
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
938
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
939
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
912
940
            echo "\n";
913
941
            ?>
914
942
<td<?php echo $colspan; ?>></td>
919
947
        } // end vertical mode
920
948
    }
921
949
 
922
 
    if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
923
 
     || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
950
    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
951
     || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
924
952
        ?>
925
953
</tr>
926
954
</thead>
935
963
/**
936
964
 * Displays the body of the results table
937
965
 *
938
 
 * @uses    $_SESSION['userconf']['disp_direction']
939
 
 * @uses    $_SESSION['userconf']['repeat_cells']
940
 
 * @uses    $_SESSION['userconf']['max_rows']
941
 
 * @uses    $_SESSION['userconf']['display_text']
942
 
 * @uses    $_SESSION['userconf']['display_binary']
943
 
 * @uses    $_SESSION['userconf']['display_blob']
 
966
 * @uses    $_SESSION['tmp_user_values']['disp_direction']
 
967
 * @uses    $_SESSION['tmp_user_values']['repeat_cells']
 
968
 * @uses    $_SESSION['tmp_user_values']['max_rows']
 
969
 * @uses    $_SESSION['tmp_user_values']['display_text']
 
970
 * @uses    $_SESSION['tmp_user_values']['display_binary']
 
971
 * @uses    $_SESSION['tmp_user_values']['display_binary_as_hex']
 
972
 * @uses    $_SESSION['tmp_user_values']['display_blob']
944
973
 * @param   integer  the link id associated to the query which results have
945
974
 *                   to be displayed
946
975
 * @param   array    which elements to display
947
976
 * @param   array    the list of relations
948
977
 * @param   array    the analyzed query
949
978
 *
950
 
 * @return  boolean  $clause_is_unique 
 
979
 * @return  boolean  always true
951
980
 *
952
981
 * @global  string   $db                the database name
953
982
 * @global  string   $table             the table name
1014
1043
    $odd_row = true;
1015
1044
    while ($row = PMA_DBI_fetch_row($dt_result)) {
1016
1045
        // lem9: "vertical display" mode stuff
1017
 
        if ($row_no != 0 && $_SESSION['userconf']['repeat_cells'] != 0 && !($row_no % $_SESSION['userconf']['repeat_cells'])
1018
 
          && ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1019
 
           || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped'))
 
1046
        if ($row_no != 0 && $_SESSION['tmp_user_values']['repeat_cells'] != 0 && !($row_no % $_SESSION['tmp_user_values']['repeat_cells'])
 
1047
          && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1048
           || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'))
1020
1049
        {
1021
1050
            echo '<tr>' . "\n";
1022
1051
            if ($vertical_display['emptypre'] > 0) {
1037
1066
 
1038
1067
        $class = $odd_row ? 'odd' : 'even';
1039
1068
        $odd_row = ! $odd_row;
1040
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1041
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
1069
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1070
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
1042
1071
            // loic1: pointer code part
1043
1072
            echo '    <tr class="' . $class . '">' . "\n";
1044
1073
            $class = '';
1045
1074
        }
1046
1075
 
1047
1076
 
1048
 
        // 1. Prepares the row (gets primary keys to use)
 
1077
        // 1. Prepares the row
1049
1078
        // 1.1 Results from a "SELECT" statement -> builds the
1050
1079
        //     WHERE clause to use in links (a unique key if possible)
1051
1080
        /**
1072
1101
                $_url_params = array(
1073
1102
                    'db'               => $db,
1074
1103
                    'table'            => $table,
1075
 
                    'primary_key'      => $where_clause,
 
1104
                    'where_clause'     => $where_clause,
1076
1105
                    'clause_is_unique' => $clause_is_unique,
1077
1106
                    'sql_query'        => $url_sql_query,
1078
1107
                    'goto'             => 'sql.php',
1113
1142
                $lnk_goto = 'sql.php' . PMA_generate_common_url($_url_params, 'text');
1114
1143
 
1115
1144
                $del_query = 'DELETE FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table)
1116
 
                    . ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1');
 
1145
                    . ' WHERE ' . $where_clause . ($clause_is_unique ? '' : ' LIMIT 1'); 
1117
1146
 
1118
1147
                $_url_params = array(
1119
1148
                    'db'        => $db,
1126
1155
 
1127
1156
                $js_conf  = 'DELETE FROM ' . PMA_jsFormat($db) . '.' . PMA_jsFormat($table)
1128
1157
                          . ' WHERE ' . PMA_jsFormat($where_clause, false)
1129
 
                          . ($clause_is_unique ? '' : ' LIMIT 1');
 
1158
                          . ($clause_is_unique ? '' : ' LIMIT 1'); 
1130
1159
                $del_str = PMA_getIcon('b_drop.png', $GLOBALS['strDelete'], true);
1131
1160
            } elseif ($is_display['del_lnk'] == 'kp') { // kill process case
1132
1161
 
1151
1180
 
1152
1181
            // 1.3 Displays the links at left if required
1153
1182
            if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
1154
 
             && ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1155
 
              || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
 
1183
             && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1184
              || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
1156
1185
                $doWriteModifyAt = 'left';
1157
1186
                require './libraries/display_tbl_links.lib.php';
1158
1187
            } // end if (1.3)
1171
1200
            }
1172
1201
 
1173
1202
            $mouse_events = '';
1174
 
            if ($_SESSION['userconf']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
 
1203
            if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical' && (!isset($GLOBALS['printview']) || ($GLOBALS['printview'] != '1'))) {
1175
1204
                if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) {
1176
1205
                    $mouse_events .= ' onmouseover="setVerticalPointer(this, ' . $row_no . ', \'over\', \'odd\', \'even\', \'hover\', \'marked\');"'
1177
1206
                              . ' onmouseout="setVerticalPointer(this, ' . $row_no . ', \'out\', \'odd\', \'even\', \'hover\', \'marked\');" ';
1210
1239
            $_url_params = array(
1211
1240
                'db'            => $db,
1212
1241
                'table'         => $table,
1213
 
                'primary_key'   => $where_clause,
 
1242
                'where_clause'  => $where_clause,
1214
1243
                'transform_key' => $meta->name,
1215
1244
            );
1216
1245
 
1255
1284
                    $PMA_Config = $_SESSION['PMA_Config'];
1256
1285
 
1257
1286
                    // if PMA configuration exists
1258
 
                    if ($PMA_Config)
1259
 
                    {
 
1287
                    if ($PMA_Config) {
1260
1288
                        // load BS variables
1261
1289
                        $pluginsExist = $PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST');
1262
1290
 
1263
1291
                        // if BS plugins exist
1264
 
                        if ($pluginsExist)
1265
 
                        {
 
1292
                        if ($pluginsExist) {
1266
1293
                            // load BS databases
1267
1294
                            $bs_tables = $PMA_Config->get('BLOBSTREAMABLE_DATABASES');
1268
1295
 
1269
1296
                            // if BS db array and specified db string not empty and valid
1270
 
                            if (!empty($bs_tables) && strlen($db) > 0)
1271
 
                            {
 
1297
                            if (!empty($bs_tables) && strlen($db) > 0) {
1272
1298
                                $bs_tables = $bs_tables[$db];
1273
1299
 
1274
 
                                if (isset($bs_tables))
1275
 
                                {
 
1300
                                if (isset($bs_tables)) {
1276
1301
                                    $allBSTablesExist = TRUE;
1277
1302
 
1278
1303
                                    // check if BS tables exist for given database
1279
1304
                                    foreach ($bs_tables as $table_key=>$bs_tbl)
1280
 
                                        if (!$bs_tables[$table_key]['Exists'])
1281
 
                                        {
 
1305
                                        if (!$bs_tables[$table_key]['Exists']) {
1282
1306
                                            $allBSTablesExist = FALSE;
1283
1307
                                            break;
1284
1308
                                        }
1288
1312
                    }
1289
1313
 
1290
1314
                    // if necessary BS tables exist
1291
 
                    if ($allBSTablesExist)
 
1315
                    if ($allBSTablesExist) {
1292
1316
                        $bs_reference_exists = PMA_BS_ReferenceExists($row[$i], $db);
 
1317
                    }
1293
1318
 
1294
1319
                    // if valid BS reference exists
1295
 
                    if ($bs_reference_exists)
 
1320
                    if ($bs_reference_exists) {
1296
1321
                        $blobtext = PMA_BS_CreateReferenceLink($row[$i], $db);
1297
 
                    else
 
1322
                    } else {
1298
1323
                        $blobtext = PMA_handle_non_printable_contents('BLOB', (isset($row[$i]) ? $row[$i] : ''), $transform_function, $transform_options, $default_function, $meta);
 
1324
                    }
1299
1325
 
1300
1326
                    $vertical_display['data'][$row_no][$i]      = '    <td align="left"' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">' . $blobtext . '</td>';
1301
1327
                    unset($blobtext);
 
1328
                // not binary:
1302
1329
                } else {
1303
1330
                    if (!isset($row[$i]) || is_null($row[$i])) {
1304
1331
                        $vertical_display['data'][$row_no][$i] = '    <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
1305
1332
                    } elseif ($row[$i] != '') {
1306
1333
                        // garvin: if a transform function for blob is set, none of these replacements will be made
1307
 
                        if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['userconf']['display_text'] == 'P') {
 
1334
                        if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P') {
1308
1335
                            $row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
1309
1336
                        }
1310
1337
                        // loic1: displays all space characters, 4 space
1316
1343
                        $vertical_display['data'][$row_no][$i] = '    <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '">&nbsp;</td>' . "\n";
1317
1344
                    }
1318
1345
                }
 
1346
            // n o t   n u m e r i c   a n d   n o t   B L O B 
1319
1347
            } else {
1320
1348
                if (!isset($row[$i]) || is_null($row[$i])) {
1321
1349
                    $vertical_display['data'][$row_no][$i]     = '    <td' . $mouse_events . ' class="' . $class . ($condition_field ? ' condition' : '') . '"><i>NULL</i></td>' . "\n";
1325
1353
 
1326
1354
                    // nijel: Cut all fields to $GLOBALS['cfg']['LimitChars']
1327
1355
                    // lem9: (unless it's a link-type transformation)
1328
 
                    if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['userconf']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
 
1356
                    if (PMA_strlen($row[$i]) > $GLOBALS['cfg']['LimitChars'] && $_SESSION['tmp_user_values']['display_text'] == 'P' && !strpos($transform_function, 'link') === true) {
1329
1357
                        $row[$i] = PMA_substr($row[$i], 0, $GLOBALS['cfg']['LimitChars']) . '...';
1330
1358
                    }
1331
1359
 
1334
1362
                    if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
1335
1363
                        $row[$i]     = PMA_printable_bit_value($row[$i], $meta->length);
1336
1364
                    } elseif (stristr($field_flags, 'BINARY') && $meta->type == 'string') {
1337
 
                        if ($_SESSION['userconf']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
 
1365
                        if ($_SESSION['tmp_user_values']['display_binary'] || (isset($GLOBALS['is_analyse']) && $GLOBALS['is_analyse'])) {
1338
1366
                            // user asked to see the real contents of BINARY
1339
1367
                            // fields, or we detected a PROCEDURE ANALYSE in
1340
1368
                            // the query (results are reported as being
1341
1369
                            // binary strings)
1342
 
                            $row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
 
1370
                            if ($_SESSION['tmp_user_values']['display_binary_as_hex']) {
 
1371
                                $row[$i] = bin2hex($row[$i]);
 
1372
                                                        }
 
1373
                                                        else {
 
1374
                                $row[$i] = htmlspecialchars(PMA_replace_binary_contents($row[$i]));
 
1375
                                                        }
1343
1376
                        } else {
1344
1377
                            // we show the BINARY message and field's size
1345
1378
                            // (or maybe use a transformation)
1362
1395
            }
1363
1396
 
1364
1397
            // lem9: output stored cell
1365
 
            if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1366
 
             || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
1398
            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1399
             || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
1367
1400
                echo $vertical_display['data'][$row_no][$i];
1368
1401
            }
1369
1402
 
1376
1409
 
1377
1410
        // 3. Displays the modify/delete links on the right if required
1378
1411
        if ($GLOBALS['cfg']['ModifyDeleteAtRight']
1379
 
         && ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1380
 
          || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped')) {
 
1412
         && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1413
          || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')) {
1381
1414
                $doWriteModifyAt = 'right';
1382
1415
                require './libraries/display_tbl_links.lib.php';
1383
1416
        } // end if (3)
1384
1417
 
1385
 
        if ($_SESSION['userconf']['disp_direction'] == 'horizontal'
1386
 
         || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') {
 
1418
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
 
1419
         || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') {
1387
1420
            ?>
1388
1421
</tr>
1389
1422
            <?php
1434
1467
            unset($vertical_display['delete'][$row_no]);
1435
1468
        }
1436
1469
 
1437
 
        echo (($_SESSION['userconf']['disp_direction'] == 'horizontal' || $_SESSION['userconf']['disp_direction'] == 'horizontalflipped') ? "\n" : '');
 
1470
        echo (($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal' || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped') ? "\n" : '');
1438
1471
        $row_no++;
1439
1472
    } // end while
1440
1473
 
1450
1483
 *
1451
1484
 * @return  boolean  always true
1452
1485
 *
1453
 
 * @uses    $_SESSION['userconf']['repeat_cells']
 
1486
 * @uses    $_SESSION['tmp_user_values']['repeat_cells']
1454
1487
 * @global  array    $vertical_display the information to display
1455
1488
 *
1456
1489
 * @access  private
1467
1500
        echo $vertical_display['textbtn'];
1468
1501
        $foo_counter = 0;
1469
1502
        foreach ($vertical_display['row_delete'] as $val) {
1470
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1503
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1471
1504
                echo '<th></th>' . "\n";
1472
1505
            }
1473
1506
 
1485
1518
        }
1486
1519
        $foo_counter = 0;
1487
1520
        foreach ($vertical_display['edit'] as $val) {
1488
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1521
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1489
1522
                echo '    <th></th>' . "\n";
1490
1523
            }
1491
1524
 
1503
1536
        }
1504
1537
        $foo_counter = 0;
1505
1538
        foreach ($vertical_display['delete'] as $val) {
1506
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1539
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1507
1540
                echo '<th></th>' . "\n";
1508
1541
            }
1509
1542
 
1521
1554
 
1522
1555
        $foo_counter = 0;
1523
1556
        foreach ($vertical_display['rowdata'][$key] as $subval) {
1524
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) and !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1557
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) and !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1525
1558
                echo $val;
1526
1559
            }
1527
1560
 
1538
1571
        echo $vertical_display['textbtn'];
1539
1572
        $foo_counter = 0;
1540
1573
        foreach ($vertical_display['row_delete'] as $val) {
1541
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1574
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1542
1575
                echo '<th></th>' . "\n";
1543
1576
            }
1544
1577
 
1556
1589
        }
1557
1590
        $foo_counter = 0;
1558
1591
        foreach ($vertical_display['edit'] as $val) {
1559
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1592
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1560
1593
                echo '<th></th>' . "\n";
1561
1594
            }
1562
1595
 
1574
1607
        }
1575
1608
        $foo_counter = 0;
1576
1609
        foreach ($vertical_display['delete'] as $val) {
1577
 
            if (($foo_counter != 0) && ($_SESSION['userconf']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['userconf']['repeat_cells'])) {
 
1610
            if (($foo_counter != 0) && ($_SESSION['tmp_user_values']['repeat_cells'] != 0) && !($foo_counter % $_SESSION['tmp_user_values']['repeat_cells'])) {
1578
1611
                echo '<th></th>' . "\n";
1579
1612
            }
1580
1613
 
1589
1622
 
1590
1623
/**
1591
1624
 *
1592
 
 * @uses    $_SESSION['userconf']['disp_direction']
 
1625
 * @uses    $_SESSION['tmp_user_values']['disp_direction']
1593
1626
 * @uses    $_REQUEST['disp_direction']
1594
1627
 * @uses    $GLOBALS['cfg']['DefaultDisplay']
1595
 
 * @uses    $_SESSION['userconf']['repeat_cells']
 
1628
 * @uses    $_SESSION['tmp_user_values']['repeat_cells']
1596
1629
 * @uses    $_REQUEST['repeat_cells']
1597
1630
 * @uses    $GLOBALS['cfg']['RepeatCells']
1598
 
 * @uses    $_SESSION['userconf']['max_rows']
 
1631
 * @uses    $_SESSION['tmp_user_values']['max_rows']
1599
1632
 * @uses    $_REQUEST['session_max_rows']
1600
1633
 * @uses    $GLOBALS['cfg']['MaxRows']
1601
 
 * @uses    $_SESSION['userconf']['pos']
 
1634
 * @uses    $_SESSION['tmp_user_values']['pos']
1602
1635
 * @uses    $_REQUEST['pos']
1603
 
 * @uses    $_SESSION['userconf']['display_text']
 
1636
 * @uses    $_SESSION['tmp_user_values']['display_text']
1604
1637
 * @uses    $_REQUEST['display_text']
1605
 
 * @uses    $_SESSION['userconf']['relational_display']
 
1638
 * @uses    $_SESSION['tmp_user_values']['relational_display']
1606
1639
 * @uses    $_REQUEST['relational_display']
1607
 
 * @uses    $_SESSION['userconf']['display_binary']
 
1640
 * @uses    $_SESSION['tmp_user_values']['display_binary']
1608
1641
 * @uses    $_REQUEST['display_binary']
1609
 
 * @uses    $_SESSION['userconf']['display_blob']
 
1642
 * @uses    $_SESSION['tmp_user_values']['display_binary_as_hex']
 
1643
 * @uses    $_REQUEST['display_binary_as_hex']
 
1644
 * @uses    $_SESSION['tmp_user_values']['display_blob']
1610
1645
 * @uses    $_REQUEST['display_blob']
1611
1646
 * @uses    PMA_isValid()
1612
1647
 * @uses    $GLOBALS['sql_query']
1619
1654
{
1620
1655
    $sql_key = md5($GLOBALS['sql_query']);
1621
1656
 
1622
 
    $_SESSION['userconf']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
 
1657
    $_SESSION['tmp_user_values']['query'][$sql_key]['sql'] = $GLOBALS['sql_query'];
1623
1658
 
1624
1659
    if (PMA_isValid($_REQUEST['disp_direction'], array('horizontal', 'vertical', 'horizontalflipped'))) {
1625
 
        $_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
 
1660
        $_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $_REQUEST['disp_direction'];
1626
1661
        unset($_REQUEST['disp_direction']);
1627
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['disp_direction'])) {
1628
 
        $_SESSION['userconf']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
 
1662
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'])) {
 
1663
        $_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'] = $GLOBALS['cfg']['DefaultDisplay'];
1629
1664
    }
1630
1665
 
1631
1666
    if (PMA_isValid($_REQUEST['repeat_cells'], 'numeric')) {
1632
 
        $_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
 
1667
        $_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $_REQUEST['repeat_cells'];
1633
1668
        unset($_REQUEST['repeat_cells']);
1634
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['repeat_cells'])) {
1635
 
        $_SESSION['userconf']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
 
1669
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'])) {
 
1670
        $_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'] = $GLOBALS['cfg']['RepeatCells'];
1636
1671
    }
1637
1672
 
1638
1673
    if (PMA_isValid($_REQUEST['session_max_rows'], 'numeric') || $_REQUEST['session_max_rows'] == 'all') {
1639
 
        $_SESSION['userconf']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
 
1674
        $_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $_REQUEST['session_max_rows'];
1640
1675
        unset($_REQUEST['session_max_rows']);
1641
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['max_rows'])) {
1642
 
        $_SESSION['userconf']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
 
1676
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'])) {
 
1677
        $_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'] = $GLOBALS['cfg']['MaxRows'];
1643
1678
    }
1644
1679
 
1645
1680
    if (PMA_isValid($_REQUEST['pos'], 'numeric')) {
1646
 
        $_SESSION['userconf']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
 
1681
        $_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = $_REQUEST['pos'];
1647
1682
        unset($_REQUEST['pos']);
1648
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['pos'])) {
1649
 
        $_SESSION['userconf']['query'][$sql_key]['pos'] = 0;
 
1683
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['pos'])) {
 
1684
        $_SESSION['tmp_user_values']['query'][$sql_key]['pos'] = 0;
1650
1685
    }
1651
1686
 
1652
1687
    if (PMA_isValid($_REQUEST['display_text'], array('P', 'F'))) {
1653
 
        $_SESSION['userconf']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
 
1688
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = $_REQUEST['display_text'];
1654
1689
        unset($_REQUEST['display_text']);
1655
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['display_text'])) {
1656
 
        $_SESSION['userconf']['query'][$sql_key]['display_text'] = 'P';
 
1690
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['display_text'])) {
 
1691
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_text'] = 'P';
1657
1692
    }
1658
1693
 
1659
1694
    if (PMA_isValid($_REQUEST['relational_display'], array('K', 'D'))) {
1660
 
        $_SESSION['userconf']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
 
1695
        $_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = $_REQUEST['relational_display'];
1661
1696
        unset($_REQUEST['relational_display']);
1662
 
    } elseif (empty($_SESSION['userconf']['query'][$sql_key]['relational_display'])) {
1663
 
        $_SESSION['userconf']['query'][$sql_key]['relational_display'] = 'K';
 
1697
    } elseif (empty($_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'])) {
 
1698
        $_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'] = 'K';
1664
1699
    }
1665
1700
 
1666
1701
    if (isset($_REQUEST['display_binary'])) {
1667
 
        $_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
 
1702
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
1668
1703
        unset($_REQUEST['display_binary']);
1669
1704
    } elseif (isset($_REQUEST['display_options_form'])) {
1670
1705
        // we know that the checkbox was unchecked
1671
 
        unset($_SESSION['userconf']['query'][$sql_key]['display_binary']);
 
1706
        unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']);
1672
1707
    } else {
1673
1708
        // selected by default because some operations like OPTIMIZE TABLE
1674
1709
        // and all queries involving functions return "binary" contents,
1675
1710
        // according to low-level field flags
1676
 
        $_SESSION['userconf']['query'][$sql_key]['display_binary'] = true;
 
1711
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_binary'] = true;
 
1712
    }
 
1713
    
 
1714
    if (isset($_REQUEST['display_binary_as_hex'])) {
 
1715
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex'] = true;
 
1716
        unset($_REQUEST['display_binary_as_hex']);
 
1717
    } elseif (isset($_REQUEST['display_options_form'])) {
 
1718
        // we know that the checkbox was unchecked
 
1719
        unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex']);
 
1720
    } else {
 
1721
        // display_binary_as_hex config option
 
1722
        if (isset($GLOBALS['cfg']['DisplayBinaryAsHex']) && true === $GLOBALS['cfg']['DisplayBinaryAsHex']) {
 
1723
                $_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex'] = true;
 
1724
                }
1677
1725
    }
1678
1726
 
1679
1727
    if (isset($_REQUEST['display_blob'])) {
1680
 
        $_SESSION['userconf']['query'][$sql_key]['display_blob'] = true;
 
1728
        $_SESSION['tmp_user_values']['query'][$sql_key]['display_blob'] = true;
1681
1729
        unset($_REQUEST['display_blob']);
1682
1730
    } elseif (isset($_REQUEST['display_options_form'])) {
1683
1731
        // we know that the checkbox was unchecked
1684
 
        unset($_SESSION['userconf']['query'][$sql_key]['display_blob']);
 
1732
        unset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']);
1685
1733
    }
1686
1734
 
1687
1735
    if (isset($_REQUEST['hide_transformation'])) {
1688
 
        $_SESSION['userconf']['query'][$sql_key]['hide_transformation'] = true;
 
1736
        $_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation'] = true;
1689
1737
        unset($_REQUEST['hide_transformation']);
1690
1738
    } elseif (isset($_REQUEST['display_options_form'])) {
1691
1739
        // we know that the checkbox was unchecked
1692
 
        unset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']);
 
1740
        unset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']);
1693
1741
    }
1694
1742
 
1695
1743
    // move current query to the last position, to be removed last
1696
1744
    // so only least executed query will be removed if maximum remembered queries
1697
1745
    // limit is reached
1698
 
    $tmp = $_SESSION['userconf']['query'][$sql_key];
1699
 
    unset($_SESSION['userconf']['query'][$sql_key]);
1700
 
    $_SESSION['userconf']['query'][$sql_key] = $tmp;
 
1746
    $tmp = $_SESSION['tmp_user_values']['query'][$sql_key];
 
1747
    unset($_SESSION['tmp_user_values']['query'][$sql_key]);
 
1748
    $_SESSION['tmp_user_values']['query'][$sql_key] = $tmp;
1701
1749
 
1702
1750
    // do not exceed a maximum number of queries to remember
1703
 
    if (count($_SESSION['userconf']['query']) > 10) {
1704
 
        array_shift($_SESSION['userconf']['query']);
 
1751
    if (count($_SESSION['tmp_user_values']['query']) > 10) {
 
1752
        array_shift($_SESSION['tmp_user_values']['query']);
1705
1753
        //echo 'deleting one element ...';
1706
1754
    }
1707
1755
 
1708
1756
    // populate query configuration
1709
 
    $_SESSION['userconf']['display_text'] = $_SESSION['userconf']['query'][$sql_key]['display_text'];
1710
 
    $_SESSION['userconf']['relational_display'] = $_SESSION['userconf']['query'][$sql_key]['relational_display'];
1711
 
    $_SESSION['userconf']['display_binary'] = isset($_SESSION['userconf']['query'][$sql_key]['display_binary']) ? true : false;
1712
 
    $_SESSION['userconf']['display_blob'] = isset($_SESSION['userconf']['query'][$sql_key]['display_blob']) ? true : false;
1713
 
    $_SESSION['userconf']['hide_transformation'] = isset($_SESSION['userconf']['query'][$sql_key]['hide_transformation']) ? true : false;
1714
 
    $_SESSION['userconf']['pos'] = $_SESSION['userconf']['query'][$sql_key]['pos'];
1715
 
    $_SESSION['userconf']['max_rows'] = $_SESSION['userconf']['query'][$sql_key]['max_rows'];
1716
 
    $_SESSION['userconf']['repeat_cells'] = $_SESSION['userconf']['query'][$sql_key]['repeat_cells'];
1717
 
    $_SESSION['userconf']['disp_direction'] = $_SESSION['userconf']['query'][$sql_key]['disp_direction'];
 
1757
    $_SESSION['tmp_user_values']['display_text'] = $_SESSION['tmp_user_values']['query'][$sql_key]['display_text'];
 
1758
    $_SESSION['tmp_user_values']['relational_display'] = $_SESSION['tmp_user_values']['query'][$sql_key]['relational_display'];
 
1759
    $_SESSION['tmp_user_values']['display_binary'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary']) ? true : false;
 
1760
    $_SESSION['tmp_user_values']['display_binary_as_hex'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_binary_as_hex']) ? true : false;
 
1761
    $_SESSION['tmp_user_values']['display_blob'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['display_blob']) ? true : false;
 
1762
    $_SESSION['tmp_user_values']['hide_transformation'] = isset($_SESSION['tmp_user_values']['query'][$sql_key]['hide_transformation']) ? true : false;
 
1763
    $_SESSION['tmp_user_values']['pos'] = $_SESSION['tmp_user_values']['query'][$sql_key]['pos'];
 
1764
    $_SESSION['tmp_user_values']['max_rows'] = $_SESSION['tmp_user_values']['query'][$sql_key]['max_rows'];
 
1765
    $_SESSION['tmp_user_values']['repeat_cells'] = $_SESSION['tmp_user_values']['query'][$sql_key]['repeat_cells'];
 
1766
    $_SESSION['tmp_user_values']['disp_direction'] = $_SESSION['tmp_user_values']['query'][$sql_key]['disp_direction'];
1718
1767
 
1719
1768
    /*
1720
1769
     * debugging
1721
1770
    echo '<pre>';
1722
 
    var_dump($_SESSION['userconf']);
 
1771
    var_dump($_SESSION['tmp_user_values']);
1723
1772
    echo '</pre>';
1724
1773
     */
1725
1774
}
1733
1782
 * @param   array   the display mode
1734
1783
 * @param   array   the analyzed query
1735
1784
 *
1736
 
 * @uses    $_SESSION['userconf']['pos']
 
1785
 * @uses    $_SESSION['tmp_user_values']['pos']
1737
1786
 * @global  string   $db                the database name
1738
1787
 * @global  string   $table             the table name
1739
1788
 * @global  string   $goto              the URL to go back in case of errors
1796
1845
 
1797
1846
    // 1.2 Defines offsets for the next and previous pages
1798
1847
    if ($is_display['nav_bar'] == '1') {
1799
 
        if ($_SESSION['userconf']['max_rows'] == 'all') {
 
1848
        if ($_SESSION['tmp_user_values']['max_rows'] == 'all') {
1800
1849
            $pos_next     = 0;
1801
1850
            $pos_prev     = 0;
1802
1851
        } else {
1803
 
            $pos_next     = $_SESSION['userconf']['pos'] + $_SESSION['userconf']['max_rows'];
1804
 
            $pos_prev     = $_SESSION['userconf']['pos'] - $_SESSION['userconf']['max_rows'];
 
1852
            $pos_next     = $_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'];
 
1853
            $pos_prev     = $_SESSION['tmp_user_values']['pos'] - $_SESSION['tmp_user_values']['max_rows'];
1805
1854
            if ($pos_prev < 0) {
1806
1855
                $pos_prev = 0;
1807
1856
            }
1866
1915
        } else {
1867
1916
            $selectstring = '';
1868
1917
        }
1869
 
        $last_shown_rec = ($_SESSION['userconf']['max_rows'] == 'all' || $pos_next > $total)
 
1918
        $last_shown_rec = ($_SESSION['tmp_user_values']['max_rows'] == 'all' || $pos_next > $total)
1870
1919
                        ? $total - 1
1871
1920
                        : $pos_next - 1;
1872
1921
 
1881
1930
        }
1882
1931
 
1883
1932
        $message = PMA_Message::success('strShowingRecords');
1884
 
        $message->addMessage($_SESSION['userconf']['pos']);
 
1933
        $message->addMessage($_SESSION['tmp_user_values']['pos']);
1885
1934
        if ($message_view_warning) {
1886
1935
            $message->addMessage('...', ' - ');
1887
1936
            $message->addMessage($message_view_warning);
1922
1971
    }
1923
1972
 
1924
1973
    if ($is_display['nav_bar'] == '1') {
1925
 
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query);
 
1974
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'top_direction_dropdown');
1926
1975
        echo "\n";
1927
1976
    } elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
1928
1977
        echo "\n" . '<br /><br />' . "\n";
1968
2017
    echo '<tbody>' . "\n";
1969
2018
    $clause_is_unique = PMA_displayTableBody($dt_result, $is_display, $map, $analyzed_sql);
1970
2019
    // vertical output case
1971
 
    if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
 
2020
    if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
1972
2021
        PMA_displayVerticalTable();
1973
2022
    } // end if
1974
2023
    unset($vertical_display);
1994
2043
        $_url_params['checkall'] = '1';
1995
2044
        $checkall_url = 'sql.php' . PMA_generate_common_url($_url_params);
1996
2045
 
1997
 
        if ($_SESSION['userconf']['disp_direction'] == 'vertical') {
 
2046
        if ($_SESSION['tmp_user_values']['disp_direction'] == 'vertical') {
1998
2047
            $checkall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', true)) return false;';
1999
2048
            $uncheckall_params['onclick'] = 'if (setCheckboxes(\'rowsDeleteForm\', false)) return false;';
2000
2049
        } else {
2003
2052
        }
2004
2053
        $checkall_link = PMA_linkOrButton($checkall_url, $GLOBALS['strCheckAll'], $checkall_params, false);
2005
2054
        $uncheckall_link = PMA_linkOrButton($uncheckall_url, $GLOBALS['strUncheckAll'], $uncheckall_params, false);
2006
 
        if ($_SESSION['userconf']['disp_direction'] != 'vertical') {
 
2055
        if ($_SESSION['tmp_user_values']['disp_direction'] != 'vertical') {
2007
2056
            echo '<img class="selectallarrow" width="38" height="22"'
2008
2057
                .' src="' . $GLOBALS['pmaThemeImage'] . 'arrow_' . $GLOBALS['text_dir'] . '.png' . '"'
2009
2058
                .' alt="' . $GLOBALS['strWithChecked'] . '" />';
2039
2088
 
2040
2089
    if ($is_display['nav_bar'] == '1') {
2041
2090
        echo '<br />' . "\n";
2042
 
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query);
 
2091
        PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, 'bottom_direction_dropdown');
2043
2092
    } elseif (!isset($GLOBALS['printview']) || $GLOBALS['printview'] != '1') {
2044
2093
        echo "\n" . '<br /><br />' . "\n";
2045
2094
    }
2065
2114
 * @param   array   the display mode
2066
2115
 * @param   array   the analyzed query
2067
2116
 *
2068
 
 * @uses    $_SESSION['userconf']['pos']
2069
 
 * @uses    $_SESSION['userconf']['display_text']
 
2117
 * @uses    $_SESSION['tmp_user_values']['pos']
 
2118
 * @uses    $_SESSION['tmp_user_values']['display_text']
2070
2119
 * @global  string   $db                the database name
2071
2120
 * @global  string   $table             the table name
2072
2121
 * @global  string   $sql_query         the current SQL query
2108
2157
                PMA_getIcon('b_print.png', $GLOBALS['strPrintView'], false, true),
2109
2158
                '', true, true, 'print_view') . "\n";
2110
2159
 
2111
 
            if ($_SESSION['userconf']['display_text']) {
 
2160
            if ($_SESSION['tmp_user_values']['display_text']) {
2112
2161
                $_url_params['display_text'] = 'F';
2113
2162
                echo PMA_linkOrButton(
2114
2163
                    'sql.php' . PMA_generate_common_url($_url_params),
2215
2264
            $result = $transform_function($result, $transform_options, $meta);
2216
2265
        } else {
2217
2266
            $result = $default_function($result, array(), $meta);
2218
 
            if (stristr($meta->type, 'BLOB') && $_SESSION['userconf']['display_blob']) {
 
2267
            if (stristr($meta->type, 'BLOB') && $_SESSION['tmp_user_values']['display_blob']) {
2219
2268
                // in this case, restart from the original $content
2220
2269
                $result = htmlspecialchars(PMA_replace_binary_contents($content));
2221
2270
            }
2293
2342
            $result .= ($transform_function != $default_function ? $transform_function($data, $transform_options, $meta) : $transform_function($data, array(), $meta)) . ' <code>[-&gt;' . $dispval . ']</code>';
2294
2343
        } else {
2295
2344
 
2296
 
            if ('K' == $_SESSION['userconf']['relational_display']) {
 
2345
            if ('K' == $_SESSION['tmp_user_values']['relational_display']) {
2297
2346
                // user chose "relational key" in the display options, so
2298
2347
                // the title contains the display field
2299
2348
                $title = (! empty($dispval))? ' title="' . htmlspecialchars($dispval) . '"' : '';
2318
2367
                // not on the display field
2319
2368
                $result .= $transform_function($data, $transform_options, $meta);
2320
2369
            } else {
2321
 
                if ('D' == $_SESSION['userconf']['relational_display']) {
 
2370
                if ('D' == $_SESSION['tmp_user_values']['relational_display']) {
2322
2371
                    // user chose "relational display field" in the
2323
2372
                    // display options, so show display field in the cell
2324
2373
                    $result .= $transform_function($dispval, array(), $meta);