diff --git a/ChangeLog b/ChangeLog index 0228abac4..9dfe9d1b7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ $Source$ - Add support for groupping options. - Support for forcing one of two bool/bgroups. - Add documentation. + - Support for localised texts in defaults. * css/phpmyadmin.css.php, themes/darkblue_orange/css/theme_right.css.php, themes/original/css/theme_right.css.php: New style for non table forms used in plugins. diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index 67d608344..c8ce7a81a 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -91,7 +91,19 @@ function PMA_pluginGetDefault($section, $opt) if (isset($GLOBALS['timeout_passed']) && $GLOBALS['timeout_passed'] && isset($_REQUEST[$opt])) { return htmlspecialchars($_REQUEST[$opt]); } elseif (isset($GLOBALS['cfg'][$section][$opt])) { - return htmlspecialchars($GLOBALS['cfg'][$section][$opt]); + $matches = array(); + /* Possibly replace localised texts */ + if (preg_match_all('/(str[A-Z][A-Za-z0-9]*)/', $GLOBALS['cfg'][$section][$opt], $matches)) { + $val = $GLOBALS['cfg'][$section][$opt]; + foreach($matches[0] as $match) { + if (isset($GLOBALS[$match])) { + $val = str_replace($match, $GLOBALS[$match], $val); + } + } + return htmlspecialchars($val); + } else { + return htmlspecialchars($GLOBALS['cfg'][$section][$opt]); + } } return ''; }