Skip to content

Commit

Permalink
Split URL generating from returning URL
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Aug 7, 2013
1 parent 91bd7e4 commit eac01ea
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions libraries/Util.class.php
Expand Up @@ -430,21 +430,17 @@ public static function showDocLink($link, $target = 'documentation')
} // end of the 'showDocLink()' function

/**
* Displays a link to the official MySQL documentation
* Get a URL link to the official MySQL documentation
*
* @param string $chapter chapter of "HTML, one page per chapter" documentation
* @param string $link contains name of page/anchor that is being linked
* @param bool $big_icon whether to use big icon (like in left frame)
* @param string $anchor anchor to page part
* @param bool $just_open whether only the opening <a> tag should be returned
*
* @return string the html link
* @return string the URL link
*
* @access public
*/
public static function showMySQLDocu(
$chapter, $link, $big_icon = false, $anchor = '', $just_open = false
) {
public static function getMySQLDocuURL($chapter, $link, $anchor = '') {
global $cfg;

if (($cfg['MySQLManualType'] == 'none') || empty($cfg['MySQLManualBase'])) {
Expand Down Expand Up @@ -505,15 +501,34 @@ public static function showMySQLDocu(
}
break;
}
return PMA_linkURL($url);
}

$open_link = '<a href="' . PMA_linkURL($url) . '" target="mysql_doc">';
/**
* Displays a link to the official MySQL documentation
*
* @param string $chapter chapter of "HTML, one page per chapter" documentation
* @param string $link contains name of page/anchor that is being linked
* @param bool $big_icon whether to use big icon (like in left frame)
* @param string $anchor anchor to page part
* @param bool $just_open whether only the opening <a> tag should be returned
*
* @return string the html link
*
* @access public
*/
public static function showMySQLDocu(
$chapter, $link, $big_icon = false, $anchor = '', $just_open = false
) {
$url = self::getMySQLDocuURL($chapter, $link, $anchor);
$open_link = '<a href="' . $url . '" target="mysql_doc">';
if ($just_open) {
return $open_link;
} elseif ($big_icon) {
return $open_link
. self::getImage('b_sqlhelp.png', __('Documentation')) . '</a>';
} else {
return self::showDocLink(PMA_linkURL($url), 'mysql_doc');
return self::showDocLink($url, 'mysql_doc');
}
} // end of the 'showMySQLDocu()' function

Expand Down

0 comments on commit eac01ea

Please sign in to comment.