Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92972720
DiffusionRepositoryActionsManagementPanel.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Nov 25, 06:46
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 06:46 (2 d)
Engine
blob
Format
Raw Data
Handle
22548089
Attached To
rPH Phabricator
DiffusionRepositoryActionsManagementPanel.php
View Options
<?php
final
class
DiffusionRepositoryActionsManagementPanel
extends
DiffusionRepositoryManagementPanel
{
const
PANELKEY
=
'actions'
;
public
function
getManagementPanelLabel
()
{
return
pht
(
'Actions'
);
}
public
function
getManagementPanelOrder
()
{
return
1100
;
}
public
function
getManagementPanelIcon
()
{
$repository
=
$this
->
getRepository
();
$has_any
=
$repository
->
getDetail
(
'herald-disabled'
)
||
$repository
->
getDetail
(
'disable-autoclose'
);
// NOTE: Any value here really means something is disabled, so try to
// hint that a little bit with the icon.
if
(
$has_any
)
{
return
'fa-comment-o'
;
}
else
{
return
'fa-commenting grey'
;
}
}
protected
function
getEditEngineFieldKeys
()
{
return
array
(
'publish'
,
'autoclose'
,
);
}
public
function
buildManagementPanelCurtain
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$action_list
=
$this
->
getNewActionList
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$repository
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$actions_uri
=
$this
->
getEditPageURI
();
$action_list
->
addAction
(
id
(
new
PhabricatorActionView
())
->
setIcon
(
'fa-pencil'
)
->
setName
(
pht
(
'Edit Actions'
))
->
setHref
(
$actions_uri
)
->
setDisabled
(!
$can_edit
)
->
setWorkflow
(!
$can_edit
));
return
$this
->
getNewCurtainView
(
$action_list
);
}
public
function
buildManagementPanelContent
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$view
=
id
(
new
PHUIPropertyListView
())
->
setViewer
(
$viewer
);
$notify
=
$repository
->
getDetail
(
'herald-disabled'
)
?
pht
(
'Off'
)
:
pht
(
'On'
);
$notify
=
phutil_tag
(
'em'
,
array
(),
$notify
);
$view
->
addProperty
(
pht
(
'Publish/Notify'
),
$notify
);
$autoclose
=
$repository
->
getDetail
(
'disable-autoclose'
)
?
pht
(
'Off'
)
:
pht
(
'On'
);
$autoclose
=
phutil_tag
(
'em'
,
array
(),
$autoclose
);
$view
->
addProperty
(
pht
(
'Autoclose'
),
$autoclose
);
return
$this
->
newBox
(
pht
(
'Actions'
),
$view
);
}
}
Event Timeline
Log In to Comment