diff --git a/ChangeLog b/ChangeLog index bb7b2a1ec..5046da116 100755 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ $Source$ Possibility to select SQL compatibility on import (RFE #1386132). * main.php, lang/*: Better message for reloading privileges (RFE #1420556). + * Documentation.html, libraries/config.default.php, + libraries/header.inc.php: Customizable window title (RFE #1408241). 2006-02-22 Sebastian Mendel * libraries/footer.inc.php: diff --git a/Documentation.html b/Documentation.html index da5a01b00..6b34070a8 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1623,14 +1623,24 @@ ALTER TABLE `pma_column_comments` t1, t2, t10). Currently implemented in the left panel (Light mode) and in Database view, for the table list. -
$cfg[ShowHttpHostTitle] boolean
-
Shows the HTTP host name - in window's title bar.
- -
$cfg[SetHttpHostTitle] string
-
If $cfg['ShowHttpHostTitle'] is TRUE, it shows the real - HTTP host name, unless - an alternate name is set here.
+
$cfg[TitleTable] string
+
$cfg[TitleDatabase] string
+
$cfg[TitleServer] string
+
$cfg[TitleDefault] string
+
Allows you to specify window's title bar. Following magic string can + be used to get special values: +
+
@HTTP_HOST@
+
HTTP host that runs phpMyAdmin
+
@SERVER@
+
MySQL server name
+
@DATABASE@
+
Currently opened database
+
@TABLE@
+
Currently opened table
+
@PHPMYADMIN@
+
phpMyAdmin with version
+
$cfg[ErrorIconic] boolean
Uses icons for warnings, errors and informations.
diff --git a/libraries/config.default.php b/libraries/config.default.php index 2ee1b6b63..7e1033c99 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -514,10 +514,11 @@ $cfg['NaturalOrder'] = TRUE; // Sort table and database in natura // FIXME: // 2004-05-08 rabus: We need to rearrange these variables. -$cfg['ShowHttpHostTitle'] = TRUE; // show HttpHost in browsers window title (true|false)? -$cfg['SetHttpHostTitle'] = ''; // if ShowHttpHostTitle=true, please set your host (server) - // or an other string, wich should be shown in browsers window title. - // If not set (or empty), the PMA will get your real Host-Adress. +// Window title settings +$cfg['TitleTable'] = '@HTTP_HOST@ / @SERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'; +$cfg['TitleDatabase'] = '@HTTP_HOST@ / @SERVER@ / @DATABASE@ | @PHPMYADMIN@'; +$cfg['TitleServer'] = '@HTTP_HOST@ / @SERVER@ | @PHPMYADMIN@'; +$cfg['TitleDefault'] = '@HTTP_HOST@ | @PHPMYADMIN@'; $cfg['ErrorIconic'] = TRUE; // show some icons for warning, error and information messages (true|false)? $cfg['MainPageIconic'] = TRUE; // show icons in list on main page and on menu tabs (true|false)? diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 1252f6759..105ac92f0 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -26,27 +26,33 @@ if (empty($GLOBALS['is_header_sent'])) { require_once('./libraries/header_meta_style.inc.php'); // generate title - $title = ''; - if ($cfg['ShowHttpHostTitle']) { - $title .= (empty($GLOBALS['cfg']['SetHttpHostTitle']) && isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $GLOBALS['cfg']['SetHttpHostTitle']) . ' / '; - } - if (!empty($GLOBALS['cfg']['Server']) && isset($GLOBALS['cfg']['Server']['host'])) { - $title.=str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['host']); - } - if (isset($GLOBALS['db'])) { - $title .= ' / ' . str_replace('\'', '\\\'', $GLOBALS['db']); - } - if (isset($GLOBALS['table'])) { - $title .= (empty($title) ? '' : ' ') . ' / ' . str_replace('\'', '\\\'', $GLOBALS['table']); - } - $title .= ' | phpMyAdmin ' . PMA_VERSION; + $title = str_replace( + array( + '@HTTP_HOST@', + '@SERVER@', + '@DATABASE@', + '@TABLE@', + '@PHPMYADMIN@', + ), + array( + isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '', + isset($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['Server']['host'] : '', + isset($GLOBALS['db']) ? $GLOBALS['db'] : '', + isset($GLOBALS['table']) ? $GLOBALS['table'] : '', + 'phpMyAdmin ' . PMA_VERSION, + ), + !empty($GLOBALS['table']) ? $GLOBALS['cfg']['TitleTable'] : + (!empty($GLOBALS['db']) ? $GLOBALS['cfg']['TitleDatabase'] : + (!empty($GLOBALS['cfg']['Server']['host']) ? $GLOBALS['cfg']['TitleServer'] : + $GLOBALS['cfg']['TitleDefault'])) + ); ?>