• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP json_reply函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中json_reply函数的典型用法代码示例。如果您正苦于以下问题:PHP json_reply函数的具体用法?PHP json_reply怎么用?PHP json_reply使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了json_reply函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: define

 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'view.php';
$group = param_integer('group', null);
$institution = param_alphanum('institution', null);
$views = new StdClass();
$views->query = trim(param_variable('viewquery', ''));
$views->ownerquery = trim(param_variable('ownerquery', ''));
$views->offset = param_integer('viewoffset', 0);
$views->limit = param_integer('viewlimit', 10);
$views->group = param_integer('group', null);
$views->institution = param_alphanum('institution', null);
$views->copyableby = (object) array('group' => $group, 'institution' => $institution);
if (!($group || $institution)) {
    $views->copyableby->owner = $USER->get('id');
}
$searchcollection = param_integer('searchcollection', null);
$sort[] = array('column' => 'title', 'desc' => 0);
if ($searchcollection) {
    array_unshift($sort, array('column' => 'collection', 'desc' => 0, 'tablealias' => 'cv'));
    $views->collection = $searchcollection;
}
$views->sort = (object) $sort;
View::get_templatesearch_data($views);
json_reply(false, array('message' => null, 'data' => array('table' => $views->html, 'pagination' => $views->pagination['html'], 'count' => $views->count)));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:templatesearch.json.php


示例2: define

<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'searchlib.php';
$tag = param_variable('tag', null);
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$sort = param_alpha('sort', 'name');
$type = param_alpha('type', null);
$owner = (object) array('type' => 'user', 'id' => $USER->get('id'));
$data = get_portfolio_items_by_tag($tag, $owner, $limit, $offset, $sort, $type);
build_portfolio_search_html($data);
$data->tagdisplay = is_null($tag) ? get_string('alltags') : hsc(str_shorten_text($tag, 50));
$data->tagurl = urlencode($tag);
json_reply(false, array('data' => $data));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:26,代码来源:tagsearch.php


示例3: define

 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
$result = get_records_sql_array('SELECT a.id, a.title, a.note, (u.profileicon = a.id) AS isdefault,
        COUNT (DISTINCT aa.artefact) AS attachcount, COUNT(DISTINCT va.view) AS viewcount, COUNT(DISTINCT s.id) AS skincount
    FROM {artefact} a
    LEFT OUTER JOIN {view_artefact} va ON va.artefact = a.id
    LEFT OUTER JOIN {artefact_attachment} aa ON aa.attachment = a.id
    LEFT OUTER JOIN {skin} s ON (s.bodybgimg = a.id OR s.viewbgimg = a.id)
    LEFT OUTER JOIN {usr} u ON (u.id = a.owner)
    WHERE artefacttype = \'profileicon\'
    AND a.owner = ?
    GROUP BY a.id, a.title, a.note, isdefault
    ORDER BY a.id', array($USER->get('id')));
$lastrow = array('id' => 0, 'isdefault' => 't', 'title' => get_string('standardavatartitle', 'artefact.file'), 'note' => get_string('standardavatarnote', 'artefact.file'));
$usersdefaulticon = record_exists_select('usr', 'profileicon IS NULL AND id = ?', array($USER->get('id')));
if (!$usersdefaulticon) {
    $lastrow['isdefault'] = 'f';
}
if (!$result) {
    $result = array();
}
$result[] = $lastrow;
$data['error'] = false;
$data['data'] = $result;
$data['count'] = $result ? count($result) : 0;
json_reply(false, $data);
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:profileicons.json.php


示例4: define

<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
define('NOSESSKEY', 1);
require 'init.php';
json_reply(false, $USER->get('sesskey'));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:16,代码来源:minilogin.php


示例5: json_reply

    $extradata->blockid = $blockid;
}
if (empty($extradata->view) || empty($extradata->annotation) || empty($extradata->blockid)) {
    json_reply('local', get_string('annotationinformationerror', 'artefact.annotation'));
}
if (!can_view_view($extradata->view)) {
    json_reply('local', get_string('noaccesstoview', 'view'));
}
if (!artefact_in_view($extradata->annotation, $extradata->view)) {
    json_reply('local', get_string('accessdenied', 'error'));
}
if (!empty($extradata->artefact) && !artefact_in_view($extradata->artefact, $extradata->view)) {
    json_reply('local', get_string('accessdenied', 'error'));
}
if ($ispagination) {
    // This is not really working yet. Need to do more work on artefact/artefact.php
    $options = ArtefactTypeAnnotationfeedback::get_annotation_feedback_options();
    $options->limit = $limit;
    $options->offset = $offset;
    $options->view = $extradata->view;
    $options->annotation = $extradata->annotation;
    $options->artefact = $extradata->artefact;
    $options->block = $extradata->blockid;
    $annotationfeedback = ArtefactTypeAnnotationfeedback::get_annotation_feedback($options);
    json_reply(false, array('data' => $annotationfeedback));
} else {
    $view = new View($extradata->view);
    $annotationartefact = artefact_instance_from_id($extradata->annotation);
    list($feedbackcount, $annotationfeedback) = ArtefactTypeAnnotationfeedback::get_annotation_feedback_for_view($annotationartefact, $view, $extradata->blockid);
    json_reply(false, array('data' => $annotationfeedback));
}
开发者ID:rboyatt,项目名称:mahara,代码行数:31,代码来源:annotations.json.php


示例6: define

define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
json_headers();
$name = param_variable('name');
$itemid = param_variable('itemid');
$data = new StdClass();
$data->title = $name;
if ($itemid == 'new') {
    try {
        $displayorders = get_records_array('group_category', '', '', '', 'displayorder');
        $max = 0;
        if ($displayorders) {
            foreach ($displayorders as $r) {
                $max = $r->displayorder >= $max ? $r->displayorder + 1 : $max;
            }
        }
        $data->displayorder = $max;
        $itemid = insert_record('group_category', $data, 'id', true);
    } catch (Exception $e) {
        json_reply('local', get_string('savefailed', 'admin'));
    }
} else {
    $data->id = (int) $itemid;
    try {
        update_record('group_category', $data, 'id');
    } catch (Exception $e) {
        json_reply('local', get_string('savefailed', 'admin'));
    }
}
json_reply(false, array('id' => (int) $itemid));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:updategroup.json.php


示例7: define

/**
 * returns shared collections in a given group id
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('blocktype', 'groupviews');
require_once get_config('libroot') . 'view.php';
require_once get_config('libroot') . 'group.php';
$offset = param_integer('offset', 0);
$groupid = param_integer('group');
$group_homepage_view = group_get_homepage_view($groupid);
$bi = group_get_homepage_view_groupview_block($groupid);
if (!can_view_view($group_homepage_view)) {
    json_reply(true, get_string('accessdenied', 'error'));
}
$configdata = $bi->get('configdata');
if (!isset($configdata['showsharedcollections'])) {
    $configdata['showsharedcollections'] = 1;
}
$limit = isset($configdata['count']) ? intval($configdata['count']) : 5;
$limit = $limit > 0 ? $limit : 5;
$sharedcollections = (array) View::get_sharedcollections_data($limit, $offset, $groupid);
if (!empty($configdata['showsharedcollections']) && isset($sharedcollections)) {
    $baseurl = $group_homepage_view->get_url();
    $baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'group=' . $groupid;
    $pagination = array('baseurl' => $baseurl, 'id' => 'sharedcollections_pagination', 'datatable' => 'sharedcollectionlist', 'jsonscript' => 'blocktype/groupviews/sharedcollections.json.php', 'resultcounttextsingular' => get_string('collection', 'collection'), 'resultcounttextplural' => get_string('collections', 'collection'));
    PluginBlocktypeGroupViews::render_items($sharedcollections, 'blocktype:groupviews:sharedcollections.tpl', $configdata, $pagination);
}
json_reply(false, array('data' => $sharedcollections));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:sharedcollections.json.php


示例8: array

    GROUP BY
        u.id, u.firstname, u.lastname, u.studentid, u.suspendedctime, u.suspendedreason,
        ua.firstname, ua.lastname, u.expiry
    ORDER BY ' . ($type == 'expired' ? 'u.expiry' : 'u.suspendedctime') . ', u.id
    LIMIT ?
    OFFSET ?', array($limit, $offset));
if (!$data) {
    $data = array();
} else {
    $institutions = get_records_sql_array('
        SELECT ui.usr, ui.studentid, i.displayname
        FROM {usr_institution} ui INNER JOIN {institution} i ON ui.institution = i.name
        WHERE ui.usr IN (' . join(',', array_keys($data)) . ')', null);
    if ($institutions) {
        foreach ($institutions as &$i) {
            $data[$i->usr]->institutions[] = $i->displayname;
            $data[$i->usr]->institutionids[] = $i->studentid;
        }
    }
    $data = array_values($data);
    foreach ($data as &$record) {
        $record->name = full_name($record);
        $record->firstname = $record->cusrfirstname;
        $record->lastname = $record->cusrlastname;
        $record->cusrname = full_name($record);
        $record->expiry = $record->expiry ? format_date($record->expiry, 'strftimew3cdate') : '-';
        unset($record->firstname, $record->lastname);
    }
}
json_reply(false, array('count' => $count, 'limit' => $limit, 'offset' => $offset, 'data' => $data));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:suspended.json.php


示例9: stdClass

     }
     $authinstance = new stdClass();
     // Get the auth instance with the highest priority number (which is
     // the instance with the lowest priority).
     // TODO: rethink 'priority' as a fieldname... it's backwards!!
     $lastinstance = get_records_array('auth_instance', 'institution', $institution, 'priority DESC', '*', '0', '1');
     if ($lastinstance == false) {
         $authinstance->priority = 0;
     } else {
         $authinstance->priority = $lastinstance[0]->priority + 1;
     }
     $authinstance->instancename = $plugin;
     $authinstance->institution = $institution;
     $authinstance->authname = $plugin;
     $authinstance->id = insert_record('auth_instance', $authinstance, 'id', true);
     json_reply(false, array('id' => $authinstance->id, 'name' => ucfirst($authinstance->authname), 'authname' => $authinstance->authname));
     exit;
 }
 $authclass = new $classname();
 $form = $authclass->get_instance_config_options($institution, $instanceid);
 $form['name'] = 'auth_config';
 $form['plugintype'] = 'auth';
 $form['pluginname'] = strtolower($plugin);
 $form['elements']['submit'] = array('type' => 'submitcancel', 'value' => array(get_string('submit'), get_string('cancel')), 'goto' => 'addauthority.php?c=1');
 $form = pieform($form);
 $smarty = smarty();
 if ($add) {
     $smarty->assign('PAGETITLE', get_string('addauthority', 'auth'));
 } else {
     $smarty->assign('PAGETITLE', get_string('editauthority', 'auth'));
 }
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:31,代码来源:addauthority.php


示例10: define

 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require 'searchlib.php';
safe_require('search', 'internal');
try {
    $query = param_variable('query');
} catch (ParameterException $e) {
    json_reply('missingparameter', 'Missing parameter \'query\'');
}
$type = param_variable('type', 'user');
$limit = param_integer('limit', 20);
$offset = param_integer('offset', 0);
switch ($type) {
    case 'group':
        $data = search_group($query, $limit, $offset, 'all');
        $data['type'] = 'group';
        break;
    default:
        $data = search_user($query, $limit, $offset);
        $data['type'] = 'user';
        break;
}
json_headers();
开发者ID:Br3nda,项目名称:mahara,代码行数:31,代码来源:search.php


示例11: safe_require

safe_require('blocktype', 'groupviews');
require_once get_config('libroot') . 'view.php';
require_once get_config('libroot') . 'group.php';
require_once get_config('libroot') . 'pieforms/pieform.php';
$offset = param_integer('offset', 0);
$groupid = param_integer('group');
$editing = param_boolean('editing', false);
$group_homepage_view = group_get_homepage_view($groupid);
$bi = group_get_homepage_view_groupview_block($groupid);
if (!can_view_view($group_homepage_view) || !group_user_can_assess_submitted_views($groupid, $USER->get('id'))) {
    json_reply(true, get_string('accessdenied', 'error'));
}
$configdata = $bi->get('configdata');
$limit = isset($configdata['count']) ? intval($configdata['count']) : 5;
$limit = $limit > 0 ? $limit : 5;
if (!isset($configdata['sortsubmittedby']) || $configdata['sortsubmittedby'] == PluginBlocktypeGroupViews::SORTBY_TITLE) {
    $sortsubmittedby = 'c.name, v.title';
} else {
    $sortsubmittedby = 'c.submittedtime DESC, v.submittedtime DESC';
}
list($collections, $views) = View::get_views_and_collections(null, null, null, null, false, $groupid, $sortsubmittedby);
$allsubmitted = array_merge(array_values($collections), array_values($views));
$allsubmitted = array('data' => array_slice($allsubmitted, $offset, $limit), 'count' => count($allsubmitted), 'limit' => $limit, 'offset' => $offset);
if (!empty($configdata['showsubmitted'])) {
    $baseurl = $group_homepage_view->get_url();
    $baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'group=' . $groupid . '&editing=' . $editing;
    $pagination = array('baseurl' => $baseurl, 'id' => 'allsubmitted_pagination', 'datatable' => 'allsubmissionlist', 'jsonscript' => 'blocktype/groupviews/allsubmissions.json.php', 'resultcounttextsingular' => get_string('vieworcollection', 'view'), 'resultcounttextplural' => get_string('viewsandcollections', 'view'));
    PluginBlocktypeGroupViews::render_items($allsubmitted, 'blocktype:groupviews:allsubmissions.tpl', $configdata, $pagination);
}
json_reply(false, array('data' => $allsubmitted));
开发者ID:kienv,项目名称:mahara,代码行数:30,代码来源:allsubmissions.json.php


示例12: json_reply

        // Bad menu item type
        json_reply('local', get_string('badmenuitemtype', 'admin'));
    }
}
$data->title = $name;
if ($itemid == 'new') {
    $data->public = $public;
    // set displayorder to be after all the existing menu items
    try {
        $displayorders = get_records_array('site_menu', 'public', $data->public, '', 'displayorder');
        $max = 0;
        if ($displayorders) {
            foreach ($displayorders as $r) {
                $max = $r->displayorder >= $max ? $r->displayorder + 1 : $max;
            }
        }
        $data->displayorder = $max;
        insert_record('site_menu', $data);
    } catch (Exception $e) {
        json_reply('local', get_string('savefailed', 'admin'));
    }
} else {
    $data->id = $itemid;
    try {
        update_record('site_menu', $data, 'id');
    } catch (Exception $e) {
        json_reply('local', get_string('savefailed', 'admin'));
    }
}
json_reply(false, get_string('menuitemsaved', 'admin'));
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:30,代码来源:updatemenu.json.php


示例13: define

 * @copyright  (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('PUBLIC', 1);
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once 'group.php';
require_once 'searchlib.php';
$id = param_integer('id');
$query = trim(param_variable('query', ''));
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
define('GROUP', $id);
$group = group_current_group();
if (!is_logged_in() && !$group->public) {
    throw new AccessDeniedException(get_string('accessdenied', 'error'));
}
$membershiptype = param_variable('membershiptype', '');
if (!empty($membershiptype)) {
    if (group_user_access($id) != 'admin') {
        json_reply('local', get_string('accessdenied', 'error'));
    }
}
$results = get_group_user_search_results($group->id, $query, $offset, $limit, $membershiptype);
if (!param_integer('html', 1)) {
    json_reply(false, $results);
}
list($html, $pagination, $count, $offset, $membershiptype) = group_get_membersearch_data($results, $id, $query, $membershiptype);
json_reply(false, array('message' => null, 'data' => array('tablerows' => $html, 'pagination' => $pagination['html'], 'pagination_js' => $pagination['javascript'], 'count' => $count, 'results' => $count . ' ' . ($count == 1 ? get_string('result') : get_string('results')), 'offset' => $offset, 'membershiptype' => $membershiptype)));
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:30,代码来源:membersearchresults.json.php


示例14: BlockInstance

    $bi = new BlockInstance($blockid);
    if (!can_view_view($bi->get('view'))) {
        json_reply(true, get_string('accessdenied', 'error'));
    }
    $configdata = $bi->get('configdata');
    $limit = isset($configdata['count']) ? $configdata['count'] : 5;
    $configdata['countcomments'] = true;
    $configdata['viewid'] = $bi->get('view');
    $posts = ArtefactTypeBlogpost::get_posts($configdata['artefactid'], $limit, $offset, $configdata);
    $template = 'artefact:blog:viewposts.tpl';
    $baseurl = $bi->get_view()->get_url();
    $baseurl .= (strpos($baseurl, '?') === false ? '?' : '&') . 'block=' . $blockid;
    $pagination = array('baseurl' => $baseurl, 'id' => 'blogpost_pagination_' . $blockid, 'datatable' => 'postlist_' . $blockid, 'jsonscript' => 'artefact/blog/posts.json.php');
    ArtefactTypeBlogpost::render_posts($posts, $template, $configdata, $pagination);
} else {
    // No block, we're just rendering the blog by itself.
    $limit = param_integer('limit', ArtefactTypeBlog::pagination);
    $blogid = param_integer('artefact');
    $viewid = param_integer('view');
    if (!can_view_view($viewid)) {
        json_reply(true, get_string('accessdenied', 'error'));
    }
    $options = array('viewid' => $viewid, 'countcomments' => true);
    $posts = ArtefactTypeBlogpost::get_posts($blogid, $limit, $offset, $options);
    $template = 'artefact:blog:viewposts.tpl';
    $baseurl = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $blogid . '&view=' . $viewid;
    $pagination = array('baseurl' => $baseurl, 'id' => 'blogpost_pagination', 'datatable' => 'postlist', 'jsonscript' => 'artefact/blog/posts.json.php');
    ArtefactTypeBlogpost::render_posts($posts, $template, $options, $pagination);
}
json_reply(false, array('data' => $posts));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:posts.json.php


示例15: define

 * Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage core
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(__FILE__)) . '/init.php';
require_once get_config('libroot') . 'view.php';
if (!($data = View::new_token(param_integer('view')))) {
    json_reply(true, get_string('createviewtokenfailed', 'view'));
}
json_reply(false, array('message' => null, 'data' => $data));
开发者ID:Br3nda,项目名称:mahara,代码行数:30,代码来源:newviewtoken.json.php


示例16: define

 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage admin
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
 *
 */
define('INTERNAL', 1);
define('ADMIN', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
json_headers();
$itemid = param_integer('itemid');
if (!delete_records('site_menu', 'id', $itemid)) {
    json_reply('local', get_string('deletefailed', 'admin'));
}
json_reply(false, get_string('menuitemdeleted', 'admin'));
开发者ID:Br3nda,项目名称:mahara,代码行数:30,代码来源:deletemenuitem.json.php


示例17: delete_messages_mr

            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));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:indexin.json.php


示例18: get_string

// Check that we can actually access the view and not just hacking the viewid passed in
if (!can_view_view($view)) {
    $result->message = get_string('updatewatchlistfailed', 'view');
    json_reply('local', $result);
}
$title = hsc($view->get('title'));
if (get_record('usr_watchlist_view', 'usr', $data->usr, 'view', $viewid)) {
    if (!delete_records('usr_watchlist_view', 'usr', $data->usr, 'view', $viewid)) {
        $result->message = get_string('updatewatchlistfailed', 'view');
        json_reply('local', $result);
    }
    $result->message = get_string('removedfromwatchlist', 'view');
    if ($artefact) {
        $result->newtext = get_string('addtowatchlistartefact', 'view', $title);
    } else {
        $result->newtext = get_string('addtowatchlist', 'view');
    }
    json_reply(false, $result);
}
if (!insert_record('usr_watchlist_view', $data)) {
    $result->message = get_string('updatewatchlistfailed', 'view');
    json_reply('local', $result);
}
$result->message = get_string('addedtowatchlist', 'view');
if ($artefact) {
    $result->newtext = get_string('removefromwatchlistartefact', 'view', $title);
} else {
    $result->newtext = get_string('removefromwatchlist', 'view');
}
json_reply(false, $result);
开发者ID:vohung96,项目名称:mahara,代码行数:30,代码来源:togglewatchlist.json.php


示例19: isset

    $type = 'users';
}
if ($type == 'historical') {
    $field = isset($extradata->field) ? $extradata->field : 'count_usr';
}
if ($type == 'institutions') {
    $sort = isset($extradata->sort) ? $extradata->sort : 'displayname';
    $sortdesc = isset($extradata->sortdesc) ? $extradata->sortdesc : false;
}
switch ($type) {
    case 'institutions':
        $data = institution_comparison_stats_table($limit, $offset, $sort, $sortdesc);
        break;
    case 'historical':
        $data = historical_stats_table($limit, $offset, $field);
        break;
    case 'content':
        $data = content_stats_table($limit, $offset);
        break;
    case 'groups':
        $data = group_stats_table($limit, $offset);
        break;
    case 'views':
        $data = view_stats_table($limit, $offset);
        break;
    case 'users':
    default:
        $data = user_stats_table($limit, $offset);
}
json_reply(false, (object) array('message' => false, 'data' => $data));
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:30,代码来源:statistics.json.php


示例20: define

<?php

/**
 *
 * @package    mahara
 * @subpackage artefact-flexifact
 * @author     EdICT Training Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', 1);
define('JSON', 1);
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('artefact', 'flexifact');
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
$flexifact = ArtefactTypeFlexifact::get_flexifact($offset, $limit);
ArtefactTypeTarget::build_flexifact_list_html($flexifact);
json_reply(FALSE, (object) array('message' => FALSE, 'data' => $flexifact));
开发者ID:edictdev,项目名称:flexifact,代码行数:20,代码来源:flexifact.json.php



注:本文中的json_reply函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP json_response函数代码示例发布时间:2022-05-15
下一篇:
PHP json_output函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap