Translation update done using Pootle.
[phpmyadmin-themes.git] / navigation.php
blob864456e2a30830fa6ff684ea473def31e784a7bf
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * the navigation frame - displays server, db and table selection tree
6 * @version $Id$
7 * @package phpMyAdmin
8 * @uses $GLOBALS['pma']->databases
9 * @uses $GLOBALS['server']
10 * @uses $GLOBALS['db']
11 * @uses $GLOBALS['table']
12 * @uses $GLOBALS['available_languages']
13 * @uses $GLOBALS['lang']
14 * @uses $GLOBALS['text_dir']
15 * @uses $GLOBALS['charset']
16 * @uses $GLOBALS['pmaThemeImage']
17 * @uses $GLOBALS['strNavTableFilter']
18 * @uses $GLOBALS['strReset']
19 * @uses $GLOBALS['strNoDatabases']
20 * @uses $GLOBALS['strDatabase']
21 * @uses $GLOBALS['strGo']
22 * @uses $GLOBALS['strSelectADb']
23 * @uses $GLOBALS['strNoTablesFound']
24 * @uses $GLOBALS['cfg']['LeftFrameLight']
25 * @uses $GLOBALS['cfg']['ShowTooltip']
26 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
27 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
28 * @uses $GLOBALS['cfgRelation']['commwork']) {
29 * @uses PMA_List_Database::getSingleItem()
30 * @uses PMA_List_Database::getHtmlSelectGrouped()
31 * @uses PMA_List_Database::getGroupedDetails()
32 * @uses PMA_generate_common_url()
33 * @uses PMA_generate_common_hidden_inputs()
34 * @uses PMA_getDbComment();
35 * @uses PMA_getTableCount()
36 * @uses PMA_getTableList()
37 * @uses PMA_getRelationsParam()
38 * @uses PMA_outBufferPre()
39 * @uses strlen()
40 * @uses session_write_close()
41 * @uses is_array()
42 * @uses implode()
43 * @uses htmlspecialchars()
46 /**
47 * Gets a core script and starts output buffering work
49 require_once './libraries/common.inc.php';
51 /**
52 * finish and cleanup navigation.php script execution, only to be used in navigation.php
54 * @uses $GLOBALS['controllink'] to close it
55 * @uses $GLOBALS['userlink'] to close it
56 * @access private
58 function PMA_exitNavigationFrame()
60 $params = array('uniqid' => uniqid());
61 if (!empty($GLOBALS['db'])) {
62 $params['db'] = $GLOBALS['db'];
64 echo '<div id="reloadlink">' . "\n";
65 echo '<a href="navigation.php' . PMA_generate_common_url($params) . '" target="frame_navigation">';
66 if ($GLOBALS['cfg']['NavigationBarIconic']) {
67 echo '<img class="icon" src="'. $GLOBALS['pmaThemeImage'] . 's_reload.png"'
68 . ' title="' . $GLOBALS['strReloadNavi'] . '"'
69 . ' alt="' . $GLOBALS['strReloadNavi'] . '" />';
71 if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) {
72 echo $GLOBALS['strReloadNavi'];
74 echo '</a>';
75 echo '</div>' . "\n";
76 echo '</body></html>';
77 exit;
80 // keep the offset of the db list in session before closing it
81 if (! isset($_SESSION['tmp_user_values']['navi_limit_offset'])) {
82 $_SESSION['tmp_user_values']['navi_limit_offset'] = 0;
84 if (! isset($_SESSION['tmp_user_values']['table_limit_offset']) || $_SESSION['tmp_user_values']['table_limit_offset_db'] != $db) {
85 $_SESSION['tmp_user_values']['table_limit_offset'] = 0;
86 $_SESSION['tmp_user_values']['table_limit_offset_db'] = $db;
88 if (isset($_REQUEST['pos'])) {
89 if (isset($_REQUEST['tpos'])) {
90 $_SESSION['tmp_user_values']['table_limit_offset'] = (int) $_REQUEST['pos'];
92 else {
93 $_SESSION['tmp_user_values']['navi_limit_offset'] = (int) $_REQUEST['pos'];
96 $pos = $_SESSION['tmp_user_values']['navi_limit_offset'];
97 $tpos = $_SESSION['tmp_user_values']['table_limit_offset'];
98 // free the session file, for the other frames to be loaded
99 // but only if debugging is not enabled
100 if (empty($_SESSION['debug'])) {
101 session_write_close();
105 * the output compression library
107 require_once './libraries/ob.lib.php';
109 PMA_outBufferPre();
112 * selects the database if there is only one on current server
114 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
115 $GLOBALS['db'] = $GLOBALS['pma']->databases->getSingleItem();
118 $db_start = $GLOBALS['db'];
121 * the relation library
123 require_once './libraries/relation.lib.php';
124 $cfgRelation = PMA_getRelationsParam();
127 * garvin: For re-usability, moved http-headers to a seperate file.
128 * It can now be included by libraries/header.inc.php, querywindow.php.
130 require_once './libraries/header_http.inc.php';
133 * Displays the frame
135 // xml declaration moves IE into quirks mode, making much trouble with CSS
136 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
138 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
139 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
140 <html xmlns="http://www.w3.org/1999/xhtml"
141 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
142 lang="<?php echo $available_languages[$lang][2]; ?>"
143 dir="<?php echo $GLOBALS['text_dir']; ?>">
145 <head>
146 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
147 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
148 <title>phpMyAdmin</title>
149 <meta http-equiv="Content-Type"
150 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
151 <base target="frame_content" />
152 <link rel="stylesheet" type="text/css"
153 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $GLOBALS['PMA_Config']->getThemeUniqueValue(); ?>" />
154 <script type="text/javascript" src="js/navigation.js"></script>
155 <script type="text/javascript" src="js/functions.js"></script>
156 <script type="text/javascript">
157 // <![CDATA[
158 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
159 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
161 // INIT PMA_setFrameSize
162 var onloadCnt = 0;
163 var onLoadHandler = window.onload;
164 var resizeHandler = window.onresize;
165 window.document.onresize = resizeHandler;
166 window.onload = function() {
167 if (onloadCnt == 0) {
168 if (typeof(onLoadHandler) == "function") {
169 onLoadHandler();
171 if (typeof(PMA_setFrameSize) != 'undefined' && typeof(PMA_setFrameSize) == 'function') {
172 PMA_setFrameSize();
174 onloadCnt++;
177 window.onresize = function() {
178 if (typeof(resizeHandler) == "function") {
179 resizeHandler();
181 if (typeof(PMA_saveFrameSize) != 'undefined' && typeof(PMA_saveFrameSize) == 'function') {
182 PMA_saveFrameSize();
185 // ]]>
186 </script>
187 <?php
189 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
192 <!--[if IE 6]>
193 <style type="text/css">
194 /* <![CDATA[ */
195 html {
196 overflow-y: scroll;
198 /* ]]> */
199 </style>
200 <![endif]-->
201 </head>
203 <body id="body_leftFrame">
204 <?php
205 require './libraries/navigation_header.inc.php';
206 if (! $GLOBALS['server']) {
207 // no server selected
208 PMA_exitNavigationFrame();
209 } elseif (! count($GLOBALS['pma']->databases)) {
210 // no database available, so we break here
211 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
212 PMA_exitNavigationFrame();
213 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && count($GLOBALS['pma']->databases) > 1) {
214 $list = $cfg['DisplayDatabasesList'];
215 if ($list === 'auto') {
216 if (empty($GLOBALS['db'])) {
217 $list = true;
218 } else {
219 $list = false;
222 if (!$list) {
223 // more than one database available and LeftFrameLight is true
224 // display db selectbox
226 // Light mode -> beginning of the select combo for databases
227 // Note: When javascript is active, the frameset will be changed from
228 // within navigation.php. With no JS (<noscript>) the whole frameset will
229 // be rebuilt with the new target frame.
232 <div id="databaseList">
233 <form method="post" action="index.php" target="_parent" id="left">
234 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
235 <?php
236 echo PMA_generate_common_hidden_inputs() . "\n";
237 echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
238 echo '<noscript>' . "\n"
239 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
240 .'</noscript>' . "\n"
241 .'</form>' . "\n";
242 } else {
243 if (! empty($db)) {
244 echo '<div id="databaseList">' . "\n";
246 echo $GLOBALS['pma']->databases->getHtmlListGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
248 $_url_params = array('pos' => $pos);
249 PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
250 if (! empty($db)) {
251 echo '</div>' . "\n";
256 <div id="left_tableList">
257 <?php
258 // Don't display expansible/collapsible database info if:
259 // 1. $GLOBALS['server'] == 0 (no server selected)
260 // This is the case when there are multiple servers and
261 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
262 // screen to appear with no database info displayed.
263 // 2. there is only one database available (ie either only one database exists
264 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
265 // In this case, the database should not be collapsible/expandable
267 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
268 .' width="9" height="9" alt="+" />';
269 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
270 .' width="9" height="9" alt="-" />';
272 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
273 .' href="navigation.php?%s" target="_self">';
275 $element_counter = 0;
278 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
279 $table_list = PMA_getTableList($GLOBALS['db']);
280 $table_count = count($table_list);
282 // show selected databasename as link to DefaultTabDatabase-page
283 // with table count in ()
284 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
286 $db_tooltip = '';
288 if ($GLOBALS['cfg']['ShowTooltip']
289 && $GLOBALS['cfgRelation']['commwork']) {
290 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
291 if ($_db_tooltip) {
292 $db_tooltip = $_db_tooltip;
296 $disp_name = $GLOBALS['db'];
297 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
298 $disp_name = $db_tooltip;
299 $disp_name_cut = $db_tooltip;
300 $db_tooltip = $GLOBALS['db'];
304 <p><a class="item"
305 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
306 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
307 <?php
308 if ($GLOBALS['text_dir'] === 'rtl') {
309 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
311 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
312 if ($GLOBALS['text_dir'] === 'ltr') {
313 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
315 echo '</a></p>';
316 if ($table_count) {
317 echo '<span id=\'NavFilter\' style="display:none;"><span onclick="document.getElementById(\'fast_filter\').value=\'\'; fast_filter(\'\');document.getElementById(\'fast_filter\').focus();" style="background:white;color:black;cursor:pointer;padding:2px;margin:0 0 0 -20px;position:relative;float:right;" title="' . $strReset . '">X</span><input type="text" name="fast_filter" id="fast_filter" title="' . $strNavTableFilter . '" onkeyup="setTimeout(function(word){ return function(){ fast_filter(word);}}(this.value),1000);" style="width:100%;padding:0 -20px 0 0; padding:2px;" onfocus="this.select();" /></span><script type="text/javascript">document.getElementById(\'NavFilter\').style.display=\'\';</script>';
321 * This helps reducing the navi panel size; in the right panel,
322 * user can find a navigator to page thru all tables.
325 $table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
326 if (! empty($table_list)) {
327 // upper table list paginator
328 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
329 $_url_params = array(
330 'tpos' => 'true',
331 'pos' => $tpos,
332 'db' => $GLOBALS['db']
334 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
336 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
337 // lower table list paginator
338 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
339 PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
341 } else {
342 echo $GLOBALS['strNoTablesFound'];
344 unset($table_list);
345 echo '<ul id="newtable"><li><a target="frame_content" href="tbl_create.php' . PMA_generate_common_url(array('db' => $GLOBALS['db'])) . '">'
346 .'<img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_snewtbl.png" id="icon_newtable" width="10" height="10" alt="' . $strCreateTableShort . '" />'
347 . $strCreateTableShort . '</a></li></ul>';
348 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
349 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>';
350 } else {
351 echo '<div id="databaseList">' . "\n";
352 $_url_params = array('pos' => $pos);
353 PMA_listNavigator(count($GLOBALS['pma']->databases), $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']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['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 integer $element_counter
374 * @global string $img_minus
375 * @global string $img_plus
376 * @global string $href_left
377 * @global string $db_start
378 * @global string $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']->databases->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 (count($GLOBALS['pma']->databases) > 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 (count($GLOBALS['pma']->databases) > 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) (count($GLOBALS['pma']->databases) === 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 whether 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 $link_title = PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']);
633 // quick access icon next to each table name
634 echo '<li>' . "\n";
635 echo '<a class="tableicon" title="'
636 . htmlspecialchars($link_title)
637 . ': ' . htmlspecialchars($table['Comment'])
638 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
639 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
640 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
641 . $GLOBALS['common_url_query']
642 .'&amp;table=' . urlencode($table['Name'])
643 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
644 . '" >'
645 .'<img class="icon"';
646 if ('VIEW' === strtoupper($table['Comment'])) {
647 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
648 } else {
649 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
651 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
652 .' width="10" height="10" alt="' . htmlspecialchars($link_title) . '" /></a>' . "\n";
654 // link for the table name itself
655 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
656 .$GLOBALS['common_url_query'] . '&amp;table='
657 .urlencode($table['Name']) . '&amp;pos=0';
658 echo '<a href="' . $href
659 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
660 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
661 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
662 // preserve spaces in table name
663 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
664 echo '</li>' . "\n";
667 echo '</ul>';
670 echo '</div>' . "\n";
672 PMA_exitNavigationFrame();