@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a Phurl Typeahead

Summary: Adds a basic typeahead for Phurl Objects.

Test Plan: http://local.phacility.com/typeahead/browse/PhabricatorPhurlURLDatasource/

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D17339

+37
+2
src/__phutil_library_map__.php
··· 3371 3371 'PhabricatorPhurlURLAccessController' => 'applications/phurl/controller/PhabricatorPhurlURLAccessController.php', 3372 3372 'PhabricatorPhurlURLCommentController' => 'applications/phurl/controller/PhabricatorPhurlURLCommentController.php', 3373 3373 'PhabricatorPhurlURLCreateCapability' => 'applications/phurl/capability/PhabricatorPhurlURLCreateCapability.php', 3374 + 'PhabricatorPhurlURLDatasource' => 'applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php', 3374 3375 'PhabricatorPhurlURLEditConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php', 3375 3376 'PhabricatorPhurlURLEditController' => 'applications/phurl/controller/PhabricatorPhurlURLEditController.php', 3376 3377 'PhabricatorPhurlURLEditEngine' => 'applications/phurl/editor/PhabricatorPhurlURLEditEngine.php', ··· 8521 8522 'PhabricatorPhurlURLAccessController' => 'PhabricatorPhurlController', 8522 8523 'PhabricatorPhurlURLCommentController' => 'PhabricatorPhurlController', 8523 8524 'PhabricatorPhurlURLCreateCapability' => 'PhabricatorPolicyCapability', 8525 + 'PhabricatorPhurlURLDatasource' => 'PhabricatorTypeaheadDatasource', 8524 8526 'PhabricatorPhurlURLEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 8525 8527 'PhabricatorPhurlURLEditController' => 'PhabricatorPhurlController', 8526 8528 'PhabricatorPhurlURLEditEngine' => 'PhabricatorEditEngine',
+35
src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php
··· 1 + <?php 2 + 3 + final class PhabricatorPhurlURLDatasource 4 + extends PhabricatorTypeaheadDatasource { 5 + 6 + public function getBrowseTitle() { 7 + return pht('Browse Phurl URLs'); 8 + } 9 + 10 + public function getPlaceholderText() { 11 + return pht('Select a phurl...'); 12 + } 13 + 14 + public function getDatasourceApplicationClass() { 15 + return 'PhabricatorPhurlApplication'; 16 + } 17 + 18 + public function loadResults() { 19 + $query = id(new PhabricatorPhurlURLQuery()); 20 + $urls = $this->executeQuery($query); 21 + $results = array(); 22 + foreach ($urls as $url) { 23 + $result = id(new PhabricatorTypeaheadResult()) 24 + ->setDisplayName($url->getName()) 25 + ->setName($url->getName()." ".$url->getAlias()) 26 + ->setPHID($url->getPHID()) 27 + ->addAttribute($url->getLongURL()); 28 + 29 + $results[] = $result; 30 + } 31 + 32 + return $this->filterResultsAgainstTokens($results); 33 + } 34 + 35 + }