1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22:41 +01:00

Missing change from D5120 which I incorrectly discarded in a merge.

Auditors: vrana
This commit is contained in:
epriestley 2013-02-27 07:18:30 -08:00
parent f01213b089
commit b5da7b3723
5 changed files with 77 additions and 14 deletions

View file

@ -1851,7 +1851,7 @@ phutil_register_library_map(array(
'DifferentialPathFieldSpecification' => 'DifferentialFieldSpecification',
'DifferentialPeopleMenuEventListener' => 'PhutilEventListener',
'DifferentialPrimaryPaneView' => 'AphrontView',
'DifferentialRemarkupRule' => 'PhabricatorRemarkupRuleObjectName',
'DifferentialRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'DifferentialReplyHandler' => 'PhabricatorMailReplyHandler',
'DifferentialResultsTableView' => 'AphrontView',
'DifferentialRevertPlanFieldSpecification' => 'DifferentialFieldSpecification',
@ -2071,7 +2071,7 @@ phutil_register_library_map(array(
'ManiphestEdgeEventListener' => 'PhutilEventListener',
'ManiphestExportController' => 'ManiphestController',
'ManiphestPeopleMenuEventListener' => 'PhutilEventListener',
'ManiphestRemarkupRule' => 'PhabricatorRemarkupRuleObjectName',
'ManiphestRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'ManiphestReplyHandler' => 'PhabricatorMailReplyHandler',
'ManiphestReportController' => 'ManiphestController',
'ManiphestSavedQuery' => 'ManiphestDAO',
@ -2604,7 +2604,7 @@ phutil_register_library_map(array(
'PhabricatorPasteEditController' => 'PhabricatorPasteController',
'PhabricatorPasteListController' => 'PhabricatorPasteController',
'PhabricatorPasteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorPasteRemarkupRule' => 'PhabricatorRemarkupRuleObjectName',
'PhabricatorPasteRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'PhabricatorPasteViewController' => 'PhabricatorPasteController',
'PhabricatorPeopleController' => 'PhabricatorController',
'PhabricatorPeopleEditController' => 'PhabricatorPeopleController',
@ -3028,7 +3028,7 @@ phutil_register_library_map(array(
'PonderQuestionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PonderQuestionSummaryView' => 'AphrontView',
'PonderQuestionViewController' => 'PonderController',
'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObjectName',
'PonderRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'PonderReplyHandler' => 'PhabricatorMailReplyHandler',
'PonderSearchIndexer' => 'PhabricatorSearchDocumentIndexer',
'PonderUserProfileView' => 'AphrontView',

View file

@ -1,13 +1,26 @@
<?php
/**
* @group markup
* @group differential
*/
final class DifferentialRemarkupRule
extends PhabricatorRemarkupRuleObjectName {
extends PhabricatorRemarkupRuleObject {
protected function getObjectNamePrefix() {
return 'D';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
if (!$viewer) {
return array();
}
return id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs($ids)
->execute();
}
}

View file

@ -1,13 +1,26 @@
<?php
/**
* @group markup
* @group maniphest
*/
final class ManiphestRemarkupRule
extends PhabricatorRemarkupRuleObjectName {
extends PhabricatorRemarkupRuleObject {
protected function getObjectNamePrefix() {
return 'T';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
if (!$viewer) {
return array();
}
return id(new ManiphestTaskQuery())
->setViewer($viewer)
->withTaskIDs($ids)
->execute();
}
}

View file

@ -4,10 +4,24 @@
* @group markup
*/
final class PhabricatorPasteRemarkupRule
extends PhabricatorRemarkupRuleObjectName {
extends PhabricatorRemarkupRuleObject {
protected function getObjectNamePrefix() {
return 'P';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
if (!$viewer) {
return array();
}
return id(new PhabricatorPasteQuery())
->setViewer($viewer)
->withIDs($ids)
->execute();
}
}

View file

@ -1,13 +1,36 @@
<?php
/**
* @group markup
*/
final class PonderRemarkupRule
extends PhabricatorRemarkupRuleObjectName {
extends PhabricatorRemarkupRuleObject {
protected function getObjectNamePrefix() {
return 'Q(?![1-4]\b)';
return 'Q';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
if (!$viewer) {
return array();
}
return id(new PonderQuestionQuery())
->setViewer($viewer)
->withIDs($ids)
->execute();
}
protected function shouldMarkupObject(array $params) {
// NOTE: Q1, Q2, Q3 and Q4 are often used to refer to quarters of the year;
// mark them up only in the {Q1} format.
if ($params['type'] == 'ref') {
if ($params['id'] <= 4) {
return false;
}
}
return true;
}
}