Ferreteria/v2/class/fcNavLink: Difference between revisions
< Ferreteria | v2 | class
Jump to navigation
Jump to search
(Created page with "{{page/code/class}} <source lang=php> /*:::: PURPOSE: a navigation link * permission-aware (from base) * defaults to having permission (from base) * does not def...") |
m (2 revisions imported: moving this project here) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{page/code/class}} | {{page/code/class}} | ||
* '''file''': {{l/ferreteria/file|menu/nav.php}} | |||
* '''extends''': {{l/version|class|fcNavBase}} | |||
* '''extender''': {{l/version|class|fcMenuLink}} | |||
<source lang=php> | <source lang=php> | ||
/*:::: | /*:::: | ||
Line 38: | Line 41: | ||
// -- OUTPUT -- // | // -- OUTPUT -- // | ||
}</source> | }</source> | ||
Latest revision as of 16:45, 22 May 2022
- file: Template:L/ferreteria/file
- extends: Template:L/version
- extender: Template:L/version
/*::::
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 -- //
}