aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Apps.php30
-rw-r--r--Zotlabs/Module/Bookmarks.php3
-rw-r--r--view/tpl/app_install.tpl2
3 files changed, 10 insertions, 25 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 1c3daf158..201ea122e 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -537,6 +537,13 @@ class Apps {
$install_action = (($installed) ? t('Update') : t('Install'));
$icon = ((strpos($papp['photo'],'icon:') === 0) ? substr($papp['photo'],5) : '');
+ if (!$installed && $mode === 'module') {
+ return replace_macros(get_markup_template('app_install.tpl'), [
+ '$papp' => $papp,
+ '$install' => $install_action
+ ]);
+ }
+
if($mode === 'navbar') {
return replace_macros(get_markup_template('app_nav.tpl'),array(
'$app' => $papp,
@@ -576,29 +583,6 @@ class Apps {
}
- /**
- * @brief Render a simple app install button with app name and description without checking requirements.
- *
- * @param string $app app name
- * @return string
- */
- static public function app_render_install($app) {
-
- $papp = self::get_papp($app);
-
- if (!$papp) {
- return EMPTY_STR;
- }
-
- $papp_encoded = self::papp_encode($papp);
-
- return replace_macros(get_markup_template('app_install.tpl'), [
- '$papp' => $papp,
- '$papp_encoded' => $papp_encoded,
- '$install' => t('Install')
- ]);
- }
-
static public function app_install($uid,$app) {
if(! is_array($app)) {
diff --git a/Zotlabs/Module/Bookmarks.php b/Zotlabs/Module/Bookmarks.php
index ea34754da..bd52acf98 100644
--- a/Zotlabs/Module/Bookmarks.php
+++ b/Zotlabs/Module/Bookmarks.php
@@ -74,7 +74,8 @@ class Bookmarks extends \Zotlabs\Web\Controller {
if(! Apps::system_app_installed(local_channel(), 'Bookmarks')) {
//Do not display any associated widgets at this point
App::$pdl = '';
- return Apps::app_render_install('Bookmarks');
+ $app = Apps::get_papp('Bookmarks');
+ return Apps::app_render($app, 'module');
}
require_once('include/menu.php');
diff --git a/view/tpl/app_install.tpl b/view/tpl/app_install.tpl
index fa2a02eb5..d5981eba7 100644
--- a/view/tpl/app_install.tpl
+++ b/view/tpl/app_install.tpl
@@ -5,7 +5,7 @@
{{$papp.desc}}
</div>
<form action="appman" method="post">
- <input type="hidden" name="papp" value="{{$papp_encoded}}" />
+ <input type="hidden" name="papp" value="{{$papp.papp}}" />
<button type="submit" name="install" value="install" class="btn btn-success">
<i class="fa fa-fw fa-arrow-circle-o-down"></i> {{$install}}
</button>