當前位置: 首頁>>代碼示例>>PHP>>正文


PHP repository::check_capability方法代碼示例

本文整理匯總了PHP中repository::check_capability方法的典型用法代碼示例。如果您正苦於以下問題:PHP repository::check_capability方法的具體用法?PHP repository::check_capability怎麽用?PHP repository::check_capability使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在repository的用法示例。


在下文中一共展示了repository::check_capability方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

    die(json_encode($err));
}
if (!confirm_sesskey()) {
    $err->error = get_string('invalidsesskey');
    die(json_encode($err));
}
/// Get repository instance information
$sql = 'SELECT i.name, i.typeid, r.type FROM {repository} r, {repository_instances} i WHERE i.id=? AND i.typeid=r.id';
if (!($repository = $DB->get_record_sql($sql, array($repo_id)))) {
    $err->error = get_string('invalidrepositoryid', 'repository');
    die(json_encode($err));
} else {
    $type = $repository->type;
}
/// Check permissions
repository::check_capability($contextid, $repository);
$moodle_maxbytes = get_max_upload_file_size();
// to prevent maxbytes greater than moodle maxbytes setting
if ($maxbytes == 0 || $maxbytes >= $moodle_maxbytes) {
    $maxbytes = $moodle_maxbytes;
}
/// Wait as long as it takes for this script to finish
set_time_limit(0);
// Early actions which need to be done before repository instances initialised
switch ($action) {
    // global search
    case 'gsearch':
        $params = array();
        $params['context'] = array(get_context_instance_by_id($contextid), get_system_context());
        $params['currentcontext'] = get_context_instance_by_id($contextid);
        $repos = repository::get_instances($params);
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:31,代碼來源:repository_ajax.php


注:本文中的repository::check_capability方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。