Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge

This commit is contained in:
zotlabs 2017-07-21 16:20:50 -07:00
commit 992f8272d3
19 changed files with 35 additions and 35 deletions

View File

@ -284,6 +284,9 @@ class Apps {
if(! $papp['photo']) if(! $papp['photo'])
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80); $papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
if(\App::$nav_sel['active'] == $papp['name'])
$papp['active'] = true;
self::translate_system_apps($papp); self::translate_system_apps($papp);
if(trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin'])))) if(trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin']))))

View File

@ -52,6 +52,8 @@ class Admin extends \Zotlabs\Web\Controller {
* Page content * Page content
*/ */
nav_set_selected('Admin');
$o = ''; $o = '';
if(argc() > 1) { if(argc() > 1) {

View File

@ -94,7 +94,7 @@ class Channel extends \Zotlabs\Web\Controller {
} }
else { else {
if(\App::$profile['profile_uid'] == local_channel()) { if(\App::$profile['profile_uid'] == local_channel()) {
nav_set_selected('home'); nav_set_selected(t('Channel Home'));
} }
} }

View File

@ -30,6 +30,8 @@ class Connections extends \Zotlabs\Web\Controller {
return login(); return login();
} }
nav_set_selected(t('Connections'));
$blocked = false; $blocked = false;
$hidden = false; $hidden = false;
$ignored = false; $ignored = false;
@ -71,7 +73,6 @@ class Connections extends \Zotlabs\Web\Controller {
$search_flags = " and abook_pending = 1 "; $search_flags = " and abook_pending = 1 ";
$head = t('New'); $head = t('New');
$pending = true; $pending = true;
nav_set_selected('intros');
break; break;
case 'ifpending': case 'ifpending':
$r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and abook_pending = 1 and abook_self = 0 and abook_ignored = 0 and xchan_deleted = 0 and xchan_orphan = 0 ", $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and abook_pending = 1 and abook_self = 0 and abook_ignored = 0 and xchan_deleted = 0 and xchan_orphan = 0 ",
@ -81,7 +82,6 @@ class Connections extends \Zotlabs\Web\Controller {
$search_flags = " and abook_pending = 1 "; $search_flags = " and abook_pending = 1 ";
$head = t('New'); $head = t('New');
$pending = true; $pending = true;
nav_set_selected('intros');
\App::$argv[1] = 'pending'; \App::$argv[1] = 'pending';
} }
else { else {
@ -91,7 +91,6 @@ class Connections extends \Zotlabs\Web\Controller {
\App::$argc = 1; \App::$argc = 1;
unset(\App::$argv[1]); unset(\App::$argv[1]);
} }
nav_set_selected('intros');
break; break;
// case 'unconnected': // case 'unconnected':
// $search_flags = " and abook_unconnected = 1 "; // $search_flags = " and abook_unconnected = 1 ";

View File

@ -77,7 +77,7 @@ class Directory extends \Zotlabs\Web\Controller {
$pubforums = get_directory_setting($observer, 'pubforums'); $pubforums = get_directory_setting($observer, 'pubforums');
$o = ''; $o = '';
nav_set_selected('directory'); nav_set_selected(t('Directory'));
if(x($_POST,'search')) if(x($_POST,'search'))
$search = notags(trim($_POST['search'])); $search = notags(trim($_POST['search']));

View File

@ -272,7 +272,7 @@ class Events extends \Zotlabs\Web\Controller {
return; return;
} }
nav_set_selected('all_events'); nav_set_selected(t('Events'));
if((argc() > 2) && (argv(1) === 'ignore') && intval(argv(2))) { if((argc() > 2) && (argv(1) === 'ignore') && intval(argv(2))) {
$r = q("update event set dismissed = 1 where id = %d and uid = %d", $r = q("update event set dismissed = 1 where id = %d and uid = %d",

View File

@ -15,7 +15,7 @@ require_once('include/help.php');
class Help extends \Zotlabs\Web\Controller { class Help extends \Zotlabs\Web\Controller {
function get() { function get() {
nav_set_selected('help'); nav_set_selected(t('Help'));
if($_REQUEST['search']) { if($_REQUEST['search']) {
$o .= '<div id="help-content" class="generic-content-wrapper">'; $o .= '<div id="help-content" class="generic-content-wrapper">';

View File

@ -140,7 +140,7 @@ class Mail extends \Zotlabs\Web\Controller {
function get() { function get() {
$o = ''; $o = '';
nav_set_selected('messages'); nav_set_selected(t('Mail'));
if(! local_channel()) { if(! local_channel()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);

View File

@ -11,6 +11,8 @@ class Manage extends \Zotlabs\Web\Controller {
return; return;
} }
nav_set_selected('Manage');
require_once('include/security.php'); require_once('include/security.php');
$change_channel = ((argc() > 1) ? intval(argv(1)) : 0); $change_channel = ((argc() > 1) ? intval(argv(1)) : 0);

View File

@ -154,7 +154,7 @@ class Network extends \Zotlabs\Web\Controller {
)); ));
} }
nav_set_selected('network'); nav_set_selected(t('Activity'));
$channel_acl = array( $channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'], 'allow_cid' => $channel['channel_allow_cid'],

View File

@ -555,6 +555,8 @@ class Photos extends \Zotlabs\Web\Controller {
$sql_extra = permissions_sql($owner_uid,get_observer_hash(),'photo'); $sql_extra = permissions_sql($owner_uid,get_observer_hash(),'photo');
$sql_attach = permissions_sql($owner_uid,get_observer_hash(),'attach'); $sql_attach = permissions_sql($owner_uid,get_observer_hash(),'attach');
nav_set_selected(t('Photos'));
$o = ""; $o = "";
$o .= "<script> var profile_uid = " . \App::$profile['profile_uid'] $o .= "<script> var profile_uid = " . \App::$profile['profile_uid']

View File

@ -22,6 +22,8 @@ class Profile extends \Zotlabs\Web\Controller {
return; return;
} }
nav_set_selected('Profile');
$profile = ''; $profile = '';
$channel = \App::get_channel(); $channel = \App::get_channel();

View File

@ -9,7 +9,7 @@ class Profiles extends \Zotlabs\Web\Controller {
function init() { function init() {
nav_set_selected('profiles'); nav_set_selected('Profiles');
if(! local_channel()) { if(! local_channel()) {
return; return;

View File

@ -53,7 +53,7 @@ class Settings extends \Zotlabs\Web\Controller {
function get() { function get() {
nav_set_selected('settings'); nav_set_selected('Settings');
if((! local_channel()) || ($_SESSION['delegate'])) { if((! local_channel()) || ($_SESSION['delegate'])) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );

View File

@ -76,6 +76,8 @@ class Wiki extends \Zotlabs\Web\Controller {
$wiki_owner = true; $wiki_owner = true;
nav_set_selected(t('Wiki'));
// Obtain the default permission settings of the channel // Obtain the default permission settings of the channel
$owner_acl = array( $owner_acl = array(
'allow_cid' => $owner['channel_allow_cid'], 'allow_cid' => $owner['channel_allow_cid'],

View File

@ -244,6 +244,8 @@ class Browser extends DAV\Browser\Plugin {
$a = false; $a = false;
nav_set_selected(t('Files'));
\App::$page['content'] = $html; \App::$page['content'] = $html;
load_pdl(); load_pdl();

View File

@ -101,12 +101,12 @@ EOT;
$nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn']; $nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn'];
// user menu // 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')) 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 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 { else {
@ -290,21 +290,7 @@ EOT;
* *
*/ */
function nav_set_selected($item){ function nav_set_selected($item){
App::$nav_sel = array( App::$nav_sel['active'] = $item;
'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';
} }

View File

@ -26,7 +26,7 @@
</div> </div>
{{/if}} {{/if}}
{{if $navapps}} {{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}}
{{if $order}} {{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> <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>

View File

@ -19,10 +19,10 @@
{{if $localuser}} {{if $localuser}}
<div class="dropdown-menu"> <div class="dropdown-menu">
{{foreach $nav.usermenu as $usermenu}} {{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}} {{/foreach}}
{{if $nav.manage}} {{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}}
{{if $nav.channels}} {{if $nav.channels}}
{{foreach $nav.channels as $chan}} {{foreach $nav.channels as $chan}}
@ -34,11 +34,11 @@
{{/if}} {{/if}}
{{if $nav.settings}} {{if $nav.settings}}
<div class="dropdown-divider"></div> <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}}
{{if $nav.admin}} {{if $nav.admin}}
<div class="dropdown-divider"></div> <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}}
{{if $nav.logout}} {{if $nav.logout}}
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>