diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a0b3693f46..eb855d1c6a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -549,6 +549,7 @@ phutil_register_library_map(array( 'PhabricatorApplicationDaemons' => 'applications/daemon/application/PhabricatorApplicationDaemons.php', 'PhabricatorApplicationDifferential' => 'applications/differential/application/PhabricatorApplicationDifferential.php', 'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php', + 'PhabricatorApplicationDiviner' => 'applications/diviner/application/PhabricatorApplicationDiviner.php', 'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php', 'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php', 'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php', @@ -1671,6 +1672,7 @@ phutil_register_library_map(array( 'PhabricatorApplicationDaemons' => 'PhabricatorApplication', 'PhabricatorApplicationDifferential' => 'PhabricatorApplication', 'PhabricatorApplicationDiffusion' => 'PhabricatorApplication', + 'PhabricatorApplicationDiviner' => 'PhabricatorApplication', 'PhabricatorApplicationFact' => 'PhabricatorApplication', 'PhabricatorApplicationFlags' => 'PhabricatorApplication', 'PhabricatorApplicationLaunchView' => 'AphrontView', diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 8de9359d8f..4abd3ce216 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -70,6 +70,21 @@ abstract class PhabricatorApplication { return null; } + public function getHelpURI() { + // TODO: When these applications get created, link to their docs: + // + // - Conduit + // - Drydock + // - Herald + // - OAuth Server + // - Owners + // - Phame + // - Slowvote + + + return null; + } + /* -( URI Routing )-------------------------------------------------------- */ diff --git a/src/applications/calendar/controller/PhabricatorCalendarController.php b/src/applications/calendar/controller/PhabricatorCalendarController.php index 9688769cb7..9831a28743 100644 --- a/src/applications/calendar/controller/PhabricatorCalendarController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarController.php @@ -1,7 +1,7 @@ setGlyph("\xE2\x8C\xA8"); - $page->appendChild($view); - $page->setTabs( - array( - ), - idx($data, 'tab')); - $response = new AphrontWebpageResponse(); return $response->setContent($page->render()); } diff --git a/src/applications/conduit/controller/PhabricatorConduitController.php b/src/applications/conduit/controller/PhabricatorConduitController.php index 366ae2625c..f3f7ccdd7f 100644 --- a/src/applications/conduit/controller/PhabricatorConduitController.php +++ b/src/applications/conduit/controller/PhabricatorConduitController.php @@ -25,21 +25,12 @@ abstract class PhabricatorConduitController extends PhabricatorController { protected $showSideNav; public function buildStandardPageResponse($view, array $data) { - $doclink = PhabricatorEnv::getDoclink( - 'article/Conduit_Technical_Documentation.html' - ); - $page = $this->buildStandardPageView(); $page->setApplicationName('Conduit'); $page->setBaseURI('/conduit/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x87\xB5"); - $page->setTabs(array( - 'help' => array( - 'href' => $doclink, - 'name' => 'Help') - ), null); if ($this->showSideNav()) { diff --git a/src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php b/src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php index 97553db4fa..efe4c78c48 100644 --- a/src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php +++ b/src/applications/daemon/controller/PhabricatorDaemonTimelineConsoleController.php @@ -65,7 +65,6 @@ final class PhabricatorDaemonTimelineConsoleController $nav, array( 'title' => 'Timeline', - 'tab' => 'timeline', )); } diff --git a/src/applications/differential/controller/DifferentialController.php b/src/applications/differential/controller/DifferentialController.php index 07f6244324..e77c750d05 100644 --- a/src/applications/differential/controller/DifferentialController.php +++ b/src/applications/differential/controller/DifferentialController.php @@ -34,7 +34,6 @@ abstract class DifferentialController extends PhabricatorController { $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x9A\x99"); $page->appendChild($view); - $page->setIsLoggedOut($viewer_is_anonymous); $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_REVISIONS); $response = new AphrontWebpageResponse(); diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index b568145e49..eeda03b398 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -84,7 +84,6 @@ final class DifferentialDiffCreateController extends DifferentialController { $panel, array( 'title' => 'Create Diff', - 'tab' => 'create', )); } diff --git a/src/applications/differential/controller/DifferentialRevisionListController.php b/src/applications/differential/controller/DifferentialRevisionListController.php index ec3cacdcd8..e14c1ecaac 100644 --- a/src/applications/differential/controller/DifferentialRevisionListController.php +++ b/src/applications/differential/controller/DifferentialRevisionListController.php @@ -228,7 +228,6 @@ final class DifferentialRevisionListController extends DifferentialController { $side_nav, array( 'title' => 'Differential Home', - 'tab' => 'revisions', )); } diff --git a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php index fc5a47aaf9..4c78988f72 100644 --- a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php +++ b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php @@ -30,6 +30,10 @@ final class PhabricatorApplicationDiffusion extends PhabricatorApplication { return celerity_get_resource_uri('/rsrc/image/app/app_diffusion.png'); } + public function getHelpURI() { + return PhabricatorEnv::getDoclink('article/Diffusion_User_Guide.html'); + } + public function getRoutes() { return array( '/r(?P[A-Z]+)(?P[a-z0-9]+)' diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index 862f3d69f7..f2d87036d4 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -47,15 +47,6 @@ abstract class DiffusionController extends PhabricatorController { $page->setBaseURI('/diffusion/'); $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x89\x88"); - $page->setTabs( - array( - 'help' => array( - 'href' => PhabricatorEnv::getDoclink( - 'article/Diffusion_User_Guide.html'), - 'name' => 'Help', - ), - ), - null); $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_COMMITS); $page->appendChild($view); diff --git a/src/applications/diviner/application/PhabricatorApplicationDiviner.php b/src/applications/diviner/application/PhabricatorApplicationDiviner.php new file mode 100644 index 0000000000..3cfd5a1bad --- /dev/null +++ b/src/applications/diviner/application/PhabricatorApplicationDiviner.php @@ -0,0 +1,46 @@ +getCurrentApplication(); + if ($application && $application->getHelpURI()) { + $class = 'main-menu-item-icon-help'; + $item = new PhabricatorMainMenuIconView(); + $item->setName(pht('%s Help', $application->getName())); + $item->addClass('main-menu-item-icon '.$class); + $item->setHref($application->getHelpURI()); + $item->setSortOrder(0.1); + $items[] = $item; + } + + return $items; + } + + +} + diff --git a/src/applications/drydock/controller/DrydockController.php b/src/applications/drydock/controller/DrydockController.php index 311d951322..710d40ec83 100644 --- a/src/applications/drydock/controller/DrydockController.php +++ b/src/applications/drydock/controller/DrydockController.php @@ -29,15 +29,6 @@ abstract class DrydockController extends PhabricatorController { $page->appendChild($view); - $help_uri = PhabricatorEnv::getDoclink('article/Drydock_User_Guide.html'); - $page->setTabs( - array( - 'help' => array( - 'name' => 'Help', - 'href' => $help_uri, - ), - ), null); - $response = new AphrontWebpageResponse(); return $response->setContent($page->render()); } diff --git a/src/applications/files/controller/PhabricatorFileListController.php b/src/applications/files/controller/PhabricatorFileListController.php index 0d10f08472..16079eced6 100644 --- a/src/applications/files/controller/PhabricatorFileListController.php +++ b/src/applications/files/controller/PhabricatorFileListController.php @@ -177,7 +177,6 @@ final class PhabricatorFileListController extends PhabricatorFileController { $side_nav, array( 'title' => 'Files', - 'tab' => 'files', )); } diff --git a/src/applications/files/controller/PhabricatorFileMacroListController.php b/src/applications/files/controller/PhabricatorFileMacroListController.php index f63bb3d854..5a92bead91 100644 --- a/src/applications/files/controller/PhabricatorFileMacroListController.php +++ b/src/applications/files/controller/PhabricatorFileMacroListController.php @@ -158,7 +158,6 @@ final class PhabricatorFileMacroListController $side_nav, array( 'title' => 'Image Macros', - 'tab' => 'macros', )); } } diff --git a/src/applications/herald/controller/HeraldController.php b/src/applications/herald/controller/HeraldController.php index c3814082c4..7497e366f4 100644 --- a/src/applications/herald/controller/HeraldController.php +++ b/src/applications/herald/controller/HeraldController.php @@ -26,16 +26,6 @@ abstract class HeraldController extends PhabricatorController { $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x98\xBF"); - $doclink = PhabricatorEnv::getDoclink('article/Herald_User_Guide.html'); - - $tabs = array( - 'help' => array( - 'href' => $doclink, - 'name' => 'Help', - ), - ); - $page->setTabs($tabs, null); - $page->appendChild($view); $page->setIsAdminInterface(idx($data, 'admin')); diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php index 10f6c92494..028f65971a 100644 --- a/src/applications/herald/controller/HeraldTestConsoleController.php +++ b/src/applications/herald/controller/HeraldTestConsoleController.php @@ -144,7 +144,6 @@ final class HeraldTestConsoleController extends HeraldController { $nav, array( 'title' => 'Test Console', - 'tab' => 'test', )); } diff --git a/src/applications/herald/controller/HeraldTranscriptListController.php b/src/applications/herald/controller/HeraldTranscriptListController.php index 7b41b43432..cee544d902 100644 --- a/src/applications/herald/controller/HeraldTranscriptListController.php +++ b/src/applications/herald/controller/HeraldTranscriptListController.php @@ -119,7 +119,6 @@ final class HeraldTranscriptListController extends HeraldController { $nav, array( 'title' => 'Herald Transcripts', - 'tab' => 'transcripts', )); } diff --git a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php index 2660aec3e3..7d317a4efd 100644 --- a/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php +++ b/src/applications/mailinglists/controller/PhabricatorMailingListsListController.php @@ -81,7 +81,6 @@ final class PhabricatorMailingListsListController $panel, array( 'title' => 'Mailing Lists', - 'tab' => 'lists', )); } } diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php b/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php index bbd1e51d5c..16d0cd73a6 100644 --- a/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php +++ b/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php @@ -91,7 +91,6 @@ final class PhabricatorMetaMTAReceivedListController $nav, array( 'title' => 'Received Mail', - 'tab' => 'received', )); } } diff --git a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php index 31c7940901..2a6843e9b3 100644 --- a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php +++ b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php @@ -47,17 +47,6 @@ extends PhabricatorController { $nav->appendChild($view); $page->appendChild($nav); - $doc_href = PhabricatorEnv::getDoclink( - 'article/Using_the_Phabricator_OAuth_Server.html' - ); - $page->setTabs( - array( - 'help' => array( - 'name' => 'Help', - 'href' => $doc_href, - ), - ), - null); $response = new AphrontWebpageResponse(); return $response->setContent($page->render()); diff --git a/src/applications/owners/controller/PhabricatorOwnersController.php b/src/applications/owners/controller/PhabricatorOwnersController.php index a4be6afcad..e3c5002e73 100644 --- a/src/applications/owners/controller/PhabricatorOwnersController.php +++ b/src/applications/owners/controller/PhabricatorOwnersController.php @@ -39,16 +39,6 @@ abstract class PhabricatorOwnersController extends PhabricatorController { $nav->appendChild($view); $page->appendChild($nav); - $doclink = - PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html'); - $tabs = array( - 'help' => array( - 'href' => $doclink, - 'name' => 'Help', - ), - ); - $page->setTabs($tabs, null); - $response = new AphrontWebpageResponse(); return $response->setContent($page->render()); } diff --git a/src/applications/paste/controller/PhabricatorPasteViewController.php b/src/applications/paste/controller/PhabricatorPasteViewController.php index bcef68d16f..216753bbb3 100644 --- a/src/applications/paste/controller/PhabricatorPasteViewController.php +++ b/src/applications/paste/controller/PhabricatorPasteViewController.php @@ -122,7 +122,6 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController { ), array( 'title' => 'Paste: '.nonempty($paste->getTitle(), 'P'.$paste->getID()), - 'tab' => 'view', )); } diff --git a/src/applications/phame/controller/PhameController.php b/src/applications/phame/controller/PhameController.php index af1ec4ec17..8b12a8a323 100644 --- a/src/applications/phame/controller/PhameController.php +++ b/src/applications/phame/controller/PhameController.php @@ -39,14 +39,6 @@ abstract class PhameController extends PhabricatorController { $page->setTitle(idx($data, 'title')); $page->setGlyph("\xe2\x9c\xa9"); - $tabs = array( - 'help' => array( - 'name' => 'Help', - 'href' => - PhabricatorEnv::getDoclink('article/Phame_User_Guide.html'), - ), - ); - $page->setTabs($tabs, idx($data, 'tab')); if ($this->showSideNav()) { $nav = $this->renderSideNavFilterView($this->getSideNavFilter()); $nav->appendChild($view); diff --git a/src/applications/phriction/application/PhabricatorApplicationPhriction.php b/src/applications/phriction/application/PhabricatorApplicationPhriction.php index 080cdd6863..6593ed3747 100644 --- a/src/applications/phriction/application/PhabricatorApplicationPhriction.php +++ b/src/applications/phriction/application/PhabricatorApplicationPhriction.php @@ -30,6 +30,10 @@ final class PhabricatorApplicationPhriction extends PhabricatorApplication { return celerity_get_resource_uri('/rsrc/image/app/app_phriction.png'); } + public function getHelpURI() { + return PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'); + } + public function getRoutes() { return array( // Match "/w/" with slug "/". diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php index 7f2e872223..0c1e6c329e 100644 --- a/src/applications/phriction/controller/PhrictionController.php +++ b/src/applications/phriction/controller/PhrictionController.php @@ -30,14 +30,6 @@ abstract class PhrictionController extends PhabricatorController { $page->setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x9A\xA1"); - $tabs = array( - 'help' => array( - 'name' => 'Help', - 'href' => - PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'), - ), - ); - $page->setTabs($tabs, idx($data, 'tab')); $page->appendChild($view); $page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_WIKI); diff --git a/src/applications/slowvote/controller/PhabricatorSlowvoteController.php b/src/applications/slowvote/controller/PhabricatorSlowvoteController.php index b5976adc08..5368519702 100644 --- a/src/applications/slowvote/controller/PhabricatorSlowvoteController.php +++ b/src/applications/slowvote/controller/PhabricatorSlowvoteController.php @@ -1,7 +1,7 @@ setTitle(idx($data, 'title')); $page->setGlyph("\xE2\x9C\x94"); - $doc_href = PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html'); - $page->setTabs( - array( - 'help' => array( - 'name' => 'Help', - 'href' => $doc_href, - ), - ), - null); - $page->appendChild($view); $response = new AphrontWebpageResponse(); diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 43b995d859..a88f2e0b92 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -20,8 +20,6 @@ final class PhabricatorStandardPageView extends AphrontPageView { private $baseURI; private $applicationName; - private $tabs = array(); - private $selectedTab; private $glyph; private $bodyContent; private $menuContent; @@ -48,18 +46,6 @@ final class PhabricatorStandardPageView extends AphrontPageView { return $this; } - public function setIsLoggedOut($is_logged_out) { - if ($is_logged_out) { - $this->tabs = array_merge($this->tabs, array( - 'login' => array( - 'name' => 'Login', - 'href' => '/login/' - ) - )); - } - return $this; - } - public function getIsAdminInterface() { return $this->isAdminInterface; } @@ -101,12 +87,6 @@ final class PhabricatorStandardPageView extends AphrontPageView { return $this->baseURI; } - public function setTabs(array $tabs, $selected_tab) { - $this->tabs = $tabs; - $this->selectedTab = $selected_tab; - return $this; - } - public function setShowChrome($show_chrome) { $this->showChrome = $show_chrome; return $this; @@ -269,26 +249,6 @@ final class PhabricatorStandardPageView extends AphrontPageView { protected function getBody() { $console = $this->getConsole(); - $tabs = array(); - foreach ($this->tabs as $name => $tab) { - $tab_markup = phutil_render_tag( - 'a', - array( - 'href' => idx($tab, 'href'), - ), - phutil_escape_html(idx($tab, 'name'))); - $tab_markup = phutil_render_tag( - 'td', - array( - 'class' => ($name == $this->selectedTab) - ? 'phabricator-selected-tab' - : null, - ), - $tab_markup); - $tabs[] = $tab_markup; - } - $tabs = implode('', $tabs); - $login_stuff = null; $request = $this->getRequest(); $user = null; diff --git a/webroot/rsrc/css/application/base/main-menu-view.css b/webroot/rsrc/css/application/base/main-menu-view.css index 7e1995322b..377f9318c3 100644 --- a/webroot/rsrc/css/application/base/main-menu-view.css +++ b/webroot/rsrc/css/application/base/main-menu-view.css @@ -202,6 +202,18 @@ background-image: url(/rsrc/image/menu/icon_logout_selected.png); } +.main-menu-item-icon-help { + background-image: url(/rsrc/image/menu/icon_help.png); +} + +.main-menu-item-icon-help:hover { + background-image: url(/rsrc/image/menu/icon_help_hover.png); +} + +.main-menu-item-icon-help-selected { + background-image: url(/rsrc/image/menu/icon_help_selected.png); +} + .main-menu-item-icon-profile { background-repeat: no-repeat; background-size: 26px 26px; diff --git a/webroot/rsrc/image/app/app_applications.png b/webroot/rsrc/image/app/app_applications.png index ff13f2866e..7b4c3d0b6e 100644 Binary files a/webroot/rsrc/image/app/app_applications.png and b/webroot/rsrc/image/app/app_applications.png differ diff --git a/webroot/rsrc/image/menu/icon_help.png b/webroot/rsrc/image/menu/icon_help.png new file mode 100644 index 0000000000..8889d9d5e1 Binary files /dev/null and b/webroot/rsrc/image/menu/icon_help.png differ diff --git a/webroot/rsrc/image/menu/icon_help_hover.png b/webroot/rsrc/image/menu/icon_help_hover.png new file mode 100644 index 0000000000..18c3c98518 Binary files /dev/null and b/webroot/rsrc/image/menu/icon_help_hover.png differ diff --git a/webroot/rsrc/image/menu/icon_help_selected.png b/webroot/rsrc/image/menu/icon_help_selected.png new file mode 100644 index 0000000000..9a2fbf95bf Binary files /dev/null and b/webroot/rsrc/image/menu/icon_help_selected.png differ