Replace all instances of AphrontSideNavView with AphrontSideNavFilterView

Summary:
AphrontSideNavView is an old class which required you to do a lot of work; it was obsoleted by AphrontSideNavFilterView. Remove all direct callsites so I can clean it up.

This is a precursor to letting me render a filter menu as a dropdown menu for T1960.

Test Plan:
Examined each interface for correct filter construction and selection:

  - Browsed Diffusion
  - Browsed Differential
  - Browsed Files
  - Browsed Slowvote
  - Browsed Phriction
  - Browsed repo edit interface

Grepped for `AphrontSideNavView`. The only remaining instances are in `AphrontSideNavView` itself and `AphrontSideNavFilterView` (which currently uses it).

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1960

Differential Revision: https://secure.phabricator.com/D4034
This commit is contained in:
epriestley
2012-12-07 13:30:31 -08:00
parent 6482876cf3
commit 20ee3003b5
7 changed files with 40 additions and 110 deletions

View File

@@ -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();