1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 11:52:40 +01:00
phorge-phorge/src/applications/phlux/controller/PhluxListController.php
Chad Little 8a0fccf97a Mobile Crumbs.
Summary: Not for full review. This makes crumbs appear consistently in mobile. It helps give a quick link to the apps home, the page title currently on, and action icons for the object. It will take additional clean-up to make this consistent across apps. Passing for early review from a UEX perspective. I actually really like it and think onces it's everywhere, helps mobile feel complete.

Test Plan: Testing in iOS and Simulator.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2796

Differential Revision: https://secure.phabricator.com/D5446
2013-03-26 13:15:15 -07:00

52 lines
1.2 KiB
PHP

<?php
final class PhluxListController extends PhluxController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$pager = new AphrontCursorPagerView();
$pager->readFromRequest($request);
$query = id(new PhluxVariableQuery())
->setViewer($user);
$vars = $query->executeWithCursorPager($pager);
$view = new PhabricatorObjectItemListView();
foreach ($vars as $var) {
$key = $var->getVariableKey();
$item = new PhabricatorObjectItemView();
$item->setHeader($key);
$item->setHref($this->getApplicationURI('/view/'.$key.'/'));
$item->addIcon(
'none',
phabricator_datetime($var->getDateModified(), $user));
$view->addItem($item);
}
$crumbs = $this->buildApplicationCrumbs();
$title = pht('Variable List');
$crumbs->addCrumb(
id(new PhabricatorCrumbView())
->setName($title)
->setHref($this->getApplicationURI()));
return $this->buildApplicationPage(
array(
$crumbs,
$view,
$pager,
),
array(
'title' => $title,
'device' => true,
'dust' => true,
));
}
}