diff options
Diffstat (limited to 'Zotlabs/Lib/Apps.php')
-rw-r--r-- | Zotlabs/Lib/Apps.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 2480dde1f..64ac16e5b 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -349,7 +349,8 @@ class Apps { '$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''), '$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''), '$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''), - '$deleted' => $papp['deleted'] + '$deleted' => $papp['deleted'], + '$featured' => ((strpos($papp['categories'], 'featured') === false) ? false : true) )); } @@ -421,7 +422,6 @@ class Apps { } } - static public function app_undestroy($uid,$app) { // undelete a system app @@ -443,8 +443,27 @@ class Apps { } } + static public function app_feature($uid,$app) { + $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", + dbesc($app['guid']), + intval($uid) + ); + $x = q("select * from term where otype = %d and oid = %d limit 1", + intval(TERM_OBJ_APP), + intval($r[0]['id']) + ); + if($x) { + q("delete from term where otype = %d and oid = %d", + intval(TERM_OBJ_APP), + intval($x[0]['oid']) + ); + } + else { + store_item_tag($uid,$r[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,'featured',escape_tags(z_root() . '/apps/?f=&cat=featured')); + } + } static public function app_installed($uid,$app) { |