@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 51 lines 1.0 kB view raw
1<?php 2 3final class MacroEmojiExample extends PhabricatorUIExample { 4 5 public function getName() { 6 return pht('Emoji'); 7 } 8 9 public function getDescription() { 10 return pht('Shiny happy people holding hands.'); 11 } 12 13 public function getCategory() { 14 return pht('Catalogs'); 15 } 16 17 public function renderExample() { 18 19 $raw = id(new PhabricatorEmojiRemarkupRule()) 20 ->markupEmojiJSON(); 21 22 $json = phutil_json_decode($raw); 23 24 $content = array(); 25 foreach ($json as $shortname => $hex) { 26 27 $display_name = ' '.$hex.' '.$shortname; 28 29 $content[] = phutil_tag( 30 'div', 31 array( 32 'class' => 'ms grouped', 33 'style' => 'width: 240px; height: 24px; float: left;', 34 ), 35 $display_name); 36 37 } 38 39 $wrap = id(new PHUIObjectBoxView()) 40 ->setHeaderText(pht('Emojis')) 41 ->addClass('grouped') 42 ->appendChild($content); 43 44 return phutil_tag( 45 'div', 46 array(), 47 array( 48 $wrap, 49 )); 50 } 51}