@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.

at recaptime-dev/main 89 lines 2.2 kB view raw
1<?php 2 3final class PhabricatorSearchApplicationStorageEnginePanel 4 extends PhabricatorApplicationConfigurationPanel { 5 6 public function getPanelKey() { 7 return 'search'; 8 } 9 10 public function shouldShowForApplication( 11 PhabricatorApplication $application) { 12 return $application instanceof PhabricatorSearchApplication; 13 } 14 15 public function buildConfigurationPagePanel() { 16 $viewer = $this->getViewer(); 17 $application = $this->getApplication(); 18 19 $services = PhabricatorSearchService::getAllServices(); 20 21 $rows = array(); 22 $rowc = array(); 23 24 foreach ($services as $key => $service) { 25 try { 26 $name = $service->getDisplayName(); 27 } catch (Exception $ex) { 28 $name = phutil_tag('em', array(), pht('Error')); 29 } 30 31 try { 32 $can_read = $service->isReadable() ? pht('Yes') : pht('No'); 33 } catch (Exception $ex) { 34 $can_read = pht('N/A'); 35 } 36 37 try { 38 $can_write = $service->isWritable() ? pht('Yes') : pht('No'); 39 } catch (Exception $ex) { 40 $can_write = pht('N/A'); 41 } 42 43 $rows[] = array( 44 $name, 45 $can_read, 46 $can_write, 47 ); 48 } 49 50 $instructions = pht( 51 'To configure the search engines, edit [[ %s | %s ]] configuration. '. 52 'See **[[ %s | %s ]]** for documentation.', 53 '/config/edit/cluster.search/', 54 'cluster.search', 55 PhabricatorEnv::getDoclink('Cluster: Search'), 56 pht('Cluster: Search')); 57 58 59 $table = id(new AphrontTableView($rows)) 60 ->setNoDataString(pht('No search engines available.')) 61 ->setNotice(new PHUIRemarkupView($viewer, $instructions)) 62 ->setHeaders( 63 array( 64 pht('Engine Name'), 65 pht('Writable'), 66 pht('Readable'), 67 )) 68 ->setRowClasses($rowc) 69 ->setColumnClasses( 70 array( 71 'wide', 72 '', 73 '', 74 )); 75 76 $box = id(new PHUIObjectBoxView()) 77 ->setHeaderText(pht('Search Engines')) 78 ->appendChild($table); 79 80 return $box; 81 } 82 83 public function handlePanelRequest( 84 AphrontRequest $request, 85 PhabricatorController $controller) { 86 return new Aphront404Response(); 87 } 88 89}