@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
at upstream/main 47 lines 1.2 kB view raw
1<?php 2 3final class PhabricatorHelpDocumentationController 4 extends PhabricatorHelpController { 5 6 public function shouldAllowPublic() { 7 return true; 8 } 9 10 public function handleRequest(AphrontRequest $request) { 11 $viewer = $this->getViewer(); 12 13 $application_class = $request->getURIData('application'); 14 $application = id(new PhabricatorApplicationQuery()) 15 ->setViewer($viewer) 16 ->withClasses(array($application_class)) 17 ->executeOne(); 18 if (!$application) { 19 return new Aphront404Response(); 20 } 21 22 $items = $application->getHelpMenuItems($viewer); 23 $title = pht('%s Help', $application->getName()); 24 25 $list = id(new PHUIObjectItemListView()) 26 ->setUser($viewer); 27 foreach ($items as $item) { 28 if ($item->getType() == PHUIListItemView::TYPE_LABEL) { 29 continue; 30 } 31 $list->addItem( 32 id(new PHUIObjectItemView()) 33 ->setHeader($item->getName()) 34 ->setHref($item->getHref())); 35 } 36 37 $crumbs = $this->buildApplicationCrumbs(); 38 $crumbs->addTextCrumb($title); 39 40 return $this->newPage() 41 ->setTitle($title) 42 ->setCrumbs($crumbs) 43 ->appendChild($list); 44 } 45 46 47}