diff --git a/src/applications/differential/controller/DifferentialRevisionListController.php b/src/applications/differential/controller/DifferentialRevisionListController.php
index f02cd9138b..71bed2ea0b 100644
--- a/src/applications/differential/controller/DifferentialRevisionListController.php
+++ b/src/applications/differential/controller/DifferentialRevisionListController.php
@@ -82,32 +82,17 @@ final class DifferentialRevisionListController extends DifferentialController {
'order' => 'modified',
);
- $side_nav = new AphrontSideNavView();
+ $side_nav = new AphrontSideNavFilterView();
+ $side_nav->setBaseURI(id(clone $uri)->setPath('/differential/filter/'));
foreach ($filters as $filter) {
list($filter_name, $display_name) = $filter;
if ($filter_name) {
- $href = clone $uri;
- $href->setPath('/differential/filter/'.$filter_name.'/'.$username);
- if ($filter_name == $this->filter) {
- $class = 'aphront-side-nav-selected';
- } else {
- $class = null;
- }
- $item = phutil_render_tag(
- 'a',
- array(
- 'href' => (string)$href,
- 'class' => $class,
- ),
- phutil_escape_html($display_name));
+ $side_nav->addFilter($filter_name.'/'.$username, $display_name);
} else {
- $item = phutil_render_tag(
- 'span',
- array(),
- phutil_escape_html($display_name));
+ $side_nav->addLabel($display_name);
}
- $side_nav->addNavItem($item);
}
+ $side_nav->selectFilter($this->filter.'/'.$username, null);
$panels = array();
$handles = array();
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
index fa07dd1669..2c16ab2246 100644
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -42,7 +42,8 @@ abstract class DiffusionController extends PhabricatorController {
}
final protected function buildSideNav($selected, $has_change_view) {
- $nav = new AphrontSideNavView();
+ $nav = new AphrontSideNavFilterView();
+ $nav->setBaseURI(new PhutilURI(''));
$navs = array(
'history' => 'History View',
@@ -61,36 +62,27 @@ abstract class DiffusionController extends PhabricatorController {
$navs['lint'] = 'Lint View';
}
+ $selected_href = null;
foreach ($navs as $action => $name) {
$href = $drequest->generateURI(
array(
'action' => $action,
));
+ if ($action == $selected) {
+ $selected_href = $href;
+ }
- $nav->addNavItem(
- phutil_render_tag(
- 'a',
- array(
- 'href' => $href,
- 'class' =>
- ($action == $selected
- ? 'aphront-side-nav-selected'
- : null),
- ),
- $name));
+ $nav->addFilter($href, $name);
}
+ $nav->selectFilter($selected_href, null);
// TODO: URI encoding might need to be sorted out for this link.
- $nav->addNavItem(
- phutil_render_tag(
- 'a',
- array(
- 'href' => '/owners/view/search/'.
- '?repository='.phutil_escape_uri($drequest->getCallsign()).
- '&path='.phutil_escape_uri('/'.$drequest->getPath()),
- ),
- "Search Owners \xE2\x86\x97"));
+ $nav->addFilter(
+ '/owners/view/search/'.
+ '?repository='.phutil_escape_uri($drequest->getCallsign()).
+ '&path='.phutil_escape_uri('/'.$drequest->getPath()),
+ "Search Owners \xE2\x86\x97");
return $nav;
}
diff --git a/src/applications/files/view/PhabricatorFileSideNavView.php b/src/applications/files/view/PhabricatorFileSideNavView.php
index 71cbabc626..62e9a533c4 100644
--- a/src/applications/files/view/PhabricatorFileSideNavView.php
+++ b/src/applications/files/view/PhabricatorFileSideNavView.php
@@ -21,45 +21,26 @@ final class PhabricatorFileSideNavView extends AphrontView {
'Files' => array(),
'upload' => array(
'name' => 'Upload File',
- 'href' => '/file/filter/upload/'
),
'my' => array(
'name' => 'My Files',
- 'href' => '/file/filter/my/'
),
'all' => array(
'name' => 'All Files',
- 'href' => '/file/filter/all/'
),
- // TODO: Remove this fairly soon.
- '
' => null,
- '