rfe #1821619 LeftFrameDBSeparator can be an array

This commit is contained in:
Michal Čihař
2008-11-30 14:54:29 +00:00
parent 28b8e9448a
commit 800762b81b
3 changed files with 26 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- rfe #2100910 configurable default charset for import
- rfe #1913541 link to InnoDB status when error 1005 occurs
- rfe #1927189 strip ` from column names on import
- rfe #1821619 LeftFrameDBSeparator can be an array
3.1.1.0 (not yet released)
- patch #2242765 [core] Navi panel server links wrong,

View File

@@ -1271,9 +1271,11 @@ ALTER TABLE `pma_column_comments`
<a href="#cfg_LeftFrameDBSeparator" class="configrule">$cfg['LeftFrameDBSeparator']</a>.
</dd>
<dt id="cfg_LeftFrameDBSeparator">$cfg['LeftFrameDBSeparator'] string</dt>
<dt id="cfg_LeftFrameDBSeparator">$cfg['LeftFrameDBSeparator']
string or array</dt>
<dd>The string used to separate the parts of the database name when showing
them in a tree.</dd>
them in a tree. Alternatively you can specify more strings in an array
and all of them will be used as a separator.</dd>
<dt id="cfg_LeftFrameTableSeparator">$cfg['LeftFrameTableSeparator'] string</dt>
<dd>Defines a string to be used to nest table spaces. Defaults to '__'.

View File

@@ -278,6 +278,16 @@ require_once './libraries/List.class.php';
$db_tooltips = PMA_getDbComments();
}
if (!$GLOBALS['cfg']['LeftFrameDBTree']) {
$separators = array();
} elseif (is_array($GLOBALS['cfg']['LeftFrameDBSeparator'])) {
$separators = $GLOBALS['cfg']['LeftFrameDBSeparator'];
} elseif (!empty($GLOBALS['cfg']['LeftFrameDBSeparator'])) {
$separators = array($GLOBALS['cfg']['LeftFrameDBSeparator']);
} else {
$separators = array();
}
foreach ($this->getLimitedItems($offset, $count) as $key => $db) {
// garvin: Get comments from PMA comments table
$db_tooltip = '';
@@ -286,15 +296,21 @@ require_once './libraries/List.class.php';
$db_tooltip = $_db_tooltips[$db];
}
if ($GLOBALS['cfg']['LeftFrameDBTree']
&& $GLOBALS['cfg']['LeftFrameDBSeparator']
&& strstr($db, $GLOBALS['cfg']['LeftFrameDBSeparator']))
{
$pos = false;
foreach($separators as $separator) {
// use strpos instead of strrpos; it seems more common to
// have the db name, the separator, then the rest which
// might contain a separator
// like dbname_the_rest
$pos = strpos($db, $GLOBALS['cfg']['LeftFrameDBSeparator']);
$pos = strpos($db, $separator);
if ($pos !== false) {
break;
}
}
if ($pos !== false) {
$group = substr($db, 0, $pos);
$disp_name_cut = substr($db, $pos);
} else {