Translation update done using Pootle.
[phpmyadmin/crack.git] / navigation.php
blob17cb587094d9fbe74b604601bd6a396cbe640092
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 $params = array('uniqid' => uniqid());
53 if (!empty($GLOBALS['db'])) {
54 $params['db'] = $GLOBALS['db'];
56 echo '<div id="reloadlink">' . "\n";
57 echo '<a href="navigation.php' . PMA_generate_common_url($params) . '" target="frame_navigation">';
58 if ($GLOBALS['cfg']['NavigationBarIconic']) {
59 echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 's_reload.png"'
60 . ' title="' . __('Reload navigation frame') . '"'
61 . ' alt="' . __('Reload navigation frame') . '" />';
63 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
64 echo __('Reload navigation frame');
66 echo '</a>';
67 echo '</div>' . "\n";
68 echo '</body></html>';
69 exit;
72 // keep the offset of the db list in session before closing it
73 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
74 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
76 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
77 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
78 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
80 if (isset($_REQUEST['pos'])) {
81 if (isset($_REQUEST['tpos'])) {
82 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
84 else {
85 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
88 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
89 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
90 // free the session file, for the other frames to be loaded
91 // but only if debugging is not enabled
92 if (empty($_SESSION['debug'])) {
93 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']->databases->getSingleItem();
110 $db_start = $GLOBALS['db'];
113 * the relation library
115 require_once './libraries/relation.lib.php';
116 $cfgRelation = PMA_getRelationsParam();
119 * 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';
125 * Displays the frame
127 // xml declaration moves IE into quirks mode, making much trouble with CSS
128 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
130 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
131 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
132 <html xmlns="http://www.w3.org/1999/xhtml"
133 xml:lang="<?php echo $available_languages[$lang][1]; ?>"
134 lang="<?php echo $available_languages[$lang][1]; ?>"
135 dir="<?php echo $GLOBALS['text_dir']; ?>">
137 <head>
138 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
139 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
140 <title>phpMyAdmin</title>
141 <meta http-equiv="Content-Type"
142 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
143 <base target="frame_content" />
144 <link rel="stylesheet" type="text/css"
145 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
146 <script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
147 <script type="text/javascript" src="js/navigation.js"></script>
148 <script type="text/javascript" src="js/functions.js"></script>
149 <script type="text/javascript">
150 // <![CDATA[
151 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
152 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
154 // INIT PMA_setFrameSize
155 var onloadCnt = 0;
156 var onLoadHandler = window.onload;
157 var resizeHandler = window.onresize;
158 window.document.onresize = resizeHandler;
159 window.onload = function() {
160 if (onloadCnt == 0) {
161 if (typeof(onLoadHandler) == "function") {
162 onLoadHandler();
164 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
165 PMA_setFrameSize();
167 onloadCnt++;
170 window.onresize = function() {
171 if (typeof(resizeHandler) == "function") {
172 resizeHandler();
174 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
175 PMA_saveFrameSize();
178 // ]]>
179 </script>
180 <?php
182 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
185 <!--[if IE 6]>
186 <style type="text/css">
187 /* <![CDATA[ */
188 html {
189 overflow-y: scroll;
191 /* ]]> */
192 </style>
193 <![endif]-->
194 </head>
196 <body id="body_leftFrame">
197 <?php
198 require './libraries/navigation_header.inc.php';
199 if (! $GLOBALS['server']) {
200 // no server selected
201 PMA_exitNavigationFrame();
202 } elseif (! count($GLOBALS['pma']->databases)) {
203 // no database available, so we break here
204 echo '<p>' . __('No databases') . '</p>';
205 PMA_exitNavigationFrame();
206 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
207 $list = $cfg['DisplayDatabasesList'];
208 if ($list === 'auto') {
209 if (empty($GLOBALS['db'])) {
210 $list = true;
211 } else {
212 $list = false;
215 if (!$list) {
216 // more than one database available and LeftFrameLight is true
217 // display db selectbox
219 // Light mode -> beginning of the select combo for databases
220 // Note: When javascript is active, the frameset will be changed from
221 // within navigation.php. With no JS (<noscript>) the whole frameset will
222 // be rebuilt with the new target frame.
225 <div id="databaseList">
226 <form method="post" action="index.php" target="_parent" id="left">
227 <?php
228 echo PMA_generate_common_hidden_inputs() . "\n";
229 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
230 echo '<noscript>' . "\n"
231 .'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
232 .'</noscript>' . "\n"
233 .'</form>' . "\n";
234 } else {
235 if (! empty($db)) {
236 echo '<div id="databaseList">' . "\n";
238 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
240 $_url_params = array('pos' => $pos);
241 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
242 if (! empty($db)) {
243 echo '</div>' . "\n";
248 <div id="left_tableList">
249 <?php
250 // Don't display expansible/collapsible database info if:
251 // 1. $GLOBALS['server'] == 0 (no server selected)
252 // This is the case when there are multiple servers and
253 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
254 // screen to appear with no database info displayed.
255 // 2. there is only one database available (ie either only one database exists
256 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
257 // In this case, the database should not be collapsible/expandable
259 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
260 .' width="9" height="9" alt="+" />';
261 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
262 .' width="9" height="9" alt="-" />';
264 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
265 .' href="navigation.php?%s" target="_self">';
267 $element_counter = 0;
270 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
271 $table_list = PMA_getTableList($GLOBALS['db']);
272 $table_count = count($table_list);
274 // show selected databasename as link to DefaultTabDatabase-page
275 // with table count in ()
276 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
278 $db_tooltip = '';
280 if ($GLOBALS['cfg']['ShowTooltip']
281 && $GLOBALS['cfgRelation']['commwork']) {
282 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
283 if ($_db_tooltip) {
284 $db_tooltip = $_db_tooltip;
288 $disp_name = $GLOBALS['db'];
289 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
290 $disp_name = $db_tooltip;
291 $disp_name_cut = $db_tooltip;
292 $db_tooltip = $GLOBALS['db'];
295 if ($table_count) {
297 <span id="NavFilter">
298 <input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" />
299 <span id="clear_fast_filter" title="<?php echo __('Clear'); ?>">X</span>
300 </span>
301 <?php
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 __('No tables found in database.');
328 unset($table_list);
329 echo '<ul id="newtable"><li><a target="frame_content" href="tbl_create.php' . PMA_generate_common_url(array('db' => $GLOBALS['db'])) . '">'
330 .'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_snewtbl.png" id="icon_newtable" width="10" height="10" alt="' . _pgettext('short form', 'Create table') . '" />'
331 . _pgettext('short form', 'Create table') . '</a></li></ul>';
332 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
333 echo '<p>' . __('Please select a database') . '</p>';
334 } else {
335 echo '<div id="databaseList">' . "\n";
336 $_url_params = array('pos' => $pos);
337 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
338 echo '</div>' . "\n";
340 $common_url_query = PMA_generate_common_url();
341 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']);
345 * displays collapsable db list
347 * @uses $_REQUEST['dbgroup']
348 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
349 * @uses strpos()
350 * @uses urlencode()
351 * @uses printf()
352 * @uses htmlspecialchars()
353 * @uses PMA_generate_common_url()
354 * @uses PMA_getTableList()
355 * @uses PMA_displayTableList()
356 * @global integer $element_counter
357 * @global string $img_minus
358 * @global string $img_plus
359 * @global string $href_left
360 * @global string $db_start
361 * @global string $common_url_query
362 * @param array $ext_dblist extended db list
363 * @param integer $offset
364 * @param integer $count
366 function PMA_displayDbList($ext_dblist, $offset, $count) {
367 global $element_counter, $img_minus, $img_plus, $href_left,
368 $db_start, $common_url_query;
370 // get table list, for all databases
371 // doing this in one step takes advantage of a single query with information_schema!
372 $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));
374 $url_dbgroup = '';
375 echo '<ul id="leftdatabaselist">';
376 $close_db_group = false;
377 foreach ($ext_dblist as $group => $db_group) {
378 if (count($GLOBALS['pma']->databases) > 1) {
379 if ($close_db_group) {
380 $url_dbgroup = '';
381 echo '</ul>';
382 echo '</li>';
383 $close_db_group = false;
385 if (count($db_group) > 1) {
386 $close_db_group = true;
387 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
388 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
389 $element_counter++;
390 echo '<li class="dbgroup">';
391 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
392 || $db_start == $group || strpos($db_start, $group) === 0) {
393 // display + only if this db(group) is not preselected
394 printf($href_left, $element_counter, PMA_generate_common_url());
395 printf($img_minus, $element_counter);
396 } else {
397 printf($href_left, $element_counter, $common_url_query);
398 printf($img_plus, $element_counter);
400 echo '</a> ' . $group . "\n";
401 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
402 || $db_start == $group || strpos($db_start, $group) === 0) {
403 echo '<ul id="subel' . $element_counter . '">' . "\n";
404 } else {
405 echo '<ul id="subel' . $element_counter . '"'
406 .' style="display: none">' . "\n";
410 foreach ($db_group as $db) {
411 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
413 $element_counter++;
414 // Displays the database name
415 echo '<li>' . "\n";
417 if (count($GLOBALS['pma']->databases) > 1) {
418 // only with more than one db we need collapse ...
419 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
420 // display + only if this db is not preselected
421 // or table count is 0
422 printf($href_left, $element_counter, $common_url_query);
423 printf($img_plus, $element_counter);
424 } else {
425 printf($href_left, $element_counter,
426 PMA_generate_common_url() . $url_dbgroup);
427 printf($img_minus, $element_counter);
429 echo '</a>';
431 // ... and we need to refresh both frames on db selection
433 <a class="item"
434 id="<?php echo htmlspecialchars($db['name']); ?>"
435 href="index.php?<?php echo $common_url_query; ?>"
436 target="_parent"
437 title="<?php echo htmlspecialchars($db['comment']); ?>"
438 onclick="
439 if (! toggle('<?php echo $element_counter; ?>', true))
440 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
441 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
442 . '?' . $common_url_query; ?>', 'main');
443 return false;">
444 <?php
445 if ($GLOBALS['text_dir'] === 'rtl') {
446 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
448 echo htmlspecialchars($db['disp_name']);
449 if ($GLOBALS['text_dir'] === 'ltr') {
450 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
453 </a>
454 <?php
455 } else {
456 // with only 1 db available we dont need to refresh left frame
457 // on db selection, only phpmain
459 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
460 . '?' . $common_url_query; ?>"
461 id="<?php echo htmlspecialchars($db['name']); ?>"
462 title="<?php echo htmlspecialchars($db['comment']); ?>">
463 <?php
464 if ($GLOBALS['text_dir'] === 'rtl') {
465 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
467 echo htmlspecialchars($db['disp_name']);
468 if ($GLOBALS['text_dir'] === 'ltr') {
469 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
472 </a>
473 <?php
475 if ($db['num_tables']) {
476 if (isset($tables_full[$db['name']])) {
477 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
478 } elseif (isset($tables_full[strtolower($db['name'])])) {
479 // on windows with lower_case_table_names = 1
480 // MySQL returns
481 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
482 // but information_schema.TABLES gives `test`
483 // bug #1436171
484 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
485 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
486 } else {
487 $tables = PMA_getTableList($db['name']);
489 $child_visible =
490 (bool) (count($GLOBALS['pma']->databases) === 1 || $db_start == $db['name']);
491 PMA_displayTableList($tables, $child_visible, '', $db['name']);
492 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
493 // no tables and LeftFrameLight:
494 // display message no tables in selected db
495 echo '<p>' . __('Please select a database') . '</p>' . "\n";
497 echo '</li>' . "\n";
498 } // end foreach db
499 } // end foreach group
501 if ($close_db_group) {
502 $url_dbgroup = '';
503 echo '</ul>';
504 echo '</li>';
505 $close_db_group = false;
508 echo '</ul>' . "\n";
512 * display unordered list of tables
513 * calls itself recursively if table in given list
514 * is a list itself
516 * @uses is_array()
517 * @uses count()
518 * @uses urlencode()
519 * @uses strpos()
520 * @uses printf()
521 * @uses htmlspecialchars()
522 * @uses strlen()
523 * @uses is_array()
524 * @uses PMA_displayTableList()
525 * @uses $_REQUEST['tbl_group']
526 * @uses $GLOBALS['common_url_query']
527 * @uses $GLOBALS['table']
528 * @uses $GLOBALS['pmaThemeImage']
529 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
530 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
531 * @uses $GLOBALS['cfg']['DefaultTabTable']
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 class="tableicon" title="'
627 . htmlspecialchars($link_title)
628 . ': ' . htmlspecialchars($table['Comment'])
629 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . __('Rows') . ')"'
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) . ' ' . __('Rows')) . ')"'
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();