X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsection.php;h=2d8d6f3673f50233ec266a964f22ea8a27297f45;hb=31b29fde50e9664e1b70064c043879ce87553883;hp=753a37efa424dc52c4f7da187aff869f464aade0;hpb=c4b9dc7a0ff2e41712715ac21bace067e8c02715;p=quix0rs-gnu-social.git diff --git a/lib/section.php b/lib/section.php index 753a37efa4..2d8d6f3673 100644 --- a/lib/section.php +++ b/lib/section.php @@ -61,22 +61,39 @@ class Section extends Widget array('id' => $this->divId(), 'class' => 'section')); - $this->out->element('h2', null, - $this->title()); + $this->showTitle(); $have_more = $this->showContent(); if ($have_more) { - $this->out->elementStart('p'); - $this->out->element('a', array('href' => $this->moreUrl(), - 'class' => 'more'), - $this->moreTitle()); - $this->out->elementEnd('p'); + $this->showMore(); } $this->out->elementEnd('div'); } + function showTitle() + { + $link = $this->link(); + if (!empty($link)) { + $this->out->elementStart('h2'); + $this->out->element('a', array('href' => $link), $this->title()); + $this->out->elementEnd('h2'); + } else { + $this->out->element('h2', null, + $this->title()); + } + } + + function showMore() + { + $this->out->elementStart('p'); + $this->out->element('a', array('href' => $this->moreUrl(), + 'class' => 'more'), + $this->moreTitle()); + $this->out->elementEnd('p'); + } + function divId() { return 'generic_section'; @@ -88,6 +105,11 @@ class Section extends Widget return _('Untitled section'); } + function link() + { + return null; + } + function showContent() { $this->out->element('p', null,