X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsmilies.php;h=1c0a1bbd769e2415a739aa2aafe9e542a6282639;hb=daa1177e3a1e42b4c95e0a8759f1610942b952c7;hp=5ca3af14a42fae3ae7e29d15b44688354d7a05ee;hpb=0cd241bcbe762e38e2eba0c58800eb60a2240e36;p=friendica.git diff --git a/mod/smilies.php b/mod/smilies.php index 5ca3af14a4..1c0a1bbd76 100644 --- a/mod/smilies.php +++ b/mod/smilies.php @@ -1,20 +1,31 @@ argv[1]==="json"){ - $tmp = Smilies::get_list(); - $results = array(); - for ($i = 0; $i < count($tmp['texts']); $i++) { - $results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]); +/** + * @param object $a App + * @return string + */ +function smilies_content(App $a) +{ + $smilies = Smilies::getList(); + if ($a->argv[1] === "json") { + $results = []; + for ($i = 0; $i < count($smilies['texts']); $i++) { + $results[] = ['text' => $smilies['texts'][$i], 'icon' => $smilies['icons'][$i]]; } - json_return_and_die($results); + System::jsonExit($results); } else { - return Smilies::replace('',true); + $s = '
'; + for ($x = 0; $x < count($smilies['texts']); $x ++) { + $s .= '
' . $smilies['texts'][$x] . '
' . $smilies['icons'][$x] . '
'; + } + $s .= '
'; + + return $s; } }