Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F114976859
PHUISpacesNamespaceContextView.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
Thu, May 29, 03:46
Size
1 KB
Mime Type
text/x-php
Expires
Sat, May 31, 03:46 (2 d)
Engine
blob
Format
Raw Data
Handle
26414186
Attached To
rPH Phabricator
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
),
' | '
,
));
}
}
Event Timeline
Log In to Comment