Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F557322
PHUITabView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PHUITabView.php
View Options
<?php
final
class
PHUITabView
extends
AphrontTagView
{
private
$name
;
private
$key
;
private
$keyLocked
;
private
$contentID
;
public
function
setKey
(
$key
)
{
if
(
$this
->
keyLocked
)
{
throw
new
Exception
(
pht
(
'Attempting to change the key of a tab with a locked key ("%s").'
,
$this
->
key
));
}
$this
->
key
=
$key
;
return
$this
;
}
public
function
hasKey
()
{
return
(
$this
->
key
!==
null
);
}
public
function
getKey
()
{
if
(!
$this
->
hasKey
())
{
throw
new
PhutilInvalidStateException
(
'setKey'
);
}
return
$this
->
key
;
}
public
function
lockKey
()
{
if
(!
$this
->
hasKey
())
{
throw
new
PhutilInvalidStateException
(
'setKey'
);
}
$this
->
keyLocked
=
true
;
return
$this
;
}
public
function
setName
(
$name
)
{
$this
->
name
=
$name
;
return
$this
;
}
public
function
getName
()
{
return
$this
->
name
;
}
public
function
getContentID
()
{
if
(
$this
->
contentID
===
null
)
{
$this
->
contentID
=
celerity_generate_unique_node_id
();
}
return
$this
->
contentID
;
}
public
function
newMenuItem
()
{
return
id
(
new
PHUIListItemView
())
->
setName
(
$this
->
getName
())
->
setKey
(
$this
->
getKey
())
->
setType
(
PHUIListItemView
::
TYPE_LINK
)
->
setHref
(
'#'
)
->
addSigil
(
'phui-tab-view'
)
->
setMetadata
(
array
(
'tabKey'
=>
$this
->
getKey
(),
));
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 8:01 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
126899
Default Alt Text
PHUITabView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment