0
我有需要在\ mod \ lti目錄中添加一行代碼到locallib.php。 ('custom_user'=> $ USER-> username,)將一行代碼插入到moodle模塊中的正確方法是什麼?
$requestparams = array(
'resource_link_id' => $instance->id,
'resource_link_title' => $instance->name,
'resource_link_description' => $instance->intro,
'user_id' => $USER->id,
'roles' => $role,
'context_id' => $course->id,
'context_label' => $course->shortname,
'context_title' => $course->fullname,
'launch_presentation_locale' => current_language()
);
$requestparams = array(
'resource_link_id' => $instance->id,
'resource_link_title' => $instance->name,
'resource_link_description' => $instance->intro,
'user_id' => $USER->id,
'custom_user' => $USER->username,
'roles' => $role,
'context_id' => $course->id,
'context_label' => $course->shortname,
'context_title' => $course->fullname,
'launch_presentation_locale' => current_language()
);
有沒有正確的方法來做到這一點?看看插件,它似乎是爲了添加全新的功能,而不僅僅是修補現有的代碼。
謝謝,但我很喜歡這種補丁在Moodle中完成的半官方方式。也許某些或某些方面也會表明或防止維護過度消除補丁? – user3235382