diff options
author | friendica <info@friendica.com> | 2013-01-07 13:40:58 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-01-07 13:40:58 -0800 |
commit | f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214 (patch) | |
tree | f26e330f8dbeba32786e29d9634c6cc17f0c28a8 | |
parent | 0001cc6fd38aaefa9bcabd1458b05ece855f3c67 (diff) | |
download | volse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.tar.gz volse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.tar.bz2 volse-hubzilla-f04ce3b093c03fc343fce5b93e6ec6c7fd1ab214.zip |
more work on notification system, fix a couple of minor issues from smarty conversion
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | include/nav.php | 10 | ||||
-rw-r--r-- | js/main.js | 23 | ||||
-rw-r--r-- | mod/channel.php | 17 | ||||
-rw-r--r-- | mod/hcard.php | 2 | ||||
-rw-r--r-- | mod/profile.php | 21 | ||||
-rw-r--r-- | mod/profile_photo.php | 4 | ||||
-rw-r--r-- | mod/profiles.php | 2 | ||||
-rw-r--r-- | mod/profperm.php | 2 | ||||
-rw-r--r-- | mod/viewcontacts.php | 2 |
10 files changed, 51 insertions, 34 deletions
@@ -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); diff --git a/include/nav.php b/include/nav.php index 5b5d80b17..aa98192c8 100644 --- a/include/nav.php +++ b/include/nav.php @@ -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')); diff --git a/js/main.js b/js/main.js index 356efcf79..18cf79ce8 100644 --- a/js/main.js +++ b/js/main.js @@ -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(); diff --git a/mod/channel.php b/mod/channel.php index 096c76ae2..4510ad61d 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -32,13 +32,20 @@ function channel_aside(&$a) { require_once('include/contact_widgets.php'); require_once('include/items.php'); - profile_aside($a); - - $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat']) : ''); + if(! $a->profile['profile_uid']) + return; - $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)); + } } diff --git a/mod/hcard.php b/mod/hcard.php index 83ae7c7af..ab2fa88a1 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -49,5 +49,5 @@ function hcard_init(&$a) { } function hcard_aside(&$a) { - profile_aside($a); + profile_create_sidebar($a); } diff --git a/mod/profile.php b/mod/profile.php index 8f15766b6..2f869a533 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -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); } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index e7be543c6..d1e24269a 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -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); } diff --git a/mod/profiles.php b/mod/profiles.php index 5b2102852..12c86e3a2 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -153,7 +153,7 @@ function profiles_aside(&$a) { } if((argc() > 1) && (intval(argv(1)))) { - profile_aside($a); + profile_create_sidebar($a); } } diff --git a/mod/profperm.php b/mod/profperm.php index 7c7fe7b11..8054851e8 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -18,7 +18,7 @@ function profperm_aside(&$a) { if(! local_user()) return; - profile_aside($a); + profile_create_sidebar($a); } diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index 7f5050d5d..3f69e4a09 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -17,7 +17,7 @@ function viewcontacts_aside(&$a) { return; } - profile_aside($a); + profile_create_sidebar($a); } |