friendica_2021-01/mod/smilies.php
Adam Magness f04d40a37e Review update
Rename function, move others
2018-01-27 11:13:41 -05:00

26 lines
492 B
PHP

<?php
/**
* @file mod/smilies.php
*/
use Friendica\App;
use Friendica\Content\Smilies;
use Friendica\Util\Network;
/**
* @param object $a App
* @return mixed
*/
function smilies_content(App $a)
{
if ($a->argv[1] === "json") {
$tmp = Smilies::getList();
$results = [];
for ($i = 0; $i < count($tmp['texts']); $i++) {
$results[] = ['text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]];
}
Network::jsonExit($results);
} else {
return Smilies::replace('', true);
}
}