public function render()
 {
     require_celerity_resource('conpherence-menu-css');
     $menu = id(new PHUIListView())->addClass('conpherence-menu')->setID('conpherence-menu');
     $policy_objects = ConpherenceThread::loadViewPolicyObjects($this->getUser(), $this->threads);
     $this->addRoomsToMenu($menu, $this->threads, $policy_objects);
     return $menu;
 }
 protected function renderResultList(array $conpherences, PhabricatorSavedQuery $query, array $handles)
 {
     assert_instances_of($conpherences, 'ConpherenceThread');
     $viewer = $this->requireViewer();
     $policy_objects = ConpherenceThread::loadViewPolicyObjects($viewer, $conpherences);
     $engines = array();
     $fulltext = $query->getParameter('fulltext');
     if (strlen($fulltext) && $conpherences) {
         $context = $this->loadContextMessages($conpherences, $fulltext);
         $author_phids = array();
         foreach ($context as $phid => $messages) {
             $conpherence = $conpherences[$phid];
             $engine = id(new PhabricatorMarkupEngine())->setViewer($viewer)->setContextObject($conpherence);
             foreach ($messages as $group) {
                 foreach ($group as $message) {
                     $xaction = $message['xaction'];
                     if ($xaction) {
                         $author_phids[] = $xaction->getAuthorPHID();
                         $engine->addObject($xaction->getComment(), PhabricatorApplicationTransactionComment::MARKUP_FIELD_COMMENT);
                     }
                 }
             }
             $engine->process();
             $engines[$phid] = $engine;
         }
         $handles = $viewer->loadHandles($author_phids);
         $handles = iterator_to_array($handles);
     } else {
         $context = array();
     }
     $content = array();
     $list = new PHUIObjectItemListView();
     $list->setUser($viewer);
     foreach ($conpherences as $conpherence_phid => $conpherence) {
         $created = phabricator_date($conpherence->getDateCreated(), $viewer);
         $title = $conpherence->getDisplayTitle($viewer);
         $monogram = $conpherence->getMonogram();
         $icon_name = $conpherence->getPolicyIconName($policy_objects);
         $icon = id(new PHUIIconView())->setIcon($icon_name);
         if (!strlen($fulltext)) {
             $item = id(new PHUIObjectItemView())->setObjectName($conpherence->getMonogram())->setHeader($title)->setHref('/' . $conpherence->getMonogram())->setObject($conpherence)->setImageURI($conpherence->getProfileImageURI())->addIcon('none', $created)->addIcon('none', pht('Messages: %d', $conpherence->getMessageCount()))->addAttribute(array($icon, ' ', pht('Last updated %s', phabricator_datetime($conpherence->getDateModified(), $viewer))));
             $list->addItem($item);
         } else {
             $messages = idx($context, $conpherence_phid);
             $box = array();
             $list = null;
             if ($messages) {
                 foreach ($messages as $group) {
                     $rows = array();
                     foreach ($group as $message) {
                         $xaction = $message['xaction'];
                         if (!$xaction) {
                             continue;
                         }
                         $view = id(new ConpherenceTransactionView())->setUser($viewer)->setHandles($handles)->setMarkupEngine($engines[$conpherence_phid])->setConpherenceThread($conpherence)->setConpherenceTransaction($xaction)->setSearchResult(true)->addClass('conpherence-fulltext-result');
                         if ($message['match']) {
                             $view->addClass('conpherence-fulltext-match');
                         }
                         $rows[] = $view;
                     }
                     $box[] = id(new PHUIBoxView())->appendChild($rows)->addClass('conpherence-fulltext-results');
                 }
             }
             $header = id(new PHUIHeaderView())->setHeader($title)->setHeaderIcon($icon_name)->setHref('/' . $monogram);
             $content[] = id(new PHUIObjectBoxView())->setHeader($header)->appendChild($box);
         }
     }
     if ($list) {
         $content = $list;
     } else {
         $content = id(new PHUIBoxView())->addClass('conpherence-search-room-results')->appendChild($content);
     }
     $result = new PhabricatorApplicationSearchResultView();
     $result->setContent($content);
     $result->setNoDataString(pht('No results found.'));
     return $result;
 }
 protected function getTagContent()
 {
     $column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY;
     $minimize_key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY;
     Javelin::initBehavior('durable-column', array('visible' => $this->getVisible(), 'minimize' => $this->getMinimize(), 'visibleURI' => '/settings/adjust/?key=' . $column_key, 'minimizeURI' => '/settings/adjust/?key=' . $minimize_key, 'quicksandConfig' => $this->getQuicksandConfig()));
     $policy_objects = ConpherenceThread::loadViewPolicyObjects($this->getUser(), $this->getConpherences());
     $this->setPolicyObjects($policy_objects);
     $classes = array();
     $classes[] = 'conpherence-durable-column-header';
     $classes[] = 'grouped';
     $header = phutil_tag('div', array('class' => implode(' ', $classes), 'data-sigil' => 'conpherence-minimize-window'), $this->buildHeader());
     $icon_bar = null;
     if ($this->conpherences) {
         $icon_bar = $this->buildIconBar();
     }
     $icon_bar = phutil_tag('div', array('class' => 'conpherence-durable-column-icon-bar'), $icon_bar);
     $transactions = $this->buildTransactions();
     $content = javelin_tag('div', array('class' => 'conpherence-durable-column-main', 'sigil' => 'conpherence-durable-column-main'), phutil_tag('div', array('id' => 'conpherence-durable-column-content', 'class' => 'conpherence-durable-column-frame'), javelin_tag('div', array('class' => 'conpherence-durable-column-transactions', 'sigil' => 'conpherence-durable-column-transactions'), $transactions)));
     $input = $this->buildTextInput();
     return array($header, javelin_tag('div', array('class' => 'conpherence-durable-column-body', 'sigil' => 'conpherence-durable-column-body'), array($icon_bar, $content, $input)));
 }
 protected function getTagContent()
 {
     $column_key = PhabricatorUserPreferences::PREFERENCE_CONPHERENCE_COLUMN;
     require_celerity_resource('font-source-sans-pro');
     Javelin::initBehavior('durable-column', array('visible' => $this->getVisible(), 'settingsURI' => '/settings/adjust/?key=' . $column_key, 'quicksandConfig' => $this->getQuicksandConfig()));
     $policy_objects = ConpherenceThread::loadViewPolicyObjects($this->getUser(), $this->getConpherences());
     $this->setPolicyObjects($policy_objects);
     $classes = array();
     $classes[] = 'conpherence-durable-column-header';
     $classes[] = 'sprite-main-header';
     $classes[] = 'main-header-' . PhabricatorEnv::getEnvConfig('ui.header-color');
     $loading_mask = phutil_tag('div', array('class' => 'loading-mask'), '');
     $header = phutil_tag('div', array('class' => implode(' ', $classes)), $this->buildHeader());
     $icon_bar = phutil_tag('div', array('class' => 'conpherence-durable-column-icon-bar'), $this->buildIconBar());
     $transactions = $this->buildTransactions();
     $content = javelin_tag('div', array('class' => 'conpherence-durable-column-main', 'sigil' => 'conpherence-durable-column-main'), phutil_tag('div', array('id' => 'conpherence-durable-column-content', 'class' => 'conpherence-durable-column-frame'), javelin_tag('div', array('class' => 'conpherence-durable-column-transactions', 'sigil' => 'conpherence-durable-column-transactions'), $transactions)));
     $input = $this->buildTextInput();
     $footer = phutil_tag('div', array('class' => 'conpherence-durable-column-footer'), array($this->buildSendButton(), phutil_tag('div', array('class' => 'conpherence-durable-column-status'), $this->buildStatusText())));
     return array($loading_mask, $header, javelin_tag('div', array('class' => 'conpherence-durable-column-body', 'sigil' => 'conpherence-durable-column-body'), array($icon_bar, $content, $input, $footer)));
 }
 protected function getTagContent()
 {
     $column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY;
     Javelin::initBehavior('durable-column', array('visible' => $this->getVisible(), 'settingsURI' => '/settings/adjust/?key=' . $column_key, 'quicksandConfig' => $this->getQuicksandConfig()));
     $policy_objects = ConpherenceThread::loadViewPolicyObjects($this->getUser(), $this->getConpherences());
     $this->setPolicyObjects($policy_objects);
     $classes = array();
     $classes[] = 'conpherence-durable-column-header';
     $classes[] = 'phabricator-main-menu-background';
     $classes[] = 'sprite-main-header';
     $loading_mask = phutil_tag('div', array('class' => 'loading-mask'), '');
     $header = phutil_tag('div', array('class' => implode(' ', $classes)), $this->buildHeader());
     $icon_bar = phutil_tag('div', array('class' => 'conpherence-durable-column-icon-bar'), $this->buildIconBar());
     $transactions = $this->buildTransactions();
     $content = javelin_tag('div', array('class' => 'conpherence-durable-column-main', 'sigil' => 'conpherence-durable-column-main'), phutil_tag('div', array('id' => 'conpherence-durable-column-content', 'class' => 'conpherence-durable-column-frame'), javelin_tag('div', array('class' => 'conpherence-durable-column-transactions', 'sigil' => 'conpherence-durable-column-transactions'), $transactions)));
     $input = $this->buildTextInput();
     $footer = phutil_tag('div', array('class' => 'conpherence-durable-column-footer'), array($this->buildSendButton(), phutil_tag('div', array('class' => 'conpherence-durable-column-status'), $this->buildStatusText())));
     return array($loading_mask, $header, javelin_tag('div', array('class' => 'conpherence-durable-column-body', 'sigil' => 'conpherence-durable-column-body'), array($icon_bar, $content, $input, $footer)));
 }