From dce9a70ff59658249abeb58af46144eea16c721b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 3 Feb 2017 12:12:05 +0100 Subject: check for app-icons in app_list() instead of app_render() --- Zotlabs/Lib/Apps.php | 9 ++++++--- include/nav.php | 1 - view/tpl/app.tpl | 2 +- view/tpl/navapps.tpl | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 595cf33ee..c8345e351 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -339,12 +339,9 @@ class Apps { } $install_action = (($installed) ? t('Update') : t('Install')); - $icon = ((strpos($papp['photo'],'icon:') === 0) ? substr($papp['photo'],5) : ''); - return replace_macros(get_markup_template('app.tpl'),array( '$app' => $papp, - '$icon' => $icon, '$hosturl' => $hosturl, '$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''), '$install' => (($hosturl && $mode == 'view') ? $install_action : ''), @@ -512,8 +509,11 @@ class Apps { intval(TERM_OBJ_APP), intval($r[$x]['id']) ); + + $r[$x]['app_icon'] = ((strpos($r[$x]['app_photo'],'icon:') === 0) ? substr($r[$x]['app_photo'],5) : ''); } } + return($r); } @@ -719,6 +719,9 @@ class Apps { if($app['app_photo']) $ret['photo'] = $app['app_photo']; + if($app['app_icon']) + $ret['icon'] = $app['app_icon']; + if($app['app_version']) $ret['version'] = $app['app_version']; diff --git a/include/nav.php b/include/nav.php index 98b6ebe3f..356c0643b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -264,7 +264,6 @@ EOT; '$localuser' => local_channel(), )); - $tpl = get_markup_template('nav.tpl'); App::$page['nav'] .= replace_macros($tpl, array( diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 434653e1e..a389695ee 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -1,6 +1,6 @@
diff --git a/view/tpl/navapps.tpl b/view/tpl/navapps.tpl index db5c7ae17..07110706c 100644 --- a/view/tpl/navapps.tpl +++ b/view/tpl/navapps.tpl @@ -1,6 +1,6 @@ {{foreach $apps as $app}} -
  • {{if $icon}}{{else}}{{/if}} {{$app.name}}
  • +
  • {{if $app.icon}}{{else}}{{/if}} {{$app.name}}
  • {{/foreach}} {{if $localuser}}
  • -- cgit v1.2.3