Skip to content

Commit 66cee12

Browse files
author
epriestley
committed
Remove all code referencing old tab navigation
Summary: - Add getHelpURI() to PhabricatorApplication for application user guides. - Add a new "help" icon menu item and skeletal Diviner application. - Move help tabs to Applications where they exist, document the other ones that don't exist yet. - Grep for all tab-related stuff and delete it. Test Plan: Clicked "help" for some apps. Clicked around randomly in a bunch of other apps. Reviewers: btrahan, vrana Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3267
1 parent a68c30c commit 66cee12

32 files changed

+85
-143
lines changed

src/__phutil_library_map__.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@
549549
'PhabricatorApplicationDaemons' => 'applications/daemon/application/PhabricatorApplicationDaemons.php',
550550
'PhabricatorApplicationDifferential' => 'applications/differential/application/PhabricatorApplicationDifferential.php',
551551
'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php',
552+
'PhabricatorApplicationDiviner' => 'applications/diviner/application/PhabricatorApplicationDiviner.php',
552553
'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php',
553554
'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php',
554555
'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php',
@@ -1671,6 +1672,7 @@
16711672
'PhabricatorApplicationDaemons' => 'PhabricatorApplication',
16721673
'PhabricatorApplicationDifferential' => 'PhabricatorApplication',
16731674
'PhabricatorApplicationDiffusion' => 'PhabricatorApplication',
1675+
'PhabricatorApplicationDiviner' => 'PhabricatorApplication',
16741676
'PhabricatorApplicationFact' => 'PhabricatorApplication',
16751677
'PhabricatorApplicationFlags' => 'PhabricatorApplication',
16761678
'PhabricatorApplicationLaunchView' => 'AphrontView',

src/applications/base/PhabricatorApplication.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ public function getTitleGlyph() {
7070
return null;
7171
}
7272

73+
public function getHelpURI() {
74+
// TODO: When these applications get created, link to their docs:
75+
//
76+
// - Conduit
77+
// - Drydock
78+
// - Herald
79+
// - OAuth Server
80+
// - Owners
81+
// - Phame
82+
// - Slowvote
83+
84+
85+
return null;
86+
}
87+
7388

7489
/* -( URI Routing )-------------------------------------------------------- */
7590

src/applications/calendar/controller/PhabricatorCalendarController.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Copyright 2011 Facebook, Inc.
4+
* Copyright 2012 Facebook, Inc.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -30,12 +30,6 @@ public function buildStandardPageResponse($view, array $data) {
3030
// use "keyboard" since it looks vaguely similar.
3131
$page->setGlyph("\xE2\x8C\xA8");
3232

33-
$page->appendChild($view);
34-
$page->setTabs(
35-
array(
36-
),
37-
idx($data, 'tab'));
38-
3933
$response = new AphrontWebpageResponse();
4034
return $response->setContent($page->render());
4135
}

src/applications/conduit/controller/PhabricatorConduitController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,12 @@ abstract class PhabricatorConduitController extends PhabricatorController {
2525
protected $showSideNav;
2626

2727
public function buildStandardPageResponse($view, array $data) {
28-
$doclink = PhabricatorEnv::getDoclink(
29-
'article/Conduit_Technical_Documentation.html'
30-
);
31-
3228
$page = $this->buildStandardPageView();
3329

3430
$page->setApplicationName('Conduit');
3531
$page->setBaseURI('/conduit/');
3632
$page->setTitle(idx($data, 'title'));
3733
$page->setGlyph("\xE2\x87\xB5");
38-
$page->setTabs(array(
39-
'help' => array(
40-
'href' => $doclink,
41-
'name' => 'Help')
42-
), null);
4334

4435
if ($this->showSideNav()) {
4536

src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public function processRequest() {
6565
$nav,
6666
array(
6767
'title' => 'Timeline',
68-
'tab' => 'timeline',
6968
));
7069
}
7170

src/applications/differential/controller/DifferentialController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public function buildStandardPageResponse($view, array $data) {
3434
$page->setTitle(idx($data, 'title'));
3535
$page->setGlyph("\xE2\x9A\x99");
3636
$page->appendChild($view);
37-
$page->setIsLoggedOut($viewer_is_anonymous);
3837
$page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_REVISIONS);
3938

4039
$response = new AphrontWebpageResponse();

src/applications/differential/controller/DifferentialDiffCreateController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public function processRequest() {
8484
$panel,
8585
array(
8686
'title' => 'Create Diff',
87-
'tab' => 'create',
8887
));
8988
}
9089

src/applications/differential/controller/DifferentialRevisionListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ public function processRequest() {
228228
$side_nav,
229229
array(
230230
'title' => 'Differential Home',
231-
'tab' => 'revisions',
232231
));
233232
}
234233

src/applications/diffusion/application/PhabricatorApplicationDiffusion.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public function getIconURI() {
3030
return celerity_get_resource_uri('/rsrc/image/app/app_diffusion.png');
3131
}
3232

33+
public function getHelpURI() {
34+
return PhabricatorEnv::getDoclink('article/Diffusion_User_Guide.html');
35+
}
36+
3337
public function getRoutes() {
3438
return array(
3539
'/r(?P<callsign>[A-Z]+)(?P<commit>[a-z0-9]+)'

src/applications/diffusion/controller/DiffusionController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ public function buildStandardPageResponse($view, array $data) {
4747
$page->setBaseURI('/diffusion/');
4848
$page->setTitle(idx($data, 'title'));
4949
$page->setGlyph("\xE2\x89\x88");
50-
$page->setTabs(
51-
array(
52-
'help' => array(
53-
'href' => PhabricatorEnv::getDoclink(
54-
'article/Diffusion_User_Guide.html'),
55-
'name' => 'Help',
56-
),
57-
),
58-
null);
5950
$page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_COMMITS);
6051

6152
$page->appendChild($view);
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/*
4+
* Copyright 2012 Facebook, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
final class PhabricatorApplicationDiviner extends PhabricatorApplication {
20+
21+
public function shouldAppearInLaunchView() {
22+
return false;
23+
}
24+
25+
public function buildMainMenuItems(
26+
PhabricatorUser $user,
27+
PhabricatorController $controller = null) {
28+
29+
$items = array();
30+
$application = $controller->getCurrentApplication();
31+
if ($application && $application->getHelpURI()) {
32+
$class = 'main-menu-item-icon-help';
33+
$item = new PhabricatorMainMenuIconView();
34+
$item->setName(pht('%s Help', $application->getName()));
35+
$item->addClass('main-menu-item-icon '.$class);
36+
$item->setHref($application->getHelpURI());
37+
$item->setSortOrder(0.1);
38+
$items[] = $item;
39+
}
40+
41+
return $items;
42+
}
43+
44+
45+
}
46+

src/applications/drydock/controller/DrydockController.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ public function buildStandardPageResponse($view, array $data) {
2929

3030
$page->appendChild($view);
3131

32-
$help_uri = PhabricatorEnv::getDoclink('article/Drydock_User_Guide.html');
33-
$page->setTabs(
34-
array(
35-
'help' => array(
36-
'name' => 'Help',
37-
'href' => $help_uri,
38-
),
39-
), null);
40-
4132
$response = new AphrontWebpageResponse();
4233
return $response->setContent($page->render());
4334
}

src/applications/files/controller/PhabricatorFileListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ public function processRequest() {
177177
$side_nav,
178178
array(
179179
'title' => 'Files',
180-
'tab' => 'files',
181180
));
182181
}
183182

src/applications/files/controller/PhabricatorFileMacroListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ public function processRequest() {
158158
$side_nav,
159159
array(
160160
'title' => 'Image Macros',
161-
'tab' => 'macros',
162161
));
163162
}
164163
}

src/applications/herald/controller/HeraldController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ public function buildStandardPageResponse($view, array $data) {
2626
$page->setTitle(idx($data, 'title'));
2727
$page->setGlyph("\xE2\x98\xBF");
2828

29-
$doclink = PhabricatorEnv::getDoclink('article/Herald_User_Guide.html');
30-
31-
$tabs = array(
32-
'help' => array(
33-
'href' => $doclink,
34-
'name' => 'Help',
35-
),
36-
);
37-
$page->setTabs($tabs, null);
38-
3929
$page->appendChild($view);
4030
$page->setIsAdminInterface(idx($data, 'admin'));
4131

src/applications/herald/controller/HeraldTestConsoleController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public function processRequest() {
144144
$nav,
145145
array(
146146
'title' => 'Test Console',
147-
'tab' => 'test',
148147
));
149148
}
150149

src/applications/herald/controller/HeraldTranscriptListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ public function processRequest() {
119119
$nav,
120120
array(
121121
'title' => 'Herald Transcripts',
122-
'tab' => 'transcripts',
123122
));
124123
}
125124

src/applications/mailinglists/controller/PhabricatorMailingListsListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public function processRequest() {
8181
$panel,
8282
array(
8383
'title' => 'Mailing Lists',
84-
'tab' => 'lists',
8584
));
8685
}
8786
}

src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function processRequest() {
9191
$nav,
9292
array(
9393
'title' => 'Received Mail',
94-
'tab' => 'received',
9594
));
9695
}
9796
}

src/applications/oauthserver/controller/PhabricatorOAuthServerController.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ public function buildStandardPageResponse($view, array $data) {
4747
$nav->appendChild($view);
4848

4949
$page->appendChild($nav);
50-
$doc_href = PhabricatorEnv::getDoclink(
51-
'article/Using_the_Phabricator_OAuth_Server.html'
52-
);
53-
$page->setTabs(
54-
array(
55-
'help' => array(
56-
'name' => 'Help',
57-
'href' => $doc_href,
58-
),
59-
),
60-
null);
6150

6251
$response = new AphrontWebpageResponse();
6352
return $response->setContent($page->render());

src/applications/owners/controller/PhabricatorOwnersController.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ public function buildStandardPageResponse($view, array $data) {
3939
$nav->appendChild($view);
4040
$page->appendChild($nav);
4141

42-
$doclink =
43-
PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html');
44-
$tabs = array(
45-
'help' => array(
46-
'href' => $doclink,
47-
'name' => 'Help',
48-
),
49-
);
50-
$page->setTabs($tabs, null);
51-
5242
$response = new AphrontWebpageResponse();
5343
return $response->setContent($page->render());
5444
}

src/applications/paste/controller/PhabricatorPasteViewController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ public function processRequest() {
122122
),
123123
array(
124124
'title' => 'Paste: '.nonempty($paste->getTitle(), 'P'.$paste->getID()),
125-
'tab' => 'view',
126125
));
127126
}
128127

src/applications/phame/controller/PhameController.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ public function buildStandardPageResponse($view, array $data) {
3939
$page->setTitle(idx($data, 'title'));
4040
$page->setGlyph("\xe2\x9c\xa9");
4141

42-
$tabs = array(
43-
'help' => array(
44-
'name' => 'Help',
45-
'href' =>
46-
PhabricatorEnv::getDoclink('article/Phame_User_Guide.html'),
47-
),
48-
);
49-
$page->setTabs($tabs, idx($data, 'tab'));
5042
if ($this->showSideNav()) {
5143
$nav = $this->renderSideNavFilterView($this->getSideNavFilter());
5244
$nav->appendChild($view);

src/applications/phriction/application/PhabricatorApplicationPhriction.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public function getIconURI() {
3030
return celerity_get_resource_uri('/rsrc/image/app/app_phriction.png');
3131
}
3232

33+
public function getHelpURI() {
34+
return PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html');
35+
}
36+
3337
public function getRoutes() {
3438
return array(
3539
// Match "/w/" with slug "/".

src/applications/phriction/controller/PhrictionController.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ public function buildStandardPageResponse($view, array $data) {
3030
$page->setTitle(idx($data, 'title'));
3131
$page->setGlyph("\xE2\x9A\xA1");
3232

33-
$tabs = array(
34-
'help' => array(
35-
'name' => 'Help',
36-
'href' =>
37-
PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'),
38-
),
39-
);
40-
$page->setTabs($tabs, idx($data, 'tab'));
4133
$page->appendChild($view);
4234
$page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_WIKI);
4335

src/applications/slowvote/controller/PhabricatorSlowvoteController.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Copyright 2011 Facebook, Inc.
4+
* Copyright 2012 Facebook, Inc.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -29,16 +29,6 @@ public function buildStandardPageResponse($view, array $data) {
2929
$page->setTitle(idx($data, 'title'));
3030
$page->setGlyph("\xE2\x9C\x94");
3131

32-
$doc_href = PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html');
33-
$page->setTabs(
34-
array(
35-
'help' => array(
36-
'name' => 'Help',
37-
'href' => $doc_href,
38-
),
39-
),
40-
null);
41-
4232
$page->appendChild($view);
4333

4434
$response = new AphrontWebpageResponse();

0 commit comments

Comments
 (0)