mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Update Settings for handleRequest
Summary: Run through the Settings controllers Test Plan: Test various settings pages, save some settings. Reviewers: epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13775
This commit is contained in:
parent
1b744d9cb6
commit
ba2cc4f2ee
2 changed files with 9 additions and 16 deletions
|
@ -3,8 +3,7 @@
|
||||||
final class PhabricatorSettingsAdjustController
|
final class PhabricatorSettingsAdjustController
|
||||||
extends PhabricatorController {
|
extends PhabricatorController {
|
||||||
|
|
||||||
public function processRequest() {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
||||||
$prefs = $user->loadPreferences();
|
$prefs = $user->loadPreferences();
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
final class PhabricatorSettingsMainController
|
final class PhabricatorSettingsMainController
|
||||||
extends PhabricatorController {
|
extends PhabricatorController {
|
||||||
|
|
||||||
private $id;
|
|
||||||
private $key;
|
|
||||||
private $user;
|
private $user;
|
||||||
|
|
||||||
private function getUser() {
|
private function getUser() {
|
||||||
|
@ -12,24 +10,20 @@ final class PhabricatorSettingsMainController
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isSelf() {
|
private function isSelf() {
|
||||||
$viewer_phid = $this->getRequest()->getUser()->getPHID();
|
$viewer_phid = $this->getViewer()->getPHID();
|
||||||
$user_phid = $this->getUser()->getPHID();
|
$user_phid = $this->getUser()->getPHID();
|
||||||
return ($viewer_phid == $user_phid);
|
return ($viewer_phid == $user_phid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function willProcessRequest(array $data) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
$this->id = idx($data, 'id');
|
$viewer = $this->getViewer();
|
||||||
$this->key = idx($data, 'key');
|
$id = $request->getURIData('id');
|
||||||
}
|
$key = $request->getURIData('key');
|
||||||
|
|
||||||
public function processRequest() {
|
if ($id) {
|
||||||
$request = $this->getRequest();
|
|
||||||
$viewer = $request->getUser();
|
|
||||||
|
|
||||||
if ($this->id) {
|
|
||||||
$user = id(new PhabricatorPeopleQuery())
|
$user = id(new PhabricatorPeopleQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($this->id))
|
->withIDs(array($id))
|
||||||
->requireCapabilities(
|
->requireCapabilities(
|
||||||
array(
|
array(
|
||||||
PhabricatorPolicyCapability::CAN_VIEW,
|
PhabricatorPolicyCapability::CAN_VIEW,
|
||||||
|
@ -49,7 +43,7 @@ final class PhabricatorSettingsMainController
|
||||||
$panels = $this->buildPanels();
|
$panels = $this->buildPanels();
|
||||||
$nav = $this->renderSideNav($panels);
|
$nav = $this->renderSideNav($panels);
|
||||||
|
|
||||||
$key = $nav->selectFilter($this->key, head($panels)->getPanelKey());
|
$key = $nav->selectFilter($key, head($panels)->getPanelKey());
|
||||||
|
|
||||||
$panel = $panels[$key];
|
$panel = $panels[$key];
|
||||||
$panel->setUser($this->getUser());
|
$panel->setUser($this->getUser());
|
||||||
|
|
Loading…
Reference in a new issue