2011-05-05 21:53:39 +02:00
|
|
|
<?php
|
|
|
|
|
2013-10-29 20:26:07 +01:00
|
|
|
final class DiffusionRepositoryEditDeleteController
|
|
|
|
extends DiffusionRepositoryEditController {
|
2011-05-05 21:53:39 +02:00
|
|
|
|
2016-01-05 17:49:10 +01:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$response = $this->loadDiffusionContextForEdit();
|
|
|
|
if ($response) {
|
|
|
|
return $response;
|
2011-05-05 21:53:39 +02:00
|
|
|
}
|
|
|
|
|
2016-01-05 17:49:10 +01:00
|
|
|
$viewer = $this->getViewer();
|
|
|
|
$drequest = $this->getDiffusionRequest();
|
|
|
|
$repository = $drequest->getRepository();
|
|
|
|
|
2013-10-29 20:26:07 +01:00
|
|
|
$edit_uri = $this->getRepositoryControllerURI($repository, 'edit/');
|
2011-05-05 21:53:39 +02:00
|
|
|
|
|
|
|
$dialog = new AphrontDialogView();
|
2013-10-29 20:26:07 +01:00
|
|
|
$text_1 = pht(
|
|
|
|
'If you really want to delete the repository, run this command from '.
|
|
|
|
'the command line:');
|
|
|
|
$command = csprintf(
|
2014-06-13 16:06:53 +02:00
|
|
|
'phabricator/ $ ./bin/remove destroy %R',
|
|
|
|
$repository->getMonogram());
|
2015-05-22 09:27:56 +02:00
|
|
|
$text_2 = pht(
|
|
|
|
'Repositories touch many objects and as such deletes are '.
|
|
|
|
'prohibitively expensive to run from the web UI.');
|
2013-01-25 14:50:50 +01:00
|
|
|
$body = phutil_tag(
|
2012-10-26 01:23:41 +02:00
|
|
|
'div',
|
|
|
|
array(
|
|
|
|
'class' => 'phabricator-remarkup',
|
|
|
|
),
|
2013-01-25 14:50:50 +01:00
|
|
|
array(
|
|
|
|
phutil_tag('p', array(), $text_1),
|
|
|
|
phutil_tag('p', array(),
|
|
|
|
phutil_tag('tt', array(), $command)),
|
|
|
|
phutil_tag('p', array(), $text_2),
|
|
|
|
));
|
|
|
|
|
2016-01-05 17:49:10 +01:00
|
|
|
return $this->newDialog()
|
2012-10-26 01:23:41 +02:00
|
|
|
->setTitle(pht('Really want to delete the repository?'))
|
|
|
|
->appendChild($body)
|
2013-10-29 20:26:07 +01:00
|
|
|
->addCancelButton($edit_uri, pht('Okay'));
|
2011-05-05 21:53:39 +02:00
|
|
|
}
|
2013-10-29 20:26:07 +01:00
|
|
|
|
2011-05-05 21:53:39 +02:00
|
|
|
}
|