mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
rework autocomplete: Access list of smilies over JSON
This commit is contained in:
parent
162f754e2d
commit
5f7c5e6ab6
4 changed files with 215 additions and 156 deletions
|
@ -1,3 +1,21 @@
|
|||
<?php
|
||||
|
||||
function smilies_content(&$a) { return smilies('',true); }
|
||||
/**
|
||||
* @file mod/smilies.php
|
||||
*/
|
||||
|
||||
require_once("include/smilies.php");
|
||||
|
||||
function smilies_content(&$a) {
|
||||
if ($a->argv[1]==="json"){
|
||||
$tmp = smilies::list_smilies();
|
||||
$results = array();
|
||||
for($i = 0; $i < count($tmp['texts']); $i++) {
|
||||
$results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
|
||||
}
|
||||
json_return_and_die($results);
|
||||
}
|
||||
else {
|
||||
return smilies('',true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue