[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class ConpherenceLayoutView extends AphrontView { 4 5 private $thread; 6 private $baseURI; 7 private $threadView; 8 private $role; 9 private $header; 10 private $messages; 11 private $replyForm; 12 13 public function setMessages($messages) { 14 $this->messages = $messages; 15 return $this; 16 } 17 18 public function setReplyForm($reply_form) { 19 $this->replyForm = $reply_form; 20 return $this; 21 } 22 23 public function setHeader($header) { 24 $this->header = $header; 25 return $this; 26 } 27 28 public function setRole($role) { 29 $this->role = $role; 30 return $this; 31 } 32 33 public function getThreadView() { 34 return $this->threadView; 35 } 36 37 public function setBaseURI($base_uri) { 38 $this->baseURI = $base_uri; 39 return $this; 40 } 41 42 public function setThread(ConpherenceThread $thread) { 43 $this->thread = $thread; 44 return $this; 45 } 46 47 public function setThreadView(ConpherenceThreadListView $thead_view) { 48 $this->threadView = $thead_view; 49 return $this; 50 } 51 52 public function render() { 53 require_celerity_resource('conpherence-menu-css'); 54 require_celerity_resource('conpherence-message-pane-css'); 55 require_celerity_resource('conpherence-widget-pane-css'); 56 57 $layout_id = celerity_generate_unique_node_id(); 58 59 $selected_id = null; 60 $selected_thread_id = null; 61 if ($this->thread) { 62 $selected_id = $this->thread->getPHID().'-nav-item'; 63 $selected_thread_id = $this->thread->getID(); 64 } 65 $this->initBehavior('conpherence-menu', 66 array( 67 'baseURI' => $this->baseURI, 68 'layoutID' => $layout_id, 69 'selectedID' => $selected_id, 70 'selectedThreadID' => $selected_thread_id, 71 'role' => $this->role, 72 'hasThreadList' => (bool)$this->threadView, 73 'hasThread' => (bool)$this->messages, 74 'hasWidgets' => false, 75 )); 76 77 $this->initBehavior( 78 'conpherence-widget-pane', 79 array( 80 'widgetBaseUpdateURI' => $this->baseURI.'update/', 81 'widgetRegistry' => array( 82 'conpherence-message-pane' => array( 83 'name' => pht('Thread'), 84 'icon' => 'fa-comment', 85 'deviceOnly' => true, 86 'hasCreate' => false, 87 ), 88 'widgets-people' => array( 89 'name' => pht('Participants'), 90 'icon' => 'fa-users', 91 'deviceOnly' => false, 92 'hasCreate' => true, 93 'createData' => array( 94 'refreshFromResponse' => true, 95 'action' => ConpherenceUpdateActions::ADD_PERSON, 96 'customHref' => null, 97 ), 98 ), 99 'widgets-files' => array( 100 'name' => pht('Files'), 101 'icon' => 'fa-files-o', 102 'deviceOnly' => false, 103 'hasCreate' => false, 104 ), 105 'widgets-calendar' => array( 106 'name' => pht('Calendar'), 107 'icon' => 'fa-calendar', 108 'deviceOnly' => false, 109 'hasCreate' => true, 110 'createData' => array( 111 'refreshFromResponse' => false, 112 'action' => ConpherenceUpdateActions::ADD_STATUS, 113 'customHref' => '/calendar/event/create/', 114 ), 115 ), 116 'widgets-settings' => array( 117 'name' => pht('Settings'), 118 'icon' => 'fa-wrench', 119 'deviceOnly' => false, 120 'hasCreate' => false, 121 ), 122 ), 123 )); 124 125 126 return javelin_tag( 127 'div', 128 array( 129 'id' => $layout_id, 130 'sigil' => 'conpherence-layout', 131 'class' => 'conpherence-layout conpherence-role-'.$this->role, 132 ), 133 array( 134 javelin_tag( 135 'div', 136 array( 137 'class' => 'phabricator-nav-column-background', 138 'sigil' => 'phabricator-nav-column-background', 139 ), 140 ''), 141 javelin_tag( 142 'div', 143 array( 144 'id' => 'conpherence-menu-pane', 145 'class' => 'conpherence-menu-pane phabricator-side-menu', 146 'sigil' => 'conpherence-menu-pane', 147 ), 148 $this->threadView), 149 javelin_tag( 150 'div', 151 array( 152 'class' => 'conpherence-content-pane', 153 ), 154 array( 155 javelin_tag( 156 'div', 157 array( 158 'class' => 'conpherence-header-pane', 159 'id' => 'conpherence-header-pane', 160 'sigil' => 'conpherence-header-pane', 161 ), 162 nonempty($this->header, '')), 163 javelin_tag( 164 'div', 165 array( 166 'class' => 'conpherence-no-threads', 167 'sigil' => 'conpherence-no-threads', 168 'style' => 'display: none;', 169 ), 170 array( 171 phutil_tag( 172 'div', 173 array( 174 'class' => 'text', 175 ), 176 pht('You do not have any messages yet.')), 177 javelin_tag( 178 'a', 179 array( 180 'href' => '/conpherence/new/', 181 'class' => 'button grey', 182 'sigil' => 'workflow', 183 ), 184 pht('Send a Message')), 185 )), 186 javelin_tag( 187 'div', 188 array( 189 'class' => 'conpherence-widget-pane', 190 'id' => 'conpherence-widget-pane', 191 'sigil' => 'conpherence-widget-pane', 192 ), 193 array( 194 phutil_tag( 195 'div', 196 array( 197 'class' => 'widgets-loading-mask', 198 ), 199 ''), 200 javelin_tag( 201 'div', 202 array( 203 'sigil' => 'conpherence-widgets-holder', 204 ), 205 ''), 206 )), 207 javelin_tag( 208 'div', 209 array( 210 'class' => 'conpherence-message-pane', 211 'id' => 'conpherence-message-pane', 212 'sigil' => 'conpherence-message-pane', 213 ), 214 array( 215 javelin_tag( 216 'div', 217 array( 218 'class' => 'conpherence-messages', 219 'id' => 'conpherence-messages', 220 'sigil' => 'conpherence-messages', 221 ), 222 nonempty($this->messages, '')), 223 phutil_tag( 224 'div', 225 array( 226 'class' => 'messages-loading-mask', 227 ), 228 ''), 229 javelin_tag( 230 'div', 231 array( 232 'id' => 'conpherence-form', 233 'sigil' => 'conpherence-form', 234 ), 235 nonempty($this->replyForm, '')), 236 )), 237 )), 238 )); 239 } 240 241 }
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 |