Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F100297
board_edit_sketch.php
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
epriestley
Jan 9 2014, 5:10 PM
2014-01-09 17:10:39 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
board_edit_sketch.php
View Options
<?php
final
class
ProjectBoardEditController
extends
ProjectController
{
private
$id
;
public
function
willProcessRequest
(
array
$data
)
{
$this
->
projectID
=
=
$data
[
'projectID'
];
$this
->
id
=
idx
(
$data
[
'id'
]);
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$viewer
=
$request
->
getUser
();
// First, load the project and make sure the user can edit it.
// Use `PhabricatorProjectQuery` with `requireCapabilities()`.
$project
=
id
(
new
PhabricatorProjectQuery
())->...->
executeOne
();
if
(!
$project
)
{
// 404
}
// Now, either load an existing column (for an edit) or create a new one.
if
(
$this
->
id
)
{
$column
=
// load
// You can ignore this for now, we only care about create.
}
else
{
$column
=
PhabricatorProjectBoardColumn
::
initializeNewColumn
(
$viewer
);
}
if
(
$request
->
isFormPost
())
{
// set values from the request on the $column, then call save()
// then redirect back to the board
}
// If we reach this, there were form errors or the request isn't a form
// submit. Render the create/edit form.
$form
=
new
AphrontFormView
();
// add fields
return
$this
->
buildApplicationPage
(
// ...
);
}
}
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/7f/fm/ubfiyjxbpxlalwgu
Default Alt Text
board_edit_sketch.php (1 KB)
Attached To
Mode
P1043 board_edit_sketch.php
Attached
Detach File
Event Timeline
Log In to Comment