Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92653327
PhabricatorCrumbsView.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, Nov 22, 10:17
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:17 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
22478662
Attached To
rPH Phabricator
PhabricatorCrumbsView.php
View Options
<?php
final
class
PhabricatorCrumbsView
extends
AphrontView
{
private
$crumbs
=
array
();
private
$actions
=
array
();
protected
function
canAppendChild
()
{
return
false
;
}
public
function
addCrumb
(
PhabricatorCrumbView
$crumb
)
{
$this
->
crumbs
[]
=
$crumb
;
return
$this
;
}
public
function
addAction
(
PhabricatorMenuItemView
$action
)
{
$this
->
actions
[]
=
$action
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'phabricator-crumbs-view-css'
);
$action_view
=
null
;
if
(
$this
->
actions
)
{
$actions
=
array
();
foreach
(
$this
->
actions
as
$action
)
{
$icon
=
null
;
if
(
$action
->
getIcon
())
{
$icon
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'sprite-icon action-'
.
$action
->
getIcon
(),
),
''
);
}
$actions
[]
=
javelin_render_tag
(
'a'
,
array
(
'href'
=>
$action
->
getHref
(),
'class'
=>
'phabricator-crumbs-action'
,
'sigil'
=>
$action
->
getWorkflow
()
?
'workflow'
:
null
,
),
$icon
.
phutil_escape_html
(
$action
->
getName
()));
}
$action_view
=
phutil_render_tag
(
'div'
,
array
(
'class'
=>
'phabricator-crumbs-actions'
,
),
self
::
renderSingleView
(
$actions
));
}
if
(
$this
->
crumbs
)
{
last
(
$this
->
crumbs
)->
setIsLastCrumb
(
true
);
}
return
phutil_render_tag
(
'div'
,
array
(
'class'
=>
'phabricator-crumbs-view '
.
'sprite-gradient gradient-breadcrumbs'
,
),
$action_view
.
self
::
renderSingleView
(
$this
->
crumbs
));
}
}
Event Timeline
Log In to Comment