Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 402] [Versions 400 and 403]
Course and category management helper class.
Copyright: | 2013 Sam Hemelryk |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1026 lines (42 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
helper:: (33 methods):
get_course_detail_array()
get_category_listitem_actions()
get_course_listitem_actions()
get_course_detail_actions()
action_course_change_sortorder_up_one()
action_course_change_sortorder_down_one()
action_course_change_sortorder_up_one_by_record()
action_course_change_sortorder_down_one_by_record()
action_course_change_sortorder_after_course()
action_course_show()
action_course_hide()
action_course_show_by_record()
action_course_hide_by_record()
action_category_change_sortorder_up_one()
action_category_change_sortorder_down_one()
action_category_change_sortorder_up_one_by_id()
action_category_change_sortorder_down_one_by_id()
action_category_hide()
action_category_show()
action_category_show_by_id()
action_category_hide_by_id()
action_category_resort_subcategories()
action_category_resort_courses()
action_category_move_courses_into()
get_management_viewmodes()
search_courses()
move_courses_into_category()
get_category_courses_visibility()
get_category_children_visibility()
record_expanded_category()
get_expanded_categories()
get_course_copy_capabilities()
can_copy_course()
get_course_detail_array(\core_course_list_element $course) X-Ref |
Returns course details in an array ready to be printed. return: array param: \core_course_list_element $course |
get_category_listitem_actions(\core_course_category $category) X-Ref |
Returns an array of actions that can be performed upon a category being shown in a list. return: array param: \core_course_category $category |
get_course_listitem_actions(\core_course_category $category, \core_course_list_element $course) X-Ref |
Returns an array of actions for a course listitem. return: array param: \core_course_category $category param: \core_course_list_element $course |
get_course_detail_actions(\core_course_list_element $course) X-Ref |
Returns an array of actions that can be performed on the course being displayed. return: array param: \core_course_list_element $course |
action_course_change_sortorder_up_one(\core_course_list_element $course,\core_course_category $category) X-Ref |
Resorts the courses within a category moving the given course up by one. return: bool param: \core_course_list_element $course param: \core_course_category $category |
action_course_change_sortorder_down_one(\core_course_list_element $course,\core_course_category $category) X-Ref |
Resorts the courses within a category moving the given course down by one. return: bool param: \core_course_list_element $course param: \core_course_category $category |
action_course_change_sortorder_up_one_by_record($courserecordorid) X-Ref |
Resorts the courses within a category moving the given course up by one. return: bool param: int|\stdClass $courserecordorid |
action_course_change_sortorder_down_one_by_record($courserecordorid) X-Ref |
Resorts the courses within a category moving the given course down by one. return: bool param: int|\stdClass $courserecordorid |
action_course_change_sortorder_after_course($courserecordorid, $moveaftercourseid) X-Ref |
Changes the sort order so that the first course appears after the second course. return: bool param: int|\stdClass $courserecordorid param: int $moveaftercourseid |
action_course_show(\core_course_list_element $course) X-Ref |
Makes a course visible given a \core_course_list_element object. return: bool param: \core_course_list_element $course |
action_course_hide(\core_course_list_element $course) X-Ref |
Makes a course hidden given a \core_course_list_element object. return: bool param: \core_course_list_element $course |
action_course_show_by_record($courserecordorid) X-Ref |
Makes a course visible given a course id or a database record. return: bool param: int|\stdClass $courserecordorid |
action_course_hide_by_record($courserecordorid) X-Ref |
Makes a course hidden given a course id or a database record. return: bool param: int|\stdClass $courserecordorid |
action_category_change_sortorder_up_one(\core_course_category $category) X-Ref |
Resort a categories subcategories shifting the given category up one. return: bool param: \core_course_category $category |
action_category_change_sortorder_down_one(\core_course_category $category) X-Ref |
Resort a categories subcategories shifting the given category down one. return: bool param: \core_course_category $category |
action_category_change_sortorder_up_one_by_id($categoryid) X-Ref |
Resort a categories subcategories shifting the given category up one. return: bool param: int $categoryid |
action_category_change_sortorder_down_one_by_id($categoryid) X-Ref |
Resort a categories subcategories shifting the given category down one. return: bool param: int $categoryid |
action_category_hide(\core_course_category $category) X-Ref |
Makes a category hidden given a core_course_category object. return: bool param: \core_course_category $category |
action_category_show(\core_course_category $category) X-Ref |
Makes a category visible given a core_course_category object. return: bool param: \core_course_category $category |
action_category_show_by_id($categoryid) X-Ref |
Makes a category visible given a course category id or database record. return: bool param: int|\stdClass $categoryid |
action_category_hide_by_id($categoryid) X-Ref |
Makes a category hidden given a course category id or database record. return: bool param: int|\stdClass $categoryid |
action_category_resort_subcategories(\core_course_category $category, $sort, $cleanup = true) X-Ref |
Resorts the sub categories of the given category. return: bool param: \core_course_category $category param: string $sort One of idnumber or name. param: bool $cleanup If true cleanup will be done, if false you will need to do it manually later. |
action_category_resort_courses(\core_course_category $category, $sort, $cleanup = true) X-Ref |
Resorts the courses within the given category. return: bool param: \core_course_category $category param: string $sort One of fullname, shortname or idnumber param: bool $cleanup If true cleanup will be done, if false you will need to do it manually later. |
action_category_move_courses_into(\core_course_category $oldcategory,\core_course_category $newcategory, array $courseids) X-Ref |
Moves courses out of one category and into a new category. return: bool True on success. param: \core_course_category $oldcategory The category we are moving courses out of. param: \core_course_category $newcategory The category we are moving courses into. param: array $courseids The ID's of the courses we want to move. |
get_management_viewmodes() X-Ref |
Returns the view modes for the management interface. return: array |
search_courses($search, $blocklist, $modulelist, $page = 0, $perpage = null) X-Ref |
Search for courses with matching params. Please note that only one of search, blocklist, or modulelist can be specified at a time. Specifying more than one will result in only the first being used. return: array param: string $search Words to search for. We search fullname, shortname, idnumber and summary. param: int $blocklist The ID of a block, courses will only be returned if they use this block. param: string $modulelist The name of a module (relates to database table name). Only courses containing this module param: int $page The page number to display, starting at 0. param: int $perpage The number of courses to display per page. |
move_courses_into_category($categoryorid, $courseids = array() X-Ref |
Moves one or more courses out of the category they are currently in and into a new category. This function works much the same way as action_category_move_courses_into however it allows courses from multiple categories to be moved into a single category. return: bool True on success or false on failure. param: int|\core_course_category $categoryorid The category to move them into. param: array|int $courseids An array of course id's or optionally just a single course id. |
get_category_courses_visibility($categoryid) X-Ref |
Returns an array of courseids and visiblity for all courses within the given category. return: array param: int $categoryid |
get_category_children_visibility($categoryid) X-Ref |
Returns an array of all categoryids that have the given category as a parent and their visible value. return: array param: int $categoryid |
record_expanded_category(\core_course_category $coursecat, $expanded = true) X-Ref |
Records when a category is expanded or collapsed so that when the user param: \core_course_category $coursecat The category we're working with. param: bool $expanded True if the category is expanded now. |
get_expanded_categories($withpath = null) X-Ref |
Returns the categories that should be expanded when displaying the interface. return: \core_course_category[] An array of Category ID's to expand. param: int|null $withpath If specified a path to require as the parent. |
get_course_copy_capabilities() X-Ref |
Get an array of the capabilities required to copy a course. return: array |
can_copy_course(int $courseid) X-Ref |
Returns true if the current user can copy this course. return: bool param: int $courseid |