aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-02-06 20:10:10 +0100
committerMario Vavti <mario@mariovavti.com>2017-02-06 20:10:10 +0100
commit70edcabca1e9341b857c469760c88e5c9d318c53 (patch)
tree6af269b8e2d64e3be5ff6036e38e860e55fe2f33
parentdce5e8d0ccc1bb01b7db53af67bd872704a918ed (diff)
downloadvolse-hubzilla-70edcabca1e9341b857c469760c88e5c9d318c53.tar.gz
volse-hubzilla-70edcabca1e9341b857c469760c88e5c9d318c53.tar.bz2
volse-hubzilla-70edcabca1e9341b857c469760c88e5c9d318c53.zip
move icon stuff back to app_render() and send navapps through app_render()
-rw-r--r--Zotlabs/Lib/Apps.php9
-rw-r--r--Zotlabs/Module/Apps.php2
-rw-r--r--app/chat.apd2
-rw-r--r--app/wiki.apd2
-rw-r--r--include/nav.php7
-rw-r--r--view/tpl/app.tpl6
-rwxr-xr-xview/tpl/nav.tpl8
-rw-r--r--view/tpl/navapps.tpl8
8 files changed, 22 insertions, 22 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 7c07f2974..e40c7ef0e 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -26,7 +26,6 @@ class Apps {
foreach($files as $f) {
$x = self::parse_app_description($f,$translate);
if($x) {
- $x['icon'] = ((strpos($x['photo'],'icon:') === 0) ? substr($x['photo'],5) : '');
$ret[] = $x;
}
}
@@ -40,7 +39,6 @@ class Apps {
$x = self::parse_app_description($f,$translate);
if($x) {
$x['plugin'] = $plugin;
- $x['icon'] = ((strpos($x['photo'],'icon:') === 0) ? substr($x['photo'],5) : '');
$ret[] = $x;
}
}
@@ -341,9 +339,11 @@ 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 : ''),
@@ -351,7 +351,8 @@ class Apps {
'$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''),
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
'$deleted' => $papp['deleted'],
- '$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true)
+ '$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
+ '$navapps' => ((local_channel() && $installed && $mode == 'nav') ? true : false)
));
}
@@ -512,8 +513,6 @@ 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) : '');
}
}
diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php
index 1ccd792eb..2df6d675f 100644
--- a/Zotlabs/Module/Apps.php
+++ b/Zotlabs/Module/Apps.php
@@ -38,7 +38,7 @@ class Apps extends \Zotlabs\Web\Controller {
foreach($syslist as $app) {
$apps[] = Zlib\Apps::app_render($app,$mode);
}
-
+
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
'$cat' => ((array_key_exists('cat',$_GET) && $_GET['cat']) ? ' - ' . escape_tags($_GET['cat']) : ''),
diff --git a/app/chat.apd b/app/chat.apd
index f590b4f59..b59d846a6 100644
--- a/app/chat.apd
+++ b/app/chat.apd
@@ -1,6 +1,6 @@
version: 1
url: $baseurl/chat/$nick
-requires: local_channel
+requires: local_channel, ajaxchat
name: My Chatrooms
photo: icon:comments-o
categories: Productivity
diff --git a/app/wiki.apd b/app/wiki.apd
index 94a3e6741..1110f0cc4 100644
--- a/app/wiki.apd
+++ b/app/wiki.apd
@@ -1,6 +1,6 @@
version: 1
url: $baseurl/wiki/$nick
-requires: local_channel
+requires: local_channel, wiki
name: Wiki
photo: icon:pencil-square-o
categories: Productivity
diff --git a/include/nav.php b/include/nav.php
index 70e9bfc59..a6e59a91f 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -273,10 +273,9 @@ EOT;
$syslist = Zlib\Apps::get_system_apps(true);
}
- $navapps = replace_macros(get_markup_template('navapps.tpl'), array(
- '$apps' => $syslist,
- '$localuser' => local_channel(),
- ));
+ foreach($syslist as $app) {
+ $navapps[] = Zlib\Apps::app_render($app,'nav');
+ }
$tpl = get_markup_template('nav.tpl');
diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl
index d4b4c19e8..2ecb5a701 100644
--- a/view/tpl/app.tpl
+++ b/view/tpl/app.tpl
@@ -1,6 +1,7 @@
+{{if !$navapps}}
<div class="app-container">
<div class="app-detail{{if $deleted}} app-deleted{{/if}}">
- <a href="{{$app.url}}" {{if $ap.target}}target="{{$app.target}}" {{/if}}{{if $app.desc}}title="{{$app.desc}}{{if $app.price}} ({{$app.price}}){{/if}}"{{else}}title="{{$app.name}}"{{/if}}>{{if $app.icon}}<i class="app-icon fa fa-fw fa-{{$app.icon}}"></i>{{else}}<img src="{{$app.photo}}" width="80" height="80" />{{/if}}
+ <a href="{{$app.url}}"{{if $app.target}} target="{{$app.target}}"{{/if}}{{if $app.desc}} title="{{$app.desc}}{{if $app.price}} ({{$app.price}}){{/if}}"{{else}}title="{{$app.name}}"{{/if}}>{{if $icon}}<i class="app-icon fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="80" height="80" />{{/if}}
<div class="app-name" style="text-align:center;">{{$app.name}}</div>
</a>
</div>
@@ -24,4 +25,7 @@
</div>
{{/if}}
</div>
+{{else}}
+<li><a href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a></li>
+{{/if}}
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 972b919fa..236cde230 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -170,7 +170,13 @@
<li class="">
<a href="#" data-toggle="dropdown"><i class="fa fa-bars"></i></a>
<ul class="dropdown-menu">
- {{$navapps}}
+ {{foreach $navapps as $navapp}}
+ {{$navapp}}
+ {{/foreach}}
+ {{if $localuser}}
+ <li class="divider"></li>
+ <li><a href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>Add Apps</a></li>
+ {{/if}}
</ul>
</li>
</ul>
diff --git a/view/tpl/navapps.tpl b/view/tpl/navapps.tpl
deleted file mode 100644
index 735c322e5..000000000
--- a/view/tpl/navapps.tpl
+++ /dev/null
@@ -1,8 +0,0 @@
-{{foreach $apps as $app}}
-<li><a href="{{$app.url}}">{{if $app.icon}}<i class="generic-icons-nav fa fa-fw fa-{{$app.icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a></li>
-{{/foreach}}
-{{if $localuser}}
-<li class="divider"></li>
-<li><a href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>Add Apps</a></li>
-{{/if}}
-