// Remember the number of unread messages being deleted foreach ($_GET as $k => $v) { if (preg_match('/^delete\\-([a-zA-Z_]+)\\-(\\d+)$/', $k, $m)) { $table = $m[1]; $ids[$table][] = $m[2]; if (isset($_GET['unread-' . $table . '-' . $m[2]])) { $deleteunread++; } } } $countdeleted = 0; db_begin(); foreach ($ids as $table => $idspertable) { if ('artefact_multirecipient_notification' === $table) { delete_messages_mr($idspertable, $USER->get('id')); $countdeleted += count($idspertable); } } db_commit(); $message = get_string('deletednotifications1', 'artefact.multirecipientnotification', $countdeleted); } } // ------------ Change ------------ // use the new function to show from - and to user $newhtml = activitylistout_html($type, $limit, $offset); // --------- End Change ----------- if (isset($newunread)) { $newhtml['newunreadcount'] = $newunread; $newhtml['newimage'] = $THEME->get_url($newunread ? 'images/newmail.png' : 'images/message.png'); } json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
// ... and add the element for 'all types' to the beginning $options = array_merge(array('all' => get_string('alltypes', 'activity')), $options); $type = param_variable('type', 'all'); if ($type == '') { $type = 'all'; } if (!isset($options[$type])) { // Comma-separated list; filter out anything that's not an installed type $type = join(',', array_unique(array_filter(split(',', $type), function ($a) { global $installedtypes; return isset($installedtypes[$a]); }))); } require_once get_config('docroot') . 'lib/activity.php'; // use the new function to show from - and to user $activitylist = activitylistout_html($type); $star = json_encode($THEME->get_url('images/star.png')); $readicon = json_encode($THEME->get_url('images/readusermessage.png')); $strread = json_encode(get_string('read', 'activity')); $strnodelete = json_encode(get_string('nodelete', 'activity')); $javascript = <<<JAVASCRIPT function markread(form, action) { var e = getElementsByTagAndClassName(null,'tocheck'+action,form); var pd = {}; var havedelete = false; for (cb in e) { if (e[cb].checked == true) { pd[e[cb].name] = 1;