Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97594725
PhabricatorActionIconView.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, Jan 5, 13:52
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jan 7, 13:52 (2 d)
Engine
blob
Format
Raw Data
Handle
23432765
Attached To
rPH Phabricator
PhabricatorActionIconView.php
View Options
<?php
final
class
PhabricatorActionIconView
extends
AphrontView
{
const
SPRITE_MINICONS
=
'minicons'
;
const
SPRITE_ACTIONS
=
'actions'
;
private
$href
;
private
$workflow
;
private
$image
;
private
$spriteIcon
;
private
$spriteSheet
;
public
function
setHref
(
$href
)
{
$this
->
href
=
$href
;
return
$this
;
}
public
function
setWorkflow
(
$workflow
)
{
$this
->
workflow
=
$workflow
;
return
$this
;
}
public
function
setImage
(
$image
)
{
$this
->
image
=
$image
;
return
$this
;
}
public
function
setSpriteIcon
(
$sprite
)
{
$this
->
spriteIcon
=
$sprite
;
return
$this
;
}
public
function
setSpriteSheet
(
$sheet
)
{
$this
->
spriteSheet
=
$sheet
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'phabricator-action-icon-view-css'
);
if
(
$this
->
spriteIcon
)
{
require_celerity_resource
(
'sprite-actions-css'
);
require_celerity_resource
(
'sprite-minicons-css'
);
$classes
=
array
();
$classes
[]
=
'phabricator-action-icon-item-link'
;
$classes
[]
=
'sprite-'
.
$this
->
spriteSheet
;
$classes
[]
=
$this
->
spriteSheet
.
'-'
.
$this
->
spriteIcon
;
$action_icon
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$this
->
href
,
'class'
=>
implode
(
' '
,
$classes
),
'sigil'
=>
$this
->
workflow
?
'workflow'
:
null
,
),
''
);
}
else
{
$action_icon
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$this
->
href
,
'class'
=>
'phabricator-action-icon-item-link'
,
'sigil'
=>
$this
->
workflow
?
'workflow'
:
null
,
'style'
=>
'background-image: url('
.
$this
->
image
.
');'
),
''
);
}
return
$action_icon
;
}
}
Event Timeline
Log In to Comment