remote install app (untested)
This commit is contained in:
parent
970c82faa3
commit
059ccae278
@ -201,16 +201,29 @@ function app_render($papp,$mode = 'view') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hosturl = '';
|
||||||
|
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
$installed = app_installed(local_user(),$papp);
|
$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'));
|
$install_action = (($installed) ? t('Update') : t('Install'));
|
||||||
|
|
||||||
return replace_macros(get_markup_template('app.tpl'),array(
|
return replace_macros(get_markup_template('app.tpl'),array(
|
||||||
'$app' => $papp,
|
'$app' => $papp,
|
||||||
|
'$hosturl' => $hosturl,
|
||||||
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
|
'$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') : ''),
|
'$edit' => ((local_user() && $installed && $mode == 'edit') ? t('Edit') : ''),
|
||||||
'$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '')
|
'$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '')
|
||||||
));
|
));
|
||||||
|
@ -66,7 +66,7 @@ function appman_content(&$a) {
|
|||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger('content');
|
|
||||||
$channel = $a->get_channel();
|
$channel = $a->get_channel();
|
||||||
$app = null;
|
$app = null;
|
||||||
$embed = null;
|
$embed = null;
|
||||||
|
@ -1 +1 @@
|
|||||||
2014-06-09.701
|
2014-06-10.702
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<a href="{{$app.page}}" class="btn btn-default" title="{{$purchase}}" ><i class="icon-external"></i></a>
|
<a href="{{$app.page}}" class="btn btn-default" title="{{$purchase}}" ><i class="icon-external"></i></a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $install || $update || $delete }}
|
{{if $install || $update || $delete }}
|
||||||
<form action="appman" method="post">
|
<form action="{{$hosturl}}appman" method="post">
|
||||||
<input type="hidden" name="papp" value="{{$app.papp}}" />
|
<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 $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}}
|
{{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}}
|
||||||
|
Reference in New Issue
Block a user