Differential D14073 Diff 34742 src/applications/conpherence/controller/ConpherenceUpdateController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/controller/ConpherenceUpdateController.php
| Show First 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | final class ConpherenceUpdateController | ||||
| private function renderRemovePersonDialogue( | private function renderRemovePersonDialogue( | ||||
| ConpherenceThread $conpherence) { | ConpherenceThread $conpherence) { | ||||
| $request = $this->getRequest(); | $request = $this->getRequest(); | ||||
| $user = $request->getUser(); | $user = $request->getUser(); | ||||
| $remove_person = $request->getStr('remove_person'); | $remove_person = $request->getStr('remove_person'); | ||||
| $participants = $conpherence->getParticipants(); | $participants = $conpherence->getParticipants(); | ||||
| $message = pht( | $message = pht('Are you sure you want to leave this room?'); | ||||
| 'Are you sure you want to leave this room?'); | |||||
| $test_conpherence = clone $conpherence; | $test_conpherence = clone $conpherence; | ||||
| $test_conpherence->attachParticipants(array()); | $test_conpherence->attachParticipants(array()); | ||||
| if (!PhabricatorPolicyFilter::hasCapability( | if (!PhabricatorPolicyFilter::hasCapability( | ||||
| $user, | $user, | ||||
| $test_conpherence, | $test_conpherence, | ||||
| PhabricatorPolicyCapability::CAN_VIEW)) { | PhabricatorPolicyCapability::CAN_VIEW)) { | ||||
| if (count($participants) == 1) { | if (count($participants) == 1) { | ||||
| $message .= pht( | $message .= ' '.pht('The room will be inaccessible forever and ever.'); | ||||
| ' The room will be inaccessible forever and ever.'); | |||||
| } else { | } else { | ||||
| $message .= pht( | $message .= ' '.pht('Someone else in the room can add you back later.'); | ||||
| ' Someone else in the room can add you back later.'); | |||||
| } | } | ||||
| } | } | ||||
| $body = phutil_tag( | $body = phutil_tag( | ||||
| 'p', | 'p', | ||||
| array( | array(), | ||||
| ), | |||||
| $message); | $message); | ||||
| require_celerity_resource('conpherence-update-css'); | require_celerity_resource('conpherence-update-css'); | ||||
| return id(new AphrontDialogView()) | return id(new AphrontDialogView()) | ||||
| ->setTitle(pht('Leave Room')) | ->setTitle(pht('Leave Room')) | ||||
| ->addHiddenInput('action', 'remove_person') | ->addHiddenInput('action', 'remove_person') | ||||
| ->addHiddenInput('remove_person', $remove_person) | ->addHiddenInput('remove_person', $remove_person) | ||||
| ->addHiddenInput( | ->addHiddenInput( | ||||
| ▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines | |||||