2013-03-21 02:01:52 +01:00
|
|
|
<?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);
|
|
|
|
|
2013-09-09 23:14:34 +02:00
|
|
|
$view = new PHUIObjectItemListView();
|
2013-03-21 02:01:52 +01:00
|
|
|
foreach ($vars as $var) {
|
|
|
|
$key = $var->getVariableKey();
|
|
|
|
|
2013-09-09 23:14:34 +02:00
|
|
|
$item = new PHUIObjectItemView();
|
2013-03-21 02:01:52 +01:00
|
|
|
$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');
|
|
|
|
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs->addTextCrumb($title, $this->getApplicationURI());
|
2013-03-21 02:01:52 +01:00
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
|
|
array(
|
|
|
|
$crumbs,
|
|
|
|
$view,
|
|
|
|
$pager,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => $title,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|