';
$element_counter = 0;
if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
// show selected databasename as link to DefaultTabDatabase-page
// with table count in ()
$common_url_query = PMA_generate_common_url($GLOBALS['db']);
$db_tooltip = '';
if ($GLOBALS['cfg']['ShowTooltip']
&& $GLOBALS['cfgRelation']['commwork']) {
$_db_tooltip = PMA_getComments($GLOBALS['db']);
if (is_array($_db_tooltip)) {
$db_tooltip = implode(' ', $_db_tooltip);
}
}
$disp_name = $GLOBALS['db'];
if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
$disp_name = $db_tooltip;
$disp_name_cut = $db_tooltip;
$db_tooltip = $GLOBALS['db'];
}
?>
(' . PMA_getTableCount($GLOBALS['db']) . ') ';
}
echo '' . htmlspecialchars($disp_name) . '';
if ($GLOBALS['text_dir'] === 'ltr') {
echo ' (' . PMA_getTableCount($GLOBALS['db']) . ') ';
}
echo '
';
/**
* This helps reducing the navi panel size; in the right panel,
* user can find a navigator to page thru all tables.
*
* @todo instead of the 0 parameter, keep track of the
* offset in the list of tables ($_SESSION['navi_table_limit_offset'])
* and use PMA_listNavigator(); do not just check pos in REQUEST
* but add another hidden param to see if it's the pos of databases
* or the pos of tables.
*/
$table_list = PMA_getTableList($GLOBALS['db'], null, 0, $cfg['MaxTableList']);
if (! empty($table_list)) {
PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
// hint user that the table list is larger, until the todo is done
if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && PMA_getTableCount($GLOBALS['db']) > $GLOBALS['cfg']['MaxTableList']) {
echo ' ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', PMA_getTableCount($GLOBALS['db']), ' )';
}
} else {
echo $GLOBALS['strNoTablesFound'];
}
unset($table_list);
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
echo '' . $GLOBALS['strSelectADb'] . '
' . "\n";
} else {
echo '' . "\n";
$_url_params = array('pos' => $pos);
PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
echo '
' . "\n";
$common_url_query = PMA_generate_common_url();
PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
}
/**
* displays collapsable db list
*
* @uses $_REQUEST['dbgroup']
* @uses $GLOBALS['cfg']['DefaultTabDatabase']
* @uses $GLOBALS['strSelectADb']
* @uses strpos()
* @uses urlencode()
* @uses printf()
* @uses htmlspecialchars()
* @uses PMA_generate_common_url()
* @uses PMA_getTableList()
* @uses PMA_displayTableList()
* @global $element_counter
* @global $img_minus
* @global $img_plus
* @global $href_left
* @global $db_start
* @global $common_url_query
* @param array $ext_dblist extended db list
* @param integer $offset
* @param integer $count
*/
function PMA_displayDbList($ext_dblist, $offset, $count) {
global $element_counter, $img_minus, $img_plus, $href_left,
$db_start, $common_url_query;
// get table list, for all databases
// doing this in one step takes advantage of a single query with information_schema!
$tables_full = PMA_DBI_get_tables_full($GLOBALS['PMA_List_Database']->getLimitedItems($offset, $count));
$url_dbgroup = '';
echo '';
$close_db_group = false;
foreach ($ext_dblist as $group => $db_group) {
if ($GLOBALS['PMA_List_Database']->count() > 1) {
if ($close_db_group) {
$url_dbgroup = '';
echo '
';
echo '';
$close_db_group = false;
}
if (count($db_group) > 1) {
$close_db_group = true;
$url_dbgroup = '&dbgroup=' . urlencode($group);
$common_url_query = PMA_generate_common_url() . $url_dbgroup;
$element_counter++;
echo '';
if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
|| $db_start == $group || strpos($db_start, $group) === 0) {
// display + only if this db(group) is not preselected
printf($href_left, $element_counter, PMA_generate_common_url());
printf($img_minus, $element_counter);
} else {
printf($href_left, $element_counter, $common_url_query);
printf($img_plus, $element_counter);
}
echo ' ' . $group . "\n";
if ((! empty($_REQUEST['dbgroup']) && $_REQUEST['dbgroup'] == $group)
|| $db_start == $group || strpos($db_start, $group) === 0) {
echo '
' . "\n";
}
/**
* display unordered list of tables
* calls itself recursively if table in given list
* is a list itself
*
* @uses is_array()
* @uses count()
* @uses urlencode()
* @uses strpos()
* @uses printf()
* @uses htmlspecialchars()
* @uses strlen()
* @uses is_array()
* @uses PMA_displayTableList()
* @uses $_REQUEST['tbl_group']
* @uses $GLOBALS['common_url_query']
* @uses $GLOBALS['table']
* @uses $GLOBALS['pmaThemeImage']
* @uses $GLOBALS['cfg']['LeftFrameTableSeparator']
* @uses $GLOBALS['cfg']['DefaultTabDatabase']
* @uses $GLOBALS['cfg']['DefaultTabTable']
* @uses $GLOBALS['strRows']
* @uses $GLOBALS['strBrowse']
* @global integer the element counter
* @global string html code for '-' image
* @global string html code for '+' image
* @global string html code for self link
* @param array $tables array of tables/tablegroups
* @param boolean $visible wether the list is visible or not
* @param string $tab_group_full full tab group name
* @param string $table_db db of this table
*/
function PMA_displayTableList($tables, $visible = false,
$tab_group_full = '', $table_db = '')
{
if (! is_array($tables) || count($tables) === 0) {
return;
}
global $element_counter, $img_minus, $img_plus, $href_left;
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
if ($visible) {
echo '