1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Legalpad - remarkup LX to link to LX

Summary: standard ish. Fixes T4388.

Test Plan: made a comment with L1 and noted L1 linked to L1. Also observed working-ish hovercard.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T4388

Differential Revision: https://secure.phabricator.com/D8178
This commit is contained in:
Bob Trahan 2014-02-10 11:27:08 -08:00
parent 724be3930f
commit f430232dd0
3 changed files with 27 additions and 3 deletions

View file

@ -842,6 +842,7 @@ phutil_register_library_map(array(
'LegalpadDocumentEditor' => 'applications/legalpad/editor/LegalpadDocumentEditor.php',
'LegalpadDocumentListController' => 'applications/legalpad/controller/LegalpadDocumentListController.php',
'LegalpadDocumentQuery' => 'applications/legalpad/query/LegalpadDocumentQuery.php',
'LegalpadDocumentRemarkupRule' => 'applications/legalpad/remarkup/LegalpadDocumentRemarkupRule.php',
'LegalpadDocumentSearchEngine' => 'applications/legalpad/query/LegalpadDocumentSearchEngine.php',
'LegalpadDocumentSignController' => 'applications/legalpad/controller/LegalpadDocumentSignController.php',
'LegalpadDocumentSignature' => 'applications/legalpad/storage/LegalpadDocumentSignature.php',
@ -3438,6 +3439,7 @@ phutil_register_library_map(array(
1 => 'PhabricatorApplicationSearchResultsControllerInterface',
),
'LegalpadDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'LegalpadDocumentRemarkupRule' => 'PhabricatorRemarkupRuleObject',
'LegalpadDocumentSearchEngine' => 'PhabricatorApplicationSearchEngine',
'LegalpadDocumentSignController' => 'LegalpadController',
'LegalpadDocumentSignature' =>

View file

@ -1,8 +1,5 @@
<?php
/**
* @group legalpad
*/
final class PhabricatorApplicationLegalpad extends PhabricatorApplication {
public function getBaseURI() {
@ -33,6 +30,12 @@ final class PhabricatorApplicationLegalpad extends PhabricatorApplication {
return true;
}
public function getRemarkupRules() {
return array(
new LegalpadDocumentRemarkupRule(),
);
}
public function getRoutes() {
return array(
'/L(?P<id>\d+)' => 'LegalpadDocumentSignController',

View file

@ -0,0 +1,19 @@
<?php
final class LegalpadDocumentRemarkupRule
extends PhabricatorRemarkupRuleObject {
protected function getObjectNamePrefix() {
return 'L';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
return id(new LegalpadDocumentQuery())
->setViewer($viewer)
->withIDs($ids)
->execute();
}
}