Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/tokens/controller/PhabricatorTokenController.php b/src/applications/tokens/controller/PhabricatorTokenController.php
index 3253e9301f..feb5d6b2db 100644
--- a/src/applications/tokens/controller/PhabricatorTokenController.php
+++ b/src/applications/tokens/controller/PhabricatorTokenController.php
@@ -1,16 +1,26 @@
<?php
abstract class PhabricatorTokenController extends PhabricatorController {
protected function buildSideNav() {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
+ $nav->addLabel(pht('Tokens'));
$nav->addFilter('given/', pht('Tokens Given'));
$nav->addFilter('leaders/', pht('Leader Board'));
return $nav;
}
+ public function buildApplicationMenu() {
+ return $this->buildSideNav()->getMenu();
+ }
+
+ public function buildApplicationCrumbs() {
+ $crumbs = parent::buildApplicationCrumbs();
+ return $crumbs;
+ }
+
}
diff --git a/src/applications/tokens/controller/PhabricatorTokenGivenController.php b/src/applications/tokens/controller/PhabricatorTokenGivenController.php
index d1d75b3b8f..b44985fc7c 100644
--- a/src/applications/tokens/controller/PhabricatorTokenGivenController.php
+++ b/src/applications/tokens/controller/PhabricatorTokenGivenController.php
@@ -1,79 +1,80 @@
<?php
final class PhabricatorTokenGivenController extends PhabricatorTokenController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$pager = id(new AphrontCursorPagerView())
->setURI(new PhutilURI($this->getApplicationURI('/given/')));
$tokens_given = id(new PhabricatorTokenGivenQuery())
->setViewer($user)
->setLimit(100)
->executeWithCursorPager($pager);
$handles = array();
if ($tokens_given) {
$object_phids = mpull($tokens_given, 'getObjectPHID');
$user_phids = mpull($tokens_given, 'getAuthorPHID');
$handle_phids = array_merge($object_phids, $user_phids);
$handles = id(new PhabricatorObjectHandleData($handle_phids))
->setViewer($user)
->loadHandles();
}
$tokens = array();
if ($tokens_given) {
$token_phids = mpull($tokens_given, 'getTokenPHID');
$tokens = id(new PhabricatorTokenQuery())
->setViewer($user)
->withPHIDs($token_phids)
->execute();
$tokens = mpull($tokens, null, 'getPHID');
}
$list = new PhabricatorObjectItemListView();
foreach ($tokens_given as $token_given) {
$handle = $handles[$token_given->getObjectPHID()];
$token = idx($tokens, $token_given->getTokenPHID());
$item = id(new PhabricatorObjectItemView());
$item->setHeader($handle->getFullName());
$item->setHref($handle->getURI());
$item->addAttribute($token->renderIcon());
$item->addAttribute(
pht(
'Given by %s on %s',
$handles[$token_given->getAuthorPHID()]->renderLink(),
phabricator_date($token_given->getDateCreated(), $user)));
$list->addItem($item);
}
$title = pht('Tokens Given');
$nav = $this->buildSideNav();
$nav->setCrumbs(
$this->buildApplicationCrumbs()
->addCrumb(
id(new PhabricatorCrumbView())
->setName($title)));
$nav->selectFilter('given/');
$nav->appendChild($list);
$nav->appendChild($pager);
return $this->buildApplicationPage(
$nav,
array(
'title' => $title,
'device' => true,
+ 'dust' => true,
));
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Oct 31, 12:37 PM (18 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
312190
Default Alt Text
(3 KB)

Event Timeline