本文整理汇总了PHP中moodleform::get_coursemodule方法的典型用法代码示例。如果您正苦于以下问题:PHP moodleform::get_coursemodule方法的具体用法?PHP moodleform::get_coursemodule怎么用?PHP moodleform::get_coursemodule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodleform
的用法示例。
在下文中一共展示了moodleform::get_coursemodule方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tool_lp_coursemodule_standard_elements
/**
* Inject the competencies elements into all moodle module settings forms.
*
* @param moodleform $formwrapper The moodle quickforms wrapper object.
* @param MoodleQuickForm $mform The actual form object (required to modify the form).
*/
function tool_lp_coursemodule_standard_elements($formwrapper, $mform)
{
global $CFG, $COURSE;
if (!get_config('core_competency', 'enabled')) {
return;
} else {
if (!has_capability('moodle/competency:coursecompetencymanage', $formwrapper->get_context())) {
return;
}
}
$mform->addElement('header', 'competenciessection', get_string('competencies', 'core_competency'));
MoodleQuickForm::registerElementType('course_competencies', "{$CFG->dirroot}/admin/tool/lp/classes/course_competencies_form_element.php", 'tool_lp_course_competencies_form_element');
$cmid = null;
if ($cm = $formwrapper->get_coursemodule()) {
$cmid = $cm->id;
}
$options = array('courseid' => $COURSE->id, 'cmid' => $cmid);
$mform->addElement('course_competencies', 'competencies', get_string('modcompetencies', 'tool_lp'), $options);
$mform->addHelpButton('competencies', 'modcompetencies', 'tool_lp');
MoodleQuickForm::registerElementType('course_competency_rule', "{$CFG->dirroot}/admin/tool/lp/classes/course_competency_rule_form_element.php", 'tool_lp_course_competency_rule_form_element');
// Reuse the same options.
$mform->addElement('course_competency_rule', 'competency_rule', get_string('uponcoursemodulecompletion', 'tool_lp'), $options);
}