Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2992201
PHUISpacesNamespaceContextView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PHUISpacesNamespaceContextView.php
View Options
<?php
final
class
PHUISpacesNamespaceContextView
extends
AphrontView
{
private
$object
;
public
function
setObject
(
$object
)
{
$this
->
object
=
$object
;
return
$this
;
}
public
function
getObject
(
)
{
return
$this
->
object
;
}
public
function
render
(
)
{
$object
=
$this
->
getObject
(
)
;
$space_phid
=
PhabricatorSpacesNamespaceQuery
::
getObjectSpacePHID
(
$object
)
;
if
(
!
$space_phid
)
{
return
null
;
}
// If the viewer can't see spaces, pretend they don't exist.
$viewer
=
$this
->
getUser
(
)
;
if
(
!
PhabricatorSpacesNamespaceQuery
::
getViewerSpacesExist
(
$viewer
)
)
{
return
null
;
}
// If this is the default space, don't show a space label.
$default
=
PhabricatorSpacesNamespaceQuery
::
getDefaultSpace
(
)
;
if
(
$default
)
{
if
(
$default
->
getPHID
(
)
==
$space_phid
)
{
return
null
;
}
}
return
phutil_tag
(
'span'
,
array
(
'class'
=>
'spaces-name'
,
)
,
array
(
$viewer
->
renderHandle
(
$space_phid
)
->
setUseShortName
(
true
)
,
' | '
,
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Feb 23, 07:03 (1 d, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1181199
Default Alt Text
PHUISpacesNamespaceContextView.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment