From: Roland Häder Date: Sat, 6 Dec 2008 22:20:18 +0000 (+0000) Subject: WebLinkHelper class rewritten X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d2fd9a08c36d00d6e5db997c695aa03f6920d370;p=core.git WebLinkHelper class rewritten --- diff --git a/inc/classes/main/helper/web/links/class_WebLinkHelper.php b/inc/classes/main/helper/web/links/class_WebLinkHelper.php index 1a238a6d..178ae8dd 100644 --- a/inc/classes/main/helper/web/links/class_WebLinkHelper.php +++ b/inc/classes/main/helper/web/links/class_WebLinkHelper.php @@ -75,15 +75,16 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * extra content * * @param $linkText Link text to set in link + * @param $linkTitle Link title to set in link * @param $extraContent Optional extra HTML content * @return $linkContent Rendered text link content */ - private function renderLinkContentWithTextExtraContent ($linkText, $extraContent="") { + private function renderLinkContentWithTextExtraContent ($linkText, $linkTitle, $extraContent="") { // Construct link content $linkContent = sprintf("%s", $this->getLinkBase(), $extraContent, - $linkText, + $linkTitle, $linkText ); @@ -221,7 +222,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { * @return void * @throws NoGroupOpenedException If no previous group was opened */ - public function addActionLink ($linkAction, $linkText) { + public function addActionLink ($linkAction, $linkText, $linkTitle) { // Check if a previous group was opened if ($this->ifGroupOpenedPreviously() === false) { // No group was opened before! @@ -245,7 +246,7 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { ); // Renders the link content - $linkContent = $this->renderLinkContentWithTextExtraContent($linkText, $action); + $linkContent = $this->renderLinkContentWithTextExtraContent($linkText, $linkTitle, $action); // Add the content to the previous group $this->addContentToPreviousGroup($linkContent); @@ -260,10 +261,13 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ public function addActionLinkById ($linkAction, $languageId) { // Resolve the language string - $languageResolved = $this->getLanguageInstance()->getMessage($languageId); + $languageResolvedText = $this->getLanguageInstance()->getMessage("link_" . $languageId . "_text"); + + // Resolve the language string + $languageResolvedTitle = $this->getLanguageInstance()->getMessage("link_" . $languageId . "_title"); // Add the action link - $this->addActionLink($linkAction, $languageResolved); + $this->addActionLink($linkAction, $languageResolvedText, $languageResolvedTitle); } /** @@ -275,10 +279,13 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate { */ public function addLinkWithTextById ($languageId) { // Resolve the language string - $languageResolved = $this->getLanguageInstance()->getMessage($languageId); + $languageResolvedText = $this->getLanguageInstance()->getMessage("link_" . $languageId . "_text"); + + // Resolve the language string + $languageResolvedTitle = $this->getLanguageInstance()->getMessage("link_" . $languageId . "_title"); // Now add the link - $linkContent = $this->renderLinkContentWithTextExtraContent($languageResolved); + $linkContent = $this->renderLinkContentWithTextExtraContent($languageResolvedText, $languageResolvedTitle); // Add the content to the previous group $this->addContentToPreviousGroup($linkContent);