obey MaxTableList in navi also (Light mode only); move the navigator near the database list

This commit is contained in:
Marc Delisle
2007-07-09 16:30:39 +00:00
parent 6b8aabaae8
commit ae603822a5
4 changed files with 29 additions and 12 deletions

View File

@@ -1094,7 +1094,8 @@ ALTER TABLE `pma_column_comments`
<dt id="cfg_MaxTableList">$cfg['MaxTableList'] integer</dt> <dt id="cfg_MaxTableList">$cfg['MaxTableList'] integer</dt>
<dd>The maximum number of table names to be displayed in the <dd>The maximum number of table names to be displayed in the
right panel's list.</dd> main panel's list. This limit is also enforced in the navigation panel
when in Light mode.</dd>
<dt id="cfg_MaxCharactersInDisplayedSQL">$cfg['MaxCharactersInDisplayedSQL'] integer</dt> <dt id="cfg_MaxCharactersInDisplayedSQL">$cfg['MaxCharactersInDisplayedSQL'] integer</dt>
<dd>The maximum number of characters when a SQL query is displayed. The <dd>The maximum number of characters when a SQL query is displayed. The

View File

@@ -717,7 +717,7 @@ function PMA_sendHeaderLocation($uri)
} }
/** /**
* returns array with tables of given db with extended infomation and grouped * returns array with tables of given db with extended information and grouped
* *
* @uses $cfg['LeftFrameTableSeparator'] * @uses $cfg['LeftFrameTableSeparator']
* @uses $cfg['LeftFrameTableLevel'] * @uses $cfg['LeftFrameTableLevel']
@@ -730,14 +730,15 @@ function PMA_sendHeaderLocation($uri)
* @uses strstr() * @uses strstr()
* @uses explode() * @uses explode()
* @param string $db name of db * @param string $db name of db
* return array (rekursive) grouped table list * @param string $tables name of tables
* return array (recursive) grouped table list
*/ */
function PMA_getTableList($db, $tables = null) function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = false)
{ {
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator']; $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
if (null === $tables) { if (null === $tables) {
$tables = PMA_DBI_get_tables_full($db); $tables = PMA_DBI_get_tables_full($db, false, false, null, $limit_offset, $limit_count);
if ($GLOBALS['cfg']['NaturalOrder']) { if ($GLOBALS['cfg']['NaturalOrder']) {
uksort($tables, 'strnatcasecmp'); uksort($tables, 'strnatcasecmp');
} }

View File

@@ -204,11 +204,14 @@ if (! $GLOBALS['server']) {
echo '<noscript>' . "\n" echo '<noscript>' . "\n"
.'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n" .'<input type="submit" name="Go" value="' . $GLOBALS['strGo'] . '" />' . "\n"
.'</noscript>' . "\n" .'</noscript>' . "\n"
.'</form>' . "\n" .'</form>' . "\n";
.'</div>' . "\n";
} else { } else {
echo '<div id="databaseList">' . "\n";
echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n"; echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['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']);
echo '</div>' . "\n";
} }
?> ?>
@@ -269,7 +272,17 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
} }
echo '</a></p>'; echo '</a></p>';
$table_list = PMA_getTableList($GLOBALS['db']); /**
* 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 (count($table_list) > 0) { if (count($table_list) > 0) {
PMA_displayTableList($table_list, true, '', $GLOBALS['db']); PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
} else { } else {
@@ -279,6 +292,11 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
} elseif ($GLOBALS['cfg']['LeftFrameLight']) { } elseif ($GLOBALS['cfg']['LeftFrameLight']) {
echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n"; echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
} else { } else {
echo '<div id="databaseList">' . "\n";
$_url_params = array('pos' => $pos);
PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
echo '</div>' . "\n";
$common_url_query = PMA_generate_common_url(); $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']); PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
} }
@@ -588,7 +606,5 @@ function PMA_displayTableList($tables, $visible = false,
echo '</div>' . "\n"; echo '</div>' . "\n";
$_url_params = array('pos' => $pos);
PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
PMA_exitNavigationFrame(); PMA_exitNavigationFrame();
?> ?>

View File

@@ -72,7 +72,6 @@ div#pmalogo {
} }
div#pmalogo, div#pmalogo,
div#leftframelinks, div#leftframelinks,
div#navidbpageselector,
div#databaseList { div#databaseList {
text-align: center; text-align: center;
border-bottom: 0.05em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>; border-bottom: 0.05em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
@@ -202,4 +201,4 @@ div#left_tableList ul ul {
border-<?php echo $left; ?>: 0.1em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>; border-<?php echo $left; ?>: 0.1em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
padding-bottom: 0.1em; padding-bottom: 0.1em;
border-bottom: 0.1em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>; border-bottom: 0.1em solid <?php echo $GLOBALS['cfg']['NaviColor']; ?>;
} }