aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-06-10 16:34:21 -0700
committerfriendica <info@friendica.com>2014-06-10 16:34:21 -0700
commit059ccae278cdb2db43054ee51cfc94ac5cbfd6ad (patch)
tree81041ce571dd3d66ef3e9a2274333b1dc6dc89ed
parent970c82faa3e58264f60d0d9e7700ac92b1ea02ad (diff)
downloadvolse-hubzilla-059ccae278cdb2db43054ee51cfc94ac5cbfd6ad.tar.gz
volse-hubzilla-059ccae278cdb2db43054ee51cfc94ac5cbfd6ad.tar.bz2
volse-hubzilla-059ccae278cdb2db43054ee51cfc94ac5cbfd6ad.zip
remote install app (untested)
-rw-r--r--include/apps.php15
-rw-r--r--mod/appman.php2
-rw-r--r--version.inc2
-rw-r--r--view/tpl/app.tpl2
4 files changed, 17 insertions, 4 deletions
diff --git a/include/apps.php b/include/apps.php
index f7b09c7b6..40fa42576 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -201,16 +201,29 @@ function app_render($papp,$mode = 'view') {
}
}
+ $hosturl = '';
+
if(local_user()) {
$installed = app_installed(local_user(),$papp);
+ $hosturl = z_root() . '/';
+ }
+ elseif(remote_user()) {
+ $channel = get_app()->get_channel();
+ if($channel) {
+ $x = parse_url($channel['xchan_connurl']);
+ if($x) {
+ $hosturl = $x['scheme'] . '://' . $x['host'] . '/';
+ }
+ }
}
$install_action = (($installed) ? t('Update') : t('Install'));
return replace_macros(get_markup_template('app.tpl'),array(
'$app' => $papp,
+ '$hosturl' => $hosturl,
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
- '$install' => ((local_user() && $mode == 'view') ? $install_action : ''),
+ '$install' => (((local_user() || $hosturl) && $mode == 'view') ? $install_action : ''),
'$edit' => ((local_user() && $installed && $mode == 'edit') ? t('Edit') : ''),
'$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '')
));
diff --git a/mod/appman.php b/mod/appman.php
index 0cc108079..f0a3c8a70 100644
--- a/mod/appman.php
+++ b/mod/appman.php
@@ -66,7 +66,7 @@ function appman_content(&$a) {
notice( t('Permission denied.') . EOL);
return;
}
-logger('content');
+
$channel = $a->get_channel();
$app = null;
$embed = null;
diff --git a/version.inc b/version.inc
index ec59c4b7c..27b4ad174 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-06-09.701
+2014-06-10.702
diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl
index 967ccc67c..09894c3d8 100644
--- a/view/tpl/app.tpl
+++ b/view/tpl/app.tpl
@@ -6,7 +6,7 @@
<a href="{{$app.page}}" class="btn btn-default" title="{{$purchase}}" ><i class="icon-external"></i></a>
{{/if}}
{{if $install || $update || $delete }}
-<form action="appman" method="post">
+<form action="{{$hosturl}}appman" method="post">
<input type="hidden" name="papp" value="{{$app.papp}}" />
{{if $install}}<button type="submit" name="install" value="{{$install}}" class="btn btn-default" title="{{$install}}" ><i class="icon-download-alt" ></i></button>{{/if}}
{{if $edit}}<input type="hidden" name="appid" value="{{$app.guid}}" /><button type="submit" name="edit" value="{{$edit}}" class="btn btn-default" title="{{$edit}}" ><i class="icon-pencil" ></i></button>{{/if}}