' . "\n";
} else {
if (! empty($db)) {
echo '
' . "\n";
}
echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
}
$_url_params = array('pos' => $pos);
PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
if (! empty($db)) {
echo '
' . "\n";
}
}
?>
';
$img_minus = '

';
$href_left = '
';
$element_counter = 0;
if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
$table_count = PMA_getTableCount($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_getDbComment($GLOBALS['db']);
if ($_db_tooltip) {
$db_tooltip = $_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'];
}
?>
(' . $table_count . ') ';
}
echo '' . htmlspecialchars($disp_name) . '';
if ($GLOBALS['text_dir'] === 'ltr') {
echo ' (' . $table_count . ') ';
}
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['userconf']['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'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
echo ' ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', $table_count, ' )';
}
} 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['userconf']['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['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";
} else {
echo '';
echo '';
$close_db_group = false;
}
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 '
';
} else {
echo '';
}
foreach ($tables as $group => $table) {
if (isset($table['is' . $sep . 'group'])) {
$common_url_query = $GLOBALS['common_url_query']
. '&tbl_group=' . urlencode($tab_group_full . $group);
$element_counter++;
echo '- ' . "\n";
if ($visible
&& ((isset($_REQUEST['tbl_group'])
&& (strpos($_REQUEST['tbl_group'], $group) === 0
|| strpos($_REQUEST['tbl_group'], $sep . $group) !== false))
|| strpos($GLOBALS['table'], $group) === 0)) {
printf($href_left, $element_counter,
$GLOBALS['common_url_query'] . '&tbl_group=' . $tab_group_full);
printf($img_minus, $element_counter);
} else {
printf($href_left, $element_counter, $common_url_query);
printf($img_plus, $element_counter);
}
echo '';
?>
(' . $table['tab' . $sep . 'count'] . ') ';
}
echo htmlspecialchars(substr($group, 0, strlen($group) - strlen($sep)));
if ($GLOBALS['text_dir'] === 'ltr') {
echo ' (' . $table['tab' . $sep . 'count'] . ') ';
}
?>
' . "\n";
} elseif (is_array($table)) {
// quick access icon next to each table name
echo '
- ' . "\n";
echo ''
.'
' . "\n";
// link for the table name itself
$href = $GLOBALS['cfg']['DefaultTabTable'] . '?'
.$GLOBALS['common_url_query'] . '&table='
.urlencode($table['Name']);
echo ''
// preserve spaces in table name
. str_replace(' ', ' ', htmlspecialchars($table['disp_name'])) . '';
echo ' ' . "\n";
}
}
echo '
';
}
/**
* get the action word corresponding to a script name
* in order to display it as a title in navigation panel
*
* @uses switch()
* @uses $GLOBALS
* @param string a valid value for $cfg['LeftDefaultTabTable']
* or $cfg['DefaultTabTable']
*/
function PMA_getTitleForTarget($target) {
switch ($target) {
case 'tbl_structure.php':
$message = 'strStructure';
break;
case 'tbl_sql.php':
$message = 'strSQL';
break;
case 'tbl_select.php':
$message = 'strSearch';
break;
case 'tbl_change.php':
$message = 'strInsert';
break;
case 'sql.php':
$message = 'strBrowse';
break;
default:
$message = '';
}
return $GLOBALS[$message];
}
echo '
' . "\n";
PMA_exitNavigationFrame();
?>