Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104812684
MacroEmojiExample.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
Wed, Mar 12, 14:46
Size
950 B
Mime Type
text/x-php
Expires
Fri, Mar 14, 14:46 (2 d)
Engine
blob
Format
Raw Data
Handle
24859350
Attached To
rPH Phabricator
MacroEmojiExample.php
View Options
<?php
final
class
MacroEmojiExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
pht
(
'Emoji Support'
);
}
public
function
getDescription
()
{
return
pht
(
'Shiny happy people holding hands'
);
}
public
function
renderExample
()
{
$raw
=
id
(
new
PhabricatorEmojiRemarkupRule
())
->
markupEmojiJSON
();
$json
=
phutil_json_decode
(
$raw
);
$content
=
array
();
foreach
(
$json
as
$shortname
=>
$hex
)
{
$display_name
=
' '
.
$hex
.
' '
.
$shortname
;
$content
[]
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'ms grouped'
,
'style'
=>
'width: 240px; height: 24px; float: left;'
,
),
$display_name
);
}
$wrap
=
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Emojis'
))
->
addClass
(
'grouped'
)
->
appendChild
(
$content
);
return
phutil_tag
(
'div'
,
array
(),
array
(
$wrap
,
));
}
}
Event Timeline
Log In to Comment