Something went wrong. Try again.
@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
Something went wrong. Try again.
1.8 kB · 58 lines
PHP
at commit dcd7a316
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859<?php
final class DiffusionRepositoryEditDeleteController extends DiffusionRepositoryEditController {
public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser(); $drequest = $this->diffusionRequest; $repository = $drequest->getRepository();
$repository = id(new PhabricatorRepositoryQuery()) ->setViewer($viewer) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, PhabricatorPolicyCapability::CAN_EDIT, )) ->withIDs(array($repository->getID())) ->executeOne(); if (!$repository) { return new Aphront404Response(); }
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
$dialog = new AphrontDialogView(); $text_1 = pht( 'If you really want to delete the repository, run this command from '. 'the command line:'); $command = csprintf( 'phabricator/ $ ./bin/repository delete %s', $repository->getCallsign()); $text_2 = pht('Repositories touch many objects and as such deletes are '. 'prohibitively expensive to run from the web UI.'); $body = phutil_tag( 'div', array( 'class' => 'phabricator-remarkup', ), array( phutil_tag('p', array(), $text_1), phutil_tag('p', array(), phutil_tag('tt', array(), $command)), phutil_tag('p', array(), $text_2), ));
$dialog = id(new AphrontDialogView()) ->setUser($request->getUser()) ->setTitle(pht('Really want to delete the repository?')) ->appendChild($body) ->addCancelButton($edit_uri, pht('Okay'));
return id(new AphrontDialogResponse())->setDialog($dialog); }
}