channel = $data['channel']; } public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $offset = $request->getInt('offset', 0); $page_size = 1000; $pager = new AphrontPagerView(); $request_uri = $request->getRequestURI(); $pager->setURI($request_uri, 'offset'); $pager->setPageSize($page_size); $pager->setOffset($offset); $query = new PhabricatorChatLogQuery(); $query->withChannels(array($this->channel)); $logs = $query->executeWithPager($pager); require_celerity_resource('phabricator-chatlog-css'); $last_author = null; $last_epoch = null; $row_idx = 0; $row_colors = array( 'normal', 'alternate', ); $out = array(); $out[] = ''; foreach ($logs as $log) { $this_author = $log->getAuthor(); $this_epoch = $log->getEpoch(); if (($this_author !== $last_author) || ($this_epoch - (60 * 5) > $last_epoch)) { ++$row_idx; $out[] = ''; $out[] = ''; $author = $log->getAuthor(); $author = phutil_utf8_shorten($author, 18); $out[] = ''; } else { $out[] = ''; $out[] = ''; } $out[] = ''; $out[] = ''; $last_author = $this_author; $last_epoch = $this_epoch; } $out[] = '
'. phabricator_datetime($log->getEpoch(), $user).''. phutil_escape_html($author).'
'. phutil_escape_html($log->getMessage()).'
'; return $this->buildStandardPageResponse( array( implode("\n", $out), $pager ), array( 'title' => 'Channel Log', )); } }