more work on notification system, fix a couple of minor issues from smarty conversion

This commit is contained in:
friendica 2013-01-07 13:40:58 -08:00
parent 0001cc6fd3
commit f04ce3b093
10 changed files with 51 additions and 34 deletions

View File

@ -1343,7 +1343,7 @@ function profile_load(&$a, $nickname, $profile = 0) {
return;
}}
function profile_aside(&$a) {
function profile_create_sidebar(&$a) {
$block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false);

View File

@ -131,10 +131,16 @@ EOT;
if(local_user()) {
$nav['network'] = array('network', t('Network'), "", t('Conversations from your friends'));
$nav['network']['all']=array('notifications/network', t('See all network notifications'), "", "");
$nav['network']['mark'] = array('', t('Mark all network notifications seen'), '','');
$nav['home'] = array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations'));
$nav['home']['all']=array('notifications/channel', t('See all channel notifications'), "", "");
$nav['home']['mark'] = array('', t('Mark all channel notifications seen'), '','');
$nav['intros'] = array('intro', t('Introductions'), "", t('New Connections'));
$nav['intros']['all']=array('intro', t('See all channel introductions'), "", "");
$nav['notifications'] = array('notifications', t('Notifications'), "", t('Notifications'));
@ -142,12 +148,16 @@ EOT;
$nav['notifications']['mark'] = array('', t('Mark all system notifications seen'), '','');
$nav['messages'] = array('message', t('Messages'), "", t('Private mail'));
$nav['messages']['all']=array('message', t('See all private messages'), "", "");
$nav['messages']['mark'] = array('', t('Mark all private messages seen'), '','');
$nav['messages']['inbox'] = array('message', t('Inbox'), "", t('Inbox'));
$nav['messages']['outbox']= array('message/sent', t('Outbox'), "", t('Outbox'));
$nav['messages']['new'] = array('message/new', t('New Message'), "", t('New Message'));
$nav['all_events'] = array('events', t('Events'), "", t('Event Calendar'));
$nav['all_events']['all']=array('events', t('See all events'), "", "");
$nav['all_events']['mark'] = array('', t('Mark all events seen'), '','');
$nav['manage'] = array('manage', t('Channel Select'), "", t('Manage Your Channels'));

View File

@ -163,14 +163,29 @@
last_popup_button = null;
}
}
/* Turn elements with one of our special rel tags into popup menus */
$('a[rel^=#]').click(function(e){
manage_popup_menu(this,e);
return false;
});
$('span[rel^=#]').click(function(e){
manage_popup_menu(this,e);
return false;
});
function manage_popup_menu(w,e) {
close_last_popup_menu();
menu = $( $(this).attr('rel') );
menu = $( $(w).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
$(this).parent().toggleClass("selected");
$(w).parent().toggleClass("selected");
/* notification menus are loaded dynamically
* - here we find a rel tag to figure out what type of notification to load */
var loader_source = $(menu).attr('rel');
if(loader_source.length) {
notify_popup_loader(loader_source);
@ -181,10 +196,10 @@
last_popup_button = null;
} else {
last_popup_menu = menu;
last_popup_button = $(this).parent();
last_popup_button = $(w).parent();
}
return false;
});
}
$('html').click(function() {
close_last_popup_menu();

View File

@ -32,13 +32,20 @@ function channel_aside(&$a) {
require_once('include/contact_widgets.php');
require_once('include/items.php');
profile_aside($a);
if(! $a->profile['profile_uid'])
return;
$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : '');
$a->set_widget('archive',posted_date_widget($a->get_baseurl(true) . '/channel/' . $a->profile['nickname'],$a->profile['profile_uid'],true));
$a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['nickname'],$cat));
$channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
if(! $channel_display)
profile_create_sidebar($a);
if($channel_display === 'full')
$a->page['template'] = 'full';
else {
$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : '');
$a->set_widget('archive',posted_date_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$a->profile['profile_uid'],true));
$a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$cat));
}
}

View File

@ -49,5 +49,5 @@ function hcard_init(&$a) {
}
function hcard_aside(&$a) {
profile_aside($a);
profile_create_sidebar($a);
}

View File

@ -25,8 +25,8 @@ function profile_init(&$a) {
);
if($x) {
$a->profile = $x[0];
$channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
if(! $channel_display)
// $channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
// if(! $channel_display)
profile_load($a,$which,$profile);
}
@ -38,22 +38,7 @@ function profile_aside(&$a) {
require_once('include/contact_widgets.php');
require_once('include/items.php');
$x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1",
dbesc(argv(1))
);
if($x) {
$channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
if(! $channel_display)
profile_aside($a);
if($channel_display === 'full')
$a->page['template'] = 'full';
else {
$cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : '');
$a->set_widget('archive',posted_date_widget($a->get_baseurl(true) . '/channel/' . $a->profile['nickname'],$a->profile['profile_uid'],true));
$a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['nickname'],$cat));
}
}
profile_create_sidebar($a);
}

View File

@ -14,13 +14,13 @@ function profile_photo_init(&$a) {
}
function profile_photo_init(&$a) {
function profile_photo_aside(&$a) {
if(! local_user()) {
return;
}
profile_aside($a);
profile_create_sidebar($a);
}

View File

@ -153,7 +153,7 @@ function profiles_aside(&$a) {
}
if((argc() > 1) && (intval(argv(1)))) {
profile_aside($a);
profile_create_sidebar($a);
}
}

View File

@ -18,7 +18,7 @@ function profperm_aside(&$a) {
if(! local_user())
return;
profile_aside($a);
profile_create_sidebar($a);
}

View File

@ -17,7 +17,7 @@ function viewcontacts_aside(&$a) {
return;
}
profile_aside($a);
profile_create_sidebar($a);
}