Path: blob/master/src/applications/conpherence/view/ConpherenceMenuItemView.php
12256 views
<?php12final class ConpherenceMenuItemView extends AphrontTagView {34private $title;5private $subtitle;6private $imageURI;7private $href;8private $epoch;9private $unreadCount;1011public function setUnreadCount($unread_count) {12$this->unreadCount = $unread_count;13return $this;14}15public function getUnreadCount() {16return $this->unreadCount;17}1819public function setEpoch($epoch) {20$this->epoch = $epoch;21return $this;22}23public function getEpoch() {24return $this->epoch;25}2627public function setHref($href) {28$this->href = $href;29return $this;30}31public function getHref() {32return $this->href;33}3435public function setImageURI($image_uri) {36$this->imageURI = $image_uri;37return $this;38}39public function getImageURI() {40return $this->imageURI;41}4243public function setSubtitle($subtitle) {44$this->subtitle = $subtitle;45return $this;46}47public function getSubtitle() {48return $this->subtitle;49}5051public function setTitle($title) {52$this->title = $title;53return $this;54}5556public function getTitle() {57return $this->title;58}5960protected function getTagName() {61return 'a';62}6364protected function getTagAttributes() {65$classes = array();66$classes[] = 'conpherence-menu-item-view';67$classes[] = 'phui-list-item-href';68return array(69'class' => implode(' ', $classes),70'href' => $this->href,71);72}7374protected function getTagContent() {75$image = null;76if ($this->imageURI) {77$image = phutil_tag(78'span',79array(80'class' => 'conpherence-menu-item-image',81'style' => 'background-image: url('.$this->imageURI.');',82),83'');84}85$title = null;86if ($this->title) {87$title = phutil_tag(88'span',89array(90'class' => 'conpherence-menu-item-title',91),92$this->title);93}94$subtitle = null;95if ($this->subtitle) {96$subtitle = phutil_tag(97'span',98array(99'class' => 'conpherence-menu-item-subtitle',100),101$this->subtitle);102}103$unread_count = null;104if ($this->unreadCount) {105$unread_count = phutil_tag(106'span',107array(108'class' => 'conpherence-menu-item-unread-count',109),110(int)$this->unreadCount);111}112113return array(114$image,115$title,116$subtitle,117$unread_count,118);119}120121}122123124