aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-20 22:25:36 -0700
committerfriendica <info@friendica.com>2014-05-20 22:25:36 -0700
commit5d9f924642872e30c83ac0de4807e0beb2c15011 (patch)
treecf31232b9312ce7dc9b030bea7f8bc7c93c9c1c2 /mod
parentcad481d94fb8cfb350e931620c788f1a2a47a994 (diff)
downloadvolse-hubzilla-5d9f924642872e30c83ac0de4807e0beb2c15011.tar.gz
volse-hubzilla-5d9f924642872e30c83ac0de4807e0beb2c15011.tar.bz2
volse-hubzilla-5d9f924642872e30c83ac0de4807e0beb2c15011.zip
more app work
Diffstat (limited to 'mod')
-rw-r--r--mod/appman.php60
1 files changed, 42 insertions, 18 deletions
diff --git a/mod/appman.php b/mod/appman.php
index 4fc247a42..6570e2fd9 100644
--- a/mod/appman.php
+++ b/mod/appman.php
@@ -7,6 +7,28 @@ function appman_post(&$a) {
if(! local_user())
return;
+ if($_POST['url']) {
+ $arr = array(
+ 'uid' => intval($_REQUEST['uid']),
+ 'url' => escape_tags($_REQUEST['url']),
+ 'guid' => escape_tags($_REQUEST['guid']),
+ 'author' => escape_tags($_REQUEST['author']),
+ 'addr' => escape_tags($_REQUEST['addr']),
+ 'name' => escape_tags($_REQUEST['name']),
+ 'desc' => escape_tags($_REQUEST['desc']),
+ 'photo' => escape_tags($_REQUEST['photo']),
+ 'version' => escape_tags($_REQUEST['version']),
+ 'price' => escape_tags($_REQUEST['price']),
+ 'sig' => escape_tags($_REQUEST['sig'])
+ );
+
+ $_REQUEST['appid'] = app_install(local_user(),$arr);
+ if(app_installed(local_user(),$app))
+ info( t('App installed.') . EOL);
+ return;
+ }
+
+
$papp = app_decode($_POST['papp']);
if(! is_array($papp)) {
@@ -39,7 +61,7 @@ function appman_content(&$a) {
$channel = $a->get_channel();
$app = null;
-
+ $embed = null;
if($_REQUEST['appid']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($_REQUEST['appid']),
@@ -47,24 +69,26 @@ function appman_content(&$a) {
);
if($r)
$app = $r[0];
+ $embed = array('embed', t('Embed code'), app_encode($app,true),'');
+
}
- return replace_macros(get_markup_template('app_create.tpl'), array(
-
- '$banner' => t('Create App'),
- '$app' => $app,
- '$guid' => (($app) ? $app['app_id'] : ''),
- '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
- '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']),
- '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')),
- '$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_url'] : ''), t('80 x 80 pixels - optional')),
- '$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'] : ''), ''),
- '$submit' => t('Submit')
- ));
-
+ return replace_macros(get_markup_template('app_create.tpl'), array(
+
+ '$banner' => t('Create App'),
+ '$app' => $app,
+ '$guid' => (($app) ? $app['app_id'] : ''),
+ '$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
+ '$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']),
+ '$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')),
+ '$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_url'] : ''), t('80 x 80 pixels - optional')),
+ '$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'] : ''), ''),
+ '$embed' => $embed,
+ '$submit' => t('Submit')
+ ));
} \ No newline at end of file