Class storing display options and functions to help display course category and/or courses lists.
More...
|
| get_and_erase_attributes ($classname) |
| Return all attributes and erases them so they are not applied again.
|
|
| get_categories_display_option ($optionname, $defaultvalue=null) |
| Return the specified option to display list of subcategories.
|
|
| get_categories_display_options () |
| Returns all options to display list of subcategories.
|
|
| get_category_formatted_description ($coursecat, $options=null) |
| Returns formatted and filtered description of the given category.
|
|
| get_course_formatted_name ($course, $options=array()) |
| Returns course name as it is configured to appear in courses lists formatted to course context.
|
|
| get_course_formatted_summary ($course, $options=array()) |
| Returns given course's summary with proper embedded files urls and formatted.
|
|
| get_courses_display_option ($optionname, $defaultvalue=null) |
| Return the specified option to display list of courses.
|
|
| get_courses_display_options () |
| Returns all options to display the courses.
|
|
| get_show_courses () |
| Returns how (if) to show the courses - none, collapsed, expanded, etc.
|
|
| get_subcat_depth () |
| Returns the maximum depth to expand subcategories in the tree.
|
|
| set_attributes ($attributes) |
| Sets additional general options to pass between renderer functions, usually HTML attributes.
|
|
| set_categories_display_options ($options) |
| Sets options to display list of subcategories.
|
|
| set_courses_display_option ($key, $value) |
| Sets one option to display list of courses.
|
|
| set_courses_display_options ($options) |
| Sets options to display list of courses.
|
|
| set_search_criteria ($searchcriteria) |
| Sets the search criteria if the course is a search result.
|
|
| set_show_courses ($showcourses) |
| Sets how (if) to show the courses - none, collapsed, expanded, etc.
|
|
| set_subcat_depth ($subcatdepth) |
| Sets the maximum depth to expand subcategories in the tree.
|
|
|
array | $attributes = array() |
| additional HTML attributes
|
|
array | $categoriesdisplayoptions = array() |
| options to display subcategories list
|
|
array | $coursesdisplayoptions = array() |
| options to display courses list
|
|
array | $searchcriteria = null |
| search criteria if the list is a search result
|
|
string | $showcourses = 10 |
| [none, collapsed, expanded] how (if) display courses list
|
|
int | $subcatdepth = 1 |
| depth to expand subcategories in the tree (deeper subcategories will be loaded by AJAX or proceed to category page by clicking on category name)
|
|
Class storing display options and functions to help display course category and/or courses lists.
This is a wrapper for core_course_category objects that also stores display options and functions to retrieve sorted and paginated lists of categories/courses.
If theme overrides methods in core_course_renderers that access this class it may as well not use this class at all or extend it.
- Copyright
- 2013 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
coursecat_helper::set_courses_display_options |
( |
|
$options | ) |
|
Sets options to display list of courses.
Options are later submitted as argument to core_course_category::get_courses() and/or core_course_category::search_courses()
Options that core_course_category::get_courses() accept:
- recursive - return courses from subcategories as well. Use with care, this may be a huge list!
- summary - preloads fields 'summary' and 'summaryformat'
- coursecontacts - preloads course contacts
- customfields - preloads custom fields data
- isenrolled - preloads indication whether this user is enrolled in the course
- sort - list of fields to sort. Example array('idnumber' => 1, 'shortname' => 1, 'id' => -1) will sort by idnumber asc, shortname asc and id desc. Default: array('sortorder' => 1) Only cached fields may be used for sorting!
- offset
- limit - maximum number of children to return, 0 or null for no limit
Options summary and coursecontacts are filled automatically in the set_show_courses()
Also renderer can set here any additional options it wants to pass between renderer functions.
- Parameters
-
- Return values
-