private function renderThread(ConpherenceThread $thread)
 {
     $user = $this->getUser();
     $uri = $this->baseURI . $thread->getID() . '/';
     $data = $thread->getDisplayData($user);
     $title = $data['title'];
     $subtitle = $data['subtitle'];
     $unread_count = $data['unread_count'];
     $epoch = $data['epoch'];
     $image = $data['image'];
     $dom_id = $thread->getPHID() . '-nav-item';
     return id(new ConpherenceMenuItemView())->setUser($user)->setTitle($title)->setSubtitle($subtitle)->setHref($uri)->setEpoch($epoch)->setImageURI($image)->setUnreadCount($unread_count)->setID($thread->getPHID() . '-nav-item')->addSigil('conpherence-menu-click')->setMetadata(array('title' => $data['js_title'], 'id' => $dom_id, 'threadID' => $thread->getID()));
 }
 protected function buildHeaderPaneContent(ConpherenceThread $conpherence, array $policy_objects)
 {
     assert_instances_of($policy_objects, 'PhabricatorPolicy');
     $crumbs = $this->buildApplicationCrumbs();
     $data = $conpherence->getDisplayData($this->getViewer());
     if ($conpherence->getID() && $conpherence->getIsRoom()) {
         $icon = $conpherence->getPolicyIconName($policy_objects);
     } else {
         $icon = null;
     }
     $crumbs->addCrumb(id(new PHUICrumbView())->setIcon($icon)->setName($data['title'])->setHref($this->getApplicationURI('update/' . $conpherence->getID() . '/'))->setWorkflow(true));
     return hsprintf('%s', array(phutil_tag('div', array('class' => 'header-loading-mask'), ''), $crumbs));
 }
 protected function buildHeaderPaneContent(ConpherenceThread $conpherence, array $policy_objects)
 {
     assert_instances_of($policy_objects, 'PhabricatorPolicy');
     $viewer = $this->getViewer();
     $header = null;
     if ($conpherence->getID()) {
         $data = $conpherence->getDisplayData($this->getViewer());
         $header = id(new PHUIHeaderView())->setHeader($data['title'])->setSubheader($data['topic'])->setImage($data['image']);
         $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $conpherence, PhabricatorPolicyCapability::CAN_EDIT);
         if ($can_edit) {
             $header->setImageURL($this->getApplicationURI('picture/' . $conpherence->getID() . '/'));
         }
         $participating = $conpherence->getParticipantIfExists($viewer->getPHID());
         $can_join = PhabricatorPolicyFilter::hasCapability($viewer, $conpherence, PhabricatorPolicyCapability::CAN_JOIN);
         $header->addActionItem(id(new PHUIIconCircleView())->setHref($this->getApplicationURI('update/' . $conpherence->getID()) . '/')->setIcon('fa-pencil')->addClass('hide-on-device')->setColor('violet')->setWorkflow(true));
         $header->addActionItem(id(new PHUIIconCircleView())->setHref($this->getApplicationURI('update/' . $conpherence->getID()) . '/' . '?action=' . ConpherenceUpdateActions::NOTIFICATIONS)->setIcon('fa-gear')->addClass('hide-on-device')->setColor('pink')->setWorkflow(true));
         $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY;
         $widget_view = (bool) $viewer->getUserSetting($widget_key, false);
         Javelin::initBehavior('toggle-widget', array('show' => (int) $widget_view, 'settingsURI' => '/settings/adjust/?key=' . $widget_key));
         $header->addActionItem(id(new PHUIIconCircleView())->addSigil('conpherence-widget-toggle')->setIcon('fa-group')->setHref('#')->addClass('conpherence-participant-toggle'));
         Javelin::initBehavior('conpherence-search');
         $header->addActionItem(id(new PHUIIconCircleView())->addSigil('conpherence-search-toggle')->setIcon('fa-search')->setHref('#')->setColor('green')->addClass('conpherence-search-toggle'));
         if ($can_join && !$participating) {
             $action = ConpherenceUpdateActions::JOIN_ROOM;
             $uri = $this->getApplicationURI('update/' . $conpherence->getID() . '/');
             $button = phutil_tag('button', array('type' => 'SUBMIT', 'class' => 'button green mlr'), pht('Join Room'));
             $hidden = phutil_tag('input', array('type' => 'hidden', 'name' => 'action', 'value' => ConpherenceUpdateActions::JOIN_ROOM));
             $form = phabricator_form($viewer, array('method' => 'POST', 'action' => (string) $uri), array($hidden, $button));
             $header->addActionItem($form);
         }
     }
     return $header;
 }
 protected function buildHeaderPaneContent(ConpherenceThread $conpherence)
 {
     $crumbs = $this->buildApplicationCrumbs();
     if ($conpherence->getTitle()) {
         $title = $conpherence->getTitle();
     } else {
         $title = pht('[No Title]');
     }
     $crumbs->addCrumb(id(new PhabricatorCrumbView())->setName($title)->setHref($this->getApplicationURI('update/' . $conpherence->getID() . '/'))->setWorkflow(true));
     return hsprintf('%s', array(phutil_tag('div', array('class' => 'header-loading-mask'), ''), $crumbs));
 }
 private function renderThread(ConpherenceThread $thread, array $policy_objects)
 {
     $user = $this->getUser();
     $uri = '/' . $thread->getMonogram();
     $data = $thread->getDisplayData($user);
     $icon = id(new PHUIIconView())->addClass('msr')->setIcon($thread->getPolicyIconName($policy_objects));
     $title = phutil_tag('span', array(), array($icon, $data['title']));
     $subtitle = $data['subtitle'];
     $unread_count = $data['unread_count'];
     $epoch = $data['epoch'];
     $image = $data['image'];
     $dom_id = $thread->getPHID() . '-nav-item';
     return id(new ConpherenceMenuItemView())->setUser($user)->setTitle($title)->setSubtitle($subtitle)->setHref($uri)->setEpoch($epoch)->setImageURI($image)->setUnreadCount($unread_count)->setID($thread->getPHID() . '-nav-item')->addSigil('conpherence-menu-click')->setMetadata(array('title' => $data['title'], 'id' => $dom_id, 'threadID' => $thread->getID()));
 }
 protected function buildHeaderPaneContent(ConpherenceThread $conpherence, array $policy_objects)
 {
     assert_instances_of($policy_objects, 'PhabricatorPolicy');
     $viewer = $this->getViewer();
     $header = null;
     if ($conpherence->getID()) {
         $data = $conpherence->getDisplayData($this->getViewer());
         $header = id(new PHUIHeaderView())->setHeader($data['title'])->setSubheader($data['topic'])->addClass(!$data['topic'] ? 'conpherence-no-topic' : null);
         $can_edit = PhabricatorPolicyFilter::hasCapability($viewer, $conpherence, PhabricatorPolicyCapability::CAN_EDIT);
         $header->addActionItem(id(new PHUIIconCircleView())->setHref($this->getApplicationURI('update/' . $conpherence->getID()) . '/')->setIcon('fa-pencil')->addClass('hide-on-device')->setColor('violet')->setWorkflow(true));
         $header->addActionItem(id(new PHUIIconCircleView())->setHref($this->getApplicationURI('update/' . $conpherence->getID()) . '/' . '?action=' . ConpherenceUpdateActions::NOTIFICATIONS)->setIcon('fa-gear')->addClass('hide-on-device')->setColor('pink')->setWorkflow(true));
         $widget_key = PhabricatorConpherenceWidgetVisibleSetting::SETTINGKEY;
         $widget_view = (bool) $viewer->getUserSetting($widget_key, false);
         Javelin::initBehavior('toggle-widget', array('show' => (int) $widget_view, 'settingsURI' => '/settings/adjust/?key=' . $widget_key));
         $header->addActionItem(id(new PHUIIconCircleView())->addSigil('conpherence-widget-toggle')->setIcon('fa-group')->setHref('#')->addClass('conpherence-participant-toggle'));
     }
     return $header;
 }
 private function renderThread(ConpherenceThread $thread, array $policy_objects)
 {
     $user = $this->getUser();
     $uri = '/' . $thread->getMonogram();
     $data = $thread->getDisplayData($user);
     $icon = id(new PHUIIconView())->addClass('msr')->setIcon($thread->getPolicyIconName($policy_objects));
     $title = phutil_tag('span', array(), array($icon, $data['title']));
     $subtitle = $data['subtitle'];
     $unread_count = $data['unread_count'];
     $epoch = $data['epoch'];
     $image = $data['image'];
     $dom_id = $thread->getPHID() . '-nav-item';
     $glyph_pref = PhabricatorUserPreferences::PREFERENCE_TITLES;
     $preferences = $user->loadPreferences();
     if ($preferences->getPreference($glyph_pref) == 'glyph') {
         $glyph = id(new PhabricatorConpherenceApplication())->getTitleGlyph() . ' ';
     } else {
         $glyph = null;
     }
     return id(new ConpherenceMenuItemView())->setUser($user)->setTitle($title)->setSubtitle($subtitle)->setHref($uri)->setEpoch($epoch)->setImageURI($image)->setUnreadCount($unread_count)->setID($thread->getPHID() . '-nav-item')->addSigil('conpherence-menu-click')->setMetadata(array('title' => $glyph . $data['title'], 'id' => $dom_id, 'threadID' => $thread->getID()));
 }
 protected final function getConpherenceURI(ConpherenceThread $conpherence)
 {
     $id = $conpherence->getID();
     return PhabricatorEnv::getProductionURI($this->getApplication()->getApplicationURI($id));
 }