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 5ba20b8924 Move PhabricatorObjectItem to PHUIObjectItem, add 'plain' setting for lists.
Summary: Adds plain support for object lists that just look like lists

Test Plan: review UIexamples and a number of other applications

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6922
2013-09-09 14:14:34 -07:00

51 lines
1.1 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 PHUIObjectItemListView();
foreach ($vars as $var) {
$key = $var->getVariableKey();
$item = new PHUIObjectItemView();
$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,
));
}
}