Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106084310
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, Mar 22, 05:50
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Mar 24, 05:50 (2 d)
Engine
blob
Format
Raw Data
Handle
25049582
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
;
}
// c4science customization
public
function
allowAccess
()
{
return
true
;
}
public
function
shouldEnableForRepository
(
PhabricatorRepository
$repository
)
{
return
$repository
->
isSVN
();
}
public
function
getManagementPanelIcon
()
{
return
'fa-folder'
;
}
protected
function
getEditEngineFieldKeys
()
{
return
array
(
'importOnly'
,
);
}
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
);
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$repository
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$subversion_uri
=
$this
->
getEditPageURI
();
$button
=
id
(
new
PHUIButtonView
())
->
setTag
(
'a'
)
->
setIcon
(
'fa-pencil'
)
->
setText
(
pht
(
'Edit'
))
->
setHref
(
$subversion_uri
)
->
setDisabled
(!
$can_edit
)
->
setWorkflow
(!
$can_edit
);
return
$this
->
newBox
(
pht
(
'Subversion'
),
$view
,
array
(
$button
));
}
}
Event Timeline
Log In to Comment