diff options
author | redmatrix <git@macgirvin.com> | 2016-05-04 17:35:27 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-04 17:35:27 -0700 |
commit | 50fb525b280069e4a95f9ae133b15460e8b02318 (patch) | |
tree | 681af74d8de7b6b73c6965738e366657fdc2e5cd /Zotlabs/Module | |
parent | 7c57da3a28ceda8eb5622ffedd0a20bba742e96a (diff) | |
download | volse-hubzilla-50fb525b280069e4a95f9ae133b15460e8b02318.tar.gz volse-hubzilla-50fb525b280069e4a95f9ae133b15460e8b02318.tar.bz2 volse-hubzilla-50fb525b280069e4a95f9ae133b15460e8b02318.zip |
add categories to apps (wip)
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Appman.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php index b0dd887f4..ba2a64f35 100644 --- a/Zotlabs/Module/Appman.php +++ b/Zotlabs/Module/Appman.php @@ -1,5 +1,6 @@ -<?php -namespace Zotlabs\Module; /** @file */ +<?php /** @file */ + +namespace Zotlabs\Module; require_once('include/apps.php'); @@ -25,7 +26,8 @@ class Appman extends \Zotlabs\Web\Controller { 'price' => escape_tags($_REQUEST['price']), 'requires' => escape_tags($_REQUEST['requires']), 'system' => intval($_REQUEST['system']), - 'sig' => escape_tags($_REQUEST['sig']) + 'sig' => escape_tags($_REQUEST['sig']), + 'categories' => escape_tags($_REQUEST['categories']) ); $_REQUEST['appid'] = app_install(local_channel(),$arr); @@ -81,8 +83,23 @@ class Appman extends \Zotlabs\Web\Controller { dbesc($_REQUEST['appid']), dbesc(local_channel()) ); - if($r) + if($r) { $app = $r[0]; + + $term = q("select * from term where otype = %d and oid = %d", + intval(TERM_OBJ_APP), + intval($r[0]['id']) + ); + if($term) { + $app['categories'] = ''; + foreach($term as $t) { + if($app['categories']) + $app['categories'] .= ','; + $app['categories'] .= $t['term']; + } + } + } + $embed = array('embed', t('Embed code'), app_encode($app,true),'', 'onclick="this.select();"'); } @@ -98,6 +115,7 @@ class Appman extends \Zotlabs\Web\Controller { '$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')), '$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''), '$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')), + '$categories' => array('categories',t('Categories (optional, comma separated list)'),(($app) ? $app['categories'] : ''),''), '$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''), '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), |