Changeset View
Changeset View
Standalone View
Standalone View
src/applications/meta/query/PhabricatorAppSearchEngine.php
| Show All 18 Lines | public function buildSavedQueryFromRequest(AphrontRequest $request) { | ||||
| $saved = new PhabricatorSavedQuery(); | $saved = new PhabricatorSavedQuery(); | ||||
| $saved->setParameter('name', $request->getStr('name')); | $saved->setParameter('name', $request->getStr('name')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'installed', | 'installed', | ||||
| $this->readBoolFromRequest($request, 'installed')); | $this->readBoolFromRequest($request, 'installed')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'beta', | 'prototypes', | ||||
| $this->readBoolFromRequest($request, 'beta')); | $this->readBoolFromRequest($request, 'prototypes')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'firstParty', | 'firstParty', | ||||
| $this->readBoolFromRequest($request, 'firstParty')); | $this->readBoolFromRequest($request, 'firstParty')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'launchable', | 'launchable', | ||||
| $this->readBoolFromRequest($request, 'launchable')); | $this->readBoolFromRequest($request, 'launchable')); | ||||
| return $saved; | return $saved; | ||||
| Show All 9 Lines | if (strlen($name)) { | ||||
| $query->withNameContains($name); | $query->withNameContains($name); | ||||
| } | } | ||||
| $installed = $saved->getParameter('installed'); | $installed = $saved->getParameter('installed'); | ||||
| if ($installed !== null) { | if ($installed !== null) { | ||||
| $query->withInstalled($installed); | $query->withInstalled($installed); | ||||
| } | } | ||||
| $beta = $saved->getParameter('beta'); | $prototypes = $saved->getParameter('prototypes'); | ||||
| if ($beta !== null) { | |||||
| $query->withBeta($beta); | if ($prototypes === null) { | ||||
| // NOTE: This is the old name of the 'prototypes' option, see T6084. | |||||
| $prototypes = $saved->getParameter('beta'); | |||||
| $saved->setParameter('prototypes', $prototypes); | |||||
| } | |||||
| if ($prototypes !== null) { | |||||
| $query->withPrototypes($prototypes); | |||||
| } | } | ||||
| $first_party = $saved->getParameter('firstParty'); | $first_party = $saved->getParameter('firstParty'); | ||||
| if ($first_party !== null) { | if ($first_party !== null) { | ||||
| $query->withFirstParty($first_party); | $query->withFirstParty($first_party); | ||||
| } | } | ||||
| $launchable = $saved->getParameter('launchable'); | $launchable = $saved->getParameter('launchable'); | ||||
| Show All 22 Lines | $form | ||||
| ->setOptions( | ->setOptions( | ||||
| array( | array( | ||||
| '' => pht('Show All Applications'), | '' => pht('Show All Applications'), | ||||
| 'true' => pht('Show Installed Applications'), | 'true' => pht('Show Installed Applications'), | ||||
| 'false' => pht('Show Uninstalled Applications'), | 'false' => pht('Show Uninstalled Applications'), | ||||
| ))) | ))) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
| ->setLabel(pht('Beta')) | ->setLabel(pht('Prototypes')) | ||||
| ->setName('beta') | ->setName('prototypes') | ||||
| ->setValue($this->getBoolFromQuery($saved, 'beta')) | ->setValue($this->getBoolFromQuery($saved, 'prototypes')) | ||||
| ->setOptions( | ->setOptions( | ||||
| array( | array( | ||||
| '' => pht('Show All Applications'), | '' => pht('Show All Applications'), | ||||
| 'true' => pht('Show Beta Applications'), | 'true' => pht('Show Prototype Applications'), | ||||
| 'false' => pht('Show Released Applications'), | 'false' => pht('Show Released Applications'), | ||||
| ))) | ))) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
| ->setLabel(pht('Provenance')) | ->setLabel(pht('Provenance')) | ||||
| ->setName('firstParty') | ->setName('firstParty') | ||||
| ->setValue($this->getBoolFromQuery($saved, 'firstParty')) | ->setValue($this->getBoolFromQuery($saved, 'firstParty')) | ||||
| ->setOptions( | ->setOptions( | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | foreach ($groups as $group => $applications) { | ||||
| if ($application->getBaseURI()) { | if ($application->getBaseURI()) { | ||||
| $item->setHref($application->getBaseURI()); | $item->setHref($application->getBaseURI()); | ||||
| } | } | ||||
| if (!$application->isInstalled()) { | if (!$application->isInstalled()) { | ||||
| $item->addIcon('fa-times', pht('Uninstalled')); | $item->addIcon('fa-times', pht('Uninstalled')); | ||||
| } | } | ||||
| if ($application->isBeta()) { | if ($application->isPrototype()) { | ||||
| $item->addIcon('fa-star-half-o grey', pht('Beta')); | $item->addIcon('fa-bomb grey', pht('Prototype')); | ||||
| } | } | ||||
| if (!$application->isFirstParty()) { | if (!$application->isFirstParty()) { | ||||
| $item->addIcon('fa-puzzle-piece', pht('Extension')); | $item->addIcon('fa-puzzle-piece', pht('Extension')); | ||||
| } | } | ||||
| $list->addItem($item); | $list->addItem($item); | ||||
| } | } | ||||
| $results[] = $list; | $results[] = $list; | ||||
| } | } | ||||
| return $results; | return $results; | ||||
| } | } | ||||
| } | } | ||||