Ferreteria/v2/class/fcNavLink

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Ferreteria‎ | v2‎ | class
Jump to: navigation, search
/*::::
  PURPOSE: a navigation link
    * permission-aware (from base)
    * defaults to having permission (from base)
    * does not define URL
  NOTE: It's tempting to make this a fcHypertextTag because that adds executableTree and renderableTree,
    but it also assumes an opening and closing tag.
*/
abstract class fcNavLink extends fcNavBase {

    // ++ PROPERTY VALUES ++ //

    abstract protected function GetLinkURL();
    protected function GetStyleName() {
	return 'menu-link';
    }

    // -- SETUP -- //
    // ++ OUTPUT ++ //
    
    protected function RenderContent() {
	return $this->RenderLink();
    }
    /*----
      PURPOSE: renders just the link, no before/after decoration
      TAGS: NEW
    */
    protected function RenderLink() {
	$sLinkURL = $this->GetLinkURL();
	$htLinkText = htmlspecialchars($this->GetLinkText(),ENT_QUOTES);
	$htLinkPopup = htmlspecialchars($this->GetPopup(),ENT_QUOTES);
	$htStyleName = $this->GetStyleName();
	return "<a href='$sLinkURL' title='$htLinkPopup' class='$htStyleName'>$htLinkText</a>";
    }

    // -- OUTPUT -- //
}