diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 437aedb09b..49089fb340 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1489,6 +1489,7 @@ phutil_register_library_map(array( 'PhabricatorDashboardPanelTypeText' => 'applications/dashboard/paneltype/PhabricatorDashboardPanelTypeText.php', 'PhabricatorDashboardPanelViewController' => 'applications/dashboard/controller/PhabricatorDashboardPanelViewController.php', 'PhabricatorDashboardQuery' => 'applications/dashboard/query/PhabricatorDashboardQuery.php', + 'PhabricatorDashboardRemarkupRule' => 'applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php', 'PhabricatorDashboardRemovePanelController' => 'applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php', 'PhabricatorDashboardRenderingEngine' => 'applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php', 'PhabricatorDashboardSearchEngine' => 'applications/dashboard/query/PhabricatorDashboardSearchEngine.php', @@ -4284,6 +4285,7 @@ phutil_register_library_map(array( 'PhabricatorDashboardPanelTypeText' => 'PhabricatorDashboardPanelType', 'PhabricatorDashboardPanelViewController' => 'PhabricatorDashboardController', 'PhabricatorDashboardQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorDashboardRemarkupRule' => 'PhabricatorRemarkupRuleObject', 'PhabricatorDashboardRemovePanelController' => 'PhabricatorDashboardController', 'PhabricatorDashboardRenderingEngine' => 'Phobject', 'PhabricatorDashboardSearchEngine' => 'PhabricatorApplicationSearchEngine', diff --git a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php index d18aa348a6..f4989c7806 100644 --- a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php +++ b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php @@ -41,6 +41,12 @@ final class PhabricatorApplicationDashboard extends PhabricatorApplication { ); } + public function getRemarkupRules() { + return array( + new PhabricatorDashboardRemarkupRule(), + ); + } + public function shouldAppearInLaunchView() { return false; } diff --git a/src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php b/src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php new file mode 100644 index 0000000000..44499d0aa1 --- /dev/null +++ b/src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php @@ -0,0 +1,30 @@ +getEngine()->getConfig('viewer'); + + return id(new PhabricatorDashboardPanelQuery()) + ->setViewer($viewer) + ->withIDs($ids) + ->execute(); + + } + + protected function renderObjectEmbed($object, $handle, $options) { + $viewer = $this->getEngine()->getConfig('viewer'); + + return id(new PhabricatorDashboardPanelRenderingEngine()) + ->setViewer($viewer) + ->setPanel($object) + ->setParentPanelPHIDs(array()) + ->renderPanel(); + + } +}