From 189da4fdc1408a25b4fd68c0b7d5834232a599a2 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 23 Aug 2021 10:32:48 +0000 Subject: untangle the app template into separate templates and fix bbcode view --- Zotlabs/Lib/Apps.php | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index a9af0812d..ba854197f 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -547,12 +547,38 @@ class Apps { } if($mode === 'navbar') { + return replace_macros(get_markup_template('app_nav_pinned.tpl'),array( + '$app' => $papp, + '$icon' => $icon, + )); + } + + if($mode === 'nav') { return replace_macros(get_markup_template('app_nav.tpl'),array( '$app' => $papp, '$icon' => $icon, )); } + if($mode === 'inline') { + return replace_macros(get_markup_template('app_inline.tpl'),array( + '$app' => $papp, + '$icon' => $icon, + '$installed' => $installed, + '$purchase' => ((isset($papp['page']) && (! $installed)) ? t('Purchase') : ''), + '$action_label' => $install_action + )); + } + + if(in_array($mode, ['nav-order', 'nav-order-pinned'])) { + return replace_macros(get_markup_template('app_order.tpl'),array( + '$app' => $papp, + '$icon' => $icon, + '$hosturl' => $hosturl, + '$mode' => $mode + )); + } + if($mode === 'install') { $papp['embed'] = true; } @@ -573,8 +599,6 @@ class Apps { '$pin' => ((isset($papp['embed']) || $mode == 'edit') ? false : true), '$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true), '$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true), - '$navapps' => (($mode == 'nav') ? true : false), - '$order' => (($mode === 'nav-order' || $mode === 'nav-order-pinned') ? true : false), '$mode' => $mode, '$add' => t('Add to app-tray'), '$remove' => t('Remove from app-tray'), -- cgit v1.2.3