Merge remote branch 'origin/MAINT_3_3_3' into QA_3_3
[phpmyadmin/dkf.git] / navigation.php
blob17d01935be442f7278ca34e95423fdefd445a6e1
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 strlen()
40 * @uses session_write_close()
41 * @uses is_array()
42 * @uses implode()
43 * @uses htmlspecialchars()
46 /**
47 * Gets a core script and starts output buffering work
49 require_once './libraries/common.inc.php';
51 /**
52 * finish and cleanup navigation.php script execution, only to be used in navigation.php
54 * @uses $GLOBALS['controllink'] to close it
55 * @uses $GLOBALS['userlink'] to close it
56 * @access private
58 function PMA_exitNavigationFrame()
60 echo '</body></html>';
61 exit;
64 // keep the offset of the db list in session before closing it
65 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
66 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
68 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
69 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
70 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
72 if (isset($_REQUEST['pos'])) {
73 if (isset($_REQUEST['tpos'])) {
74 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
76 else {
77 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
80 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
81 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
82 // free the session file, for the other frames to be loaded
83 // but only if debugging is not enabled
84 if (empty($_SESSION['debug'])) {
85 session_write_close();
88 /**
89 * the output compression library
91 require_once './libraries/ob.lib.php';
93 PMA_outBufferPre();
96 * selects the database if there is only one on current server
98 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
99 $GLOBALS['db'] = $GLOBALS['pma']->databases->getSingleItem();
102 $db_start = $GLOBALS['db'];
105 * the relation library
107 require_once './libraries/relation.lib.php';
108 $cfgRelation = PMA_getRelationsParam();
111 * garvin: For re-usability, moved http-headers to a seperate file.
112 * It can now be included by libraries/header.inc.php, querywindow.php.
114 require_once './libraries/header_http.inc.php';
117 * Displays the frame
119 // xml declaration moves IE into quirks mode, making much trouble with CSS
120 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
122 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
123 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
124 <html xmlns="http://www.w3.org/1999/xhtml"
125 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
126 lang="<?php echo $available_languages[$lang][2]; ?>"
127 dir="<?php echo $GLOBALS['text_dir']; ?>">
129 <head>
130 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
131 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
132 <title>phpMyAdmin</title>
133 <meta http-equiv="Content-Type"
134 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
135 <base target="frame_content" />
136 <link rel="stylesheet" type="text/css"
137 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $_SESSION['PMA_Config']->getThemeUniqueValue(); ?>" />
138 <script type="text/javascript" src="js/navigation.js"></script>
139 <script type="text/javascript" src="js/functions.js"></script>
140 <script type="text/javascript">
141 // <![CDATA[
142 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
143 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
145 // INIT PMA_setFrameSize
146 var onloadCnt = 0;
147 var onLoadHandler = window.onload;
148 var resizeHandler = window.onresize;
149 window.document.onresize = resizeHandler;
150 window.onload = function() {
151 if (onloadCnt == 0) {
152 if (typeof(onLoadHandler) == "function") {
153 onLoadHandler();
155 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
156 PMA_setFrameSize();
158 onloadCnt++;
161 window.onresize = function() {
162 if (typeof(resizeHandler) == "function") {
163 resizeHandler();
165 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
166 PMA_saveFrameSize();
169 // ]]>
170 </script>
171 <?php
173 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
176 <!--[if IE 6]>
177 <style type="text/css">
178 /* <![CDATA[ */
179 html {
180 overflow-y: scroll;
182 /* ]]> */
183 </style>
184 <![endif]-->
185 </head>
187 <body id="body_leftFrame">
188 <?php
189 require './libraries/navigation_header.inc.php';
190 if (! $GLOBALS['server']) {
191 // no server selected
192 PMA_exitNavigationFrame();
193 } elseif (! count($GLOBALS['pma']->databases)) {
194 // no database available, so we break here
195 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
196 PMA_exitNavigationFrame();
197 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
198 $list = $cfg['DisplayDatabasesList'];
199 if ($list === 'auto') {
200 if (empty($GLOBALS['db'])) {
201 $list = true;
202 } else {
203 $list = false;
206 if (!$list) {
207 // more than one database available and LeftFrameLight is true
208 // display db selectbox
210 // Light mode -> beginning of the select combo for databases
211 // Note: When javascript is active, the frameset will be changed from
212 // within navigation.php. With no JS (<noscript>) the whole frameset will
213 // be rebuilt with the new target frame.
216 <div id="databaseList">
217 <form method="post" action="index.php" target="_parent" id="left">
218 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
219 <?php
220 echo PMA_generate_common_hidden_inputs() . "\n";
221 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
222 echo '<noscript>' . "\n"
223 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
224 .'</noscript>' . "\n"
225 .'</form>' . "\n";
226 } else {
227 if (! empty($db)) {
228 echo '<div id="databaseList">' . "\n";
230 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
232 $_url_params = array('pos' => $pos);
233 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
234 if (! empty($db)) {
235 echo '</div>' . "\n";
240 <div id="left_tableList">
241 <?php
242 // Don't display expansible/collapsible database info if:
243 // 1. $GLOBALS['server'] == 0 (no server selected)
244 // This is the case when there are multiple servers and
245 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
246 // screen to appear with no database info displayed.
247 // 2. there is only one database available (ie either only one database exists
248 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
249 // In this case, the database should not be collapsible/expandable
251 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
252 .' width="9" height="9" alt="+" />';
253 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
254 .' width="9" height="9" alt="-" />';
256 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
257 .' href="navigation.php?%s" target="_self">';
259 $element_counter = 0;
262 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
263 $table_list = PMA_getTableList($GLOBALS['db']);
264 $table_count = count($table_list);
266 // show selected databasename as link to DefaultTabDatabase-page
267 // with table count in ()
268 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
270 $db_tooltip = '';
272 if ($GLOBALS['cfg']['ShowTooltip']
273 && $GLOBALS['cfgRelation']['commwork']) {
274 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
275 if ($_db_tooltip) {
276 $db_tooltip = $_db_tooltip;
280 $disp_name = $GLOBALS['db'];
281 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
282 $disp_name = $db_tooltip;
283 $disp_name_cut = $db_tooltip;
284 $db_tooltip = $GLOBALS['db'];
288 <p><a class="item"
289 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
290 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
291 <?php
292 if ($GLOBALS['text_dir'] === 'rtl') {
293 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
295 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
296 if ($GLOBALS['text_dir'] === 'ltr') {
297 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
299 echo '</a></p>';
300 if ($table_count) {
301 echo '<span id=\'NavFilter\' style="display:none;"><span onclick="document.getElementById(\'fast_filter\').value=\'\'; fast_filter(\'\');document.getElementById(\'fast_filter\').focus();" style="background:white;color:black;cursor:pointer;padding:2px;margin:0 0 0 -20px;position:relative;float:right;" title="' . $strReset . '">X</span><input type="text" name="fast_filter" id="fast_filter" title="' . $strNavTableFilter . '" onkeyup="setTimeout(function(word){ return function(){ fast_filter(word);}}(this.value),1000);" style="width:90%;padding:0 -20px 0 0; padding:2px;" onfocus="this.select();" /></span><script type="text/javascript">document.getElementById(\'NavFilter\').style.display=\'\';</script>';
305 * This helps reducing the navi panel size; in the right panel,
306 * user can find a navigator to page thru all tables.
309 $table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
310 if (! empty($table_list)) {
311 // upper table list paginator
312 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
313 $_url_params = array(
314 'tpos' => 'true',
315 'pos' => $tpos,
316 'db' => $GLOBALS['db']
318 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
320 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
321 // lower table list paginator
322 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
323 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
325 } else {
326 echo $GLOBALS['strNoTablesFound'];
328 unset($table_list);
329 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
330 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
331 } else {
332 echo '<div id="databaseList">' . "\n";
333 $_url_params = array('pos' => $pos);
334 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
335 echo '</div>' . "\n";
337 $common_url_query = PMA_generate_common_url();
338 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']);
342 * displays collapsable db list
344 * @uses $_REQUEST['dbgroup']
345 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
346 * @uses $GLOBALS['strSelectADb']
347 * @uses strpos()
348 * @uses urlencode()
349 * @uses printf()
350 * @uses htmlspecialchars()
351 * @uses PMA_generate_common_url()
352 * @uses PMA_getTableList()
353 * @uses PMA_displayTableList()
354 * @global integer $element_counter
355 * @global string $img_minus
356 * @global string $img_plus
357 * @global string $href_left
358 * @global string $db_start
359 * @global string $common_url_query
360 * @param array $ext_dblist extended db list
361 * @param integer $offset
362 * @param integer $count
364 function PMA_displayDbList($ext_dblist, $offset, $count) {
365 global $element_counter, $img_minus, $img_plus, $href_left,
366 $db_start, $common_url_query;
368 // get table list, for all databases
369 // doing this in one step takes advantage of a single query with information_schema!
370 $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));
372 $url_dbgroup = '';
373 echo '<ul id="leftdatabaselist">';
374 $close_db_group = false;
375 foreach ($ext_dblist as $group => $db_group) {
376 if (count($GLOBALS['pma']->databases) > 1) {
377 if ($close_db_group) {
378 $url_dbgroup = '';
379 echo '</ul>';
380 echo '</li>';
381 $close_db_group = false;
383 if (count($db_group) > 1) {
384 $close_db_group = true;
385 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
386 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
387 $element_counter++;
388 echo '<li class="dbgroup">';
389 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
390 || $db_start == $group || strpos($db_start, $group) === 0) {
391 // display + only if this db(group) is not preselected
392 printf($href_left, $element_counter, PMA_generate_common_url());
393 printf($img_minus, $element_counter);
394 } else {
395 printf($href_left, $element_counter, $common_url_query);
396 printf($img_plus, $element_counter);
398 echo '</a> ' . $group . "\n";
399 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
400 || $db_start == $group || strpos($db_start, $group) === 0) {
401 echo '<ul id="subel' . $element_counter . '">' . "\n";
402 } else {
403 echo '<ul id="subel' . $element_counter . '"'
404 .' style="display: none">' . "\n";
408 foreach ($db_group as $db) {
409 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
411 $element_counter++;
412 // Displays the database name
413 echo '<li>' . "\n";
415 if (count($GLOBALS['pma']->databases) > 1) {
416 // only with more than one db we need collapse ...
417 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
418 // display + only if this db is not preselected
419 // or table count is 0
420 printf($href_left, $element_counter, $common_url_query);
421 printf($img_plus, $element_counter);
422 } else {
423 printf($href_left, $element_counter,
424 PMA_generate_common_url() . $url_dbgroup);
425 printf($img_minus, $element_counter);
427 echo '</a>';
429 // ... and we need to refresh both frames on db selection
431 <a class="item"
432 id="<?php echo htmlspecialchars($db['name']); ?>"
433 href="index.php?<?php echo $common_url_query; ?>"
434 target="_parent"
435 title="<?php echo htmlspecialchars($db['comment']); ?>"
436 onclick="
437 if (! toggle('<?php echo $element_counter; ?>', true))
438 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
439 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
440 . '?' . $common_url_query; ?>', 'main');
441 return false;">
442 <?php
443 if ($GLOBALS['text_dir'] === 'rtl') {
444 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
446 echo htmlspecialchars($db['disp_name']);
447 if ($GLOBALS['text_dir'] === 'ltr') {
448 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
451 </a>
452 <?php
453 } else {
454 // with only 1 db available we dont need to refresh left frame
455 // on db selection, only phpmain
457 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
458 . '?' . $common_url_query; ?>"
459 id="<?php echo htmlspecialchars($db['name']); ?>"
460 title="<?php echo htmlspecialchars($db['comment']); ?>">
461 <?php
462 if ($GLOBALS['text_dir'] === 'rtl') {
463 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
465 echo htmlspecialchars($db['disp_name']);
466 if ($GLOBALS['text_dir'] === 'ltr') {
467 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
470 </a>
471 <?php
473 if ($db['num_tables']) {
474 if (isset($tables_full[$db['name']])) {
475 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
476 } elseif (isset($tables_full[strtolower($db['name'])])) {
477 // on windows with lower_case_table_names = 1
478 // MySQL returns
479 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
480 // but information_schema.TABLES gives `test`
481 // bug #1436171
482 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
483 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
484 } else {
485 $tables = PMA_getTableList($db['name']);
487 $child_visible =
488 (bool) (count($GLOBALS['pma']->databases) === 1 || $db_start == $db['name']);
489 PMA_displayTableList($tables, $child_visible, '', $db['name']);
490 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
491 // no tables and LeftFrameLight:
492 // display message no tables in selected db
493 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
495 echo '</li>' . "\n";
496 } // end foreach db
497 } // end foreach group
499 if ($close_db_group) {
500 $url_dbgroup = '';
501 echo '</ul>';
502 echo '</li>';
503 $close_db_group = false;
506 echo '</ul>' . "\n";
510 * display unordered list of tables
511 * calls itself recursively if table in given list
512 * is a list itself
514 * @uses is_array()
515 * @uses count()
516 * @uses urlencode()
517 * @uses strpos()
518 * @uses printf()
519 * @uses htmlspecialchars()
520 * @uses strlen()
521 * @uses is_array()
522 * @uses PMA_displayTableList()
523 * @uses $_REQUEST['tbl_group']
524 * @uses $GLOBALS['common_url_query']
525 * @uses $GLOBALS['table']
526 * @uses $GLOBALS['pmaThemeImage']
527 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
528 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
529 * @uses $GLOBALS['cfg']['DefaultTabTable']
530 * @uses $GLOBALS['strRows']
531 * @uses $GLOBALS['strBrowse']
532 * @global integer the element counter
533 * @global string html code for '-' image
534 * @global string html code for '+' image
535 * @global string html code for self link
536 * @param array $tables array of tables/tablegroups
537 * @param boolean $visible whether the list is visible or not
538 * @param string $tab_group_full full tab group name
539 * @param string $table_db db of this table
541 function PMA_displayTableList($tables, $visible = false,
542 $tab_group_full = '', $table_db = '')
544 if (! is_array($tables) || count($tables) === 0) {
545 return;
548 global $element_counter, $img_minus, $img_plus, $href_left;
549 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
551 if ($visible) {
552 echo '<ul id="subel' . $element_counter . '">';
553 } else {
554 echo '<ul id="subel' . $element_counter . '" style="display: none">';
556 foreach ($tables as $group => $table) {
557 // only allow grouping if the group has more than 1 table
558 if (isset($table['is' . $sep . 'group']) && $table['tab' . $sep . 'count'] > 1) {
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 // the table was not grouped because it is the only one with its prefix
615 if (isset($table['is' . $sep . 'group'])) {
616 // get the array with the actual table information
617 foreach ($table as $value) {
618 if(is_array($value)) {
619 $table = $value;
623 $link_title = PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']);
624 // quick access icon next to each table name
625 echo '<li>' . "\n";
626 echo '<a title="'
627 . htmlspecialchars($link_title)
628 . ': ' . htmlspecialchars($table['Comment'])
629 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
630 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
631 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
632 . $GLOBALS['common_url_query']
633 .'&amp;table=' . urlencode($table['Name'])
634 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
635 . '" >'
636 .'<img class="icon"';
637 if ('VIEW' === strtoupper($table['Comment'])) {
638 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
639 } else {
640 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
642 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
643 .' width="10" height="10" alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
645 // link for the table name itself
646 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
647 .$GLOBALS['common_url_query'] . '&amp;table='
648 .urlencode($table['Name']) . '&amp;pos=0';
649 echo '<a href="' . $href
650 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
651 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
652 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
653 // preserve spaces in table name
654 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
655 echo '</li>' . "\n";
658 echo '</ul>';
661 echo '</div>' . "\n";
663 PMA_exitNavigationFrame();