1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00
phorge-phorge/src/applications/phriction/controller/PhrictionNewController.php
vrana 21a5956a35 Convert phutil_render_tag(X, Y, pht('...')) to phutil_tag
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
2013-01-24 19:20:30 -08:00

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);
}
}