title = $title; return $this; } public function setEpoch($epoch) { $this->epoch = $epoch; return $this; } public function setImage($image) { $this->image = $image; return $this; } public function setImageHref($image_href) { $this->imageHref = $image_href; return $this; } public function setAppIcon($icon) { $this->appIcon = $icon; return $this; } public function setViewed($viewed) { $this->viewed = $viewed; return $this; } public function getViewed() { return $this->viewed; } public function setHref($href) { $this->href = $href; return $this; } public function getHref() { return $this->href; } public function renderNotification() { $classes = array( 'phabricator-notification', ); if (!$this->viewed) { $classes[] = 'phabricator-notification-unread'; } return javelin_tag( 'div', array( 'class' => implode(' ', $classes), 'sigil' => 'notification', 'meta' => array( 'href' => $this->getHref(), ), ), $this->title); } public function render() { $actor = ''; if ($this->image) { $actor = new PhabricatorActionIconView(); $actor->setImage($this->image); if ($this->imageHref) { $actor->setHref($this->imageHref); } } $head = phutil_tag( 'div', array( 'class' => 'phabricator-feed-story-head', ), array( $actor, nonempty($this->title, pht('Untitled Story')), )); $body = null; $foot = null; $image_style = null; $body = phutil_tag( 'div', array( 'class' => 'phabricator-feed-story-body', ), $this->renderChildren()); if ($this->epoch) { $foot = phabricator_datetime($this->epoch, $this->user); } else { $foot = pht('No time specified.'); } $icon = null; if ($this->appIcon) { $icon = new PhabricatorActionIconView(); $icon->setSpriteIcon($this->appIcon); $icon->setSpriteSheet(PhabricatorActionIconView::SPRITE_APPS); } $foot = phutil_tag( 'div', array( 'class' => 'phabricator-feed-story-foot', ), array( $icon, $foot)); require_celerity_resource('phabricator-feed-css'); $story = phutil_tag( 'div', array( 'class' => 'phabricator-feed-story', 'style' => $image_style, ), array( $head, $body, $foot)); return phutil_tag( 'div', array( 'class' => 'phabricator-feed-wrap' ), $story); } }