diff options
author | nobody <nobody@zotlabs.com> | 2021-05-31 14:36:14 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-05-31 14:36:14 -0700 |
commit | 462980c70a2698490d97a481cee0f2500dacb91c (patch) | |
tree | 4935db45ad6fbe37cd0af3b93bbb20ecb656c752 /Zotlabs/Module/Notifications.php | |
parent | a96345401f47be71a6eef531e204c0e25b792a16 (diff) | |
parent | 217168628421f4e394b9b85e33d2d653d8b5b3d6 (diff) | |
download | volse-hubzilla-462980c70a2698490d97a481cee0f2500dacb91c.tar.gz volse-hubzilla-462980c70a2698490d97a481cee0f2500dacb91c.tar.bz2 volse-hubzilla-462980c70a2698490d97a481cee0f2500dacb91c.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Module/Notifications.php')
-rw-r--r-- | Zotlabs/Module/Notifications.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Zotlabs/Module/Notifications.php b/Zotlabs/Module/Notifications.php index 55268e0a2..8ecf5760a 100644 --- a/Zotlabs/Module/Notifications.php +++ b/Zotlabs/Module/Notifications.php @@ -6,15 +6,17 @@ require_once('include/bbcode.php'); class Notifications extends \Zotlabs\Web\Controller { function get() { - + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; } - + nav_set_selected('Notifications'); - + $o = ''; + $notif_content = ''; + $notifications_available = false; $r = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_channel()) @@ -24,7 +26,8 @@ class Notifications extends \Zotlabs\Web\Controller { and seen = 0 order by created desc limit 50", intval(local_channel()) ); - } else { + } + else { $r1 = q("select * from notify where uid = %d and seen = 0 order by created desc limit 50", intval(local_channel()) @@ -36,12 +39,12 @@ class Notifications extends \Zotlabs\Web\Controller { ); $r = array_merge($r1,$r2); } - + if($r) { - $notifications_available = 1; + $notifications_available = true; foreach ($r as $rr) { $x = strip_tags(bbcode($rr['msg'])); - $notif_content = replace_macros(get_markup_template('notify.tpl'),array( + $notif_content .= replace_macros(get_markup_template('notify.tpl'),array( '$item_link' => z_root().'/notify/view/'. $rr['id'], '$item_image' => $rr['photo'], '$item_text' => $x, @@ -54,15 +57,15 @@ class Notifications extends \Zotlabs\Web\Controller { else { $notif_content = t('No more system notifications.'); } - + $o .= replace_macros(get_markup_template('notifications.tpl'),array( '$notif_header' => t('System Notifications'), '$notif_link_mark_seen' => t('Mark all seen'), '$notif_content' => $notif_content, '$notifications_available' => $notifications_available, )); - + return $o; } - + } |