Translation update done using Pootle.
[phpmyadmin/sankalp_k.git] / navigation.php
blob167c060d3d6f3d219079ee051e9061f0fee885f8
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 * @package phpMyAdmin
7 * @uses $GLOBALS['pma']->databases
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['cfg']['LeftFrameLight']
17 * @uses $GLOBALS['cfg']['ShowTooltip']
18 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
19 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
20 * @uses $GLOBALS['cfgRelation']['commwork']) {
21 * @uses PMA_List_Database::getSingleItem()
22 * @uses PMA_List_Database::getHtmlSelectGrouped()
23 * @uses PMA_List_Database::getGroupedDetails()
24 * @uses PMA_generate_common_url()
25 * @uses PMA_generate_common_hidden_inputs()
26 * @uses PMA_getDbComment();
27 * @uses PMA_getTableCount()
28 * @uses PMA_getTableList()
29 * @uses PMA_getRelationsParam()
30 * @uses PMA_outBufferPre()
31 * @uses strlen()
32 * @uses session_write_close()
33 * @uses is_array()
34 * @uses implode()
35 * @uses htmlspecialchars()
38 /**
39 * Gets a core script and starts output buffering work
41 require_once './libraries/common.inc.php';
43 /**
44 * finish and cleanup navigation.php script execution, only to be used in navigation.php
46 * @uses $GLOBALS['controllink'] to close it
47 * @uses $GLOBALS['userlink'] to close it
48 * @access private
50 function PMA_exitNavigationFrame()
52 echo '</body></html>';
53 exit;
56 // keep the offset of the db list in session before closing it
57 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
58 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
60 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
61 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
62 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
64 if (isset($_REQUEST['pos'])) {
65 if (isset($_REQUEST['tpos'])) {
66 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
68 else {
69 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
72 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
73 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
74 // free the session file, for the other frames to be loaded
75 // but only if debugging is not enabled
76 if (empty($_SESSION['debug'])) {
77 session_write_close();
80 /**
81 * the output compression library
83 require_once './libraries/ob.lib.php';
85 PMA_outBufferPre();
88 * selects the database if there is only one on current server
90 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
91 $GLOBALS['db'] = $GLOBALS['pma']->databases->getSingleItem();
94 $db_start = $GLOBALS['db'];
96 /**
97 * the relation settings
99 $cfgRelation = PMA_getRelationsParam();
102 * For re-usability, moved http-headers to a seperate file.
103 * It can now be included by libraries/header.inc.php, querywindow.php.
105 require_once './libraries/header_http.inc.php';
108 * Displays the frame
110 // xml declaration moves IE into quirks mode, making much trouble with CSS
111 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
113 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
114 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
115 <html xmlns="http://www.w3.org/1999/xhtml"
116 xml:lang="<?php echo $available_languages[$lang][1]; ?>"
117 lang="<?php echo $available_languages[$lang][1]; ?>"
118 dir="<?php echo $GLOBALS['text_dir']; ?>">
120 <head>
121 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
122 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
123 <title>phpMyAdmin</title>
124 <meta http-equiv="Content-Type"
125 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
126 <base target="frame_content" />
127 <link rel="stylesheet" type="text/css"
128 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
129 <script src="./js/jquery/jquery-1.4.4.js" type="text/javascript"></script>
130 <script type="text/javascript" src="js/navigation.js"></script>
131 <script type="text/javascript" src="js/functions.js"></script>
132 <script type="text/javascript">
133 // <![CDATA[
134 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
135 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
137 // INIT PMA_setFrameSize
138 var onloadCnt = 0;
139 var onLoadHandler = window.onload;
140 var resizeHandler = window.onresize;
141 window.document.onresize = resizeHandler;
142 window.onload = function() {
143 if (onloadCnt == 0) {
144 if (typeof(onLoadHandler) == "function") {
145 onLoadHandler();
147 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
148 PMA_setFrameSize();
150 onloadCnt++;
153 window.onresize = function() {
154 if (typeof(resizeHandler) == "function") {
155 resizeHandler();
157 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
158 PMA_saveFrameSize();
161 // ]]>
162 </script>
163 <?php
165 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
168 <!--[if IE 6]>
169 <style type="text/css">
170 /* <![CDATA[ */
171 html {
172 overflow-y: scroll;
174 /* ]]> */
175 </style>
176 <![endif]-->
177 </head>
179 <body id="body_leftFrame">
180 <?php
181 require './libraries/navigation_header.inc.php';
182 if (! $GLOBALS['server']) {
183 // no server selected
184 PMA_exitNavigationFrame();
185 } elseif (! count($GLOBALS['pma']->databases)) {
186 // no database available, so we break here
187 echo '<p>' . __('No databases') . '</p>';
188 PMA_exitNavigationFrame();
189 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
190 $list = $cfg['DisplayDatabasesList'];
191 if ($list === 'auto') {
192 if (empty($GLOBALS['db'])) {
193 $list = true;
194 } else {
195 $list = false;
198 if (!$list) {
199 // more than one database available and LeftFrameLight is true
200 // display db selectbox
202 // Light mode -> beginning of the select combo for databases
203 // Note: When javascript is active, the frameset will be changed from
204 // within navigation.php. With no JS (<noscript>) the whole frameset will
205 // be rebuilt with the new target frame.
208 <div id="databaseList">
209 <form method="post" action="index.php" target="_parent" id="left">
210 <?php
211 echo PMA_generate_common_hidden_inputs() . "\n";
212 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
213 echo '<noscript>' . "\n"
214 .'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
215 .'</noscript>' . "\n"
216 .'</form>' . "\n"
217 . '</div>' . "\n";
218 } else {
219 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
221 $_url_params = array('pos' => $pos);
222 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
226 <div id="left_tableList">
227 <?php
228 // Don't display expansible/collapsible database info if:
229 // 1. $GLOBALS['server'] == 0 (no server selected)
230 // This is the case when there are multiple servers and
231 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
232 // screen to appear with no database info displayed.
233 // 2. there is only one database available (ie either only one database exists
234 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
235 // In this case, the database should not be collapsible/expandable
237 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
238 .' alt="+" />';
239 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
240 .' alt="-" />';
242 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
243 .' href="navigation.php?%s" target="_self">';
245 $element_counter = 0;
248 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
249 $table_list = PMA_getTableList($GLOBALS['db']);
250 $table_count = count($table_list);
252 // show selected databasename as link to DefaultTabDatabase-page
253 // with table count in ()
254 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
256 $db_tooltip = '';
258 if ($GLOBALS['cfg']['ShowTooltip']
259 && $GLOBALS['cfgRelation']['commwork']) {
260 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
261 if ($_db_tooltip) {
262 $db_tooltip = $_db_tooltip;
266 $disp_name = $GLOBALS['db'];
267 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
268 $disp_name = $db_tooltip;
269 $disp_name_cut = $db_tooltip;
270 $db_tooltip = $GLOBALS['db'];
273 if ($table_count >= $GLOBALS['cfg']['LeftDisplayTableFilterMinimum']) {
275 <span id="NavFilter">
276 <span id="clear_fast_filter" title="<?php echo __('Clear'); ?>">X</span>
277 <input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" value="<?php echo __('filter tables by name'); ?>" />
278 </span>
279 <?php
283 * This helps reducing the navi panel size; in the right panel,
284 * user can find a navigator to page thru all tables.
287 $table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
288 if (! empty($table_list)) {
289 // upper table list paginator
290 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
291 $_url_params = array(
292 'tpos' => 'true',
293 'pos' => $tpos,
294 'db' => $GLOBALS['db']
296 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
298 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
299 // lower table list paginator
300 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
301 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
303 } else {
304 echo __('No tables found in database.');
306 unset($table_list);
307 if ($db != 'information_schema') {
308 echo '<ul id="newtable"><li><a target="frame_content" href="tbl_create.php' . PMA_generate_common_url(array('db' => $GLOBALS['db'])) . '">'
309 .'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_snewtbl.png" id="icon_newtable" alt="' . _pgettext('short form', 'Create table') . '" />'
310 . _pgettext('short form', 'Create table') . '</a></li></ul>';
312 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
313 /* No need to tell user to select database if we're showing complete list */
314 if (!$list) {
315 echo '<p>' . __('Please select a database') . '</p>';
317 } else {
318 echo '<div id="databaseList">' . "\n";
319 $_url_params = array('pos' => $pos);
320 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
321 echo '</div>' . "\n";
323 $common_url_query = PMA_generate_common_url();
324 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']);
328 * displays collapsable db list
330 * @uses $_REQUEST['dbgroup']
331 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
332 * @uses strpos()
333 * @uses urlencode()
334 * @uses printf()
335 * @uses htmlspecialchars()
336 * @uses PMA_generate_common_url()
337 * @uses PMA_getTableList()
338 * @uses PMA_displayTableList()
339 * @global integer $element_counter
340 * @global string $img_minus
341 * @global string $img_plus
342 * @global string $href_left
343 * @global string $db_start
344 * @global string $common_url_query
345 * @param array $ext_dblist extended db list
346 * @param integer $offset
347 * @param integer $count
349 function PMA_displayDbList($ext_dblist, $offset, $count) {
350 global $element_counter, $img_minus, $img_plus, $href_left,
351 $db_start, $common_url_query;
353 // get table list, for all databases
354 // doing this in one step takes advantage of a single query with information_schema!
355 $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));
357 $url_dbgroup = '';
358 echo '<ul id="leftdatabaselist">';
359 $close_db_group = false;
360 foreach ($ext_dblist as $group => $db_group) {
361 if (count($GLOBALS['pma']->databases) > 1) {
362 if ($close_db_group) {
363 $url_dbgroup = '';
364 echo '</ul>';
365 echo '</li>';
366 $close_db_group = false;
368 if (count($db_group) > 1) {
369 $close_db_group = true;
370 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
371 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
372 $element_counter++;
373 echo '<li class="dbgroup">';
374 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
375 || $db_start == $group || strpos($db_start, $group) === 0) {
376 // display + only if this db(group) is not preselected
377 printf($href_left, $element_counter, PMA_generate_common_url());
378 printf($img_minus, $element_counter);
379 } else {
380 printf($href_left, $element_counter, $common_url_query);
381 printf($img_plus, $element_counter);
383 echo '</a> ' . $group . "\n";
384 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
385 || $db_start == $group || strpos($db_start, $group) === 0) {
386 echo '<ul id="subel' . $element_counter . '">' . "\n";
387 } else {
388 echo '<ul id="subel' . $element_counter . '"'
389 .' style="display: none">' . "\n";
393 foreach ($db_group as $db) {
394 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
396 $element_counter++;
397 // Displays the database name
398 echo '<li>' . "\n";
400 if (count($GLOBALS['pma']->databases) > 1) {
401 // only with more than one db we need collapse ...
402 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
403 // display + only if this db is not preselected
404 // or table count is 0
405 printf($href_left, $element_counter, $common_url_query);
406 printf($img_plus, $element_counter);
407 } else {
408 printf($href_left, $element_counter,
409 PMA_generate_common_url() . $url_dbgroup);
410 printf($img_minus, $element_counter);
412 echo '</a>';
414 // ... and we need to refresh both frames on db selection
416 <a class="item"
417 id="<?php echo htmlspecialchars($db['name']); ?>"
418 href="index.php?<?php echo $common_url_query; ?>"
419 target="_parent"
420 title="<?php echo htmlspecialchars($db['comment']); ?>"
421 onclick="
422 if (! toggle('<?php echo $element_counter; ?>', true))
423 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
424 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
425 . '?' . $common_url_query; ?>', 'main');
426 return false;">
427 <?php
428 // Might be unset if CountTables directive is false
429 if (isset($db['num_tables'])) {
430 if ($GLOBALS['text_dir'] === 'rtl') {
431 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
434 echo htmlspecialchars($db['disp_name']);
435 if (isset($db['num_tables'])) {
436 if ($GLOBALS['text_dir'] === 'ltr') {
437 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
441 </a>
442 <?php
443 } else {
444 // with only 1 db available we dont need to refresh navi frame
445 // on db selection, only phpmain
447 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
448 . '?' . $common_url_query; ?>"
449 id="<?php echo htmlspecialchars($db['name']); ?>"
450 title="<?php echo htmlspecialchars($db['comment']); ?>">
451 <?php
452 if (isset($db['num_tables'])) {
453 if ($GLOBALS['text_dir'] === 'rtl') {
454 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
457 echo htmlspecialchars($db['disp_name']);
458 if (isset($db['num_tables'])) {
459 if ($GLOBALS['text_dir'] === 'ltr') {
460 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
464 </a>
465 <?php
467 if (($GLOBALS['cfg']['Server']['CountTables'] === false) || $db['num_tables']) {
468 if (isset($tables_full[$db['name']])) {
469 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
470 } elseif (isset($tables_full[strtolower($db['name'])])) {
471 // on windows with lower_case_table_names = 1
472 // MySQL returns
473 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
474 // but information_schema.TABLES gives `test`
475 // bug #1436171
476 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
477 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
478 } else {
479 $tables = PMA_getTableList($db['name']);
481 $child_visible =
482 (bool) (count($GLOBALS['pma']->databases) === 1 || $db_start == $db['name']);
483 PMA_displayTableList($tables, $child_visible, '', $db['name']);
484 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
485 // no tables and LeftFrameLight:
486 // display message no tables in selected db
487 echo '<p>' . __('Please select a database') . '</p>' . "\n";
489 echo '</li>' . "\n";
490 } // end foreach db
491 } // end foreach group
493 if ($close_db_group) {
494 $url_dbgroup = '';
495 echo '</ul>';
496 echo '</li>';
497 $close_db_group = false;
500 echo '</ul>' . "\n";
504 * display unordered list of tables
505 * calls itself recursively if table in given list
506 * is a list itself
508 * @uses is_array()
509 * @uses count()
510 * @uses urlencode()
511 * @uses strpos()
512 * @uses printf()
513 * @uses htmlspecialchars()
514 * @uses strlen()
515 * @uses is_array()
516 * @uses PMA_displayTableList()
517 * @uses $_REQUEST['tbl_group']
518 * @uses $GLOBALS['common_url_query']
519 * @uses $GLOBALS['table']
520 * @uses $GLOBALS['pmaThemeImage']
521 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
522 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
523 * @uses $GLOBALS['cfg']['DefaultTabTable']
524 * @global integer the element counter
525 * @global string html code for '-' image
526 * @global string html code for '+' image
527 * @global string html code for self link
528 * @param array $tables array of tables/tablegroups
529 * @param boolean $visible whether the list is visible or not
530 * @param string $tab_group_full full tab group name
531 * @param string $table_db db of this table
533 function PMA_displayTableList($tables, $visible = false,
534 $tab_group_full = '', $table_db = '')
536 if (! is_array($tables) || count($tables) === 0) {
537 return;
540 global $element_counter, $img_minus, $img_plus, $href_left;
541 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
543 if ($visible) {
544 echo '<ul id="subel' . $element_counter . '">';
545 } else {
546 echo '<ul id="subel' . $element_counter . '" style="display: none">';
548 foreach ($tables as $group => $table) {
549 // only allow grouping if the group has more than 1 table
550 if (isset($table['is' . $sep . 'group']) && $table['tab' . $sep . 'count'] > 1) {
551 $common_url_query = $GLOBALS['common_url_query']
552 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
554 $element_counter++;
555 echo '<li>' . "\n";
556 if ($visible
557 && ((isset($_REQUEST['tbl_group'])
558 && (strpos($_REQUEST['tbl_group'], $group) === 0
559 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
560 || strpos($GLOBALS['table'], $group) === 0)) {
561 printf($href_left, $element_counter,
562 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
563 printf($img_minus, $element_counter);
564 } else {
565 printf($href_left, $element_counter, $common_url_query);
566 printf($img_plus, $element_counter);
568 echo '</a>';
570 <a href="index.php?<?php echo $common_url_query; ?>"
571 target="_parent"
572 onclick="
573 if (! toggle('<?php echo $element_counter; ?>', true))
574 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
575 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
576 . '?' . $common_url_query; ?>', 'main');
577 return false;">
578 <?php
579 if ($GLOBALS['text_dir'] === 'rtl') {
580 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
582 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
583 if ($GLOBALS['text_dir'] === 'ltr') {
584 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
587 </a>
588 <?php
590 unset($table['is' . $sep . 'group']);
591 unset($table['tab' . $sep . 'group']);
592 unset($table['tab' . $sep . 'count']);
594 if ($visible &&
595 ((isset($_REQUEST['tbl_group'])
596 && (strpos($_REQUEST['tbl_group'], $group) === 0
597 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
598 || strpos($GLOBALS['table'], $group) === 0)) {
599 PMA_displayTableList($table, true,
600 $tab_group_full . $group, $table_db);
601 } else {
602 PMA_displayTableList($table, false, '', $table_db);
604 echo '</li>' . "\n";
605 } elseif (is_array($table)) {
606 // the table was not grouped because it is the only one with its prefix
607 while (isset($table['is' . $sep . 'group'])) {
608 // get the array with the actual table information
609 foreach ($table as $value) {
610 if(is_array($value)) {
611 $table = $value;
615 $link_title = PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']);
616 // quick access icon next to each table name
617 echo '<li>' . "\n";
618 echo '<a class="tableicon" title="'
619 . htmlspecialchars($link_title)
620 . ': ' . htmlspecialchars($table['Comment'])
621 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . __('Rows') . ')"'
622 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
623 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
624 . $GLOBALS['common_url_query']
625 .'&amp;table=' . urlencode($table['Name'])
626 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
627 . '" >'
628 .'<img class="icon"';
629 if ('VIEW' === strtoupper($table['Comment'])) {
630 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
631 } else {
632 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
634 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
635 .' alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
637 // link for the table name itself
638 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
639 .$GLOBALS['common_url_query'] . '&amp;table='
640 .urlencode($table['Name']) . '&amp;pos=0';
641 echo '<a href="' . $href
642 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
643 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . __('Rows')) . ')"'
644 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
645 // preserve spaces in table name
646 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
647 echo '</li>' . "\n";
650 echo '</ul>';
653 echo '</div>' . "\n";
655 PMA_exitNavigationFrame();