Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96618823
DiffusionRepositorySymbolsManagementPanel.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
Sun, Dec 29, 00:48
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 31, 00:48 (2 d)
Engine
blob
Format
Raw Data
Handle
23200366
Attached To
rPH Phabricator
DiffusionRepositorySymbolsManagementPanel.php
View Options
<?php
final
class
DiffusionRepositorySymbolsManagementPanel
extends
DiffusionRepositoryManagementPanel
{
const
PANELKEY
=
'symbols'
;
public
function
getManagementPanelLabel
()
{
return
pht
(
'Symbols'
);
}
public
function
getManagementPanelOrder
()
{
return
900
;
}
protected
function
buildManagementPanelActions
()
{
$repository
=
$this
->
getRepository
();
$viewer
=
$this
->
getViewer
();
$can_edit
=
PhabricatorPolicyFilter
::
hasCapability
(
$viewer
,
$repository
,
PhabricatorPolicyCapability
::
CAN_EDIT
);
$symbols_uri
=
$repository
->
getPathURI
(
'edit/symbols/'
);
return
array
(
id
(
new
PhabricatorActionView
())
->
setIcon
(
'fa-pencil'
)
->
setName
(
pht
(
'Edit Symbols'
))
->
setHref
(
$symbols_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
());
$languages
=
$repository
->
getSymbolLanguages
();
if
(
$languages
)
{
$languages
=
implode
(
', '
,
$languages
);
}
else
{
$languages
=
phutil_tag
(
'em'
,
array
(),
pht
(
'Any'
));
}
$view
->
addProperty
(
pht
(
'Languages'
),
$languages
);
$sources
=
$repository
->
getSymbolSources
();
if
(
$sources
)
{
$sources
=
$viewer
->
renderHandleList
(
$sources
);
}
else
{
$sources
=
phutil_tag
(
'em'
,
array
(),
pht
(
'This Repository Only'
));
}
$view
->
addProperty
(
pht
(
'Uses Symbols From'
),
$sources
);
return
$this
->
newBox
(
pht
(
'Symbols'
),
$view
);
}
}
Event Timeline
Log In to Comment