breakup Section::show()

This commit is contained in:
Evan Prodromou 2011-04-14 18:18:39 -04:00
parent 9eba121339
commit f512e3df40

View File

@ -61,6 +61,19 @@ class Section extends Widget
array('id' => $this->divId(), array('id' => $this->divId(),
'class' => 'section')); 'class' => 'section'));
$this->showTitle();
$have_more = $this->showContent();
if ($have_more) {
$this->showMore();
}
$this->out->elementEnd('div');
}
function showTitle()
{
$link = $this->link(); $link = $this->link();
if (!empty($link)) { if (!empty($link)) {
$this->out->elementStart('h2'); $this->out->elementStart('h2');
@ -70,18 +83,15 @@ class Section extends Widget
$this->out->element('h2', null, $this->out->element('h2', null,
$this->title()); $this->title());
} }
}
$have_more = $this->showContent(); function showMore()
{
if ($have_more) { $this->out->elementStart('p');
$this->out->elementStart('p'); $this->out->element('a', array('href' => $this->moreUrl(),
$this->out->element('a', array('href' => $this->moreUrl(), 'class' => 'more'),
'class' => 'more'), $this->moreTitle());
$this->moreTitle()); $this->out->elementEnd('p');
$this->out->elementEnd('p');
}
$this->out->elementEnd('div');
} }
function divId() function divId()