コード例 #1
0
        foreach ($ids as $table => $idspertable) {
            if ('artefact_multirecipient_notification' === $table) {
                delete_messages_mr($idspertable, $USER->get('id'));
            } else {
                if ('notification_internal_activity' === $table) {
                    $strids = join(',', array_map('db_quote', $idspertable));
                    $userid = $USER->get('id');
                    // Remove parent pointers to messages we're about to delete
                    // Use temp table in subselect for Mysql compat.
                    execute_sql("\n                UPDATE {notification_internal_activity}\n                SET parent = NULL\n                WHERE parent IN (\n                    SELECT id FROM (\n                       SELECT id FROM {notification_internal_activity} WHERE id IN ({$strids}) AND usr = ?\n                    ) AS temp\n                )", array($userid));
                    delete_records_select('notification_internal_activity', "id IN ({$strids}) AND usr = ?", array($userid));
                    if ($deleteunread) {
                        $newunread = $USER->add_unread(-$deleteunread);
                    }
                }
            }
            $countdeleted += count($idspertable);
        }
        db_commit();
        $message = get_string('deletednotifications1', 'activity', $countdeleted);
    }
}
// ------------ Change ------------
// use the new function to show from - and to user
$newhtml = activitylistin_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));
コード例 #2
0
ファイル: inbox.php プロジェクト: rboyatt/mahara
$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';
// add the new function for outgoing notification
// use the new function to show from - and to user
$activitylist = activitylistin_html($type);
$strread = json_encode(get_string('read', 'activity'));
$strnodelete = json_encode(get_string('nodelete', 'activity'));
$paginationjavascript = <<<JAVASCRIPT

// NOTE: most js is in the notification.js file, but we found
// this part much more difficult to relocate

jQuery(function(\$) {
// We want the paginator to tell us when a page gets changed.
function PaginatorData() {
    var self = this;
    var params = {};
    this.pageChanged = function(data) {
        self.params = {
            'offset': data.offset,