Page MenuHomePhabricator

D9215.id21886.diff
No OneTemporary

D9215.id21886.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
@@ -318,6 +318,7 @@
'DarkConsoleServicesPlugin' => 'aphront/console/plugin/DarkConsoleServicesPlugin.php',
'DarkConsoleXHProfPlugin' => 'aphront/console/plugin/DarkConsoleXHProfPlugin.php',
'DarkConsoleXHProfPluginAPI' => 'aphront/console/plugin/xhprof/DarkConsoleXHProfPluginAPI.php',
+ 'DashboardRemarkupRule' => 'applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php',
'DatabaseConfigurationProvider' => 'infrastructure/storage/configuration/DatabaseConfigurationProvider.php',
'DefaultDatabaseConfigurationProvider' => 'infrastructure/storage/configuration/DefaultDatabaseConfigurationProvider.php',
'DifferentialAction' => 'applications/differential/constants/DifferentialAction.php',
@@ -1487,6 +1488,7 @@
'PhabricatorDashboardPanelTypeText' => 'applications/dashboard/paneltype/PhabricatorDashboardPanelTypeText.php',
'PhabricatorDashboardPanelViewController' => 'applications/dashboard/controller/PhabricatorDashboardPanelViewController.php',
'PhabricatorDashboardQuery' => 'applications/dashboard/query/PhabricatorDashboardQuery.php',
+ 'PhabricatorDashboardRemarkupRule' => 'applications/dashboard/remarkup/DashboardRemarkupRule.php',
'PhabricatorDashboardRenderingEngine' => 'applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php',
'PhabricatorDashboardSearchEngine' => 'applications/dashboard/query/PhabricatorDashboardSearchEngine.php',
'PhabricatorDashboardTransaction' => 'applications/dashboard/storage/PhabricatorDashboardTransaction.php',
@@ -2978,6 +2980,7 @@
'DarkConsoleRequestPlugin' => 'DarkConsolePlugin',
'DarkConsoleServicesPlugin' => 'DarkConsolePlugin',
'DarkConsoleXHProfPlugin' => 'DarkConsolePlugin',
+ 'DashboardRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'DefaultDatabaseConfigurationProvider' => 'DatabaseConfigurationProvider',
'DifferentialActionMenuEventListener' => 'PhabricatorEventListener',
'DifferentialAddCommentView' => 'AphrontView',
@@ -4252,8 +4255,11 @@
'PhabricatorDashboardPanel' =>
array(
0 => 'PhabricatorDashboardDAO',
- 1 => 'PhabricatorPolicyInterface',
- 2 => 'PhabricatorCustomFieldInterface',
+ 1 => 'PhabricatorSubscribableInterface',
+ 2 => 'PhabricatorTokenReceiverInterface',
+ 3 => 'PhabricatorFlaggableInterface',
+ 4 => 'PhabricatorPolicyInterface',
+ 5 => 'PhabricatorCustomFieldInterface',
),
'PhabricatorDashboardPanelCoreCustomField' =>
array(
@@ -4277,6 +4283,7 @@
'PhabricatorDashboardPanelTypeText' => 'PhabricatorDashboardPanelType',
'PhabricatorDashboardPanelViewController' => 'PhabricatorDashboardController',
'PhabricatorDashboardQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+ 'PhabricatorDashboardRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'PhabricatorDashboardRenderingEngine' => 'Phobject',
'PhabricatorDashboardSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorDashboardTransaction' => 'PhabricatorApplicationTransaction',
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
@@ -37,6 +37,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
Thu, Apr 3, 7:13 AM (1 d, 23 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7722927
Default Alt Text
D9215.id21886.diff (4 KB)

Event Timeline