From 42cf4f8660f10b667765fa6767adcef39fbc52ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 17 Feb 2011 10:44:16 +0100 Subject: [PATCH] Factor out code for getting PHP documentation link --- libraries/common.lib.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 5d049315c..26d4d021c 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -447,6 +447,22 @@ function PMA_showDocu($anchor) { } } // end of the 'PMA_showDocu()' function +/** + * Returns a link to the PHP documentation + * + * @param string anchor in documentation + * + * @return string the URL + * + * @access public + */ +function PMA_getPHPDocLink($target) { + /* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */ + $lang = _pgettext('PHP documentation language', 'en'); + + return 'http://php.net/manual/' . $lang . '/' . $target; +} + /** * Displays a link to the PHP documentation * @@ -457,10 +473,7 @@ function PMA_showDocu($anchor) { * @access public */ function PMA_showPHPDocu($target) { - /* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */ - $lang = _pgettext('PHP documentation language', 'en'); - - $url = 'http://php.net/manual/' . $lang . '/' . $target; + $url = PMA_getPHPDocLink($target); if ($GLOBALS['cfg']['ReplaceHelpImg']) { return '' . __('Documentation') . '';