Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F68722675
DiffusionRepositoryStagingManagementPanel.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
Fri, Jun 28, 16:08
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jun 30, 16:08 (2 d)
Engine
blob
Format
Raw Data
Handle
18563185
Attached To
rPH Phabricator
DiffusionRepositoryStagingManagementPanel.php
View Options
<?php
final
class
DiffusionRepositoryStagingManagementPanel
extends
DiffusionRepositoryManagementPanel
{
const
PANELKEY
=
'staging'
;
public
function
getManagementPanelLabel
()
{
return
pht
(
'Staging Area'
);
}
public
function
getManagementPanelOrder
()
{
return
700
;
}
public
function
getManagementPanelIcon
()
{
$repository
=
$this
->
getRepository
();
$staging_uri
=
$repository
->
getStagingURI
();
if
(
$staging_uri
)
{
return
'fa-upload'
;
}
else
{
return
'fa-upload grey'
;
}
}
protected
function
getEditEngineFieldKeys
()
{
return
array
(
'stagingAreaURI'
,
);
}
protected
function
buildManagementPanelActions
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$repository
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$staging_uri
=
$this
->
getEditPageURI
();
return
array
(
id
(
new
PhabricatorActionView
())
->
setIcon
(
'fa-pencil'
)
->
setName
(
pht
(
'Edit Staging'
))
->
setHref
(
$staging_uri
)
->
setDisabled
(!
$can_edit
)
->
setWorkflow
(!
$can_edit
),
);
}
public
function
buildManagementPanelContent
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$view
=
id
(
new
PHUIPropertyListView
())
->
setViewer
(
$viewer
)
->
setActionList
(
$this
->
newActions
());
$staging_uri
=
$repository
->
getStagingURI
();
if
(!
$staging_uri
)
{
$staging_uri
=
phutil_tag
(
'em'
,
array
(),
pht
(
'No Staging Area'
));
}
$view
->
addProperty
(
pht
(
'Staging Area URI'
),
$staging_uri
);
return
$this
->
newBox
(
pht
(
'Staging Area'
),
$view
);
}
}
Event Timeline
Log In to Comment