[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class ConpherenceMenuItemView extends AphrontTagView { 4 5 private $title; 6 private $subtitle; 7 private $imageURI; 8 private $href; 9 private $epoch; 10 private $unreadCount; 11 12 public function setUnreadCount($unread_count) { 13 $this->unreadCount = $unread_count; 14 return $this; 15 } 16 public function getUnreadCount() { 17 return $this->unreadCount; 18 } 19 20 public function setEpoch($epoch) { 21 $this->epoch = $epoch; 22 return $this; 23 } 24 public function getEpoch() { 25 return $this->epoch; 26 } 27 28 public function setHref($href) { 29 $this->href = $href; 30 return $this; 31 } 32 public function getHref() { 33 return $this->href; 34 } 35 36 public function setImageURI($image_uri) { 37 $this->imageURI = $image_uri; 38 return $this; 39 } 40 public function getImageURI() { 41 return $this->imageURI; 42 } 43 44 public function setSubtitle($subtitle) { 45 $this->subtitle = $subtitle; 46 return $this; 47 } 48 public function getSubtitle() { 49 return $this->subtitle; 50 } 51 52 public function setTitle($title) { 53 $this->title = $title; 54 return $this; 55 } 56 57 public function getTitle() { 58 return $this->title; 59 } 60 61 protected function getTagName() { 62 return 'a'; 63 } 64 65 protected function getTagAttributes() { 66 $classes = array('conpherence-menu-item-view'); 67 return array( 68 'class' => $classes, 69 'href' => $this->href, 70 ); 71 } 72 73 protected function getTagContent() { 74 $image = null; 75 if ($this->imageURI) { 76 $image = phutil_tag( 77 'span', 78 array( 79 'class' => 'conpherence-menu-item-image', 80 'style' => 'background-image: url('.$this->imageURI.');', 81 ), 82 ''); 83 } 84 $title = null; 85 if ($this->title) { 86 $title = phutil_tag( 87 'span', 88 array( 89 'class' => 'conpherence-menu-item-title', 90 ), 91 $this->title); 92 } 93 $subtitle = null; 94 if ($this->subtitle) { 95 $subtitle = phutil_tag( 96 'span', 97 array( 98 'class' => 'conpherence-menu-item-subtitle', 99 ), 100 $this->subtitle); 101 } 102 $unread_count = null; 103 if ($this->unreadCount) { 104 $unread_count = phutil_tag( 105 'span', 106 array( 107 'class' => 'conpherence-menu-item-unread-count', 108 ), 109 (int)$this->unreadCount); 110 } 111 112 return array( 113 $image, 114 $title, 115 $subtitle, 116 $unread_count, 117 ); 118 } 119 120 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |