Cleanup of po files.
[phpmyadmin/dkf.git] / navigation.php
blobcd171e73f8e37c2584092c17da29e9d55d575021
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['strNoDatabases']
18 * @uses $GLOBALS['strDatabase']
19 * @uses $GLOBALS['strGo']
20 * @uses $GLOBALS['strSelectADb']
21 * @uses $GLOBALS['strNoTablesFound']
22 * @uses $GLOBALS['cfg']['LeftFrameLight']
23 * @uses $GLOBALS['cfg']['ShowTooltip']
24 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
25 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
26 * @uses $GLOBALS['cfgRelation']['commwork']) {
27 * @uses PMA_List_Database::getSingleItem()
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_getDbComment();
33 * @uses PMA_getTableCount()
34 * @uses PMA_getTableList()
35 * @uses PMA_getRelationsParam()
36 * @uses PMA_outBufferPre()
37 * @uses strlen()
38 * @uses session_write_close()
39 * @uses is_array()
40 * @uses implode()
41 * @uses htmlspecialchars()
44 /**
45 * Gets a core script and starts output buffering work
47 require_once './libraries/common.inc.php';
49 /**
50 * finish and cleanup navigation.php script execution, only to be used in navigation.php
52 * @uses $GLOBALS['controllink'] to close it
53 * @uses $GLOBALS['userlink'] to close it
54 * @access private
56 function PMA_exitNavigationFrame()
58 $params = array('uniqid' => uniqid());
59 if (!empty($GLOBALS['db'])) {
60 $params['db'] = $GLOBALS['db'];
62 echo '<div id="reloadlink">' . "\n";
63 echo '<a href="navigation.php' . PMA_generate_common_url($params) . '" target="frame_navigation">';
64 if ($GLOBALS['cfg']['NavigationBarIconic']) {
65 echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 's_reload.png"'
66 . ' title="' . $GLOBALS['strReloadNavi'] . '"'
67 . ' alt="' . $GLOBALS['strReloadNavi'] . '" />';
69 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
70 echo $GLOBALS['strReloadNavi'];
72 echo '</a>';
73 echo '</div>' . "\n";
74 echo '</body></html>';
75 exit;
78 // keep the offset of the db list in session before closing it
79 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
80 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
82 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
83 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
84 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
86 if (isset($_REQUEST['pos'])) {
87 if (isset($_REQUEST['tpos'])) {
88 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
90 else {
91 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
94 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
95 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
96 // free the session file, for the other frames to be loaded
97 // but only if debugging is not enabled
98 if (empty($_SESSION['debug'])) {
99 session_write_close();
103 * the output compression library
105 require_once './libraries/ob.lib.php';
107 PMA_outBufferPre();
110 * selects the database if there is only one on current server
112 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
113 $GLOBALS['db'] = $GLOBALS['pma']->databases->getSingleItem();
116 $db_start = $GLOBALS['db'];
119 * the relation library
121 require_once './libraries/relation.lib.php';
122 $cfgRelation = PMA_getRelationsParam();
125 * For re-usability, moved http-headers to a seperate file.
126 * It can now be included by libraries/header.inc.php, querywindow.php.
128 require_once './libraries/header_http.inc.php';
131 * Displays the frame
133 // xml declaration moves IE into quirks mode, making much trouble with CSS
134 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
136 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
137 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
138 <html xmlns="http://www.w3.org/1999/xhtml"
139 xml:lang="<?php echo $available_languages[$lang][1]; ?>"
140 lang="<?php echo $available_languages[$lang][1]; ?>"
141 dir="<?php echo $GLOBALS['text_dir']; ?>">
143 <head>
144 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
145 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
146 <title>phpMyAdmin</title>
147 <meta http-equiv="Content-Type"
148 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
149 <base target="frame_content" />
150 <link rel="stylesheet" type="text/css"
151 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
152 <script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
153 <script type="text/javascript" src="js/navigation.js"></script>
154 <script type="text/javascript" src="js/functions.js"></script>
155 <script type="text/javascript">
156 // <![CDATA[
157 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
158 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
160 // INIT PMA_setFrameSize
161 var onloadCnt = 0;
162 var onLoadHandler = window.onload;
163 var resizeHandler = window.onresize;
164 window.document.onresize = resizeHandler;
165 window.onload = function() {
166 if (onloadCnt == 0) {
167 if (typeof(onLoadHandler) == "function") {
168 onLoadHandler();
170 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
171 PMA_setFrameSize();
173 onloadCnt++;
176 window.onresize = function() {
177 if (typeof(resizeHandler) == "function") {
178 resizeHandler();
180 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
181 PMA_saveFrameSize();
184 // ]]>
185 </script>
186 <?php
188 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
191 <!--[if IE 6]>
192 <style type="text/css">
193 /* <![CDATA[ */
194 html {
195 overflow-y: scroll;
197 /* ]]> */
198 </style>
199 <![endif]-->
200 </head>
202 <body id="body_leftFrame">
203 <?php
204 require './libraries/navigation_header.inc.php';
205 if (! $GLOBALS['server']) {
206 // no server selected
207 PMA_exitNavigationFrame();
208 } elseif (! count($GLOBALS['pma']->databases)) {
209 // no database available, so we break here
210 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
211 PMA_exitNavigationFrame();
212 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
213 $list = $cfg['DisplayDatabasesList'];
214 if ($list === 'auto') {
215 if (empty($GLOBALS['db'])) {
216 $list = true;
217 } else {
218 $list = false;
221 if (!$list) {
222 // more than one database available and LeftFrameLight is true
223 // display db selectbox
225 // Light mode -> beginning of the select combo for databases
226 // Note: When javascript is active, the frameset will be changed from
227 // within navigation.php. With no JS (<noscript>) the whole frameset will
228 // be rebuilt with the new target frame.
231 <div id="databaseList">
232 <form method="post" action="index.php" target="_parent" id="left">
233 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
234 <?php
235 echo PMA_generate_common_hidden_inputs() . "\n";
236 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
237 echo '<noscript>' . "\n"
238 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
239 .'</noscript>' . "\n"
240 .'</form>' . "\n";
241 } else {
242 if (! empty($db)) {
243 echo '<div id="databaseList">' . "\n";
245 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
247 $_url_params = array('pos' => $pos);
248 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
249 if (! empty($db)) {
250 echo '</div>' . "\n";
255 <div id="left_tableList">
256 <?php
257 // Don't display expansible/collapsible database info if:
258 // 1. $GLOBALS['server'] == 0 (no server selected)
259 // This is the case when there are multiple servers and
260 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
261 // screen to appear with no database info displayed.
262 // 2. there is only one database available (ie either only one database exists
263 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
264 // In this case, the database should not be collapsible/expandable
266 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
267 .' width="9" height="9" alt="+" />';
268 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
269 .' width="9" height="9" alt="-" />';
271 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
272 .' href="navigation.php?%s" target="_self">';
274 $element_counter = 0;
277 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
278 $table_list = PMA_getTableList($GLOBALS['db']);
279 $table_count = count($table_list);
281 // show selected databasename as link to DefaultTabDatabase-page
282 // with table count in ()
283 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
285 $db_tooltip = '';
287 if ($GLOBALS['cfg']['ShowTooltip']
288 && $GLOBALS['cfgRelation']['commwork']) {
289 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
290 if ($_db_tooltip) {
291 $db_tooltip = $_db_tooltip;
295 $disp_name = $GLOBALS['db'];
296 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
297 $disp_name = $db_tooltip;
298 $disp_name_cut = $db_tooltip;
299 $db_tooltip = $GLOBALS['db'];
303 <p><a class="item"
304 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
305 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
306 <?php
307 if ($GLOBALS['text_dir'] === 'rtl') {
308 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
310 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
311 if ($GLOBALS['text_dir'] === 'ltr') {
312 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
314 echo '</a></p>';
315 if ($table_count) {
317 <span id="NavFilter">
318 <input type="text" name="fast_filter" id="fast_filter" title="<?php echo __('Filter'); ?>" />
319 <span id="clear_fast_filter" title="<?php echo __('Clear'); ?>">X</span>
320 </span>
321 <?php
325 * This helps reducing the navi panel size; in the right panel,
326 * user can find a navigator to page thru all tables.
329 $table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
330 if (! empty($table_list)) {
331 // upper table list paginator
332 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
333 $_url_params = array(
334 'tpos' => 'true',
335 'pos' => $tpos,
336 'db' => $GLOBALS['db']
338 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
340 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
341 // lower table list paginator
342 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
343 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
345 } else {
346 echo $GLOBALS['strNoTablesFound'];
348 unset($table_list);
349 echo '<ul id="newtable"><li><a target="frame_content" href="tbl_create.php' . PMA_generate_common_url(array('db' => $GLOBALS['db'])) . '">'
350 .'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_snewtbl.png" id="icon_newtable" width="10" height="10" alt="' . _pgettext('short form', 'Create table') . '" />'
351 . _pgettext('short form', 'Create table') . '</a></li></ul>';
352 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
353 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>';
354 } else {
355 echo '<div id="databaseList">' . "\n";
356 $_url_params = array('pos' => $pos);
357 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
358 echo '</div>' . "\n";
360 $common_url_query = PMA_generate_common_url();
361 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']);
365 * displays collapsable db list
367 * @uses $_REQUEST['dbgroup']
368 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
369 * @uses $GLOBALS['strSelectADb']
370 * @uses strpos()
371 * @uses urlencode()
372 * @uses printf()
373 * @uses htmlspecialchars()
374 * @uses PMA_generate_common_url()
375 * @uses PMA_getTableList()
376 * @uses PMA_displayTableList()
377 * @global integer $element_counter
378 * @global string $img_minus
379 * @global string $img_plus
380 * @global string $href_left
381 * @global string $db_start
382 * @global string $common_url_query
383 * @param array $ext_dblist extended db list
384 * @param integer $offset
385 * @param integer $count
387 function PMA_displayDbList($ext_dblist, $offset, $count) {
388 global $element_counter, $img_minus, $img_plus, $href_left,
389 $db_start, $common_url_query;
391 // get table list, for all databases
392 // doing this in one step takes advantage of a single query with information_schema!
393 $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));
395 $url_dbgroup = '';
396 echo '<ul id="leftdatabaselist">';
397 $close_db_group = false;
398 foreach ($ext_dblist as $group => $db_group) {
399 if (count($GLOBALS['pma']->databases) > 1) {
400 if ($close_db_group) {
401 $url_dbgroup = '';
402 echo '</ul>';
403 echo '</li>';
404 $close_db_group = false;
406 if (count($db_group) > 1) {
407 $close_db_group = true;
408 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
409 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
410 $element_counter++;
411 echo '<li class="dbgroup">';
412 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
413 || $db_start == $group || strpos($db_start, $group) === 0) {
414 // display + only if this db(group) is not preselected
415 printf($href_left, $element_counter, PMA_generate_common_url());
416 printf($img_minus, $element_counter);
417 } else {
418 printf($href_left, $element_counter, $common_url_query);
419 printf($img_plus, $element_counter);
421 echo '</a> ' . $group . "\n";
422 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
423 || $db_start == $group || strpos($db_start, $group) === 0) {
424 echo '<ul id="subel' . $element_counter . '">' . "\n";
425 } else {
426 echo '<ul id="subel' . $element_counter . '"'
427 .' style="display: none">' . "\n";
431 foreach ($db_group as $db) {
432 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
434 $element_counter++;
435 // Displays the database name
436 echo '<li>' . "\n";
438 if (count($GLOBALS['pma']->databases) > 1) {
439 // only with more than one db we need collapse ...
440 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
441 // display + only if this db is not preselected
442 // or table count is 0
443 printf($href_left, $element_counter, $common_url_query);
444 printf($img_plus, $element_counter);
445 } else {
446 printf($href_left, $element_counter,
447 PMA_generate_common_url() . $url_dbgroup);
448 printf($img_minus, $element_counter);
450 echo '</a>';
452 // ... and we need to refresh both frames on db selection
454 <a class="item"
455 id="<?php echo htmlspecialchars($db['name']); ?>"
456 href="index.php?<?php echo $common_url_query; ?>"
457 target="_parent"
458 title="<?php echo htmlspecialchars($db['comment']); ?>"
459 onclick="
460 if (! toggle('<?php echo $element_counter; ?>', true))
461 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
462 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
463 . '?' . $common_url_query; ?>', 'main');
464 return false;">
465 <?php
466 if ($GLOBALS['text_dir'] === 'rtl') {
467 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
469 echo htmlspecialchars($db['disp_name']);
470 if ($GLOBALS['text_dir'] === 'ltr') {
471 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
474 </a>
475 <?php
476 } else {
477 // with only 1 db available we dont need to refresh left frame
478 // on db selection, only phpmain
480 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
481 . '?' . $common_url_query; ?>"
482 id="<?php echo htmlspecialchars($db['name']); ?>"
483 title="<?php echo htmlspecialchars($db['comment']); ?>">
484 <?php
485 if ($GLOBALS['text_dir'] === 'rtl') {
486 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
488 echo htmlspecialchars($db['disp_name']);
489 if ($GLOBALS['text_dir'] === 'ltr') {
490 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
493 </a>
494 <?php
496 if ($db['num_tables']) {
497 if (isset($tables_full[$db['name']])) {
498 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
499 } elseif (isset($tables_full[strtolower($db['name'])])) {
500 // on windows with lower_case_table_names = 1
501 // MySQL returns
502 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
503 // but information_schema.TABLES gives `test`
504 // bug #1436171
505 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
506 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
507 } else {
508 $tables = PMA_getTableList($db['name']);
510 $child_visible =
511 (bool) (count($GLOBALS['pma']->databases) === 1 || $db_start == $db['name']);
512 PMA_displayTableList($tables, $child_visible, '', $db['name']);
513 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
514 // no tables and LeftFrameLight:
515 // display message no tables in selected db
516 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
518 echo '</li>' . "\n";
519 } // end foreach db
520 } // end foreach group
522 if ($close_db_group) {
523 $url_dbgroup = '';
524 echo '</ul>';
525 echo '</li>';
526 $close_db_group = false;
529 echo '</ul>' . "\n";
533 * display unordered list of tables
534 * calls itself recursively if table in given list
535 * is a list itself
537 * @uses is_array()
538 * @uses count()
539 * @uses urlencode()
540 * @uses strpos()
541 * @uses printf()
542 * @uses htmlspecialchars()
543 * @uses strlen()
544 * @uses is_array()
545 * @uses PMA_displayTableList()
546 * @uses $_REQUEST['tbl_group']
547 * @uses $GLOBALS['common_url_query']
548 * @uses $GLOBALS['table']
549 * @uses $GLOBALS['pmaThemeImage']
550 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
551 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
552 * @uses $GLOBALS['cfg']['DefaultTabTable']
553 * @uses $GLOBALS['strRows']
554 * @uses $GLOBALS['strBrowse']
555 * @global integer the element counter
556 * @global string html code for '-' image
557 * @global string html code for '+' image
558 * @global string html code for self link
559 * @param array $tables array of tables/tablegroups
560 * @param boolean $visible whether the list is visible or not
561 * @param string $tab_group_full full tab group name
562 * @param string $table_db db of this table
564 function PMA_displayTableList($tables, $visible = false,
565 $tab_group_full = '', $table_db = '')
567 if (! is_array($tables) || count($tables) === 0) {
568 return;
571 global $element_counter, $img_minus, $img_plus, $href_left;
572 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
574 if ($visible) {
575 echo '<ul id="subel' . $element_counter . '">';
576 } else {
577 echo '<ul id="subel' . $element_counter . '" style="display: none">';
579 foreach ($tables as $group => $table) {
580 // only allow grouping if the group has more than 1 table
581 if (isset($table['is' . $sep . 'group']) && $table['tab' . $sep . 'count'] > 1) {
582 $common_url_query = $GLOBALS['common_url_query']
583 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
585 $element_counter++;
586 echo '<li>' . "\n";
587 if ($visible
588 && ((isset($_REQUEST['tbl_group'])
589 && (strpos($_REQUEST['tbl_group'], $group) === 0
590 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
591 || strpos($GLOBALS['table'], $group) === 0)) {
592 printf($href_left, $element_counter,
593 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
594 printf($img_minus, $element_counter);
595 } else {
596 printf($href_left, $element_counter, $common_url_query);
597 printf($img_plus, $element_counter);
599 echo '</a>';
601 <a href="index.php?<?php echo $common_url_query; ?>"
602 target="_parent"
603 onclick="
604 if (! toggle('<?php echo $element_counter; ?>', true))
605 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
606 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
607 . '?' . $common_url_query; ?>', 'main');
608 return false;">
609 <?php
610 if ($GLOBALS['text_dir'] === 'rtl') {
611 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
613 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
614 if ($GLOBALS['text_dir'] === 'ltr') {
615 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
618 </a>
619 <?php
621 unset($table['is' . $sep . 'group']);
622 unset($table['tab' . $sep . 'group']);
623 unset($table['tab' . $sep . 'count']);
625 if ($visible &&
626 ((isset($_REQUEST['tbl_group'])
627 && (strpos($_REQUEST['tbl_group'], $group) === 0
628 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
629 || strpos($GLOBALS['table'], $group) === 0)) {
630 PMA_displayTableList($table, true,
631 $tab_group_full . $group, $table_db);
632 } else {
633 PMA_displayTableList($table, false, '', $table_db);
635 echo '</li>' . "\n";
636 } elseif (is_array($table)) {
637 // the table was not grouped because it is the only one with its prefix
638 if (isset($table['is' . $sep . 'group'])) {
639 // get the array with the actual table information
640 foreach ($table as $value) {
641 if(is_array($value)) {
642 $table = $value;
646 $link_title = PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']);
647 // quick access icon next to each table name
648 echo '<li>' . "\n";
649 echo '<a class="tableicon" title="'
650 . htmlspecialchars($link_title)
651 . ': ' . htmlspecialchars($table['Comment'])
652 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
653 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
654 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
655 . $GLOBALS['common_url_query']
656 .'&amp;table=' . urlencode($table['Name'])
657 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
658 . '" >'
659 .'<img class="icon"';
660 if ('VIEW' === strtoupper($table['Comment'])) {
661 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
662 } else {
663 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
665 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
666 .' width="10" height="10" alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
668 // link for the table name itself
669 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
670 .$GLOBALS['common_url_query'] . '&amp;table='
671 .urlencode($table['Name']) . '&amp;pos=0';
672 echo '<a href="' . $href
673 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
674 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
675 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
676 // preserve spaces in table name
677 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
678 echo '</li>' . "\n";
681 echo '</ul>';
684 echo '</div>' . "\n";
686 PMA_exitNavigationFrame();