public function processRequest() { $request = $this->getRequest(); $user = $request->getUser(); $nav = new AphrontSideNavFilterView(); $nav->setBaseURI(new PhutilURI('/flag/view/')); $nav->addFilter('all', 'Flags'); $nav->selectFilter('all', 'all'); $query = new PhabricatorFlagQuery(); $query->withOwnerPHIDs(array($user->getPHID())); $query->needHandles(true); $flags = $query->execute(); $view = new PhabricatorFlagListView(); $view->setFlags($flags); $view->setUser($user); $panel = new AphrontPanelView(); $panel->setHeader('Flags'); $panel->appendChild($view); $nav->appendChild($panel); return $this->buildStandardPageResponse($nav, array('title' => 'Flags')); }
private function buildFlaggedPanel() { $user = $this->getRequest()->getUser(); $flag_query = id(new PhabricatorFlagQuery())->withOwnerPHIDs(array($user->getPHID()))->needHandles(true)->setLimit(10); $flags = $flag_query->execute(); if (!$flags) { return $this->renderMiniPanel('No Flags', "You haven't flagged anything."); } $panel = new AphrontPanelView(); $panel->setHeader('Flagged Objects'); $panel->setCaption("Objects you've flagged."); $flag_view = new PhabricatorFlagListView(); $flag_view->setFlags($flags); $flag_view->setUser($user); $panel->appendChild($flag_view); $panel->addButton(phutil_render_tag('a', array('href' => '/flag/', 'class' => 'grey button'), "View All Flags »")); return $panel; }