From 38cc38eaf67bd0419504f17d64b1311323cc15b4 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 17 Mar 2014 15:01:31 -0700 Subject: [PATCH] Modernize documentation links Summary: - Point them at the new Diviner. - Make them a little less cumbersome to write. Test Plan: Found almost all of these links in the UI and clicked them. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D8553 --- src/aphront/console/plugin/DarkConsoleXHProfPlugin.php | 2 +- .../audit/application/PhabricatorApplicationAudit.php | 2 +- .../conduit/application/PhabricatorApplicationConduit.php | 3 +-- .../config/check/PhabricatorSetupCheckDaemons.php | 2 +- .../config/option/PhabricatorSecurityConfigOptions.php | 3 +-- .../application/PhabricatorApplicationDifferential.php | 2 +- .../controller/DifferentialDiffCreateController.php | 3 +-- .../application/PhabricatorApplicationDiffusion.php | 2 +- .../DiffusionRepositoryEditEncodingController.php | 2 +- .../DiffusionRepositoryEditHostingController.php | 2 +- .../controller/DiffusionRepositoryEditMainController.php | 4 ++-- .../controller/DiffusionRepositoryNewController.php | 2 +- .../files/controller/PhabricatorFileUploadController.php | 2 +- .../herald/application/PhabricatorApplicationHerald.php | 2 +- .../home/controller/PhabricatorHomeMainController.php | 2 +- .../PhabricatorOAuthClientAuthorizationListController.php | 2 +- .../owners/application/PhabricatorApplicationOwners.php | 2 +- .../phame/application/PhabricatorApplicationPhame.php | 2 +- .../pholio/view/PholioInlineCommentEditView.php | 3 +-- .../pholio/view/PholioInlineCommentSaveView.php | 3 +-- .../application/PhabricatorApplicationPhriction.php | 2 +- .../search/engine/PhabricatorJumpNavHandler.php | 2 +- .../panel/PhabricatorSettingsPanelDisplayPreferences.php | 2 +- .../application/PhabricatorApplicationSlowvote.php | 2 +- src/infrastructure/env/PhabricatorEnv.php | 8 ++++++-- src/view/form/control/PhabricatorRemarkupControl.php | 3 +-- 26 files changed, 32 insertions(+), 34 deletions(-) diff --git a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php index 45cf8bcd9d..f56ad00b9a 100644 --- a/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php +++ b/src/aphront/console/plugin/DarkConsoleXHProfPlugin.php @@ -43,7 +43,7 @@ final class DarkConsoleXHProfPlugin extends DarkConsolePlugin { $profile_uri = $data['profileURI']; if (!DarkConsoleXHProfPluginAPI::isProfilerAvailable()) { - $href = PhabricatorEnv::getDoclink('article/Installation_Guide.html'); + $href = PhabricatorEnv::getDoclink('Installation Guide'); $install_guide = phutil_tag( 'a', array( diff --git a/src/applications/audit/application/PhabricatorApplicationAudit.php b/src/applications/audit/application/PhabricatorApplicationAudit.php index d568a7be3d..76cc8e869d 100644 --- a/src/applications/audit/application/PhabricatorApplicationAudit.php +++ b/src/applications/audit/application/PhabricatorApplicationAudit.php @@ -15,7 +15,7 @@ final class PhabricatorApplicationAudit extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Audit_User_Guide.html'); + return PhabricatorEnv::getDoclink('Audit User Guide'); } public function getEventListeners() { diff --git a/src/applications/conduit/application/PhabricatorApplicationConduit.php b/src/applications/conduit/application/PhabricatorApplicationConduit.php index c4d595625c..248877bb9b 100644 --- a/src/applications/conduit/application/PhabricatorApplicationConduit.php +++ b/src/applications/conduit/application/PhabricatorApplicationConduit.php @@ -15,8 +15,7 @@ final class PhabricatorApplicationConduit extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink( - 'article/Conduit_Technical_Documentation.html'); + return PhabricatorEnv::getDoclink('Conduit Technical Documentation'); } public function getShortDescription() { diff --git a/src/applications/config/check/PhabricatorSetupCheckDaemons.php b/src/applications/config/check/PhabricatorSetupCheckDaemons.php index df3fe6d89d..e70a44968d 100644 --- a/src/applications/config/check/PhabricatorSetupCheckDaemons.php +++ b/src/applications/config/check/PhabricatorSetupCheckDaemons.php @@ -13,7 +13,7 @@ final class PhabricatorSetupCheckDaemons extends PhabricatorSetupCheck { if (!$task_daemon) { $doc_href = PhabricatorEnv::getDocLink( - 'article/Managing_Daemons_with_phd.html'); + 'Managing Daemons with phd'); $summary = pht( 'You must start the Phabricator daemons to send email, rebuild '. diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php index 9afed07213..54ddf1a559 100644 --- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php +++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php @@ -12,8 +12,7 @@ final class PhabricatorSecurityConfigOptions } public function getOptions() { - $support_href = PhabricatorEnv::getDoclink( - 'article/feedback.html'); + $support_href = PhabricatorEnv::getDoclink('Give Feedback! Get Support!'); return array( $this->newOption('security.alternate-file-domain', 'string', null) diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php index 833f2f71e9..289a1a4d5e 100644 --- a/src/applications/differential/application/PhabricatorApplicationDifferential.php +++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php @@ -15,7 +15,7 @@ final class PhabricatorApplicationDifferential extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Differential_User_Guide.html'); + return PhabricatorEnv::getDoclink('Differential User Guide'); } public function getFactObjectsForAnalysis() { diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index eb972cc14f..f306160f84 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -41,8 +41,7 @@ final class DifferentialDiffCreateController extends DifferentialController { } $form = new AphrontFormView(); - $arcanist_href = PhabricatorEnv::getDoclink( - 'article/Arcanist_User_Guide.html'); + $arcanist_href = PhabricatorEnv::getDoclink('Arcanist User Guide'); $arcanist_link = phutil_tag( 'a', array( diff --git a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php index ecb0b6fc28..cd6c0ee090 100644 --- a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php +++ b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php @@ -15,7 +15,7 @@ final class PhabricatorApplicationDiffusion extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Diffusion_User_Guide.html'); + return PhabricatorEnv::getDoclink('Diffusion User Guide'); } public function getFactObjectsForAnalysis() { diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php index 55fa5f1420..68db86ec86 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php @@ -107,7 +107,7 @@ Phabricator handles text encodings. EOT , PhabricatorEnv::getDoclink( - 'article/User_Guide_UTF-8_and_Character_Encoding.html')); + 'User Guide: UTF-8 and Character Encoding')); } } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php index 4665aa8438..d21ef40bb8 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditHostingController.php @@ -91,7 +91,7 @@ final class DiffusionRepositoryEditHostingController ->setValue($v_hosting); $doc_href = PhabricatorEnv::getDoclink( - 'article/Diffusion_User_Guide_Repository_Hosting.html'); + 'Diffusion User Guide: Repository Hosting'); $form = id(new AphrontFormView()) ->setUser($user) diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php index b62451d4c3..b5c0e1b9fe 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php @@ -769,8 +769,8 @@ final class DiffusionRepositoryEditMainController } } - $doc_href = PhabricatorEnv::getDocLink( - 'article/Managing_Daemons_with_phd.html'); + $doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd'); + $daemon_instructions = pht( 'Use %s to start daemons. See %s.', phutil_tag('tt', array(), 'bin/phd start'), diff --git a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php index ecc4b5d1e3..b26bceff1c 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php @@ -27,7 +27,7 @@ final class DiffusionRepositoryNewController } $doc_href = PhabricatorEnv::getDoclink( - 'article/Diffusion_User_Guide_Repository_Hosting.html'); + 'Diffusion User Guide: Repository Hosting'); $doc_link = phutil_tag( 'a', diff --git a/src/applications/files/controller/PhabricatorFileUploadController.php b/src/applications/files/controller/PhabricatorFileUploadController.php index 69dd3541a7..2c262ef0e6 100644 --- a/src/applications/files/controller/PhabricatorFileUploadController.php +++ b/src/applications/files/controller/PhabricatorFileUploadController.php @@ -94,7 +94,7 @@ final class PhabricatorFileUploadController extends PhabricatorFileController { } $doc_href = PhabricatorEnv::getDocLink( - 'article/Configuring_File_Upload_Limits.html'); + 'Configuring File Upload Limits'); $doc_link = phutil_tag( 'a', array( diff --git a/src/applications/herald/application/PhabricatorApplicationHerald.php b/src/applications/herald/application/PhabricatorApplicationHerald.php index 7ce1832994..c72d73717c 100644 --- a/src/applications/herald/application/PhabricatorApplicationHerald.php +++ b/src/applications/herald/application/PhabricatorApplicationHerald.php @@ -19,7 +19,7 @@ final class PhabricatorApplicationHerald extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Herald_User_Guide.html'); + return PhabricatorEnv::getDoclink('Herald User Guide'); } public function getFlavorText() { diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php index 057f68f47b..b886e38023 100644 --- a/src/applications/home/controller/PhabricatorHomeMainController.php +++ b/src/applications/home/controller/PhabricatorHomeMainController.php @@ -324,7 +324,7 @@ final class PhabricatorHomeMainController require_celerity_resource('phabricator-jump-nav'); - $doc_href = PhabricatorEnv::getDocLink('article/Jump_Nav_User_Guide.html'); + $doc_href = PhabricatorEnv::getDocLink('Jump Nav User Guide'); $doc_link = phutil_tag( 'a', array( diff --git a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php index 9e3741144b..82c30609ed 100644 --- a/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php +++ b/src/applications/oauthserver/controller/clientauthorization/PhabricatorOAuthClientAuthorizationListController.php @@ -47,7 +47,7 @@ extends PhabricatorOAuthClientAuthorizationBaseController { $updated = phabricator_datetime($authorization->getDateModified(), $current_user); $scope_doc_href = PhabricatorEnv::getDoclink( - 'article/Using_the_Phabricator_OAuth_Server.html#scopes'); + 'Using the Phabricator OAuth Server'); $row = array( phutil_tag( 'a', diff --git a/src/applications/owners/application/PhabricatorApplicationOwners.php b/src/applications/owners/application/PhabricatorApplicationOwners.php index 6a9d5d8134..ed80bf0b45 100644 --- a/src/applications/owners/application/PhabricatorApplicationOwners.php +++ b/src/applications/owners/application/PhabricatorApplicationOwners.php @@ -19,7 +19,7 @@ final class PhabricatorApplicationOwners extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Owners_Tool_User_Guide.html'); + return PhabricatorEnv::getDoclink('Owners Tool User Guide'); } public function getFlavorText() { diff --git a/src/applications/phame/application/PhabricatorApplicationPhame.php b/src/applications/phame/application/PhabricatorApplicationPhame.php index 3af2955dc8..d254d871cb 100644 --- a/src/applications/phame/application/PhabricatorApplicationPhame.php +++ b/src/applications/phame/application/PhabricatorApplicationPhame.php @@ -19,7 +19,7 @@ final class PhabricatorApplicationPhame extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Phame_User_Guide.html'); + return PhabricatorEnv::getDoclink('Phame User Guide'); } public function getApplicationGroup() { diff --git a/src/applications/pholio/view/PholioInlineCommentEditView.php b/src/applications/pholio/view/PholioInlineCommentEditView.php index 862e72aebe..d36c788019 100644 --- a/src/applications/pholio/view/PholioInlineCommentEditView.php +++ b/src/applications/pholio/view/PholioInlineCommentEditView.php @@ -96,8 +96,7 @@ final class PholioInlineCommentEditView extends AphrontView { $formatting = phutil_tag( 'a', array( - 'href' => PhabricatorEnv::getDoclink( - 'article/Remarkup_Reference.html'), + 'href' => PhabricatorEnv::getDoclink('Remarkup Reference'), 'tabindex' => '-1', 'target' => '_blank', ), diff --git a/src/applications/pholio/view/PholioInlineCommentSaveView.php b/src/applications/pholio/view/PholioInlineCommentSaveView.php index da5b361523..6f79c81f42 100644 --- a/src/applications/pholio/view/PholioInlineCommentSaveView.php +++ b/src/applications/pholio/view/PholioInlineCommentSaveView.php @@ -84,8 +84,7 @@ final class PholioInlineCommentSaveView extends AphrontView { $formatting = phutil_tag( 'a', array( - 'href' => PhabricatorEnv::getDoclink( - 'article/Remarkup_Reference.html'), + 'href' => PhabricatorEnv::getDoclink('Remarkup Reference'), 'tabindex' => '-1', 'target' => '_blank', ), diff --git a/src/applications/phriction/application/PhabricatorApplicationPhriction.php b/src/applications/phriction/application/PhabricatorApplicationPhriction.php index 5ede3d5229..6fdc116c65 100644 --- a/src/applications/phriction/application/PhabricatorApplicationPhriction.php +++ b/src/applications/phriction/application/PhabricatorApplicationPhriction.php @@ -15,7 +15,7 @@ final class PhabricatorApplicationPhriction extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Phriction_User_Guide.html'); + return PhabricatorEnv::getDoclink('Phriction User Guide'); } public function getTitleGlyph() { diff --git a/src/applications/search/engine/PhabricatorJumpNavHandler.php b/src/applications/search/engine/PhabricatorJumpNavHandler.php index e8790e1635..cfa3bc9aa2 100644 --- a/src/applications/search/engine/PhabricatorJumpNavHandler.php +++ b/src/applications/search/engine/PhabricatorJumpNavHandler.php @@ -4,7 +4,7 @@ final class PhabricatorJumpNavHandler { public static function getJumpResponse(PhabricatorUser $viewer, $jump) { $jump = trim($jump); - $help_href = PhabricatorEnv::getDocLink('article/Jump_Nav_User_Guide.html'); + $help_href = PhabricatorEnv::getDocLink('Jump Nav User Guide'); $patterns = array( '/^help/i' => 'uri:'.$help_href, diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php index 89cb362b1f..47ae324df4 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelDisplayPreferences.php @@ -86,7 +86,7 @@ EXAMPLE; 'a', array( 'href' => PhabricatorEnv::getDoclink( - 'article/User_Guide_Configuring_an_External_Editor.html'), + 'User Guide: Configuring an External Editor'), ), pht('User Guide: Configuring an External Editor')); diff --git a/src/applications/slowvote/application/PhabricatorApplicationSlowvote.php b/src/applications/slowvote/application/PhabricatorApplicationSlowvote.php index a38519fdb9..ee591fa8d3 100644 --- a/src/applications/slowvote/application/PhabricatorApplicationSlowvote.php +++ b/src/applications/slowvote/application/PhabricatorApplicationSlowvote.php @@ -19,7 +19,7 @@ final class PhabricatorApplicationSlowvote extends PhabricatorApplication { } public function getHelpURI() { - return PhabricatorEnv::getDoclink('article/Slowvote_User_Guide.html'); + return PhabricatorEnv::getDoclink('Slowvote User Guide'); } public function getFlavorText() { diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index f4882c0be1..8d83ffb4f2 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -336,8 +336,12 @@ final class PhabricatorEnv { * * @task read */ - public static function getDoclink($resource) { - return 'http://www.phabricator.com/docs/phabricator/'.$resource; + public static function getDoclink($resource, $type = 'article') { + $uri = new PhutilURI('https://secure.phabricator.com/diviner/find/'); + $uri->setQueryParam('name', $resource); + $uri->setQueryParam('type', $type); + $uri->setQueryParam('jump', true); + return (string)$uri; } diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index 7fb0ad3e44..e19f109316 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -87,8 +87,7 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { $actions['help'] = array( 'tip' => pht('Help'), 'align' => 'right', - 'href' => PhabricatorEnv::getDoclink( - 'article/Remarkup_Reference.html'), + 'href' => PhabricatorEnv::getDoclink('Remarkup Reference'), ); $actions[] = array(