2.11.8-dev
[phpmyadmin/crack.git] / navigation.php
blobe8f70fa9d3894e7937662585f69d787521fd2c2b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * the navigation frame - displays server, db and table selection tree
6 * @version $Id$
7 * @uses $GLOBALS['PMA_List_Database']
8 * @uses $GLOBALS['server']
9 * @uses $GLOBALS['db']
10 * @uses $GLOBALS['table']
11 * @uses $GLOBALS['available_languages']
12 * @uses $GLOBALS['lang']
13 * @uses $GLOBALS['text_dir']
14 * @uses $GLOBALS['charset']
15 * @uses $GLOBALS['pmaThemeImage']
16 * @uses $GLOBALS['strNoDatabases']
17 * @uses $GLOBALS['strDatabase']
18 * @uses $GLOBALS['strGo']
19 * @uses $GLOBALS['strSelectADb']
20 * @uses $GLOBALS['strNoTablesFound']
21 * @uses $GLOBALS['cfg']['LeftFrameLight']
22 * @uses $GLOBALS['cfg']['ShowTooltip']
23 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
24 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
25 * @uses $GLOBALS['cfgRelation']['commwork']) {
26 * @uses PMA_List_Database::getSingleItem()
27 * @uses PMA_List_Database::count()
28 * @uses PMA_List_Database::getHtmlSelectGrouped()
29 * @uses PMA_List_Database::getGroupedDetails()
30 * @uses PMA_generate_common_url()
31 * @uses PMA_generate_common_hidden_inputs()
32 * @uses PMA_getComments();
33 * @uses PMA_getTableCount()
34 * @uses PMA_getTableList()
35 * @uses PMA_getRelationsParam()
36 * @uses PMA_outBufferPre()
37 * @uses session_write_close()
38 * @uses strlen()
39 * @uses session_write_close()
40 * @uses is_array()
41 * @uses implode()
42 * @uses htmlspecialchars()
45 /**
46 * Gets a core script and starts output buffering work
48 require_once './libraries/common.inc.php';
50 /**
51 * finish and cleanup navigation.php script execution
53 * @uses $GLOBALS['controllink'] to close it
54 * @uses $GLOBALS['userlink'] to close it
55 * @uses PMA_DBI_close()
56 * @access private only to be used in navigation.php
58 function PMA_exitNavigationFrame()
60 echo '</body></html>';
62 /**
63 * Close MySQL connections
65 if (isset($GLOBALS['controllink']) && $GLOBALS['controllink']) {
66 @PMA_DBI_close($GLOBALS['controllink']);
68 if (isset($GLOBALS['userlink']) && $GLOBALS['userlink']) {
69 @PMA_DBI_close($GLOBALS['userlink']);
72 exit;
75 // keep the offset of the db list in session before closing it
76 if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
77 $_SESSION['userconf']['navi_limit_offset'] = 0;
79 if (isset($_REQUEST['pos'])) {
80 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
82 $pos = $_SESSION['userconf']['navi_limit_offset'];
84 // free the session file, for the other frames to be loaded
85 session_write_close();
87 /**
88 * the output compression library
90 require_once './libraries/ob.lib.php';
92 PMA_outBufferPre();
95 * selects the database if there is only one on current server
97 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
98 $GLOBALS['db'] = $GLOBALS['PMA_List_Database']->getSingleItem();
101 $db_start = $GLOBALS['db'];
104 * the relation library
106 require_once './libraries/relation.lib.php';
107 $cfgRelation = PMA_getRelationsParam();
110 * garvin: For re-usability, moved http-headers to a seperate file.
111 * It can now be included by libraries/header.inc.php, querywindow.php.
113 require_once './libraries/header_http.inc.php';
115 if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
116 $_SESSION['userconf']['navi_limit_offset'] = 0;
118 if (isset($_REQUEST['pos'])) {
119 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
121 $pos = $_SESSION['userconf']['navi_limit_offset'];
124 * Displays the frame
126 // xml declaration moves IE into quirks mode, making much trouble with CSS
127 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
129 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
130 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
131 <html xmlns="http://www.w3.org/1999/xhtml"
132 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
133 lang="<?php echo $available_languages[$lang][2]; ?>"
134 dir="<?php echo $GLOBALS['text_dir']; ?>">
136 <head>
137 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
138 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
139 <title>phpMyAdmin</title>
140 <meta http-equiv="Content-Type"
141 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
142 <base target="frame_content" />
143 <link rel="stylesheet" type="text/css"
144 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $_SESSION['PMA_Config']->getThemeUniqueValue(); ?>" />
145 <script type="text/javascript" src="js/navigation.js"></script>
146 <script type="text/javascript" src="js/functions.js"></script>
147 <script type="text/javascript">
148 // <![CDATA[
149 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
150 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
152 // INIT PMA_setFrameSize
153 var onloadCnt = 0;
154 var onLoadHandler = window.onload;
155 var resizeHandler = window.onresize;
156 window.document.onresize = resizeHandler;
157 window.onload = function() {
158 if (onloadCnt == 0) {
159 if (typeof(onLoadHandler) == "function") {
160 onLoadHandler();
162 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
163 PMA_setFrameSize();
165 onloadCnt++;
168 window.onresize = function() {
169 if (typeof(resizeHandler) == "function") {
170 resizeHandler();
172 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
173 PMA_saveFrameSize();
176 // ]]>
177 </script>
178 <?php
180 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
183 <!--[if IE 6]>
184 <style type="text/css">
185 /* <![CDATA[ */
186 html {
187 overflow-y: scroll;
189 /* ]]> */
190 </style>
191 <![endif]-->
192 </head>
194 <body id="body_leftFrame">
195 <?php
196 require './libraries/navigation_header.inc.php';
197 if (! $GLOBALS['server']) {
198 // no server selected
199 PMA_exitNavigationFrame();
200 } elseif (! $GLOBALS['PMA_List_Database']->count()) {
201 // no database available, so we break here
202 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
203 PMA_exitNavigationFrame();
204 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && $GLOBALS['PMA_List_Database']->count() > 1) {
205 $list = $cfg['DisplayDatabasesList'];
206 if ($list === 'auto') {
207 if (empty($GLOBALS['db'])) {
208 $list = true;
209 } else {
210 $list = false;
213 if (!$list) {
214 // more than one database available and LeftFrameLight is true
215 // display db selectbox
217 // Light mode -> beginning of the select combo for databases
218 // Note: When javascript is active, the frameset will be changed from
219 // within navigation.php. With no JS (<noscript>) the whole frameset will
220 // be rebuilt with the new target frame.
223 <div id="databaseList">
224 <form method="post" action="index.php" target="_parent" id="left">
225 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
226 <?php
227 echo PMA_generate_common_hidden_inputs() . "\n";
228 echo $GLOBALS['PMA_List_Database']->getHtmlSelectGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
229 echo '<noscript>' . "\n"
230 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
231 .'</noscript>' . "\n"
232 .'</form>' . "\n";
233 } else {
234 if (! empty($db)) {
235 echo '<div id="databaseList">' . "\n";
237 echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
239 $_url_params = array('pos' => $pos);
240 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
241 if (! empty($db)) {
242 echo '</div>' . "\n";
247 <div id="left_tableList">
248 <?php
249 // Don't display expansible/collapsible database info if:
250 // 1. $GLOBALS['server'] == 0 (no server selected)
251 // This is the case when there are multiple servers and
252 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
253 // screen to appear with no database info displayed.
254 // 2. there is only one database available (ie either only one database exists
255 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
256 // In this case, the database should not be collapsible/expandable
258 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
259 .' width="9" height="9" alt="+" />';
260 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
261 .' width="9" height="9" alt="-" />';
263 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
264 .' href="navigation.php?%s" target="_self">';
266 $element_counter = 0;
268 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
269 // show selected databasename as link to DefaultTabDatabase-page
270 // with table count in ()
271 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
273 $db_tooltip = '';
275 if ($GLOBALS['cfg']['ShowTooltip']
276 && $GLOBALS['cfgRelation']['commwork']) {
277 $_db_tooltip = PMA_getComments($GLOBALS['db']);
278 if (is_array($_db_tooltip)) {
279 $db_tooltip = implode(' ', $_db_tooltip);
283 $disp_name = $GLOBALS['db'];
284 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
285 $disp_name = $db_tooltip;
286 $disp_name_cut = $db_tooltip;
287 $db_tooltip = $GLOBALS['db'];
291 <p><a class="item"
292 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
293 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
294 <?php
295 if ($GLOBALS['text_dir'] === 'rtl') {
296 echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
298 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
299 if ($GLOBALS['text_dir'] === 'ltr') {
300 echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
302 echo '</a></p>';
305 * This helps reducing the navi panel size; in the right panel,
306 * user can find a navigator to page thru all tables.
308 * @todo instead of the 0 parameter, keep track of the
309 * offset in the list of tables ($_SESSION['userconf']['table_limit_offset'])
310 * and use PMA_listNavigator(); do not just check pos in REQUEST
311 * but add another hidden param to see if it's the pos of databases
312 * or the pos of tables.
314 $table_list = PMA_getTableList($GLOBALS['db'], null, 0, $cfg['MaxTableList']);
315 if (! empty($table_list)) {
316 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
317 // hint user that the table list is larger, until the todo is done
318 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && PMA_getTableCount($GLOBALS['db']) > $GLOBALS['cfg']['MaxTableList']) {
319 echo '&nbsp; ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', PMA_getTableCount($GLOBALS['db']), ' )';
321 } else {
322 echo $GLOBALS['strNoTablesFound'];
324 unset($table_list);
325 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
326 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
327 } else {
328 echo '<div id="databaseList">' . "\n";
329 $_url_params = array('pos' => $pos);
330 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
331 echo '</div>' . "\n";
333 $common_url_query = PMA_generate_common_url();
334 PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
338 * displays collapsable db list
340 * @uses $_REQUEST['dbgroup']
341 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
342 * @uses $GLOBALS['strSelectADb']
343 * @uses strpos()
344 * @uses urlencode()
345 * @uses printf()
346 * @uses htmlspecialchars()
347 * @uses PMA_generate_common_url()
348 * @uses PMA_getTableList()
349 * @uses PMA_displayTableList()
350 * @global $element_counter
351 * @global $img_minus
352 * @global $img_plus
353 * @global $href_left
354 * @global $db_start
355 * @global $common_url_query
356 * @param array $ext_dblist extended db list
357 * @param integer $offset
358 * @param integer $count
360 function PMA_displayDbList($ext_dblist, $offset, $count) {
361 global $element_counter, $img_minus, $img_plus, $href_left,
362 $db_start, $common_url_query;
364 // get table list, for all databases
365 // doing this in one step takes advantage of a single query with information_schema!
366 $tables_full = PMA_DBI_get_tables_full($GLOBALS['PMA_List_Database']->getLimitedItems($offset, $count));
368 $url_dbgroup = '';
369 echo '<ul id="leftdatabaselist">';
370 $close_db_group = false;
371 foreach ($ext_dblist as $group => $db_group) {
372 if ($GLOBALS['PMA_List_Database']->count() > 1) {
373 if ($close_db_group) {
374 $url_dbgroup = '';
375 echo '</ul>';
376 echo '</li>';
377 $close_db_group = false;
379 if (count($db_group) > 1) {
380 $close_db_group = true;
381 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
382 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
383 $element_counter++;
384 echo '<li class="dbgroup">';
385 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
386 || $db_start == $group || strpos($db_start, $group) === 0) {
387 // display + only if this db(group) is not preselected
388 printf($href_left, $element_counter, PMA_generate_common_url());
389 printf($img_minus, $element_counter);
390 } else {
391 printf($href_left, $element_counter, $common_url_query);
392 printf($img_plus, $element_counter);
394 echo '</a> ' . $group . "\n";
395 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
396 || $db_start == $group || strpos($db_start, $group) === 0) {
397 echo '<ul id="subel' . $element_counter . '">' . "\n";
398 } else {
399 echo '<ul id="subel' . $element_counter . '"'
400 .' style="display: none">' . "\n";
404 foreach ($db_group as $db) {
405 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
407 $element_counter++;
408 // Displays the database name
409 echo '<li>' . "\n";
411 if ($GLOBALS['PMA_List_Database']->count() > 1) {
412 // only with more than one db we need collapse ...
413 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
414 // display + only if this db is not preselected
415 // or table count is 0
416 printf($href_left, $element_counter, $common_url_query);
417 printf($img_plus, $element_counter);
418 } else {
419 printf($href_left, $element_counter,
420 PMA_generate_common_url() . $url_dbgroup);
421 printf($img_minus, $element_counter);
423 echo '</a>';
425 // ... and we need to refresh both frames on db selection
427 <a class="item"
428 id="<?php echo htmlspecialchars($db['name']); ?>"
429 href="index.php?<?php echo $common_url_query; ?>"
430 target="_parent"
431 title="<?php echo htmlspecialchars($db['comment']); ?>"
432 onclick="
433 if (! toggle('<?php echo $element_counter; ?>', true))
434 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
435 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
436 . '?' . $common_url_query; ?>', 'main');
437 return false;">
438 <?php
439 if ($GLOBALS['text_dir'] === 'rtl') {
440 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
442 echo htmlspecialchars($db['disp_name']);
443 if ($GLOBALS['text_dir'] === 'ltr') {
444 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
447 </a>
448 <?php
449 } else {
450 // with only 1 db available we dont need to refresh left frame
451 // on db selection, only phpmain
453 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
454 . '?' . $common_url_query; ?>"
455 id="<?php echo htmlspecialchars($db['name']); ?>"
456 title="<?php echo htmlspecialchars($db['comment']); ?>">
457 <?php
458 if ($GLOBALS['text_dir'] === 'rtl') {
459 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
461 echo htmlspecialchars($db['disp_name']);
462 if ($GLOBALS['text_dir'] === 'ltr') {
463 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
466 </a>
467 <?php
469 if ($db['num_tables']) {
470 if (isset($tables_full[$db['name']])) {
471 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
472 } elseif (isset($tables_full[strtolower($db['name'])])) {
473 // on windows with lower_case_table_names = 1
474 // MySQL returns
475 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
476 // but information_schema.TABLES gives `test`
477 // bug #1436171
478 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
479 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
480 } else {
481 $tables = PMA_getTableList($db['name']);
483 $child_visible =
484 (bool) ($GLOBALS['PMA_List_Database']->count() === 1 || $db_start == $db['name']);
485 PMA_displayTableList($tables, $child_visible, '', $db['name']);
486 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
487 // no tables and LeftFrameLight:
488 // display message no tables in selected db
489 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
491 echo '</li>' . "\n";
492 } // end foreach db
493 } // end foreach group
495 if ($close_db_group) {
496 $url_dbgroup = '';
497 echo '</ul>';
498 echo '</li>';
499 $close_db_group = false;
502 echo '</ul>' . "\n";
506 * display unordered list of tables
507 * calls itself recursively if table in given list
508 * is a list itself
510 * @uses is_array()
511 * @uses count()
512 * @uses urlencode()
513 * @uses strpos()
514 * @uses printf()
515 * @uses htmlspecialchars()
516 * @uses strlen()
517 * @uses is_array()
518 * @uses PMA_displayTableList()
519 * @uses $_REQUEST['tbl_group']
520 * @uses $GLOBALS['common_url_query']
521 * @uses $GLOBALS['table']
522 * @uses $GLOBALS['pmaThemeImage']
523 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
524 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
525 * @uses $GLOBALS['cfg']['DefaultTabTable']
526 * @uses $GLOBALS['strRows']
527 * @uses $GLOBALS['strBrowse']
528 * @global integer the element counter
529 * @global string html code for '-' image
530 * @global string html code for '+' image
531 * @global string html code for self link
532 * @param array $tables array of tables/tablegroups
533 * @param boolean $visible wether the list is visible or not
534 * @param string $tab_group_full full tab group name
535 * @param string $table_db db of this table
537 function PMA_displayTableList($tables, $visible = false,
538 $tab_group_full = '', $table_db = '')
540 if (! is_array($tables) || count($tables) === 0) {
541 return;
544 global $element_counter, $img_minus, $img_plus, $href_left;
545 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
547 if ($visible) {
548 echo '<ul id="subel' . $element_counter . '">';
549 } else {
550 echo '<ul id="subel' . $element_counter . '" style="display: none">';
552 foreach ($tables as $group => $table) {
553 if (isset($table['is' . $sep . 'group'])) {
554 $common_url_query = $GLOBALS['common_url_query']
555 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
557 $element_counter++;
558 echo '<li>' . "\n";
559 if ($visible
560 && ((isset($_REQUEST['tbl_group'])
561 && (strpos($_REQUEST['tbl_group'], $group) === 0
562 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
563 || strpos($GLOBALS['table'], $group) === 0)) {
564 printf($href_left, $element_counter,
565 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
566 printf($img_minus, $element_counter);
567 } else {
568 printf($href_left, $element_counter, $common_url_query);
569 printf($img_plus, $element_counter);
571 echo '</a>';
573 <a href="index.php?<?php echo $common_url_query; ?>"
574 target="_parent"
575 onclick="
576 if (! toggle('<?php echo $element_counter; ?>', true))
577 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
578 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
579 . '?' . $common_url_query; ?>', 'main');
580 return false;">
581 <?php
582 if ($GLOBALS['text_dir'] === 'rtl') {
583 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
585 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
586 if ($GLOBALS['text_dir'] === 'ltr') {
587 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
590 </a>
591 <?php
593 unset($table['is' . $sep . 'group']);
594 unset($table['tab' . $sep . 'group']);
595 unset($table['tab' . $sep . 'count']);
597 if ($visible &&
598 ((isset($_REQUEST['tbl_group'])
599 && (strpos($_REQUEST['tbl_group'], $group) === 0
600 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
601 || strpos($GLOBALS['table'], $group) === 0)) {
602 PMA_displayTableList($table, true,
603 $tab_group_full . $group, $table_db);
604 } else {
605 PMA_displayTableList($table, false, '', $table_db);
607 echo '</li>' . "\n";
608 } elseif (is_array($table)) {
609 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
610 .$GLOBALS['common_url_query'] . '&amp;table='
611 .urlencode($table['Name']);
612 echo '<li>' . "\n";
613 echo '<a title="' . $GLOBALS['strBrowse'] . ': '
614 . htmlspecialchars($table['Comment'])
615 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
616 .' id="browse_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
617 .' href="sql.php?' . $GLOBALS['common_url_query']
618 .'&amp;table=' . urlencode($table['Name'])
619 .'&amp;goto=' . $GLOBALS['cfg']['DefaultTabTable']
620 . '" >'
621 .'<img class="icon"';
622 if ('VIEW' === strtoupper($table['Comment'])) {
623 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
624 } else {
625 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
627 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
628 .' width="10" height="10" alt="' . $GLOBALS['strBrowse'] . '" /></a>' . "\n"
629 .'<a href="' . $href . '" title="' . htmlspecialchars($table['Comment']
630 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
631 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
632 // preserve spaces in table name
633 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
634 echo '</li>' . "\n";
637 echo '</ul>';
640 echo '</div>' . "\n";
642 PMA_exitNavigationFrame();