]> git.mxchange.org Git - friendica.git/blobdiff - mod/pretheme.php
Merge pull request #2172 from tobiasd/20151212-frosticons
[friendica.git] / mod / pretheme.php
index 5a71bbe53e45168b8c99498254fe05f6e631da50..4584cb29e2564cd31963438d08b295d09c140ecb 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 
 function pretheme_init(&$a) {
-       if($_REQUEST['theme']) echo json_encode(array('img' => get_theme_screenshot($_REQUEST['theme'])));
+       
+       if($_REQUEST['theme']) {
+               $theme = $_REQUEST['theme'];
+               $info = get_theme_info($theme);
+               if($info) {
+                       // unfortunately there will be no translation for this string
+                       $desc = $info['description'];
+                       $version = $info['version'];
+                       $credits = $info['credits'];
+               }
+               else {
+                       $desc = '';
+                       $version = '';
+                       $credits = '';
+               }
+               echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
+       }
        killme();
 }