From 4f0d61436b1a46d4548de991f4c001507d9bc5a8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 5 Jun 2015 14:19:40 -0700 Subject: [PATCH] Add a Spaces remarkup rule Summary: Ref T8449. Test Plan: {F474032} Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8449 Differential Revision: https://secure.phabricator.com/D13172 --- src/__phutil_library_map__.php | 2 ++ .../PhabricatorSpacesApplication.php | 6 ++++++ .../remarkup/PhabricatorSpacesRemarkupRule.php | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b35bc03a52..20d6e988f5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2586,6 +2586,7 @@ phutil_register_library_map(array( 'PhabricatorSpacesNamespaceSearchEngine' => 'applications/spaces/query/PhabricatorSpacesNamespaceSearchEngine.php', 'PhabricatorSpacesNamespaceTransaction' => 'applications/spaces/storage/PhabricatorSpacesNamespaceTransaction.php', 'PhabricatorSpacesNamespaceTransactionQuery' => 'applications/spaces/query/PhabricatorSpacesNamespaceTransactionQuery.php', + 'PhabricatorSpacesRemarkupRule' => 'applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php', 'PhabricatorSpacesTestCase' => 'applications/spaces/__tests__/PhabricatorSpacesTestCase.php', 'PhabricatorSpacesViewController' => 'applications/spaces/controller/PhabricatorSpacesViewController.php', 'PhabricatorStandardCustomField' => 'infrastructure/customfield/standard/PhabricatorStandardCustomField.php', @@ -6093,6 +6094,7 @@ phutil_register_library_map(array( 'PhabricatorSpacesNamespaceSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorSpacesNamespaceTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorSpacesNamespaceTransactionQuery' => 'PhabricatorApplicationTransactionQuery', + 'PhabricatorSpacesRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PhabricatorSpacesTestCase' => 'PhabricatorTestCase', 'PhabricatorSpacesViewController' => 'PhabricatorSpacesController', 'PhabricatorStandardCustomField' => 'PhabricatorCustomField', diff --git a/src/applications/spaces/application/PhabricatorSpacesApplication.php b/src/applications/spaces/application/PhabricatorSpacesApplication.php index 3733dc87ae..380f80569e 100644 --- a/src/applications/spaces/application/PhabricatorSpacesApplication.php +++ b/src/applications/spaces/application/PhabricatorSpacesApplication.php @@ -38,6 +38,12 @@ final class PhabricatorSpacesApplication extends PhabricatorApplication { return true; } + public function getRemarkupRules() { + return array( + new PhabricatorSpacesRemarkupRule(), + ); + } + public function getRoutes() { return array( '/S(?P[1-9]\d*)' => 'PhabricatorSpacesViewController', diff --git a/src/applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php b/src/applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php new file mode 100644 index 0000000000..5dbecefc17 --- /dev/null +++ b/src/applications/spaces/remarkup/PhabricatorSpacesRemarkupRule.php @@ -0,0 +1,18 @@ +getEngine()->getConfig('viewer'); + return id(new PhabricatorSpacesNamespaceQuery()) + ->setViewer($viewer) + ->withIDs($ids) + ->execute(); + } + +}