3.2.5
[phpmyadmin/crack.git] / navigation.php
blob7818111d5a59678ad9f87d8d0fd25f20aebdda0b
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 * @package phpMyAdmin
8 * @uses $GLOBALS['pma']->databases
9 * @uses $GLOBALS['server']
10 * @uses $GLOBALS['db']
11 * @uses $GLOBALS['table']
12 * @uses $GLOBALS['available_languages']
13 * @uses $GLOBALS['lang']
14 * @uses $GLOBALS['text_dir']
15 * @uses $GLOBALS['charset']
16 * @uses $GLOBALS['pmaThemeImage']
17 * @uses $GLOBALS['strNavTableFilter']
18 * @uses $GLOBALS['strReset']
19 * @uses $GLOBALS['strNoDatabases']
20 * @uses $GLOBALS['strDatabase']
21 * @uses $GLOBALS['strGo']
22 * @uses $GLOBALS['strSelectADb']
23 * @uses $GLOBALS['strNoTablesFound']
24 * @uses $GLOBALS['cfg']['LeftFrameLight']
25 * @uses $GLOBALS['cfg']['ShowTooltip']
26 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
27 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
28 * @uses $GLOBALS['cfgRelation']['commwork']) {
29 * @uses PMA_List_Database::getSingleItem()
30 * @uses PMA_List_Database::getHtmlSelectGrouped()
31 * @uses PMA_List_Database::getGroupedDetails()
32 * @uses PMA_generate_common_url()
33 * @uses PMA_generate_common_hidden_inputs()
34 * @uses PMA_getDbComment();
35 * @uses PMA_getTableCount()
36 * @uses PMA_getTableList()
37 * @uses PMA_getRelationsParam()
38 * @uses PMA_outBufferPre()
39 * @uses session_write_close()
40 * @uses strlen()
41 * @uses session_write_close()
42 * @uses is_array()
43 * @uses implode()
44 * @uses htmlspecialchars()
47 /**
48 * Gets a core script and starts output buffering work
50 require_once './libraries/common.inc.php';
52 /**
53 * finish and cleanup navigation.php script execution, only to be used in navigation.php
55 * @uses $GLOBALS['controllink'] to close it
56 * @uses $GLOBALS['userlink'] to close it
57 * @access private
59 function PMA_exitNavigationFrame()
61 echo '</body></html>';
62 exit;
65 // keep the offset of the db list in session before closing it
66 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
67 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
69 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
70 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
71 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
73 if (isset($_REQUEST['pos'])) {
74 if (isset($_REQUEST['tpos'])) {
75 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
77 else {
78 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
81 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
82 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
83 // free the session file, for the other frames to be loaded
84 // but only if debugging is not enabled
85 if (empty($_SESSION['debug'])) {
86 session_write_close();
89 /**
90 * the output compression library
92 require_once './libraries/ob.lib.php';
94 PMA_outBufferPre();
97 * selects the database if there is only one on current server
99 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
100 $GLOBALS['db'] = $GLOBALS['pma']->databases->getSingleItem();
103 $db_start = $GLOBALS['db'];
106 * the relation library
108 require_once './libraries/relation.lib.php';
109 $cfgRelation = PMA_getRelationsParam();
112 * garvin: For re-usability, moved http-headers to a seperate file.
113 * It can now be included by libraries/header.inc.php, querywindow.php.
115 require_once './libraries/header_http.inc.php';
118 * Displays the frame
120 // xml declaration moves IE into quirks mode, making much trouble with CSS
121 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
123 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
124 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
125 <html xmlns="http://www.w3.org/1999/xhtml"
126 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
127 lang="<?php echo $available_languages[$lang][2]; ?>"
128 dir="<?php echo $GLOBALS['text_dir']; ?>">
130 <head>
131 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
132 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
133 <title>phpMyAdmin</title>
134 <meta http-equiv="Content-Type"
135 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
136 <base target="frame_content" />
137 <link rel="stylesheet" type="text/css"
138 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $_SESSION['PMA_Config']->getThemeUniqueValue(); ?>" />
139 <script type="text/javascript" src="js/navigation.js"></script>
140 <script type="text/javascript" src="js/functions.js"></script>
141 <script type="text/javascript">
142 // <![CDATA[
143 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
144 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
146 // INIT PMA_setFrameSize
147 var onloadCnt = 0;
148 var onLoadHandler = window.onload;
149 var resizeHandler = window.onresize;
150 window.document.onresize = resizeHandler;
151 window.onload = function() {
152 if (onloadCnt == 0) {
153 if (typeof(onLoadHandler) == "function") {
154 onLoadHandler();
156 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
157 PMA_setFrameSize();
159 onloadCnt++;
162 window.onresize = function() {
163 if (typeof(resizeHandler) == "function") {
164 resizeHandler();
166 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
167 PMA_saveFrameSize();
170 // ]]>
171 </script>
172 <?php
174 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
177 <!--[if IE 6]>
178 <style type="text/css">
179 /* <![CDATA[ */
180 html {
181 overflow-y: scroll;
183 /* ]]> */
184 </style>
185 <![endif]-->
186 </head>
188 <body id="body_leftFrame">
189 <?php
190 require './libraries/navigation_header.inc.php';
191 if (! $GLOBALS['server']) {
192 // no server selected
193 PMA_exitNavigationFrame();
194 } elseif (! count($GLOBALS['pma']->databases)) {
195 // no database available, so we break here
196 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
197 PMA_exitNavigationFrame();
198 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
199 $list = $cfg['DisplayDatabasesList'];
200 if ($list === 'auto') {
201 if (empty($GLOBALS['db'])) {
202 $list = true;
203 } else {
204 $list = false;
207 if (!$list) {
208 // more than one database available and LeftFrameLight is true
209 // display db selectbox
211 // Light mode -> beginning of the select combo for databases
212 // Note: When javascript is active, the frameset will be changed from
213 // within navigation.php. With no JS (<noscript>) the whole frameset will
214 // be rebuilt with the new target frame.
217 <div id="databaseList">
218 <form method="post" action="index.php" target="_parent" id="left">
219 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
220 <?php
221 echo PMA_generate_common_hidden_inputs() . "\n";
222 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
223 echo '<noscript>' . "\n"
224 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
225 .'</noscript>' . "\n"
226 .'</form>' . "\n";
227 } else {
228 if (! empty($db)) {
229 echo '<div id="databaseList">' . "\n";
231 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
233 $_url_params = array('pos' => $pos);
234 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
235 if (! empty($db)) {
236 echo '</div>' . "\n";
241 <div id="left_tableList">
242 <?php
243 // Don't display expansible/collapsible database info if:
244 // 1. $GLOBALS['server'] == 0 (no server selected)
245 // This is the case when there are multiple servers and
246 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
247 // screen to appear with no database info displayed.
248 // 2. there is only one database available (ie either only one database exists
249 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
250 // In this case, the database should not be collapsible/expandable
252 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
253 .' width="9" height="9" alt="+" />';
254 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
255 .' width="9" height="9" alt="-" />';
257 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
258 .' href="navigation.php?%s" target="_self">';
260 $element_counter = 0;
263 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
264 $table_list = PMA_getTableList($GLOBALS['db']);
265 $table_count = count($table_list);
267 // show selected databasename as link to DefaultTabDatabase-page
268 // with table count in ()
269 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
271 $db_tooltip = '';
273 if ($GLOBALS['cfg']['ShowTooltip']
274 && $GLOBALS['cfgRelation']['commwork']) {
275 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
276 if ($_db_tooltip) {
277 $db_tooltip = $_db_tooltip;
281 $disp_name = $GLOBALS['db'];
282 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
283 $disp_name = $db_tooltip;
284 $disp_name_cut = $db_tooltip;
285 $db_tooltip = $GLOBALS['db'];
289 <p><a class="item"
290 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
291 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
292 <?php
293 if ($GLOBALS['text_dir'] === 'rtl') {
294 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
296 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
297 if ($GLOBALS['text_dir'] === 'ltr') {
298 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
300 echo '</a></p>';
301 if ($table_count) {
302 echo '<span id=\'NavFilter\' style="display:none"><input type="text" name="fast_filter" id="fast_filter" title="' . $strNavTableFilter . '" onkeyup="setTimeout(function(word){ return function(){ fast_filter(word);}}(this.value),1000);"/><span onclick="document.getElementById(\'fast_filter\').value=\'\'; fast_filter(\'\');document.getElementById(\'fast_filter\').focus();" style="background:white;color:black;cursor:pointer;padding:2px;" title="' . $strReset . '">X</span></span><script type="text/javascript">document.getElementById(\'NavFilter\').style.display=\'\';</script>';
306 * This helps reducing the navi panel size; in the right panel,
307 * user can find a navigator to page thru all tables.
310 $table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
311 if (! empty($table_list)) {
312 // upper table list paginator
313 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
314 $_url_params = array(
315 'tpos' => 'true',
316 'pos' => $tpos,
317 'db' => $GLOBALS['db']
319 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
321 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
322 // lower table list paginator
323 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
324 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
326 } else {
327 echo $GLOBALS['strNoTablesFound'];
329 unset($table_list);
330 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
331 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
332 } else {
333 echo '<div id="databaseList">' . "\n";
334 $_url_params = array('pos' => $pos);
335 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
336 echo '</div>' . "\n";
338 $common_url_query = PMA_generate_common_url();
339 PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
343 * displays collapsable db list
345 * @uses $_REQUEST['dbgroup']
346 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
347 * @uses $GLOBALS['strSelectADb']
348 * @uses strpos()
349 * @uses urlencode()
350 * @uses printf()
351 * @uses htmlspecialchars()
352 * @uses PMA_generate_common_url()
353 * @uses PMA_getTableList()
354 * @uses PMA_displayTableList()
355 * @global integer $element_counter
356 * @global string $img_minus
357 * @global string $img_plus
358 * @global string $href_left
359 * @global string $db_start
360 * @global string $common_url_query
361 * @param array $ext_dblist extended db list
362 * @param integer $offset
363 * @param integer $count
365 function PMA_displayDbList($ext_dblist, $offset, $count) {
366 global $element_counter, $img_minus, $img_plus, $href_left,
367 $db_start, $common_url_query;
369 // get table list, for all databases
370 // doing this in one step takes advantage of a single query with information_schema!
371 $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));
373 $url_dbgroup = '';
374 echo '<ul id="leftdatabaselist">';
375 $close_db_group = false;
376 foreach ($ext_dblist as $group => $db_group) {
377 if (count($GLOBALS['pma']->databases) > 1) {
378 if ($close_db_group) {
379 $url_dbgroup = '';
380 echo '</ul>';
381 echo '</li>';
382 $close_db_group = false;
384 if (count($db_group) > 1) {
385 $close_db_group = true;
386 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
387 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
388 $element_counter++;
389 echo '<li class="dbgroup">';
390 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
391 || $db_start == $group || strpos($db_start, $group) === 0) {
392 // display + only if this db(group) is not preselected
393 printf($href_left, $element_counter, PMA_generate_common_url());
394 printf($img_minus, $element_counter);
395 } else {
396 printf($href_left, $element_counter, $common_url_query);
397 printf($img_plus, $element_counter);
399 echo '</a> ' . $group . "\n";
400 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
401 || $db_start == $group || strpos($db_start, $group) === 0) {
402 echo '<ul id="subel' . $element_counter . '">' . "\n";
403 } else {
404 echo '<ul id="subel' . $element_counter . '"'
405 .' style="display: none">' . "\n";
409 foreach ($db_group as $db) {
410 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
412 $element_counter++;
413 // Displays the database name
414 echo '<li>' . "\n";
416 if (count($GLOBALS['pma']->databases) > 1) {
417 // only with more than one db we need collapse ...
418 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
419 // display + only if this db is not preselected
420 // or table count is 0
421 printf($href_left, $element_counter, $common_url_query);
422 printf($img_plus, $element_counter);
423 } else {
424 printf($href_left, $element_counter,
425 PMA_generate_common_url() . $url_dbgroup);
426 printf($img_minus, $element_counter);
428 echo '</a>';
430 // ... and we need to refresh both frames on db selection
432 <a class="item"
433 id="<?php echo htmlspecialchars($db['name']); ?>"
434 href="index.php?<?php echo $common_url_query; ?>"
435 target="_parent"
436 title="<?php echo htmlspecialchars($db['comment']); ?>"
437 onclick="
438 if (! toggle('<?php echo $element_counter; ?>', true))
439 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
440 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
441 . '?' . $common_url_query; ?>', 'main');
442 return false;">
443 <?php
444 if ($GLOBALS['text_dir'] === 'rtl') {
445 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
447 echo htmlspecialchars($db['disp_name']);
448 if ($GLOBALS['text_dir'] === 'ltr') {
449 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
452 </a>
453 <?php
454 } else {
455 // with only 1 db available we dont need to refresh left frame
456 // on db selection, only phpmain
458 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
459 . '?' . $common_url_query; ?>"
460 id="<?php echo htmlspecialchars($db['name']); ?>"
461 title="<?php echo htmlspecialchars($db['comment']); ?>">
462 <?php
463 if ($GLOBALS['text_dir'] === 'rtl') {
464 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
466 echo htmlspecialchars($db['disp_name']);
467 if ($GLOBALS['text_dir'] === 'ltr') {
468 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
471 </a>
472 <?php
474 if ($db['num_tables']) {
475 if (isset($tables_full[$db['name']])) {
476 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
477 } elseif (isset($tables_full[strtolower($db['name'])])) {
478 // on windows with lower_case_table_names = 1
479 // MySQL returns
480 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
481 // but information_schema.TABLES gives `test`
482 // bug #1436171
483 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
484 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
485 } else {
486 $tables = PMA_getTableList($db['name']);
488 $child_visible =
489 (bool) (count($GLOBALS['pma']->databases) === 1 || $db_start == $db['name']);
490 PMA_displayTableList($tables, $child_visible, '', $db['name']);
491 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
492 // no tables and LeftFrameLight:
493 // display message no tables in selected db
494 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
496 echo '</li>' . "\n";
497 } // end foreach db
498 } // end foreach group
500 if ($close_db_group) {
501 $url_dbgroup = '';
502 echo '</ul>';
503 echo '</li>';
504 $close_db_group = false;
507 echo '</ul>' . "\n";
511 * display unordered list of tables
512 * calls itself recursively if table in given list
513 * is a list itself
515 * @uses is_array()
516 * @uses count()
517 * @uses urlencode()
518 * @uses strpos()
519 * @uses printf()
520 * @uses htmlspecialchars()
521 * @uses strlen()
522 * @uses is_array()
523 * @uses PMA_displayTableList()
524 * @uses $_REQUEST['tbl_group']
525 * @uses $GLOBALS['common_url_query']
526 * @uses $GLOBALS['table']
527 * @uses $GLOBALS['pmaThemeImage']
528 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
529 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
530 * @uses $GLOBALS['cfg']['DefaultTabTable']
531 * @uses $GLOBALS['strRows']
532 * @uses $GLOBALS['strBrowse']
533 * @global integer the element counter
534 * @global string html code for '-' image
535 * @global string html code for '+' image
536 * @global string html code for self link
537 * @param array $tables array of tables/tablegroups
538 * @param boolean $visible whether the list is visible or not
539 * @param string $tab_group_full full tab group name
540 * @param string $table_db db of this table
542 function PMA_displayTableList($tables, $visible = false,
543 $tab_group_full = '', $table_db = '')
545 if (! is_array($tables) || count($tables) === 0) {
546 return;
549 global $element_counter, $img_minus, $img_plus, $href_left;
550 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
552 if ($visible) {
553 echo '<ul id="subel' . $element_counter . '">';
554 } else {
555 echo '<ul id="subel' . $element_counter . '" style="display: none">';
557 foreach ($tables as $group => $table) {
558 if (isset($table['is' . $sep . 'group'])) {
559 $common_url_query = $GLOBALS['common_url_query']
560 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
562 $element_counter++;
563 echo '<li>' . "\n";
564 if ($visible
565 && ((isset($_REQUEST['tbl_group'])
566 && (strpos($_REQUEST['tbl_group'], $group) === 0
567 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
568 || strpos($GLOBALS['table'], $group) === 0)) {
569 printf($href_left, $element_counter,
570 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
571 printf($img_minus, $element_counter);
572 } else {
573 printf($href_left, $element_counter, $common_url_query);
574 printf($img_plus, $element_counter);
576 echo '</a>';
578 <a href="index.php?<?php echo $common_url_query; ?>"
579 target="_parent"
580 onclick="
581 if (! toggle('<?php echo $element_counter; ?>', true))
582 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
583 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
584 . '?' . $common_url_query; ?>', 'main');
585 return false;">
586 <?php
587 if ($GLOBALS['text_dir'] === 'rtl') {
588 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
590 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
591 if ($GLOBALS['text_dir'] === 'ltr') {
592 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
595 </a>
596 <?php
598 unset($table['is' . $sep . 'group']);
599 unset($table['tab' . $sep . 'group']);
600 unset($table['tab' . $sep . 'count']);
602 if ($visible &&
603 ((isset($_REQUEST['tbl_group'])
604 && (strpos($_REQUEST['tbl_group'], $group) === 0
605 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
606 || strpos($GLOBALS['table'], $group) === 0)) {
607 PMA_displayTableList($table, true,
608 $tab_group_full . $group, $table_db);
609 } else {
610 PMA_displayTableList($table, false, '', $table_db);
612 echo '</li>' . "\n";
613 } elseif (is_array($table)) {
614 $link_title = PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']);
615 // quick access icon next to each table name
616 echo '<li>' . "\n";
617 echo '<a title="'
618 . htmlspecialchars($link_title)
619 . ': ' . htmlspecialchars($table['Comment'])
620 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
621 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
622 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
623 . $GLOBALS['common_url_query']
624 .'&amp;table=' . urlencode($table['Name'])
625 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
626 . '" >'
627 .'<img class="icon"';
628 if ('VIEW' === strtoupper($table['Comment'])) {
629 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
630 } else {
631 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
633 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
634 .' width="10" height="10" alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
636 // link for the table name itself
637 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
638 .$GLOBALS['common_url_query'] . '&amp;table='
639 .urlencode($table['Name']) . '&amp;pos=0';
640 echo '<a href="' . $href
641 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
642 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
643 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
644 // preserve spaces in table name
645 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
646 echo '</li>' . "\n";
649 echo '</ul>';
652 echo '</div>' . "\n";
654 PMA_exitNavigationFrame();