Skip to content

Commit

Permalink
Move form element to course
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Aug 21, 2024
1 parent c682037 commit d32b5dd
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,7 @@ public function definition() {
}

} else {
$catlist = core_course_category::make_categories_list('', 0, ' / ');

foreach ($mycourses as $mycourse) {
$courselabel = $catlist[$mycourse->category] . ' / ' . $mycourse->fullname.' ('.$mycourse->shortname.')';
if (empty($mycourse->visible)) {
if ($config->displayhiddencourses || $mycourse->id == $currentrefcourseid) {
$hiddenlabel = ' '.get_string('hiddencourse', 'subcourse');
$options[$mycourse->id] = $courselabel.$hiddenlabel;
}
} else {
$options[$mycourse->id] = $courselabel;
}
}

$mform->addElement('autocomplete', 'refcourse', get_string('refcourselabel', 'subcourse'), $options);
$mform->addElement('course', 'refcourse', get_string('refcourselabel', 'subcourse'), ['limittoenrolled' => 1]);

if (!empty($includekeepref)) {
$mform->disabledIf('refcourse', 'refcoursecurrent', 'checked');
Expand Down

0 comments on commit d32b5dd

Please sign in to comment.