Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F447900
PhabricatorMenuItemView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorMenuItemView.php
View Options
<?php
final
class
PhabricatorMenuItemView
extends
AphrontTagView
{
const
TYPE_LINK
=
'type-link'
;
const
TYPE_SPACER
=
'type-spacer'
;
const
TYPE_LABEL
=
'type-label'
;
const
TYPE_BUTTON
=
'type-button'
;
const
TYPE_CUSTOM
=
'type-custom'
;
private
$name
;
private
$href
;
private
$type
=
self
::
TYPE_LINK
;
private
$isExternal
;
private
$key
;
private
$icon
;
private
$selected
;
public
function
setProperty
(
$property
)
{
$this
->
property
=
$property
;
return
$this
;
}
public
function
getProperty
()
{
return
$this
->
property
;
}
public
function
setSelected
(
$selected
)
{
$this
->
selected
=
$selected
;
return
$this
;
}
public
function
getSelected
()
{
return
$this
->
selected
;
}
public
function
setIcon
(
$icon
)
{
$this
->
icon
=
$icon
;
return
$this
;
}
public
function
getIcon
()
{
return
$this
->
icon
;
}
public
function
setKey
(
$key
)
{
$this
->
key
=
(
string
)
$key
;
return
$this
;
}
public
function
getKey
()
{
return
$this
->
key
;
}
public
function
setType
(
$type
)
{
$this
->
type
=
$type
;
return
$this
;
}
public
function
getType
()
{
return
$this
->
type
;
}
public
function
setHref
(
$href
)
{
$this
->
href
=
$href
;
return
$this
;
}
public
function
getHref
()
{
return
$this
->
href
;
}
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
public
function
getName
()
{
return
$this
->
name
;
}
public
function
setIsExternal
(
$is_external
)
{
$this
->
isExternal
=
$is_external
;
return
$this
;
}
public
function
getIsExternal
()
{
return
$this
->
isExternal
;
}
protected
function
getTagName
()
{
return
$this
->
href
?
'a'
:
'div'
;
}
protected
function
getTagAttributes
()
{
return
array
(
'class'
=>
array
(
'phabricator-menu-item-view'
,
'phabricator-menu-item-'
.
$this
->
type
,
),
'href'
=>
$this
->
href
,
);
}
protected
function
getTagContent
()
{
$name
=
null
;
if
(
$this
->
name
)
{
$external
=
null
;
if
(
$this
->
isExternal
)
{
$external
=
"
\x
E2
\x
86
\x
97"
;
}
$name
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'phabricator-menu-item-name'
,
),
$this
->
name
.
$external
);
}
return
$this
->
renderHTMLView
(
array
(
$this
->
renderHTMLChildren
(),
$name
,
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 5:35 PM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
66518
Default Alt Text
PhabricatorMenuItemView.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment