2.11.11.3 release
[phpmyadmin/arisferyanto.git] / navigation.php
blob88292e27bef736ad54b7cd9ed16754c089959591
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($_SESSION['userconf']['table_limit_offset'])) {
80 $_SESSION['userconf']['table_limit_offset'] = 0;
82 if (isset($_REQUEST['pos'])) {
83 if (isset($_REQUEST['tpos'])) {
84 $_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos'];
86 else {
87 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
90 $pos = $_SESSION['userconf']['navi_limit_offset'];
91 $tpos = $_SESSION['userconf']['table_limit_offset'];
93 // free the session file, for the other frames to be loaded
94 session_write_close();
96 /**
97 * the output compression library
99 require_once './libraries/ob.lib.php';
101 PMA_outBufferPre();
104 * selects the database if there is only one on current server
106 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
107 $GLOBALS['db'] = $GLOBALS['PMA_List_Database']->getSingleItem();
110 $db_start = $GLOBALS['db'];
113 * the relation library
115 require_once './libraries/relation.lib.php';
116 $cfgRelation = PMA_getRelationsParam();
119 * garvin: For re-usability, moved http-headers to a seperate file.
120 * It can now be included by libraries/header.inc.php, querywindow.php.
122 require_once './libraries/header_http.inc.php';
124 if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
125 $_SESSION['userconf']['navi_limit_offset'] = 0;
127 if (! isset($_SESSION['userconf']['table_limit_offset'])) {
128 $_SESSION['userconf']['table_limit_offset'] = 0;
130 if (isset($_REQUEST['pos'])) {
131 if (isset($_REQUEST['tpos'])) {
132 $_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos'];
134 else {
135 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
138 $pos = $_SESSION['userconf']['navi_limit_offset'];
139 $tpos = $_SESSION['userconf']['table_limit_offset'];
142 * Displays the frame
144 // xml declaration moves IE into quirks mode, making much trouble with CSS
145 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
147 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
148 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
149 <html xmlns="http://www.w3.org/1999/xhtml"
150 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
151 lang="<?php echo $available_languages[$lang][2]; ?>"
152 dir="<?php echo $GLOBALS['text_dir']; ?>">
154 <head>
155 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
156 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
157 <title>phpMyAdmin</title>
158 <meta http-equiv="Content-Type"
159 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
160 <base target="frame_content" />
161 <link rel="stylesheet" type="text/css"
162 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $_SESSION['PMA_Config']->getThemeUniqueValue(); ?>" />
163 <script type="text/javascript" src="js/navigation.js"></script>
164 <script type="text/javascript" src="js/functions.js"></script>
165 <script type="text/javascript">
166 // <![CDATA[
167 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
168 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
170 // INIT PMA_setFrameSize
171 var onloadCnt = 0;
172 var onLoadHandler = window.onload;
173 var resizeHandler = window.onresize;
174 window.document.onresize = resizeHandler;
175 window.onload = function() {
176 if (onloadCnt == 0) {
177 if (typeof(onLoadHandler) == "function") {
178 onLoadHandler();
180 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
181 PMA_setFrameSize();
183 onloadCnt++;
186 window.onresize = function() {
187 if (typeof(resizeHandler) == "function") {
188 resizeHandler();
190 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
191 PMA_saveFrameSize();
194 // ]]>
195 </script>
196 <?php
198 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
201 <!--[if IE 6]>
202 <style type="text/css">
203 /* <![CDATA[ */
204 html {
205 overflow-y: scroll;
207 /* ]]> */
208 </style>
209 <![endif]-->
210 </head>
212 <body id="body_leftFrame">
213 <?php
214 require './libraries/navigation_header.inc.php';
215 if (! $GLOBALS['server']) {
216 // no server selected
217 PMA_exitNavigationFrame();
218 } elseif (! $GLOBALS['PMA_List_Database']->count()) {
219 // no database available, so we break here
220 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
221 PMA_exitNavigationFrame();
222 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && $GLOBALS['PMA_List_Database']->count() > 1) {
223 $list = $cfg['DisplayDatabasesList'];
224 if ($list === 'auto') {
225 if (empty($GLOBALS['db'])) {
226 $list = true;
227 } else {
228 $list = false;
231 if (!$list) {
232 // more than one database available and LeftFrameLight is true
233 // display db selectbox
235 // Light mode -> beginning of the select combo for databases
236 // Note: When javascript is active, the frameset will be changed from
237 // within navigation.php. With no JS (<noscript>) the whole frameset will
238 // be rebuilt with the new target frame.
241 <div id="databaseList">
242 <form method="post" action="index.php" target="_parent" id="left">
243 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
244 <?php
245 echo PMA_generate_common_hidden_inputs() . "\n";
246 echo $GLOBALS['PMA_List_Database']->getHtmlSelectGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
247 echo '<noscript>' . "\n"
248 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
249 .'</noscript>' . "\n"
250 .'</form>' . "\n";
251 } else {
252 if (! empty($db)) {
253 echo '<div id="databaseList">' . "\n";
255 echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
257 $_url_params = array('pos' => $pos);
258 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
259 if (! empty($db)) {
260 echo '</div>' . "\n";
265 <div id="left_tableList">
266 <?php
267 // Don't display expansible/collapsible database info if:
268 // 1. $GLOBALS['server'] == 0 (no server selected)
269 // This is the case when there are multiple servers and
270 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
271 // screen to appear with no database info displayed.
272 // 2. there is only one database available (ie either only one database exists
273 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
274 // In this case, the database should not be collapsible/expandable
276 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
277 .' width="9" height="9" alt="+" />';
278 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
279 .' width="9" height="9" alt="-" />';
281 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
282 .' href="navigation.php?%s" target="_self">';
284 $element_counter = 0;
286 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
287 // show selected databasename as link to DefaultTabDatabase-page
288 // with table count in ()
289 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
291 $db_tooltip = '';
293 if ($GLOBALS['cfg']['ShowTooltip']
294 && $GLOBALS['cfgRelation']['commwork']) {
295 $_db_tooltip = PMA_getComments($GLOBALS['db']);
296 if (is_array($_db_tooltip)) {
297 $db_tooltip = implode(' ', $_db_tooltip);
301 $disp_name = $GLOBALS['db'];
302 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
303 $disp_name = $db_tooltip;
304 $disp_name_cut = $db_tooltip;
305 $db_tooltip = $GLOBALS['db'];
309 <p><a class="item"
310 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
311 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
312 <?php
313 if ($GLOBALS['text_dir'] === 'rtl') {
314 echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
316 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
317 if ($GLOBALS['text_dir'] === 'ltr') {
318 echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
320 echo '</a></p>';
323 * This helps reducing the navi panel size; in the right panel,
324 * user can find a navigator to page thru all tables.
327 $table_list = PMA_getTableList($GLOBALS['db'], null, $tpos, $cfg['MaxTableList']);
328 if (! empty($table_list)) {
329 $table_count = PMA_getTableCount($GLOBALS['db']);
330 // upper table list paginator
331 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
332 $_url_params = array(
333 'tpos' => 'true',
334 'pos' => $tpos,
335 'db' => $GLOBALS['db']
337 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
339 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
340 // lower table list paginator
341 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
342 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
344 } else {
345 echo $GLOBALS['strNoTablesFound'];
347 unset($table_list);
348 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
349 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
350 } else {
351 echo '<div id="databaseList">' . "\n";
352 $_url_params = array('pos' => $pos);
353 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
354 echo '</div>' . "\n";
356 $common_url_query = PMA_generate_common_url();
357 PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
361 * displays collapsable db list
363 * @uses $_REQUEST['dbgroup']
364 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
365 * @uses $GLOBALS['strSelectADb']
366 * @uses strpos()
367 * @uses urlencode()
368 * @uses printf()
369 * @uses htmlspecialchars()
370 * @uses PMA_generate_common_url()
371 * @uses PMA_getTableList()
372 * @uses PMA_displayTableList()
373 * @global $element_counter
374 * @global $img_minus
375 * @global $img_plus
376 * @global $href_left
377 * @global $db_start
378 * @global $common_url_query
379 * @param array $ext_dblist extended db list
380 * @param integer $offset
381 * @param integer $count
383 function PMA_displayDbList($ext_dblist, $offset, $count) {
384 global $element_counter, $img_minus, $img_plus, $href_left,
385 $db_start, $common_url_query;
387 // get table list, for all databases
388 // doing this in one step takes advantage of a single query with information_schema!
389 $tables_full = PMA_DBI_get_tables_full($GLOBALS['PMA_List_Database']->getLimitedItems($offset, $count));
391 $url_dbgroup = '';
392 echo '<ul id="leftdatabaselist">';
393 $close_db_group = false;
394 foreach ($ext_dblist as $group => $db_group) {
395 if ($GLOBALS['PMA_List_Database']->count() > 1) {
396 if ($close_db_group) {
397 $url_dbgroup = '';
398 echo '</ul>';
399 echo '</li>';
400 $close_db_group = false;
402 if (count($db_group) > 1) {
403 $close_db_group = true;
404 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
405 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
406 $element_counter++;
407 echo '<li class="dbgroup">';
408 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
409 || $db_start == $group || strpos($db_start, $group) === 0) {
410 // display + only if this db(group) is not preselected
411 printf($href_left, $element_counter, PMA_generate_common_url());
412 printf($img_minus, $element_counter);
413 } else {
414 printf($href_left, $element_counter, $common_url_query);
415 printf($img_plus, $element_counter);
417 echo '</a> ' . $group . "\n";
418 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
419 || $db_start == $group || strpos($db_start, $group) === 0) {
420 echo '<ul id="subel' . $element_counter . '">' . "\n";
421 } else {
422 echo '<ul id="subel' . $element_counter . '"'
423 .' style="display: none">' . "\n";
427 foreach ($db_group as $db) {
428 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
430 $element_counter++;
431 // Displays the database name
432 echo '<li>' . "\n";
434 if ($GLOBALS['PMA_List_Database']->count() > 1) {
435 // only with more than one db we need collapse ...
436 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
437 // display + only if this db is not preselected
438 // or table count is 0
439 printf($href_left, $element_counter, $common_url_query);
440 printf($img_plus, $element_counter);
441 } else {
442 printf($href_left, $element_counter,
443 PMA_generate_common_url() . $url_dbgroup);
444 printf($img_minus, $element_counter);
446 echo '</a>';
448 // ... and we need to refresh both frames on db selection
450 <a class="item"
451 id="<?php echo htmlspecialchars($db['name']); ?>"
452 href="index.php?<?php echo $common_url_query; ?>"
453 target="_parent"
454 title="<?php echo htmlspecialchars($db['comment']); ?>"
455 onclick="
456 if (! toggle('<?php echo $element_counter; ?>', true))
457 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
458 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
459 . '?' . $common_url_query; ?>', 'main');
460 return false;">
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
472 } else {
473 // with only 1 db available we dont need to refresh left frame
474 // on db selection, only phpmain
476 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
477 . '?' . $common_url_query; ?>"
478 id="<?php echo htmlspecialchars($db['name']); ?>"
479 title="<?php echo htmlspecialchars($db['comment']); ?>">
480 <?php
481 if ($GLOBALS['text_dir'] === 'rtl') {
482 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
484 echo htmlspecialchars($db['disp_name']);
485 if ($GLOBALS['text_dir'] === 'ltr') {
486 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
489 </a>
490 <?php
492 if ($db['num_tables']) {
493 if (isset($tables_full[$db['name']])) {
494 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
495 } elseif (isset($tables_full[strtolower($db['name'])])) {
496 // on windows with lower_case_table_names = 1
497 // MySQL returns
498 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
499 // but information_schema.TABLES gives `test`
500 // bug #1436171
501 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
502 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
503 } else {
504 $tables = PMA_getTableList($db['name']);
506 $child_visible =
507 (bool) ($GLOBALS['PMA_List_Database']->count() === 1 || $db_start == $db['name']);
508 PMA_displayTableList($tables, $child_visible, '', $db['name']);
509 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
510 // no tables and LeftFrameLight:
511 // display message no tables in selected db
512 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
514 echo '</li>' . "\n";
515 } // end foreach db
516 } // end foreach group
518 if ($close_db_group) {
519 $url_dbgroup = '';
520 echo '</ul>';
521 echo '</li>';
522 $close_db_group = false;
525 echo '</ul>' . "\n";
529 * display unordered list of tables
530 * calls itself recursively if table in given list
531 * is a list itself
533 * @uses is_array()
534 * @uses count()
535 * @uses urlencode()
536 * @uses strpos()
537 * @uses printf()
538 * @uses htmlspecialchars()
539 * @uses strlen()
540 * @uses is_array()
541 * @uses PMA_displayTableList()
542 * @uses $_REQUEST['tbl_group']
543 * @uses $GLOBALS['common_url_query']
544 * @uses $GLOBALS['table']
545 * @uses $GLOBALS['pmaThemeImage']
546 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
547 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
548 * @uses $GLOBALS['cfg']['DefaultTabTable']
549 * @uses $GLOBALS['strRows']
550 * @uses $GLOBALS['strBrowse']
551 * @global integer the element counter
552 * @global string html code for '-' image
553 * @global string html code for '+' image
554 * @global string html code for self link
555 * @param array $tables array of tables/tablegroups
556 * @param boolean $visible wether the list is visible or not
557 * @param string $tab_group_full full tab group name
558 * @param string $table_db db of this table
560 function PMA_displayTableList($tables, $visible = false,
561 $tab_group_full = '', $table_db = '')
563 if (! is_array($tables) || count($tables) === 0) {
564 return;
567 global $element_counter, $img_minus, $img_plus, $href_left;
568 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
570 if ($visible) {
571 echo '<ul id="subel' . $element_counter . '">';
572 } else {
573 echo '<ul id="subel' . $element_counter . '" style="display: none">';
575 foreach ($tables as $group => $table) {
576 if (isset($table['is' . $sep . 'group'])) {
577 $common_url_query = $GLOBALS['common_url_query']
578 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
580 $element_counter++;
581 echo '<li>' . "\n";
582 if ($visible
583 && ((isset($_REQUEST['tbl_group'])
584 && (strpos($_REQUEST['tbl_group'], $group) === 0
585 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
586 || strpos($GLOBALS['table'], $group) === 0)) {
587 printf($href_left, $element_counter,
588 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
589 printf($img_minus, $element_counter);
590 } else {
591 printf($href_left, $element_counter, $common_url_query);
592 printf($img_plus, $element_counter);
594 echo '</a>';
596 <a href="index.php?<?php echo $common_url_query; ?>"
597 target="_parent"
598 onclick="
599 if (! toggle('<?php echo $element_counter; ?>', true))
600 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
601 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
602 . '?' . $common_url_query; ?>', 'main');
603 return false;">
604 <?php
605 if ($GLOBALS['text_dir'] === 'rtl') {
606 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
608 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
609 if ($GLOBALS['text_dir'] === 'ltr') {
610 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
613 </a>
614 <?php
616 unset($table['is' . $sep . 'group']);
617 unset($table['tab' . $sep . 'group']);
618 unset($table['tab' . $sep . 'count']);
620 if ($visible &&
621 ((isset($_REQUEST['tbl_group'])
622 && (strpos($_REQUEST['tbl_group'], $group) === 0
623 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
624 || strpos($GLOBALS['table'], $group) === 0)) {
625 PMA_displayTableList($table, true,
626 $tab_group_full . $group, $table_db);
627 } else {
628 PMA_displayTableList($table, false, '', $table_db);
630 echo '</li>' . "\n";
631 } elseif (is_array($table)) {
632 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
633 .$GLOBALS['common_url_query'] . '&amp;table='
634 .urlencode($table['Name']);
635 echo '<li>' . "\n";
636 echo '<a title="' . $GLOBALS['strBrowse'] . ': '
637 . htmlspecialchars($table['Comment'])
638 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
639 .' id="browse_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
640 .' href="sql.php?' . $GLOBALS['common_url_query']
641 .'&amp;table=' . urlencode($table['Name'])
642 .'&amp;goto=' . $GLOBALS['cfg']['DefaultTabTable']
643 . '" >'
644 .'<img class="icon"';
645 if ('VIEW' === strtoupper($table['Comment'])) {
646 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
647 } else {
648 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
650 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
651 .' width="10" height="10" alt="' . $GLOBALS['strBrowse'] . '" /></a>' . "\n"
652 .'<a href="' . $href . '" title="' . htmlspecialchars($table['Comment']
653 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
654 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
655 // preserve spaces in table name
656 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
657 echo '</li>' . "\n";
660 echo '</ul>';
663 echo '</div>' . "\n";
665 PMA_exitNavigationFrame();