require_once("include/contact_selectors.php");
require_once("include/network.php");
-function notifications_post(&$a) {
+function notifications_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
goaway(z_root());
}
intval(local_user())
);
- if(count($r)) {
+ if (dbm::is_result($r)) {
$intro_id = $r[0]['id'];
$contact_id = $r[0]['contact-id'];
}
}
}
-function notifications_content(&$a) {
+function notifications_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
nav_set_selected('introductions');
$notif_header = t('Notifications');
- if(($a->argc > 2) && ($a->argv[2] == 'all'))
- $all = 1;
- else
- $all = 0;
+ $all = (($a->argc > 2) && ($a->argv[2] == 'all'));
$notifs = $nm->introNotifs($all, $startrec, $perpage);
// The link to switch between ignored and normal connection requests
$notif_show_lnk = array(
- 'href' => ($all === 0 ? 'notifications/intros/all' : 'notifications/intros' ),
- 'text' => ($all === 0 ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
+ 'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros' ),
+ 'text' => (!$all ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
);
// Loop through all introduction notifications.This creates an array with the output html for each
'$item_label' => $it['label'],
'$item_link' => $it['link'],
'$item_image' => $it['image'],
- '$item_text' => $it['text'],
+ '$item_text' => htmlentities($it['text']),
'$item_when' => $it['when'],
'$item_seen' => $it['seen'],
));
$notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
}
-
$o .= replace_macros($notif_tpl, array(
'$notif_header' => $notif_header,
'$tabs' => $tabs,