Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101284357
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
Fri, Feb 7, 11:40
Size
1010 B
Mime Type
text/x-php
Expires
Sun, Feb 9, 11:40 (2 d)
Engine
blob
Format
Raw Data
Handle
24114717
Attached To
rPH Phabricator
MacroEmojiExample.php
View Options
<?php
final
class
MacroEmojiExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
pht
(
'Emoji'
);
}
public
function
getDescription
()
{
return
pht
(
'Shiny happy people holding hands.'
);
}
public
function
getCategory
()
{
return
pht
(
'Catalogs'
);
}
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