When there is no useful title, class="p-name e-content"

This commit is contained in:
Stephen Paul Weber 2016-06-10 21:00:48 +00:00
parent 47e541eaec
commit 83e7ade714

View File

@ -179,8 +179,9 @@ class NoticeListItem extends Widget
function showNoticeTitle() function showNoticeTitle()
{ {
if (Event::handle('StartShowNoticeTitle', array($this))) { if (Event::handle('StartShowNoticeTitle', array($this))) {
$nameClass = $this->notice->getTitle(false) ? 'p-name ' : '';
$this->element('a', array('href' => $this->notice->getUri(), $this->element('a', array('href' => $this->notice->getUri(),
'class' => 'p-name u-uid'), 'class' => $nameClass . 'u-uid'),
$this->notice->getTitle()); $this->notice->getTitle());
Event::handle('EndShowNoticeTitle', array($this)); Event::handle('EndShowNoticeTitle', array($this));
} }
@ -348,7 +349,8 @@ class NoticeListItem extends Widget
function showContent() function showContent()
{ {
// FIXME: URL, image, video, audio // FIXME: URL, image, video, audio
$this->out->elementStart('article', array('class' => 'e-content')); $nameClass = $this->notice->getTitle(false) ? '' : 'p-name ';
$this->out->elementStart('article', array('class' => $nameClass . 'e-content'));
if (Event::handle('StartShowNoticeContent', array($this->notice, $this->out, $this->out->getScoped()))) { if (Event::handle('StartShowNoticeContent', array($this->notice, $this->out, $this->out->getScoped()))) {
if ($this->maxchars > 0 && mb_strlen($this->notice->content) > $this->maxchars) { if ($this->maxchars > 0 && mb_strlen($this->notice->content) > $this->maxchars) {
$this->out->text(mb_substr($this->notice->content, 0, $this->maxchars) . '[…]'); $this->out->text(mb_substr($this->notice->content, 0, $this->maxchars) . '[…]');