mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +01:00
21a5956a35
Summary: Created with spatch: lang=diff - phutil_render_tag + phutil_tag (X, Y, pht('...')) The searched for `<` and `&` by sgrep. Test Plan: Loaded homepage. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4504
38 lines
986 B
PHP
38 lines
986 B
PHP
<?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);
|
|
}
|
|
|
|
}
|