更新时间:2023-02-08 20:03:02
要在编辑器中操作文件,您必须使用以下方法:
To manipulate files in an editor you must use the following methods:
file_prepare_standard_editor()
file_postupdate_standard_editor()
file_rewrite_pluginfile_urls()
后跟format_text()
您可以在 cohort/edit.php
和 cohort/index.php
中找到此类示例.
You can find an example of this in cohort/edit.php
and cohort/index.php
.
完成后,您需要实现函数_pluginfile
,Moodle 核心将调用该函数来获取文件._pluginfile
函数是必需的,以便您的插件可以检查用户是否可以访问该文件.您可以在 filelib.php file_pluginfile()
和各种 lib.php
中找到默认实现.
Once that is done, you need to implement the function _pluginfile
which Moodle core will call to get the file. The _pluginfile
functions are required so that your plugin can check whether or not the user can access the file. You can find default implementations in filelib.php file_pluginfile()
and in various lib.php <component_name>_pluginfile()
.