From 991db280be4c3cbbff4fb1e4dae8f303a487ed3f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 8 Oct 2017 17:19:29 +0200 Subject: experimental new notifications - needs pconfig experimental_notif set to 1 for your channel to work. --- Zotlabs/Widget/Notifications.php | 152 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 Zotlabs/Widget/Notifications.php (limited to 'Zotlabs/Widget/Notifications.php') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php new file mode 100644 index 000000000..85e8e6cac --- /dev/null +++ b/Zotlabs/Widget/Notifications.php @@ -0,0 +1,152 @@ + 'network', + 'icon' => 'th', + 'severity' => 'secondary', + 'label' => t('Activity'), + 'title' => t('Network Activity Notifications'), + 'viewall' => [ + 'url' => 'network', + 'label' => t('View your network activity') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notifications seen') + ] + ]; + + $notifications[] = [ + 'type' => 'home', + 'icon' => 'home', + 'severity' => 'danger', + 'label' => t('Home'), + 'title' => t('Channel Home Notifications'), + 'viewall' => [ + 'url' => 'channel/' . $channel['channel_address'], + 'label' => t('View your home activity') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notifications seen') + ] + ]; + + $notifications[] = [ + 'type' => 'messages', + 'icon' => 'envelope', + 'severity' => 'danger', + 'label' => t('Mail'), + 'title' => t('Private mail'), + 'viewall' => [ + 'url' => 'mail/combined', + 'label' => t('View your private mails') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all messages seen') + ] + ]; + + $notifications[] = [ + 'type' => 'all_events', + 'icon' => 'calendar', + 'severity' => 'secondary', + 'label' => t('Events'), + 'title' => t('Event Calendar'), + 'viewall' => [ + 'url' => 'mail/combined', + 'label' => t('View events') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all events seen') + ] + ]; + + $notifications[] = [ + 'type' => 'intros', + 'icon' => 'users', + 'severity' => 'danger', + 'label' => t('New Connections'), + 'title' => t('New Connections'), + 'viewall' => [ + 'url' => 'connections', + 'label' => t('View all connections') + ] + ]; + + $notifications[] = [ + 'type' => 'files', + 'icon' => 'folder', + 'severity' => 'danger', + 'label' => t('New Files'), + 'title' => t('New files shared with me'), + ]; + + $notifications[] = [ + 'type' => 'notify', + 'icon' => 'exclamation', + 'severity' => 'danger', + 'label' => t('Notices'), + 'title' => t('Notices'), + 'viewall' => [ + 'url' => 'notifications/system', + 'label' => t('View all notices') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notices seen') + ] + ]; + } + + if(local_channel() && is_site_admin()) { + $notifications[] = [ + 'type' => 'register', + 'icon' => 'user-o', + 'severity' => 'danger', + 'label' => t('New Registrations'), + 'title' => t('New Registrations'), + ]; + } + + $notifications[] = [ + 'type' => 'pubs', + 'icon' => 'globe', + 'severity' => 'secondary', + 'label' => t('Public Stream'), + 'title' => t('Public Stream Notifications'), + 'viewall' => [ + 'url' => 'pubstream', + 'label' => t('View the public stream') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notifications seen') + ] + ]; + + + $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( + '$notifications' => $notifications, + '$loading' => t('Loading...') + )); + + return $o; + + } +} + -- cgit v1.2.3 From bcf4cb519ae6c7d590db6a8023b7f24332ea9160 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 8 Oct 2017 22:21:19 +0200 Subject: new notification fixes --- Zotlabs/Widget/Notifications.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Zotlabs/Widget/Notifications.php') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 85e8e6cac..c6bf22a19 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -16,15 +16,15 @@ class Notifications { 'type' => 'network', 'icon' => 'th', 'severity' => 'secondary', - 'label' => t('Activity'), - 'title' => t('Network Activity Notifications'), + 'label' => t('New Activity'), + 'title' => t('New Activity Notifications'), 'viewall' => [ 'url' => 'network', 'label' => t('View your network activity') ], 'markall' => [ 'url' => '#', - 'label' => t('Mark all notifications seen') + 'label' => t('Mark all notifications read') ] ]; @@ -32,8 +32,8 @@ class Notifications { 'type' => 'home', 'icon' => 'home', 'severity' => 'danger', - 'label' => t('Home'), - 'title' => t('Channel Home Notifications'), + 'label' => t('New Home Activity'), + 'title' => t('New Home Activity Notifications'), 'viewall' => [ 'url' => 'channel/' . $channel['channel_address'], 'label' => t('View your home activity') @@ -45,11 +45,11 @@ class Notifications { ]; $notifications[] = [ - 'type' => 'messages', + 'type' => 'mail', 'icon' => 'envelope', 'severity' => 'danger', - 'label' => t('Mail'), - 'title' => t('Private mail'), + 'label' => t('New Mails'), + 'title' => t('New Mails Notifications'), 'viewall' => [ 'url' => 'mail/combined', 'label' => t('View your private mails') @@ -64,8 +64,8 @@ class Notifications { 'type' => 'all_events', 'icon' => 'calendar', 'severity' => 'secondary', - 'label' => t('Events'), - 'title' => t('Event Calendar'), + 'label' => t('New Events'), + 'title' => t('New Events Notifications'), 'viewall' => [ 'url' => 'mail/combined', 'label' => t('View events') @@ -81,7 +81,7 @@ class Notifications { 'icon' => 'users', 'severity' => 'danger', 'label' => t('New Connections'), - 'title' => t('New Connections'), + 'title' => t('New Connections Notifications'), 'viewall' => [ 'url' => 'connections', 'label' => t('View all connections') @@ -93,7 +93,7 @@ class Notifications { 'icon' => 'folder', 'severity' => 'danger', 'label' => t('New Files'), - 'title' => t('New files shared with me'), + 'title' => t('New Files Notifications'), ]; $notifications[] = [ @@ -119,7 +119,7 @@ class Notifications { 'icon' => 'user-o', 'severity' => 'danger', 'label' => t('New Registrations'), - 'title' => t('New Registrations'), + 'title' => t('New Registrations Notifications'), ]; } -- cgit v1.2.3 From ec173e7eb2e0b4a0768606365f6463009900f0ea Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 8 Oct 2017 22:47:43 +0200 Subject: more fixes --- Zotlabs/Widget/Notifications.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Widget/Notifications.php') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index c6bf22a19..cac884cd1 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -16,8 +16,8 @@ class Notifications { 'type' => 'network', 'icon' => 'th', 'severity' => 'secondary', - 'label' => t('New Activity'), - 'title' => t('New Activity Notifications'), + 'label' => t('New Network Activity'), + 'title' => t('New Network Activity Notifications'), 'viewall' => [ 'url' => 'network', 'label' => t('View your network activity') -- cgit v1.2.3 From e6f1fb3d954fc1354581a93509f8f64662aef2b5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 10 Oct 2017 16:51:35 +0200 Subject: remove notifications code from nav and go live with new notifications --- Zotlabs/Widget/Notifications.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Zotlabs/Widget/Notifications.php') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index cac884cd1..0f82d102e 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -6,9 +6,6 @@ class Notifications { function widget($arr) { - if(! get_pconfig(local_channel(), 'system', 'experimental_notif')) - return; - $channel = \App::get_channel(); if(local_channel()) { @@ -139,7 +136,6 @@ class Notifications { ] ]; - $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$notifications' => $notifications, '$loading' => t('Loading...') -- cgit v1.2.3 From 05c8d4819da117ce12d29cb60761da4045596d21 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 11 Oct 2017 14:26:18 +0200 Subject: only show pubs notifications if discovery_tab != disabled --- Zotlabs/Widget/Notifications.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'Zotlabs/Widget/Notifications.php') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 0f82d102e..a857f1ad9 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -120,21 +120,23 @@ class Notifications { ]; } - $notifications[] = [ - 'type' => 'pubs', - 'icon' => 'globe', - 'severity' => 'secondary', - 'label' => t('Public Stream'), - 'title' => t('Public Stream Notifications'), - 'viewall' => [ - 'url' => 'pubstream', - 'label' => t('View the public stream') - ], - 'markall' => [ - 'url' => '#', - 'label' => t('Mark all notifications seen') - ] - ]; + if(get_config('system', 'disable_discover_tab') != 1) { + $notifications[] = [ + 'type' => 'pubs', + 'icon' => 'globe', + 'severity' => 'secondary', + 'label' => t('Public Stream'), + 'title' => t('Public Stream Notifications'), + 'viewall' => [ + 'url' => 'pubstream', + 'label' => t('View the public stream') + ], + 'markall' => [ + 'url' => '#', + 'label' => t('Mark all notifications seen') + ] + ]; + } $o = replace_macros(get_markup_template('notifications_widget.tpl'), array( '$notifications' => $notifications, -- cgit v1.2.3