Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100517570
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
Fri, Jan 31, 10:04
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 2, 10:04 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23932331
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