Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F439168
PhabricatorDashboardPanelArchiveController.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorDashboardPanelArchiveController.php
View Options
<?php
final
class
PhabricatorDashboardPanelArchiveController
extends
PhabricatorDashboardController
{
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$id
=
$request
->
getURIData
(
'id'
);
$panel
=
id
(
new
PhabricatorDashboardPanelQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
requireCapabilities
(
array
(
PhabricatorPolicyCapability
::
CAN_VIEW
,
PhabricatorPolicyCapability
::
CAN_EDIT
,
))
->
executeOne
();
if
(!
$panel
)
{
return
new
Aphront404Response
();
}
$next_uri
=
'/'
.
$panel
->
getMonogram
();
if
(
$request
->
isFormPost
())
{
$xactions
=
array
();
$xactions
[]
=
id
(
new
PhabricatorDashboardPanelTransaction
())
->
setTransactionType
(
PhabricatorDashboardPanelStatusTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
((
int
)!
$panel
->
getIsArchived
());
id
(
new
PhabricatorDashboardPanelTransactionEditor
())
->
setActor
(
$viewer
)
->
setContentSourceFromRequest
(
$request
)
->
applyTransactions
(
$panel
,
$xactions
);
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
$next_uri
);
}
if
(
$panel
->
getIsArchived
())
{
$title
=
pht
(
'Activate Panel?'
);
$body
=
pht
(
'This panel will be reactivated and appear in other interfaces as '
.
'an active panel.'
);
$submit_text
=
pht
(
'Activate Panel'
);
}
else
{
$title
=
pht
(
'Archive Panel?'
);
$body
=
pht
(
'This panel will be archived and no longer appear in lists of active '
.
'panels.'
);
$submit_text
=
pht
(
'Archive Panel'
);
}
return
$this
->
newDialog
()
->
setTitle
(
$title
)
->
appendParagraph
(
$body
)
->
addSubmitButton
(
$submit_text
)
->
addCancelButton
(
$next_uri
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 3:38 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63648
Default Alt Text
PhabricatorDashboardPanelArchiveController.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment