Factor out code for getting PHP documentation link

This commit is contained in:
Michal Čihař
2011-02-17 10:44:16 +01:00
parent 4c1ee06bb3
commit 42cf4f8660

View File

@@ -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 '<a href="' . $url . '" target="documentation"><img class="icon" src="' . $GLOBALS['pmaThemeImage'] . 'b_help.png" width="11" height="11" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>';