Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97210128
ManiphestTaskProjectsView.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 3, 11:42
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 5, 11:42 (2 d)
Engine
blob
Format
Raw Data
Handle
23355271
Attached To
rPH Phabricator
ManiphestTaskProjectsView.php
View Options
<?php
/**
* @group maniphest
*/
final
class
ManiphestTaskProjectsView
extends
ManiphestView
{
private
$handles
;
public
function
setHandles
(
array
$handles
)
{
assert_instances_of
(
$handles
,
'PhabricatorObjectHandle'
);
$this
->
handles
=
$handles
;
return
$this
;
}
public
function
render
()
{
require_celerity_resource
(
'phabricator-project-tag-css'
);
$show
=
array_slice
(
$this
->
handles
,
0
,
2
);
$tags
=
array
();
if
(
$show
)
{
foreach
(
$show
as
$handle
)
{
$tags
[]
=
phutil_tag
(
'a'
,
array
(
'href'
=>
$handle
->
getURI
(),
'class'
=>
'phabricator-project-tag'
,
),
phutil_utf8_shorten
(
$handle
->
getName
(),
24
));
}
}
else
{
$tags
[]
=
phutil_tag
(
'span'
,
array
(
'class'
=>
'phabricator-project-tag phabricator-project-tag-grey'
,
),
pht
(
'No Project'
));
}
if
(
count
(
$this
->
handles
)
>
2
)
{
require_celerity_resource
(
'aphront-tooltip-css'
);
Javelin
::
initBehavior
(
'phabricator-tooltips'
);
$all
=
array
();
foreach
(
$this
->
handles
as
$handle
)
{
$all
[]
=
$handle
->
getName
();
}
$tags
[]
=
javelin_tag
(
'span'
,
array
(
'class'
=>
'phabricator-project-tag'
,
'sigil'
=>
'has-tooltip'
,
'meta'
=>
array
(
'tip'
=>
implode
(
', '
,
$all
),
'size'
=>
200
,
),
),
"
\x
E2
\x
80
\x
A6"
);
}
return
$tags
;
}
}
Event Timeline
Log In to Comment