本文整理汇总了PHP中repository::build_source_field方法的典型用法代码示例。如果您正苦于以下问题:PHP repository::build_source_field方法的具体用法?PHP repository::build_source_field怎么用?PHP repository::build_source_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类repository
的用法示例。
在下文中一共展示了repository::build_source_field方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prevent_form_autofill_password
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
$repo->print_login();
echo '</form>';
}
echo $OUTPUT->footer();
break;
case 'download':
// Check that user has permission to access this file
if (!$repo->file_is_accessible($fileurl)) {
print_error('storedfilecannotread');
}
$record = new stdClass();
$reference = $repo->get_file_reference($fileurl);
$sourcefield = $repo->get_file_source_info($fileurl);
$record->source = repository::build_source_field($sourcefield);
// If file is already a reference, set $fileurl = file source, $repo = file repository
// note that in this case user may not have permission to access the source file directly
// so no file_browser/file_info can be used below
if ($repo->has_moodle_files()) {
$file = repository::get_moodle_file($reference);
if ($file && $file->is_external_file()) {
$sourcefield = $file->get_source();
// remember the original source
$record->source = $repo::build_source_field($sourcefield);
$reference = $file->get_reference();
$repo_id = $file->get_repository_id();
$repo = repository::get_repository_by_id($repo_id, $contextid, $repooptions);
}
}
$record->filepath = $savepath;