diff --git a/ChangeLog b/ChangeLog index ca4a2d058..989e6706b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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, diff --git a/Documentation.html b/Documentation.html index 590758ad7..f1bbed10c 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1271,9 +1271,11 @@ ALTER TABLE `pma_column_comments` $cfg['LeftFrameDBSeparator']. -
$cfg['LeftFrameDBSeparator'] string
+
$cfg['LeftFrameDBSeparator'] + string or array
The string used to separate the parts of the database name when showing - them in a tree.
+ them in a tree. Alternatively you can specify more strings in an array + and all of them will be used as a separator.
$cfg['LeftFrameTableSeparator'] string
Defines a string to be used to nest table spaces. Defaults to '__'. diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index df3a6b403..10edebd11 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -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 {