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';
return _('Untitled section');
}
+ function link()
+ {
+ return null;
+ }
+
function showContent()
{
$this->out->element('p', null,