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

Modernize Pholio

Summary: Use modern methods in Pholio

Test Plan: View list, create mock, edit mock, view mobile menu

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

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

+24 -47
+3 -21
src/applications/pholio/controller/PholioController.php
··· 2 2 3 3 abstract class PholioController extends PhabricatorController { 4 4 5 - public function buildSideNavView($for_app = false) { 6 - $user = $this->getRequest()->getUser(); 7 - 8 - $nav = new AphrontSideNavFilterView(); 9 - $nav->setBaseURI(new PhutilURI($this->getApplicationURI())); 10 - 11 - id(new PholioMockSearchEngine()) 12 - ->setViewer($user) 13 - ->addNavigationItems($nav->getMenu()); 14 - 15 - if ($for_app) { 16 - $nav->addFilter('new/', pht('Create Mock')); 17 - } 18 - 19 - $nav->selectFilter(null); 20 - 21 - return $nav; 5 + public function buildApplicationMenu() { 6 + return $this->newApplicationMenu() 7 + ->setSearchEngine(new PholioMockSearchEngine()); 22 8 } 23 9 24 10 protected function buildApplicationCrumbs() { ··· 31 17 ->setIcon('fa-plus-square')); 32 18 33 19 return $crumbs; 34 - } 35 - 36 - public function buildApplicationMenu() { 37 - return $this->buildSideNavView(true)->getMenu(); 38 20 } 39 21 40 22 }
+7 -4
src/applications/pholio/controller/PholioMockEditController.php
··· 384 384 385 385 $this->addExtraQuicksandConfig( 386 386 array('mockEditConfig' => true)); 387 - return $this->buildApplicationPage( 388 - $content, 389 - array( 390 - 'title' => $title, 387 + 388 + return $this->newPage() 389 + ->setTitle($title) 390 + ->setCrumbs($crumbs) 391 + ->appendChild( 392 + array( 393 + $form_box, 391 394 )); 392 395 } 393 396
+3 -8
src/applications/pholio/controller/PholioMockListController.php
··· 7 7 } 8 8 9 9 public function handleRequest(AphrontRequest $request) { 10 - $querykey = $request->getURIData('queryKey'); 11 - 12 - $controller = id(new PhabricatorApplicationSearchController()) 13 - ->setQueryKey($querykey) 14 - ->setSearchEngine(new PholioMockSearchEngine()) 15 - ->setNavigation($this->buildSideNavView()); 16 - 17 - return $this->delegateToController($controller); 10 + return id(new PholioMockSearchEngine()) 11 + ->setController($this) 12 + ->buildResponse(); 18 13 } 19 14 20 15 }
+11 -14
src/applications/pholio/controller/PholioMockViewController.php
··· 98 98 ->setUser($viewer) 99 99 ->setMock($mock); 100 100 101 - $content = array( 102 - $crumbs, 103 - $object_box, 104 - $output, 105 - $thumb_grid, 106 - $timeline, 107 - $add_comment, 108 - ); 109 - 110 - return $this->buildApplicationPage( 111 - $content, 112 - array( 113 - 'title' => 'M'.$mock->getID().' '.$title, 114 - 'pageObjects' => array($mock->getPHID()), 101 + return $this->newPage() 102 + ->setTitle('M'.$mock->getID().' '.$title) 103 + ->setCrumbs($crumbs) 104 + ->setPageObjectPHIDs(array($mock->getPHID())) 105 + ->appendChild( 106 + array( 107 + $object_box, 108 + $output, 109 + $thumb_grid, 110 + $timeline, 111 + $add_comment, 115 112 )); 116 113 } 117 114