Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14147881
D17339.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17339.diff
View Options
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
@@ -3371,6 +3371,7 @@
'PhabricatorPhurlURLAccessController' => 'applications/phurl/controller/PhabricatorPhurlURLAccessController.php',
'PhabricatorPhurlURLCommentController' => 'applications/phurl/controller/PhabricatorPhurlURLCommentController.php',
'PhabricatorPhurlURLCreateCapability' => 'applications/phurl/capability/PhabricatorPhurlURLCreateCapability.php',
+ 'PhabricatorPhurlURLDatasource' => 'applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php',
'PhabricatorPhurlURLEditConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php',
'PhabricatorPhurlURLEditController' => 'applications/phurl/controller/PhabricatorPhurlURLEditController.php',
'PhabricatorPhurlURLEditEngine' => 'applications/phurl/editor/PhabricatorPhurlURLEditEngine.php',
@@ -8521,6 +8522,7 @@
'PhabricatorPhurlURLAccessController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLCommentController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLCreateCapability' => 'PhabricatorPolicyCapability',
+ 'PhabricatorPhurlURLDatasource' => 'PhabricatorTypeaheadDatasource',
'PhabricatorPhurlURLEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'PhabricatorPhurlURLEditController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLEditEngine' => 'PhabricatorEditEngine',
diff --git a/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php b/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phurl/typeahead/PhabricatorPhurlURLDatasource.php
@@ -0,0 +1,35 @@
+<?php
+
+final class PhabricatorPhurlURLDatasource
+ extends PhabricatorTypeaheadDatasource {
+
+ public function getBrowseTitle() {
+ return pht('Browse Phurl URLs');
+ }
+
+ public function getPlaceholderText() {
+ return pht('Select a phurl...');
+ }
+
+ public function getDatasourceApplicationClass() {
+ return 'PhabricatorPhurlApplication';
+ }
+
+ public function loadResults() {
+ $query = id(new PhabricatorPhurlURLQuery());
+ $urls = $this->executeQuery($query);
+ $results = array();
+ foreach ($urls as $url) {
+ $result = id(new PhabricatorTypeaheadResult())
+ ->setDisplayName($url->getName())
+ ->setName($url->getName()." ".$url->getAlias())
+ ->setPHID($url->getPHID())
+ ->addAttribute($url->getLongURL());
+
+ $results[] = $result;
+ }
+
+ return $this->filterResultsAgainstTokens($results);
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 8:26 AM (6 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6828524
Default Alt Text
D17339.diff (2 KB)
Attached To
Mode
D17339: Add a Phurl Typeahead
Attached
Detach File
Event Timeline
Log In to Comment