From c0592b55d7e6d6b0fa9be7ecf5befd2bd6a48851 Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 16 Jan 2012 14:41:07 -0800 Subject: [PATCH] Use generic URIs Summary: /diffusion/X/history/?copies=0 is same as /diffusion/X/history/ /countdown/1/?chrome=1 is same as /countdown/1/ Test Plan: Visit /diffusion/X/history/, click on Show/Hide Copies/Branches twice. Visit /countdown/1/, click on Disable/Enable Chrome twice. Reviewers: epriestley, tuomaspelkonen Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D1424 --- .../view/PhabricatorCountdownViewController.php | 5 +++-- .../controller/history/DiffusionHistoryController.php | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/applications/countdown/controller/view/PhabricatorCountdownViewController.php b/src/applications/countdown/controller/view/PhabricatorCountdownViewController.php index c3119b39f6..30ce623cc2 100644 --- a/src/applications/countdown/controller/view/PhabricatorCountdownViewController.php +++ b/src/applications/countdown/controller/view/PhabricatorCountdownViewController.php @@ -1,7 +1,7 @@ getBool('chrome', true); + $chrome_new = $chrome_visible ? false : null; $chrome_link = phutil_render_tag( 'a', array( - 'href' => $request->getRequestURI()->alter('chrome', !$chrome_visible), + 'href' => $request->getRequestURI()->alter('chrome', $chrome_new), 'class' => 'phabricator-timer-chrome-link', ), $chrome_visible ? 'Disable Chrome' : 'Enable Chrome'); diff --git a/src/applications/diffusion/controller/history/DiffusionHistoryController.php b/src/applications/diffusion/controller/history/DiffusionHistoryController.php index a838dcec0c..499955d03d 100644 --- a/src/applications/diffusion/controller/history/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/history/DiffusionHistoryController.php @@ -1,7 +1,7 @@ getBool('copies')) { $button_title = 'Hide Copies/Branches'; + $copies_new = null; } else { $button_title = 'Show Copies/Branches'; + $copies_new = true; } - $button_uri = $request->getRequestURI()->alter( - 'copies', - !$request->getBool('copies')); - $button = phutil_render_tag( 'a', array( 'class' => 'button small grey', - 'href' => $button_uri, + 'href' => $request->getRequestURI()->alter('copies', $copies_new), ), phutil_escape_html($button_title));