3 final class DiffusionRepositoryEditPublishingController
4 extends DiffusionRepositoryManageController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $response = $this->loadDiffusionContextForEdit();
12 $viewer = $this->getViewer();
13 $drequest = $this->getDiffusionRequest();
14 $repository = $drequest->getRepository();
16 $panel_uri = id(new DiffusionRepositoryBasicsManagementPanel())
17 ->setRepository($repository)
20 if ($request->isFormPost()) {
21 if ($repository->isPublishingDisabled()) {
27 $xaction = id(new PhabricatorRepositoryTransaction())
29 PhabricatorRepositoryNotifyTransaction
::TRANSACTIONTYPE
)
30 ->setNewValue($new_status);
32 $editor = id(new PhabricatorRepositoryEditor())
33 ->setContinueOnNoEffect(true)
34 ->setContinueOnMissingFields(true)
35 ->setContentSourceFromRequest($request)
37 ->applyTransactions($repository, array($xaction));
39 return id(new AphrontReloadResponse())->setURI($panel_uri);
43 if (!$repository->isPublishingDisabled()) {
44 $title = pht('Disable Publishing');
46 'If you disable publishing for this repository, new commits '.
47 'will not: send email, publish feed stories, trigger audits, or '.
51 'This option is most commonly used to temporarily allow a major '.
52 'repository maintenance operation (like a history rewrite) to '.
53 'occur with minimal disruption to users.');
55 $submit = pht('Disable Publishing');
57 $title = pht('Reactivate Publishing');
59 'If you reactivate publishing for this repository, new commits '.
60 'that become reachable from permanent refs will: send email, '.
61 'publish feed stories, trigger audits, and trigger Herald.');
64 'Commits which became reachable from a permanent ref while '.
65 'publishing was disabled will not trigger these actions '.
68 $submit = pht('Reactivate Publishing');
71 $dialog = $this->newDialog()
73 ->addSubmitButton($submit)
74 ->addCancelButton($panel_uri);
76 foreach ($body as $graph) {
77 $dialog->appendParagraph($graph);