Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F435766
ReleephProjectActionController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ReleephProjectActionController.php
View Options
<?php
final
class
ReleephProjectActionController
extends
ReleephController
{
private
$action
;
public
function
willProcessRequest
(
array
$data
)
{
parent
::
willProcessRequest
(
$data
);
$this
->
action
=
$data
[
'action'
];
}
public
function
processRequest
()
{
$request
=
$this
->
getRequest
();
$action
=
$this
->
action
;
$rph_project
=
$this
->
getReleephProject
();
switch
(
$action
)
{
case
'deactivate'
:
if
(
$request
->
isDialogFormPost
())
{
$rph_project
->
deactivate
(
$request
->
getUser
())->
save
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/releeph'
);
}
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$request
->
getUser
())
->
setTitle
(
pht
(
'Really deactivate Releeph Project?'
))
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
pht
(
'Really deactivate the Releeph project: %s?'
,
$rph_project
->
getName
())))
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
pht
(
'It will still exist, but '
.
'will be hidden from the list of active projects.'
)))
->
addSubmitButton
(
pht
(
'Deactivate Releeph Project'
))
->
addCancelButton
(
$request
->
getRequestURI
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
case
'activate'
:
$rph_project
->
setIsActive
(
1
)->
save
();
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/releeph'
);
case
'delete'
:
if
(
$request
->
isDialogFormPost
())
{
$rph_project
->
delete
();
return
id
(
new
AphrontRedirectResponse
())
->
setURI
(
'/releeph/project/inactive'
);
}
$dialog
=
id
(
new
AphrontDialogView
())
->
setUser
(
$request
->
getUser
())
->
setTitle
(
pht
(
'Really delete Releeph Project?'
))
->
appendChild
(
phutil_tag
(
'p'
,
array
(),
pht
(
'Really delete the Releeph project: %s? '
.
'This cannot be undone!'
),
$rph_project
->
getName
()))
->
setHeaderColor
(
PhabricatorActionHeaderView
::
HEADER_RED
)
->
addSubmitButton
(
pht
(
'Delete'
))
->
addCancelButton
(
$request
->
getRequestURI
());
return
id
(
new
AphrontDialogResponse
())->
setDialog
(
$dialog
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 9:02 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61569
Default Alt Text
ReleephProjectActionController.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment