1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-29 02:02:41 +01:00
phorge-phorge/src/applications/phriction/controller/PhrictionNewController.php

39 lines
986 B
PHP
Raw Normal View History

<?php
/**
* @group phriction
*/
final class PhrictionNewController extends PhrictionController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
if ($request->isFormPost()) {
$slug = PhabricatorSlug::normalize($request->getStr('slug'));
$uri = '/phriction/edit/?slug='.$slug;
return id(new AphrontRedirectResponse())
->setURI($uri);
}
$view = id(new AphrontFormLayoutView())
->appendChild(id(new AphrontFormTextControl())
->setLabel('/w/')
->setName('slug'));
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('New Document'))
->appendChild(phutil_tag('p',
array(),
pht('Create a new document at')))
->appendChild($view)
->addSubmitButton(pht('Create'))
->addCancelButton('/w/');
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}