X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnotify.php;h=f22c1cf5b1d11342b5c92b861ed7714397e40186;hb=d7dc1f6d27a7312edaa03d5cf4c46418330042f3;hp=0026f5ca6eb6f66556c35326966604e81d6f9899;hpb=45ebeba643a6d600e8778475f70f827f32bf3146;p=friendica.git diff --git a/mod/notify.php b/mod/notify.php index 0026f5ca6e..f22c1cf5b1 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -1,7 +1,20 @@ argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) { + if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all') { $r = $nm->setAllSeen(); - $j = json_encode(array('result' => ($r) ? 'success' : 'fail')); + $j = json_encode(['result' => ($r) ? 'success' : 'fail']); echo $j; killme(); } - } -function notify_content(App $a) { +function notify_content(App $a) +{ if (! local_user()) { - return login(); + return Login::form(); } $nm = new NotificationsManager(); @@ -49,29 +62,26 @@ function notify_content(App $a) { $notif_tpl = get_markup_template('notifications.tpl'); $not_tpl = get_markup_template('notify.tpl'); - require_once('include/bbcode.php'); - $r = $nm->getAll(array('seen'=>0)); - if (dbm::is_result($r) > 0) { + $r = $nm->getAll(['seen'=>0]); + if (DBM::is_result($r) > 0) { foreach ($r as $it) { - $notif_content .= replace_macros($not_tpl,array( - '$item_link' => App::get_baseurl(true).'/notify/view/'. $it['id'], + $notif_content .= replace_macros($not_tpl, [ + '$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'], '$item_image' => $it['photo'], - '$item_text' => strip_tags(bbcode($it['msg'])), - '$item_when' => relative_date($it['date']) - )); + '$item_text' => strip_tags(BBCode::convert($it['msg'])), + '$item_when' => Temporal::getRelativeDate($it['date']) + ]); } } else { - $notif_content .= t('No more system notifications.'); + $notif_content .= L10n::t('No more system notifications.'); } - $o .= replace_macros($notif_tpl, array( - '$notif_header' => t('System Notifications'), + $o = replace_macros($notif_tpl, [ + '$notif_header' => L10n::t('System Notifications'), '$tabs' => false, // $tabs, '$notif_content' => $notif_content, - )); + ]); return $o; - - }