Page MenuHomePhabricator

D9215.diff
No OneTemporary

D9215.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1489,6 +1489,7 @@
'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 @@
'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
--- a/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
+++ b/src/applications/dashboard/application/PhabricatorApplicationDashboard.php
@@ -41,6 +41,12 @@
);
}
+ 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
--- /dev/null
+++ b/src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php
@@ -0,0 +1,30 @@
+<?php
+
+final class PhabricatorDashboardRemarkupRule
+ extends PhabricatorRemarkupRuleObject {
+
+ protected function getObjectNamePrefix() {
+ return 'W';
+ }
+
+ protected function loadObjects(array $ids) {
+ $viewer = $this->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();
+
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 11, 3:25 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7533282
Default Alt Text
D9215.diff (3 KB)

Event Timeline