@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+85 -143
+2
src/__phutil_library_map__.php
··· 549 549 'PhabricatorApplicationDaemons' => 'applications/daemon/application/PhabricatorApplicationDaemons.php', 550 550 'PhabricatorApplicationDifferential' => 'applications/differential/application/PhabricatorApplicationDifferential.php', 551 551 'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php', 552 + 'PhabricatorApplicationDiviner' => 'applications/diviner/application/PhabricatorApplicationDiviner.php', 552 553 'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php', 553 554 'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php', 554 555 'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php', ··· 1671 1672 'PhabricatorApplicationDaemons' => 'PhabricatorApplication', 1672 1673 'PhabricatorApplicationDifferential' => 'PhabricatorApplication', 1673 1674 'PhabricatorApplicationDiffusion' => 'PhabricatorApplication', 1675 + 'PhabricatorApplicationDiviner' => 'PhabricatorApplication', 1674 1676 'PhabricatorApplicationFact' => 'PhabricatorApplication', 1675 1677 'PhabricatorApplicationFlags' => 'PhabricatorApplication', 1676 1678 'PhabricatorApplicationLaunchView' => 'AphrontView',
+15
src/applications/base/PhabricatorApplication.php
··· 70 70 return null; 71 71 } 72 72 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 + 73 88 74 89 /* -( URI Routing )-------------------------------------------------------- */ 75 90
+1 -7
src/applications/calendar/controller/PhabricatorCalendarController.php
··· 1 1 <?php 2 2 3 3 /* 4 - * Copyright 2011 Facebook, Inc. 4 + * Copyright 2012 Facebook, Inc. 5 5 * 6 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 7 * you may not use this file except in compliance with the License. ··· 29 29 // Unicode has a calendar character but it's in some distant code plane, 30 30 // use "keyboard" since it looks vaguely similar. 31 31 $page->setGlyph("\xE2\x8C\xA8"); 32 - 33 - $page->appendChild($view); 34 - $page->setTabs( 35 - array( 36 - ), 37 - idx($data, 'tab')); 38 32 39 33 $response = new AphrontWebpageResponse(); 40 34 return $response->setContent($page->render());
-9
src/applications/conduit/controller/PhabricatorConduitController.php
··· 25 25 protected $showSideNav; 26 26 27 27 public function buildStandardPageResponse($view, array $data) { 28 - $doclink = PhabricatorEnv::getDoclink( 29 - 'article/Conduit_Technical_Documentation.html' 30 - ); 31 - 32 28 $page = $this->buildStandardPageView(); 33 29 34 30 $page->setApplicationName('Conduit'); 35 31 $page->setBaseURI('/conduit/'); 36 32 $page->setTitle(idx($data, 'title')); 37 33 $page->setGlyph("\xE2\x87\xB5"); 38 - $page->setTabs(array( 39 - 'help' => array( 40 - 'href' => $doclink, 41 - 'name' => 'Help') 42 - ), null); 43 34 44 35 if ($this->showSideNav()) { 45 36
-1
src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php
··· 65 65 $nav, 66 66 array( 67 67 'title' => 'Timeline', 68 - 'tab' => 'timeline', 69 68 )); 70 69 } 71 70
-1
src/applications/differential/controller/DifferentialController.php
··· 34 34 $page->setTitle(idx($data, 'title')); 35 35 $page->setGlyph("\xE2\x9A\x99"); 36 36 $page->appendChild($view); 37 - $page->setIsLoggedOut($viewer_is_anonymous); 38 37 $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_REVISIONS); 39 38 40 39 $response = new AphrontWebpageResponse();
-1
src/applications/differential/controller/DifferentialDiffCreateController.php
··· 84 84 $panel, 85 85 array( 86 86 'title' => 'Create Diff', 87 - 'tab' => 'create', 88 87 )); 89 88 } 90 89
-1
src/applications/differential/controller/DifferentialRevisionListController.php
··· 228 228 $side_nav, 229 229 array( 230 230 'title' => 'Differential Home', 231 - 'tab' => 'revisions', 232 231 )); 233 232 } 234 233
+4
src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
··· 30 30 return celerity_get_resource_uri('/rsrc/image/app/app_diffusion.png'); 31 31 } 32 32 33 + public function getHelpURI() { 34 + return PhabricatorEnv::getDoclink('article/Diffusion_User_Guide.html'); 35 + } 36 + 33 37 public function getRoutes() { 34 38 return array( 35 39 '/r(?P<callsign>[A-Z]+)(?P<commit>[a-z0-9]+)'
-9
src/applications/diffusion/controller/DiffusionController.php
··· 47 47 $page->setBaseURI('/diffusion/'); 48 48 $page->setTitle(idx($data, 'title')); 49 49 $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); 59 50 $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_COMMITS); 60 51 61 52 $page->appendChild($view);
+46
src/applications/diviner/application/PhabricatorApplicationDiviner.php
··· 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 +
-9
src/applications/drydock/controller/DrydockController.php
··· 29 29 30 30 $page->appendChild($view); 31 31 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 - 41 32 $response = new AphrontWebpageResponse(); 42 33 return $response->setContent($page->render()); 43 34 }
-1
src/applications/files/controller/PhabricatorFileListController.php
··· 177 177 $side_nav, 178 178 array( 179 179 'title' => 'Files', 180 - 'tab' => 'files', 181 180 )); 182 181 } 183 182
-1
src/applications/files/controller/PhabricatorFileMacroListController.php
··· 158 158 $side_nav, 159 159 array( 160 160 'title' => 'Image Macros', 161 - 'tab' => 'macros', 162 161 )); 163 162 } 164 163 }
-10
src/applications/herald/controller/HeraldController.php
··· 26 26 $page->setTitle(idx($data, 'title')); 27 27 $page->setGlyph("\xE2\x98\xBF"); 28 28 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 - 39 29 $page->appendChild($view); 40 30 $page->setIsAdminInterface(idx($data, 'admin')); 41 31
-1
src/applications/herald/controller/HeraldTestConsoleController.php
··· 144 144 $nav, 145 145 array( 146 146 'title' => 'Test Console', 147 - 'tab' => 'test', 148 147 )); 149 148 } 150 149
-1
src/applications/herald/controller/HeraldTranscriptListController.php
··· 119 119 $nav, 120 120 array( 121 121 'title' => 'Herald Transcripts', 122 - 'tab' => 'transcripts', 123 122 )); 124 123 } 125 124
-1
src/applications/mailinglists/controller/PhabricatorMailingListsListController.php
··· 81 81 $panel, 82 82 array( 83 83 'title' => 'Mailing Lists', 84 - 'tab' => 'lists', 85 84 )); 86 85 } 87 86 }
-1
src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php
··· 91 91 $nav, 92 92 array( 93 93 'title' => 'Received Mail', 94 - 'tab' => 'received', 95 94 )); 96 95 } 97 96 }
-11
src/applications/oauthserver/controller/PhabricatorOAuthServerController.php
··· 47 47 $nav->appendChild($view); 48 48 49 49 $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); 61 50 62 51 $response = new AphrontWebpageResponse(); 63 52 return $response->setContent($page->render());
-10
src/applications/owners/controller/PhabricatorOwnersController.php
··· 39 39 $nav->appendChild($view); 40 40 $page->appendChild($nav); 41 41 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 - 52 42 $response = new AphrontWebpageResponse(); 53 43 return $response->setContent($page->render()); 54 44 }
-1
src/applications/paste/controller/PhabricatorPasteViewController.php
··· 122 122 ), 123 123 array( 124 124 'title' => 'Paste: '.nonempty($paste->getTitle(), 'P'.$paste->getID()), 125 - 'tab' => 'view', 126 125 )); 127 126 } 128 127
-8
src/applications/phame/controller/PhameController.php
··· 39 39 $page->setTitle(idx($data, 'title')); 40 40 $page->setGlyph("\xe2\x9c\xa9"); 41 41 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')); 50 42 if ($this->showSideNav()) { 51 43 $nav = $this->renderSideNavFilterView($this->getSideNavFilter()); 52 44 $nav->appendChild($view);
+4
src/applications/phriction/application/PhabricatorApplicationPhriction.php
··· 30 30 return celerity_get_resource_uri('/rsrc/image/app/app_phriction.png'); 31 31 } 32 32 33 + public function getHelpURI() { 34 + return PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'); 35 + } 36 + 33 37 public function getRoutes() { 34 38 return array( 35 39 // Match "/w/" with slug "/".
-8
src/applications/phriction/controller/PhrictionController.php
··· 30 30 $page->setTitle(idx($data, 'title')); 31 31 $page->setGlyph("\xE2\x9A\xA1"); 32 32 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')); 41 33 $page->appendChild($view); 42 34 $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_WIKI); 43 35
+1 -11
src/applications/slowvote/controller/PhabricatorSlowvoteController.php
··· 1 1 <?php 2 2 3 3 /* 4 - * Copyright 2011 Facebook, Inc. 4 + * Copyright 2012 Facebook, Inc. 5 5 * 6 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 7 * you may not use this file except in compliance with the License. ··· 28 28 $page->setBaseURI('/vote/'); 29 29 $page->setTitle(idx($data, 'title')); 30 30 $page->setGlyph("\xE2\x9C\x94"); 31 - 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 31 42 32 $page->appendChild($view); 43 33
-40
src/view/page/PhabricatorStandardPageView.php
··· 20 20 21 21 private $baseURI; 22 22 private $applicationName; 23 - private $tabs = array(); 24 - private $selectedTab; 25 23 private $glyph; 26 24 private $bodyContent; 27 25 private $menuContent; ··· 48 46 return $this; 49 47 } 50 48 51 - public function setIsLoggedOut($is_logged_out) { 52 - if ($is_logged_out) { 53 - $this->tabs = array_merge($this->tabs, array( 54 - 'login' => array( 55 - 'name' => 'Login', 56 - 'href' => '/login/' 57 - ) 58 - )); 59 - } 60 - return $this; 61 - } 62 - 63 49 public function getIsAdminInterface() { 64 50 return $this->isAdminInterface; 65 51 } ··· 99 85 100 86 public function getBaseURI() { 101 87 return $this->baseURI; 102 - } 103 - 104 - public function setTabs(array $tabs, $selected_tab) { 105 - $this->tabs = $tabs; 106 - $this->selectedTab = $selected_tab; 107 - return $this; 108 88 } 109 89 110 90 public function setShowChrome($show_chrome) { ··· 268 248 269 249 protected function getBody() { 270 250 $console = $this->getConsole(); 271 - 272 - $tabs = array(); 273 - foreach ($this->tabs as $name => $tab) { 274 - $tab_markup = phutil_render_tag( 275 - 'a', 276 - array( 277 - 'href' => idx($tab, 'href'), 278 - ), 279 - phutil_escape_html(idx($tab, 'name'))); 280 - $tab_markup = phutil_render_tag( 281 - 'td', 282 - array( 283 - 'class' => ($name == $this->selectedTab) 284 - ? 'phabricator-selected-tab' 285 - : null, 286 - ), 287 - $tab_markup); 288 - $tabs[] = $tab_markup; 289 - } 290 - $tabs = implode('', $tabs); 291 251 292 252 $login_stuff = null; 293 253 $request = $this->getRequest();
+12
webroot/rsrc/css/application/base/main-menu-view.css
··· 202 202 background-image: url(/rsrc/image/menu/icon_logout_selected.png); 203 203 } 204 204 205 + .main-menu-item-icon-help { 206 + background-image: url(/rsrc/image/menu/icon_help.png); 207 + } 208 + 209 + .main-menu-item-icon-help:hover { 210 + background-image: url(/rsrc/image/menu/icon_help_hover.png); 211 + } 212 + 213 + .main-menu-item-icon-help-selected { 214 + background-image: url(/rsrc/image/menu/icon_help_selected.png); 215 + } 216 + 205 217 .main-menu-item-icon-profile { 206 218 background-repeat: no-repeat; 207 219 background-size: 26px 26px;
webroot/rsrc/image/app/app_applications.png

This is a binary file and will not be displayed.

webroot/rsrc/image/menu/icon_help.png

This is a binary file and will not be displayed.

webroot/rsrc/image/menu/icon_help_hover.png

This is a binary file and will not be displayed.

webroot/rsrc/image/menu/icon_help_selected.png

This is a binary file and will not be displayed.