aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-21 10:32:21 +0200
committergit-marijus <mario@mariovavti.com>2017-07-21 10:32:21 +0200
commit1bdcfe5219c810758ae255427513a7a0c09ce8e1 (patch)
tree62affdc8e8776109c76e80954021146b9c9fb59a
parent8e5c56dcc2e38884f897acaf9d2b39e5b5dd8c29 (diff)
downloadvolse-hubzilla-1bdcfe5219c810758ae255427513a7a0c09ce8e1.tar.gz
volse-hubzilla-1bdcfe5219c810758ae255427513a7a0c09ce8e1.tar.bz2
volse-hubzilla-1bdcfe5219c810758ae255427513a7a0c09ce8e1.zip
provide a mechanism to mark apps active in the bin
-rw-r--r--Zotlabs/Lib/Apps.php3
-rw-r--r--Zotlabs/Module/Admin.php2
-rw-r--r--Zotlabs/Module/Channel.php2
-rw-r--r--Zotlabs/Module/Mail.php2
-rw-r--r--Zotlabs/Module/Manage.php2
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Module/Profile.php2
-rw-r--r--Zotlabs/Module/Profiles.php2
-rw-r--r--Zotlabs/Module/Settings.php2
-rw-r--r--Zotlabs/Module/Wiki.php4
-rw-r--r--include/nav.php22
-rw-r--r--view/tpl/app.tpl2
-rwxr-xr-xview/tpl/nav.tpl8
13 files changed, 26 insertions, 29 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 68587df49..08f054eaf 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -284,6 +284,9 @@ class Apps {
if(! $papp['photo'])
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
+ if(\App::$nav_sel['active'] == $papp['name'])
+ $papp['active'] = true;
+
self::translate_system_apps($papp);
if(trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin']))))
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index f2918dffc..30f3dfa48 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -52,6 +52,8 @@ class Admin extends \Zotlabs\Web\Controller {
* Page content
*/
+ nav_set_selected('Admin');
+
$o = '';
if(argc() > 1) {
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 98c1e1d61..bc4b3f782 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -94,7 +94,7 @@ class Channel extends \Zotlabs\Web\Controller {
}
else {
if(\App::$profile['profile_uid'] == local_channel()) {
- nav_set_selected('home');
+ nav_set_selected(t('Channel Home'));
}
}
diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php
index f6add7778..7e6ec0cf9 100644
--- a/Zotlabs/Module/Mail.php
+++ b/Zotlabs/Module/Mail.php
@@ -140,7 +140,7 @@ class Mail extends \Zotlabs\Web\Controller {
function get() {
$o = '';
- nav_set_selected('messages');
+ nav_set_selected(t('Mail'));
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
diff --git a/Zotlabs/Module/Manage.php b/Zotlabs/Module/Manage.php
index e541ee077..2d8f39ded 100644
--- a/Zotlabs/Module/Manage.php
+++ b/Zotlabs/Module/Manage.php
@@ -10,6 +10,8 @@ class Manage extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
+
+ nav_set_selected('Manage');
require_once('include/security.php');
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index f2ad77dd7..68e906c0e 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -154,7 +154,7 @@ class Network extends \Zotlabs\Web\Controller {
));
}
- nav_set_selected('network');
+ nav_set_selected(t('Activity'));
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php
index ab349b05d..6930d50ca 100644
--- a/Zotlabs/Module/Profile.php
+++ b/Zotlabs/Module/Profile.php
@@ -21,6 +21,8 @@ class Profile extends \Zotlabs\Web\Controller {
\App::$error = 404;
return;
}
+
+ nav_set_selected('Profile');
$profile = '';
$channel = \App::get_channel();
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index f6e8b11ed..b1cf9596c 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -9,7 +9,7 @@ class Profiles extends \Zotlabs\Web\Controller {
function init() {
- nav_set_selected('profiles');
+ nav_set_selected('Profiles');
if(! local_channel()) {
return;
diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php
index 76794e21c..79031c98f 100644
--- a/Zotlabs/Module/Settings.php
+++ b/Zotlabs/Module/Settings.php
@@ -53,7 +53,7 @@ class Settings extends \Zotlabs\Web\Controller {
function get() {
- nav_set_selected('settings');
+ nav_set_selected('Settings');
if((! local_channel()) || ($_SESSION['delegate'])) {
notice( t('Permission denied.') . EOL );
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 85481754f..4dc11c683 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -42,7 +42,7 @@ class Wiki extends \Zotlabs\Web\Controller {
if(! feature_enabled(\App::$profile_uid,'wiki')) {
notice( t('Not found') . EOL);
- return;
+ return;
}
@@ -76,6 +76,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$wiki_owner = true;
+ nav_set_selected(t('Wiki'));
+
// Obtain the default permission settings of the channel
$owner_acl = array(
'allow_cid' => $owner['channel_allow_cid'],
diff --git a/include/nav.php b/include/nav.php
index b0533e4c7..f6c8aa23f 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -101,12 +101,12 @@ EOT;
$nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn'];
// user menu
- $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn'];
+ $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((\App::$nav_sel['active'] == 'Profile') ? 'active' : ''), t('Your profile page'),'profile_nav_btn'];
if(feature_enabled(local_channel(),'multi_profiles'))
- $nav['usermenu'][] = ['profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn'];
+ $nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((\App::$nav_sel['active'] == 'Profiles') ? 'active' : '') , t('Manage/Edit profiles'),'profiles_nav_btn'];
else
- $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn'];
+ $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((\App::$nav_sel['active'] == 'Profiles') ? 'active' : ''), t('Edit your profile'),'profiles_nav_btn'];
}
else {
@@ -290,21 +290,7 @@ EOT;
*
*/
function nav_set_selected($item){
- App::$nav_sel = array(
- 'community' => null,
- 'network' => null,
- 'home' => null,
- 'profiles' => null,
- 'intros' => null,
- 'notifications' => null,
- 'messages' => null,
- 'directory' => null,
- 'settings' => null,
- 'contacts' => null,
- 'manage' => null,
- 'register' => null,
- );
- App::$nav_sel[$item] = 'active';
+ App::$nav_sel['active'] = $item;
}
diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl
index 804db426f..ac5c18deb 100644
--- a/view/tpl/app.tpl
+++ b/view/tpl/app.tpl
@@ -26,7 +26,7 @@
</div>
{{/if}}
{{if $navapps}}
-<a class="dropdown-item" 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>
+<a class="dropdown-item{{if $app.active}} active{{/if}}" 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>
{{/if}}
{{if $order}}
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl
index 0f2628761..93bbe187f 100755
--- a/view/tpl/nav.tpl
+++ b/view/tpl/nav.tpl
@@ -19,10 +19,10 @@
{{if $localuser}}
<div class="dropdown-menu">
{{foreach $nav.usermenu as $usermenu}}
- <a class="dropdown-item" href="{{$usermenu.0}}" title="{{$usermenu.3}}" role="menuitem" id="{{$usermenu.4}}">{{$usermenu.1}}</a>
+ <a class="dropdown-item{{if $usermenu.2}} active{{/if}}" href="{{$usermenu.0}}" title="{{$usermenu.3}}" role="menuitem" id="{{$usermenu.4}}">{{$usermenu.1}}</a>
{{/foreach}}
{{if $nav.manage}}
- <a class="dropdown-item" href="{{$nav.manage.0}}" title="{{$nav.manage.3}}" role="menuitem" id="{{$nav.manage.4}}">{{$nav.manage.1}}</a>
+ <a class="dropdown-item{{if $sel.active == Manage}} active{{/if}}" href="{{$nav.manage.0}}" title="{{$nav.manage.3}}" role="menuitem" id="{{$nav.manage.4}}">{{$nav.manage.1}}</a>
{{/if}}
{{if $nav.channels}}
{{foreach $nav.channels as $chan}}
@@ -34,11 +34,11 @@
{{/if}}
{{if $nav.settings}}
<div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}" role="menuitem" id="{{$nav.settings.4}}">{{$nav.settings.1}}</a>
+ <a class="dropdown-item{{if $sel.active == Settings}} active{{/if}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}" role="menuitem" id="{{$nav.settings.4}}">{{$nav.settings.1}}</a>
{{/if}}
{{if $nav.admin}}
<div class="dropdown-divider"></div>
- <a class="dropdown-item" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a>
+ <a class="dropdown-item{{if $sel.active == Admin}} active{{/if}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a>
{{/if}}
{{if $nav.logout}}
<div class="dropdown-divider"></div>