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

Summary: Update to new modern methods.

Test Plan: View List, New Countdown, Edit Countdown, Delete Countdown

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9690

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

+27 -50
+2 -20
src/applications/countdown/controller/PhabricatorCountdownController.php
··· 2 2 3 3 abstract class PhabricatorCountdownController 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 - if ($for_app) { 12 - $nav->addFilter('create', pht('Create Countdown')); 13 - } 14 - 15 - id(new PhabricatorCountdownSearchEngine()) 16 - ->setViewer($user) 17 - ->addNavigationItems($nav->getMenu()); 18 - 19 - $nav->selectFilter(null); 20 - 21 - return $nav; 22 - } 23 - 24 5 public function buildApplicationMenu() { 25 - return $this->buildSideNavView($for_app = true)->getMenu(); 6 + return $this->newApplicationMenu() 7 + ->setSearchEngine(new PhabricatorCountdownSearchEngine()); 26 8 } 27 9 28 10 protected function buildApplicationCrumbs() {
+7 -8
src/applications/countdown/controller/PhabricatorCountdownEditController.php
··· 184 184 ->setFormErrors($errors) 185 185 ->setForm($form); 186 186 187 - return $this->buildApplicationPage( 188 - array( 189 - $crumbs, 190 - $form_box, 191 - ), 192 - array( 193 - 'title' => $page_title, 194 - )); 187 + return $this->newPage() 188 + ->setTitle($page_title) 189 + ->setCrumbs($crumbs) 190 + ->appendChild( 191 + array( 192 + $form_box, 193 + )); 195 194 } 196 195 197 196 }
+3 -9
src/applications/countdown/controller/PhabricatorCountdownListController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 - $querykey = $request->getURIData('queryKey'); 12 - 13 - $controller = id(new PhabricatorApplicationSearchController()) 14 - ->setQueryKey($querykey) 15 - ->setSearchEngine(new PhabricatorCountdownSearchEngine()) 16 - ->setNavigation($this->buildSideNavView()); 17 - 18 - return $this->delegateToController($controller); 11 + return id(new PhabricatorCountdownSearchEngine()) 12 + ->setController($this) 13 + ->buildResponse(); 19 14 } 20 - 21 15 22 16 }
+15 -13
src/applications/countdown/controller/PhabricatorCountdownViewController.php
··· 61 61 62 62 $add_comment = $this->buildCommentForm($countdown); 63 63 64 - $content = array( 65 - $crumbs, 66 - $object_box, 67 - $countdown_view, 68 - $timeline, 69 - $add_comment, 70 - ); 71 64 72 - return $this->buildApplicationPage( 73 - $content, 74 - array( 75 - 'title' => $title, 76 - 'pageObjects' => array($countdown->getPHID()), 77 - )); 65 + 66 + return $this->newPage() 67 + ->setTitle($title) 68 + ->setCrumbs($crumbs) 69 + ->setPageObjectPHIDs( 70 + array( 71 + $countdown->getPHID(), 72 + )) 73 + ->appendChild( 74 + array( 75 + $object_box, 76 + $countdown_view, 77 + $timeline, 78 + $add_comment, 79 + )); 78 80 } 79 81 80 82 private function buildActionListView(PhabricatorCountdown $countdown) {