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.
2.6 kB · 87 lines
PHP
at commit dcd7a316
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788<?php
final class DiffusionRepositoryNewController extends DiffusionController {
public function processRequest() { $request = $this->getRequest(); $viewer = $request->getUser();
$this->requireApplicationCapability( DiffusionCapabilityCreateRepositories::CAPABILITY);
if ($request->isFormPost()) { if ($request->getStr('type')) { switch ($request->getStr('type')) { case 'create': $uri = $this->getApplicationURI('create/'); break; case 'import': default: $uri = $this->getApplicationURI('import/'); break; }
return id(new AphrontRedirectResponse())->setURI($uri); } }
$doc_href = PhabricatorEnv::getDoclink( 'article/Diffusion_User_Guide_Repository_Hosting.html');
$doc_link = phutil_tag( 'a', array( 'href' => $doc_href, 'target' => '_blank', ), pht('Diffusion User Guide: Repository Hosting'));
$form = id(new AphrontFormView()) ->setUser($viewer) ->appendChild( id(new AphrontFormRadioButtonControl()) ->setName('type') ->addButton( 'create', pht('Create a New Hosted Repository'), array( pht( 'Create a new, empty repository which Phabricator will host. '. 'For instructions on configuring repository hosting, see %s. '. 'This feature is new and in beta!', $doc_link), )) ->addButton( 'import', pht('Import an Existing External Repository'), pht( 'Import a repository hosted somewhere else, like GitHub, '. 'Bitbucket, or your organization\'s existing servers. '. 'Phabricator will read changes from the repository but will '. 'not host or manage it. The authoritative master version of '. 'the repository will stay where it is now.'))) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue(pht('Continue')) ->addCancelButton($this->getApplicationURI()));
$crumbs = $this->buildApplicationCrumbs(); $crumbs->addTextCrumb(pht('New Repository'));
$form_box = id(new PHUIObjectBoxView()) ->setHeaderText(pht('Create or Import Repository')) ->setForm($form);
return $this->buildApplicationPage( array( $crumbs, $form_box, ), array( 'title' => pht('New Repository'), 'device' => true, )); }
}