WT JMoodle library - Documentation
Category: Libraries

Courseslist Joomla Form field

Joomla Form is a field for use in XML forms of Joomla extensions. Displays a select-option drop-down list with a list of Moodle courses.

The Moodle REST API method

The field uses the core_course_get_courses Moodle REST API method.

Access rights

Required access rights for the core_course_get_courses method to work:

  • moodle/course:view
  • moodle/course:update
  • moodle/course:viewhiddencourses

Attributes

You can use all the standard attributes for Joomla fields of the list type, such as multiple, class, parentclass, layout, etc.

course_ids

The core_course_get_courses method supports the optional course_ids parameter, which allows you to specify a list of course IDs. If the parameter is empty, a list of all courses is displayed, except for the course for the main page.

Specify the list of ids separated by commas: course_ids="1,8".

Example code


<field addfieldprefix="Webtolk\JMoodle\Fields"
                       type="courseslist"
                       name="course_id"
                       course_ids="1,8"
                       multiple="true"
                       layout="joomla.form.field.list-fancy-select"
                       label="Course Ids"
                       description="Select Moodle coursees"/>

 

 

 

WebTolk Joomla Extensions

90 Extensions
11 Categories
401 Versions released
397077 Downloads
Cart
Cart is empty