aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2014-12-20 17:33:35 +0100
committerStefan Parviainen <saparvia@caterva.eu>2014-12-20 17:33:35 +0100
commitfe80dbb3a73167b6297b3d645ee566f892c0b0ee (patch)
tree354b8a4a571b9b5ae9c18ce7fa49e8438209b15b /mod
parent6d8214f96bfc8b981fae7c0ffe0cba68206dd86b (diff)
downloadvolse-hubzilla-fe80dbb3a73167b6297b3d645ee566f892c0b0ee.tar.gz
volse-hubzilla-fe80dbb3a73167b6297b3d645ee566f892c0b0ee.tar.bz2
volse-hubzilla-fe80dbb3a73167b6297b3d645ee566f892c0b0ee.zip
Access list of smilies over JSON
Diffstat (limited to 'mod')
-rw-r--r--mod/smilies.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod/smilies.php b/mod/smilies.php
index c47f95da7..b22d0c6d2 100644
--- a/mod/smilies.php
+++ b/mod/smilies.php
@@ -1,3 +1,15 @@
<?php
-function smilies_content(&$a) { return smilies('',true); }
+function smilies_content(&$a) {
+ if ($a->argv[1]==="json"){
+ $tmp = 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);
+ }
+}