Czech translation update.
[phpmyadmin/crack.git] / navigation.php
blob5f971a7d9cad181a06f54a36516e4d5031ed589c
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * the navigation frame - displays server, db and table selection tree
6 * @version $Id$
7 * @uses $GLOBALS['PMA_List_Database']
8 * @uses $GLOBALS['server']
9 * @uses $GLOBALS['db']
10 * @uses $GLOBALS['table']
11 * @uses $GLOBALS['available_languages']
12 * @uses $GLOBALS['lang']
13 * @uses $GLOBALS['text_dir']
14 * @uses $GLOBALS['charset']
15 * @uses $GLOBALS['pmaThemeImage']
16 * @uses $GLOBALS['strNoDatabases']
17 * @uses $GLOBALS['strDatabase']
18 * @uses $GLOBALS['strGo']
19 * @uses $GLOBALS['strSelectADb']
20 * @uses $GLOBALS['strNoTablesFound']
21 * @uses $GLOBALS['cfg']['LeftFrameLight']
22 * @uses $GLOBALS['cfg']['ShowTooltip']
23 * @uses $GLOBALS['cfg']['ShowTooltipAliasDB']
24 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
25 * @uses $GLOBALS['cfgRelation']['commwork']) {
26 * @uses PMA_List_Database::getSingleItem()
27 * @uses PMA_List_Database::count()
28 * @uses PMA_List_Database::getHtmlSelectGrouped()
29 * @uses PMA_List_Database::getGroupedDetails()
30 * @uses PMA_generate_common_url()
31 * @uses PMA_generate_common_hidden_inputs()
32 * @uses PMA_getDbComment();
33 * @uses PMA_getTableCount()
34 * @uses PMA_getTableList()
35 * @uses PMA_getRelationsParam()
36 * @uses PMA_outBufferPre()
37 * @uses session_write_close()
38 * @uses strlen()
39 * @uses session_write_close()
40 * @uses is_array()
41 * @uses implode()
42 * @uses htmlspecialchars()
45 /**
46 * Gets a core script and starts output buffering work
48 require_once './libraries/common.inc.php';
50 /**
51 * finish and cleanup navigation.php script execution
53 * @uses $GLOBALS['controllink'] to close it
54 * @uses $GLOBALS['userlink'] to close it
55 * @access private only to be used in navigation.php
57 function PMA_exitNavigationFrame()
59 echo '</body></html>';
60 exit;
63 // keep the offset of the db list in session before closing it
64 if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
65 $_SESSION['userconf']['navi_limit_offset'] = 0;
67 if (isset($_REQUEST['pos'])) {
68 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
70 $pos = $_SESSION['userconf']['navi_limit_offset'];
72 // free the session file, for the other frames to be loaded
73 // but only if debugging is not enabled
74 if (empty($_SESSION['debug'])) {
75 session_write_close();
78 /**
79 * the output compression library
81 require_once './libraries/ob.lib.php';
83 PMA_outBufferPre();
86 * selects the database if there is only one on current server
88 if ($GLOBALS['server'] && ! strlen($GLOBALS['db'])) {
89 $GLOBALS['db'] = $GLOBALS['PMA_List_Database']->getSingleItem();
92 $db_start = $GLOBALS['db'];
94 /**
95 * the relation library
97 require_once './libraries/relation.lib.php';
98 $cfgRelation = PMA_getRelationsParam();
101 * garvin: For re-usability, moved http-headers to a seperate file.
102 * It can now be included by libraries/header.inc.php, querywindow.php.
104 require_once './libraries/header_http.inc.php';
106 if (! isset($_SESSION['userconf']['navi_limit_offset'])) {
107 $_SESSION['userconf']['navi_limit_offset'] = 0;
109 if (isset($_REQUEST['pos'])) {
110 $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos'];
112 $pos = $_SESSION['userconf']['navi_limit_offset'];
115 * Displays the frame
117 // xml declaration moves IE into quirks mode, making much trouble with CSS
118 /* echo '<?xml version="1.0" encoding="' . $GLOBALS['charset'] . '"?>'; */
120 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
121 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
122 <html xmlns="http://www.w3.org/1999/xhtml"
123 xml:lang="<?php echo $available_languages[$lang][2]; ?>"
124 lang="<?php echo $available_languages[$lang][2]; ?>"
125 dir="<?php echo $GLOBALS['text_dir']; ?>">
127 <head>
128 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
129 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
130 <title>phpMyAdmin</title>
131 <meta http-equiv="Content-Type"
132 content="text/html; charset=<?php echo $GLOBALS['charset']; ?>" />
133 <base target="frame_content" />
134 <link rel="stylesheet" type="text/css"
135 href="phpmyadmin.css.php?<?php echo PMA_generate_common_url('', ''); ?>&amp;js_frame=left&amp;nocache=<?php echo $_SESSION['PMA_Config']->getThemeUniqueValue(); ?>" />
136 <script type="text/javascript" src="js/navigation.js"></script>
137 <script type="text/javascript" src="js/functions.js"></script>
138 <script type="text/javascript">
139 // <![CDATA[
140 var image_minus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_minus.png';
141 var image_plus = '<?php echo $GLOBALS['pmaThemeImage']; ?>b_plus.png';
142 // ]]>
143 </script>
144 <?php
146 * remove horizontal scroll bar bug in IE 6 by forcing a vertical scroll bar
149 <!--[if IE 6]>
150 <style type="text/css">
151 /* <![CDATA[ */
152 html {
153 overflow-y: scroll;
155 /* ]]> */
156 </style>
157 <![endif]-->
158 </head>
160 <body id="body_leftFrame" onload="PMA_setFrameSize();" onresize="PMA_saveFrameSize();">
161 <?php
162 require './libraries/navigation_header.inc.php';
163 if (! $GLOBALS['server']) {
164 // no server selected
165 PMA_exitNavigationFrame();
166 } elseif (! $GLOBALS['PMA_List_Database']->count()) {
167 // no database available, so we break here
168 echo '<p>' . $GLOBALS['strNoDatabases'] . '</p>';
169 PMA_exitNavigationFrame();
170 } elseif ($GLOBALS['cfg']['LeftFrameLight'] && $GLOBALS['PMA_List_Database']->count() > 1) {
171 $list = $cfg['DisplayDatabasesList'];
172 if ($list === 'auto') {
173 if (empty($GLOBALS['db'])) {
174 $list = true;
175 } else {
176 $list = false;
179 if (!$list) {
180 // more than one database available and LeftFrameLight is true
181 // display db selectbox
183 // Light mode -> beginning of the select combo for databases
184 // Note: When javascript is active, the frameset will be changed from
185 // within navigation.php. With no JS (<noscript>) the whole frameset will
186 // be rebuilt with the new target frame.
189 <div id="databaseList">
190 <form method="post" action="index.php" target="_parent" id="left">
191 <label for="lightm_db"><?php echo $GLOBALS['strDatabase']; ?></label>
192 <?php
193 echo PMA_generate_common_hidden_inputs() . "\n";
194 echo $GLOBALS['PMA_List_Database']->getHtmlSelectGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
195 echo '<noscript>' . "\n"
196 .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
197 .'</noscript>' . "\n"
198 .'</form>' . "\n";
199 } else {
200 if (! empty($db)) {
201 echo '<div id="databaseList">' . "\n";
203 echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
205 $_url_params = array('pos' => $pos);
206 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
207 if (! empty($db)) {
208 echo '</div>' . "\n";
213 <div id="left_tableList">
214 <?php
215 // Don't display expansible/collapsible database info if:
216 // 1. $GLOBALS['server'] == 0 (no server selected)
217 // This is the case when there are multiple servers and
218 // '$GLOBALS['cfg']['ServerDefault'] = 0' is set. In that case, we want the welcome
219 // screen to appear with no database info displayed.
220 // 2. there is only one database available (ie either only one database exists
221 // or $GLOBALS['cfg']['Servers']['only_db'] is defined and is not an array)
222 // In this case, the database should not be collapsible/expandable
224 $img_plus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_plus.png"'
225 .' width="9" height="9" alt="+" />';
226 $img_minus = '<img class="icon" id="el%dImg" src="' . $pmaThemeImage . 'b_minus.png"'
227 .' width="9" height="9" alt="-" />';
229 $href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
230 .' href="navigation.php?%s" target="_self">';
232 $element_counter = 0;
235 if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
236 $table_count = PMA_getTableCount($GLOBALS['db']);
238 // show selected databasename as link to DefaultTabDatabase-page
239 // with table count in ()
240 $common_url_query = PMA_generate_common_url($GLOBALS['db']);
242 $db_tooltip = '';
244 if ($GLOBALS['cfg']['ShowTooltip']
245 && $GLOBALS['cfgRelation']['commwork']) {
246 $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
247 if ($_db_tooltip) {
248 $db_tooltip = $_db_tooltip;
252 $disp_name = $GLOBALS['db'];
253 if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
254 $disp_name = $db_tooltip;
255 $disp_name_cut = $db_tooltip;
256 $db_tooltip = $GLOBALS['db'];
260 <p><a class="item"
261 href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query; ?>"
262 title="<?php echo htmlspecialchars($db_tooltip); ?>" >
263 <?php
264 if ($GLOBALS['text_dir'] === 'rtl') {
265 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
267 echo '<span class="navi_dbName">' . htmlspecialchars($disp_name) . '</span>';
268 if ($GLOBALS['text_dir'] === 'ltr') {
269 echo ' <bdo dir="ltr">(' . $table_count . ')</bdo> ';
271 echo '</a></p>';
274 * This helps reducing the navi panel size; in the right panel,
275 * user can find a navigator to page thru all tables.
277 * @todo instead of the 0 parameter, keep track of the
278 * offset in the list of tables ($_SESSION['userconf']['table_limit_offset'])
279 * and use PMA_listNavigator(); do not just check pos in REQUEST
280 * but add another hidden param to see if it's the pos of databases
281 * or the pos of tables.
283 $table_list = PMA_getTableList($GLOBALS['db'], null, 0, $cfg['MaxTableList']);
284 if (! empty($table_list)) {
285 PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
286 // hint user that the table list is larger, until the todo is done
287 if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
288 echo '&nbsp; ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', $table_count, ' )';
290 } else {
291 echo $GLOBALS['strNoTablesFound'];
293 unset($table_list);
294 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
295 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
296 } else {
297 echo '<div id="databaseList">' . "\n";
298 $_url_params = array('pos' => $pos);
299 PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
300 echo '</div>' . "\n";
302 $common_url_query = PMA_generate_common_url();
303 PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
307 * displays collapsable db list
309 * @uses $_REQUEST['dbgroup']
310 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
311 * @uses $GLOBALS['strSelectADb']
312 * @uses strpos()
313 * @uses urlencode()
314 * @uses printf()
315 * @uses htmlspecialchars()
316 * @uses PMA_generate_common_url()
317 * @uses PMA_getTableList()
318 * @uses PMA_displayTableList()
319 * @global $element_counter
320 * @global $img_minus
321 * @global $img_plus
322 * @global $href_left
323 * @global $db_start
324 * @global $common_url_query
325 * @param array $ext_dblist extended db list
326 * @param integer $offset
327 * @param integer $count
329 function PMA_displayDbList($ext_dblist, $offset, $count) {
330 global $element_counter, $img_minus, $img_plus, $href_left,
331 $db_start, $common_url_query;
333 // get table list, for all databases
334 // doing this in one step takes advantage of a single query with information_schema!
335 $tables_full = PMA_DBI_get_tables_full($GLOBALS['PMA_List_Database']->getLimitedItems($offset, $count));
337 $url_dbgroup = '';
338 echo '<ul id="leftdatabaselist">';
339 $close_db_group = false;
340 foreach ($ext_dblist as $group => $db_group) {
341 if ($GLOBALS['PMA_List_Database']->count() > 1) {
342 if ($close_db_group) {
343 $url_dbgroup = '';
344 echo '</ul>';
345 echo '</li>';
346 $close_db_group = false;
348 if (count($db_group) > 1) {
349 $close_db_group = true;
350 $url_dbgroup = '&amp;dbgroup=' . urlencode($group);
351 $common_url_query = PMA_generate_common_url() . $url_dbgroup;
352 $element_counter++;
353 echo '<li class="dbgroup">';
354 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
355 || $db_start == $group || strpos($db_start, $group) === 0) {
356 // display + only if this db(group) is not preselected
357 printf($href_left, $element_counter, PMA_generate_common_url());
358 printf($img_minus, $element_counter);
359 } else {
360 printf($href_left, $element_counter, $common_url_query);
361 printf($img_plus, $element_counter);
363 echo '</a> ' . $group . "\n";
364 if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
365 || $db_start == $group || strpos($db_start, $group) === 0) {
366 echo '<ul id="subel' . $element_counter . '">' . "\n";
367 } else {
368 echo '<ul id="subel' . $element_counter . '"'
369 .' style="display: none">' . "\n";
373 foreach ($db_group as $db) {
374 $common_url_query = PMA_generate_common_url($db['name']) . $url_dbgroup;
376 $element_counter++;
377 // Displays the database name
378 echo '<li>' . "\n";
380 if ($GLOBALS['PMA_List_Database']->count() > 1) {
381 // only with more than one db we need collapse ...
382 if ($db_start != $db['name'] || $db['num_tables'] < 1) {
383 // display + only if this db is not preselected
384 // or table count is 0
385 printf($href_left, $element_counter, $common_url_query);
386 printf($img_plus, $element_counter);
387 } else {
388 printf($href_left, $element_counter,
389 PMA_generate_common_url() . $url_dbgroup);
390 printf($img_minus, $element_counter);
392 echo '</a>';
394 // ... and we need to refresh both frames on db selection
396 <a class="item"
397 id="<?php echo htmlspecialchars($db['name']); ?>"
398 href="index.php?<?php echo $common_url_query; ?>"
399 target="_parent"
400 title="<?php echo htmlspecialchars($db['comment']); ?>"
401 onclick="
402 if (! toggle('<?php echo $element_counter; ?>', true))
403 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
404 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
405 . '?' . $common_url_query; ?>', 'main');
406 return false;">
407 <?php
408 if ($GLOBALS['text_dir'] === 'rtl') {
409 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
411 echo htmlspecialchars($db['disp_name']);
412 if ($GLOBALS['text_dir'] === 'ltr') {
413 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
416 </a>
417 <?php
418 } else {
419 // with only 1 db available we dont need to refresh left frame
420 // on db selection, only phpmain
422 <a href="<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
423 . '?' . $common_url_query; ?>"
424 id="<?php echo htmlspecialchars($db['name']); ?>"
425 title="<?php echo htmlspecialchars($db['comment']); ?>">
426 <?php
427 if ($GLOBALS['text_dir'] === 'rtl') {
428 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
430 echo htmlspecialchars($db['disp_name']);
431 if ($GLOBALS['text_dir'] === 'ltr') {
432 echo ' <bdo dir="ltr">(' . $db['num_tables'] . ')</bdo> ';
435 </a>
436 <?php
438 if ($db['num_tables']) {
439 if (isset($tables_full[$db['name']])) {
440 $tables = PMA_getTableList($db['name'], $tables_full[$db['name']]);
441 } elseif (isset($tables_full[strtolower($db['name'])])) {
442 // on windows with lower_case_table_names = 1
443 // MySQL returns
444 // with SHOW DATABASES or information_schema.SCHEMATA: `Test`
445 // but information_schema.TABLES gives `test`
446 // bug #1436171
447 // sf.net/tracker/?func=detail&aid=1436171&group_id=23067&atid=377408
448 $tables = PMA_getTableList($db['name'], $tables_full[strtolower($db['name'])]);
449 } else {
450 $tables = PMA_getTableList($db['name']);
452 $child_visible =
453 (bool) ($GLOBALS['PMA_List_Database']->count() === 1 || $db_start == $db['name']);
454 PMA_displayTableList($tables, $child_visible, '', $db['name']);
455 } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
456 // no tables and LeftFrameLight:
457 // display message no tables in selected db
458 echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
460 echo '</li>' . "\n";
461 } // end foreach db
462 } // end foreach group
464 if ($close_db_group) {
465 $url_dbgroup = '';
466 echo '</ul>';
467 echo '</li>';
468 $close_db_group = false;
471 echo '</ul>' . "\n";
475 * display unordered list of tables
476 * calls itself recursively if table in given list
477 * is a list itself
479 * @uses is_array()
480 * @uses count()
481 * @uses urlencode()
482 * @uses strpos()
483 * @uses printf()
484 * @uses htmlspecialchars()
485 * @uses strlen()
486 * @uses is_array()
487 * @uses PMA_displayTableList()
488 * @uses $_REQUEST['tbl_group']
489 * @uses $GLOBALS['common_url_query']
490 * @uses $GLOBALS['table']
491 * @uses $GLOBALS['pmaThemeImage']
492 * @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
493 * @uses $GLOBALS['cfg']['DefaultTabDatabase']
494 * @uses $GLOBALS['cfg']['DefaultTabTable']
495 * @uses $GLOBALS['strRows']
496 * @uses $GLOBALS['strBrowse']
497 * @global integer the element counter
498 * @global string html code for '-' image
499 * @global string html code for '+' image
500 * @global string html code for self link
501 * @param array $tables array of tables/tablegroups
502 * @param boolean $visible wether the list is visible or not
503 * @param string $tab_group_full full tab group name
504 * @param string $table_db db of this table
506 function PMA_displayTableList($tables, $visible = false,
507 $tab_group_full = '', $table_db = '')
509 if (! is_array($tables) || count($tables) === 0) {
510 return;
513 global $element_counter, $img_minus, $img_plus, $href_left;
514 $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
516 if ($visible) {
517 echo '<ul id="subel' . $element_counter . '">';
518 } else {
519 echo '<ul id="subel' . $element_counter . '" style="display: none">';
521 foreach ($tables as $group => $table) {
522 if (isset($table['is' . $sep . 'group'])) {
523 $common_url_query = $GLOBALS['common_url_query']
524 . '&amp;tbl_group=' . urlencode($tab_group_full . $group);
526 $element_counter++;
527 echo '<li>' . "\n";
528 if ($visible
529 && ((isset($_REQUEST['tbl_group'])
530 && (strpos($_REQUEST['tbl_group'], $group) === 0
531 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
532 || strpos($GLOBALS['table'], $group) === 0)) {
533 printf($href_left, $element_counter,
534 $GLOBALS['common_url_query'] . '&amp;tbl_group=' . $tab_group_full);
535 printf($img_minus, $element_counter);
536 } else {
537 printf($href_left, $element_counter, $common_url_query);
538 printf($img_plus, $element_counter);
540 echo '</a>';
542 <a href="index.php?<?php echo $common_url_query; ?>"
543 target="_parent"
544 onclick="
545 if (! toggle('<?php echo $element_counter; ?>', true))
546 window.parent.goTo('./navigation.php?<?php echo $common_url_query; ?>');
547 window.parent.goTo('./<?php echo $GLOBALS['cfg']['DefaultTabDatabase']
548 . '?' . $common_url_query; ?>', 'main');
549 return false;">
550 <?php
551 if ($GLOBALS['text_dir'] === 'rtl') {
552 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
554 echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
555 if ($GLOBALS['text_dir'] === 'ltr') {
556 echo ' <bdo dir="ltr">(' . $table['tab' . $sep . 'count'] . ')</bdo> ';
559 </a>
560 <?php
562 unset($table['is' . $sep . 'group']);
563 unset($table['tab' . $sep . 'group']);
564 unset($table['tab' . $sep . 'count']);
566 if ($visible &&
567 ((isset($_REQUEST['tbl_group'])
568 && (strpos($_REQUEST['tbl_group'], $group) === 0
569 || strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
570 || strpos($GLOBALS['table'], $group) === 0)) {
571 PMA_displayTableList($table, true,
572 $tab_group_full . $group, $table_db);
573 } else {
574 PMA_displayTableList($table, false, '', $table_db);
576 echo '</li>' . "\n";
577 } elseif (is_array($table)) {
578 // quick access icon next to each table name
579 echo '<li>' . "\n";
580 echo '<a title="'
581 . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['LeftDefaultTabTable']))
582 . ': ' . htmlspecialchars($table['Comment'])
583 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows'] . ')"'
584 .' id="quick_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
585 .' href="' . $GLOBALS['cfg']['LeftDefaultTabTable'] . '?'
586 . $GLOBALS['common_url_query']
587 .'&amp;table=' . urlencode($table['Name'])
588 .'&amp;goto=' . $GLOBALS['cfg']['LeftDefaultTabTable']
589 . '" >'
590 .'<img class="icon"';
591 if ('VIEW' === strtoupper($table['Comment'])) {
592 echo ' src="' . $GLOBALS['pmaThemeImage'] . 's_views.png"';
593 } else {
594 echo ' src="' . $GLOBALS['pmaThemeImage'] . 'b_sbrowse.png"';
596 echo ' id="icon_' . htmlspecialchars($table_db . '.' . $table['Name']) . '"'
597 .' width="10" height="10" alt="' . $GLOBALS['strBrowse'] . '" /></a>' . "\n";
599 // link for the table name itself
600 $href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
601 .$GLOBALS['common_url_query'] . '&amp;table='
602 .urlencode($table['Name']);
603 echo '<a href="' . $href
604 . '" title="' . htmlspecialchars(PMA_getTitleForTarget($GLOBALS['cfg']['DefaultTabTable']) . ': ' . $table['Comment']
605 .' (' . PMA_formatNumber($table['Rows'], 0) . ' ' . $GLOBALS['strRows']) . ')"'
606 .' id="' . htmlspecialchars($table_db . '.' . $table['Name']) . '">'
607 // preserve spaces in table name
608 . str_replace(' ', '&nbsp;', htmlspecialchars($table['disp_name'])) . '</a>';
609 echo '</li>' . "\n";
612 echo '</ul>';
616 * get the action word corresponding to a script name
617 * in order to display it as a title in navigation panel
619 * @uses switch()
620 * @uses $GLOBALS
621 * @param string a valid value for $cfg['LeftDefaultTabTable']
622 * or $cfg['DefaultTabTable']
624 function PMA_getTitleForTarget($target) {
625 switch ($target) {
626 case 'tbl_structure.php':
627 $message = 'strStructure';
628 break;
629 case 'tbl_sql.php':
630 $message = 'strSQL';
631 break;
632 case 'tbl_select.php':
633 $message = 'strSearch';
634 break;
635 case 'tbl_change.php':
636 $message = 'strInsert';
637 break;
638 case 'sql.php':
639 $message = 'strBrowse';
640 break;
641 default:
642 $message = '';
644 return $GLOBALS[$message];
647 echo '</div>' . "\n";
649 PMA_exitNavigationFrame();