Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92730044
DiffusionRepositorySubversionManagementPanel.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
Sat, Nov 23, 05:25
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 05:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22499324
Attached To
rPH Phabricator
DiffusionRepositorySubversionManagementPanel.php
View Options
<?php
final
class
DiffusionRepositorySubversionManagementPanel
extends
DiffusionRepositoryManagementPanel
{
const
PANELKEY
=
'subversion'
;
public
function
getManagementPanelLabel
()
{
return
pht
(
'Subversion'
);
}
public
function
getManagementPanelOrder
()
{
return
1000
;
}
public
function
shouldEnableForRepository
(
PhabricatorRepository
$repository
)
{
return
$repository
->
isSVN
();
}
public
function
getManagementPanelIcon
()
{
$repository
=
$this
->
getRepository
();
$has_any
=
(
bool
)
$repository
->
getDetail
(
'svn-subpath'
);
if
(
$has_any
)
{
return
'fa-database'
;
}
else
{
return
'fa-database grey'
;
}
}
protected
function
getEditEngineFieldKeys
()
{
return
array
(
'importOnly'
,
);
}
public
function
buildManagementPanelCurtain
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$action_list
=
$this
->
getNewActionList
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$repository
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$subversion_uri
=
$this
->
getEditPageURI
();
$action_list
->
addAction
(
id
(
new
PhabricatorActionView
())
->
setIcon
(
'fa-pencil'
)
->
setName
(
pht
(
'Edit Properties'
))
->
setHref
(
$subversion_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
);
$default_branch
=
nonempty
(
$repository
->
getHumanReadableDetail
(
'svn-subpath'
),
phutil_tag
(
'em'
,
array
(),
pht
(
'Import Entire Repository'
)));
$view
->
addProperty
(
pht
(
'Import Only'
),
$default_branch
);
return
$this
->
newBox
(
pht
(
'Subversion'
),
$view
);
}
}
Event Timeline
Log In to Comment