Moodle PHP Documentation 4.1
Moodle 4.1.11 (Build: 20240610) (c8c84b4af18)
|
Public Member Functions | |
cm_hide (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Hide course cms. | |
cm_move (stateupdates $updates, stdClass $course, array $ids, ?int $targetsectionid=null, ?int $targetcmid=null) | |
Move course modules to another location in the same course. | |
cm_moveleft (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Move course cms to the left. | |
cm_moveright (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Move course cms to the right. | |
cm_show (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Show course cms. | |
cm_state (stateupdates $updates, stdClass $course, array $ids, ?int $targetsectionid=null, ?int $targetcmid=null) | |
Add the update messages of the updated version of any cm and section related to the cm ids. | |
cm_stealth (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Stealth course cms. | |
course_state (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Add all the update messages from the complete course state. | |
section_add (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Create a course section. | |
section_content_collapsed (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Update the course content section state to collapse. | |
section_content_expanded (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Update the course content section state to expand. | |
section_delete (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Delete course sections. | |
section_hide (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Hide course sections. | |
section_index_collapsed (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Update the course index section state to collapse. | |
section_index_expanded (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Update the course index section state to expand. | |
section_move (stateupdates $updates, stdClass $course, array $ids, ?int $targetsectionid=null, ?int $targetcmid=null) | |
Move course sections to another location in the same course. | |
section_show (stateupdates $updates, stdClass $course, array $ids=[], ?int $targetsectionid=null, ?int $targetcmid=null) | |
Show course sections. | |
section_state (stateupdates $updates, stdClass $course, array $ids, ?int $targetsectionid=null, ?int $targetcmid=null) | |
Add the update messages of the updated version of any cm and section related to the section ids. | |
Protected Member Functions | |
get_cm_info (course_modinfo $modinfo, array $ids) | |
Extract several cm_info from the course_modinfo. | |
get_section_info (course_modinfo $modinfo, array $ids) | |
Extract several section_info from the course_modinfo. | |
set_cm_indentation (stateupdates $updates, stdClass $course, array $ids, int $indent) | |
Internal method to define the cm indentation level. | |
set_cm_visibility (stateupdates $updates, stdClass $course, array $ids, int $visible, int $coursevisible) | |
Internal method to define the cm visibility. | |
set_section_visibility (stateupdates $updates, stdClass $course, array $ids, int $visible) | |
Show course sections. | |
validate_cms (stdClass $course, array $cmids, ?string $info=null) | |
Checks related to course modules: all given cm exist. | |
validate_sections (stdClass $course, array $sectionids, ?string $info=null) | |
Checks related to sections: course format support them, all given sections exist and topic 0 is not included. | |
core_courseformat\stateactions::cm_hide | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Hide course cms.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::cm_move | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids, | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Move course modules to another location in the same course.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the list of affected course module ids |
int | $targetsectionid | optional target section id |
int | $targetcmid | optional target cm id |
core_courseformat\stateactions::cm_moveleft | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Move course cms to the left.
Indent = 0.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::cm_moveright | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Move course cms to the right.
Indent = 1.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::cm_show | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Show course cms.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::cm_state | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids, | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Add the update messages of the updated version of any cm and section related to the cm ids.
This action is mainly used by legacy actions to partially update the course state when the result of core_course_edit_module is not enough to generate the correct state data.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the list of affected course module ids |
int | $targetsectionid | optional target section id |
int | $targetcmid | optional target cm id |
core_courseformat\stateactions::cm_stealth | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Stealth course cms.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::course_state | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Add all the update messages from the complete course state.
This action is mainly used by legacy actions to partially update the course state when the result of core_course_edit_module is not enough to generate the correct state data.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the list of affected course module ids (not used) |
int | $targetsectionid | optional target section id (not used) |
int | $targetcmid | optional target cm id (not used) |
|
protected |
Extract several cm_info from the course_modinfo.
course_modinfo | $modinfo | the course modinfo. |
int[] | $ids | the course modules $ids |
cm_info[] | the extracted cm_info objects |
|
protected |
Extract several section_info from the course_modinfo.
course_modinfo | $modinfo | the course modinfo. |
int[] | $ids | the course modules $ids |
section_info[] | the extracted section_info objects |
core_courseformat\stateactions::section_add | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Create a course section.
This method follows the same logic as changenumsections.php.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | not used |
int | $targetsectionid | optional target section id (if not passed section will be appended) |
int | $targetcmid | not used |
core_courseformat\stateactions::section_content_collapsed | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Update the course content section state to collapse.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the collapsed section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_content_expanded | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Update the course content section state to expand.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the collapsed section ids |
int | null | $targetsectionid | not used |
int | null | $targetcmid | not used |
core_courseformat\stateactions::section_delete | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Delete course sections.
This method follows the same logic as editsection.php.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_hide | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Hide course sections.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_index_collapsed | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Update the course index section state to collapse.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the collapsed section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_index_expanded | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Update the course index section state to expand.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the collapsed section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_move | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids, | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Move course sections to another location in the same course.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the list of affected course module ids |
int | $targetsectionid | optional target section id |
int | $targetcmid | optional target cm id |
core_courseformat\stateactions::section_show | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids = [], | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Show course sections.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | section ids |
int | $targetsectionid | not used |
int | $targetcmid | not used |
core_courseformat\stateactions::section_state | ( | stateupdates | $updates, |
stdClass | $course, | ||
array | $ids, | ||
?int | $targetsectionid = null, | ||
?int | $targetcmid = null ) |
Add the update messages of the updated version of any cm and section related to the section ids.
This action is mainly used by legacy actions to partially update the course state when the result of core_course_edit_module is not enough to generate the correct state data.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | the list of affected course section ids |
int | $targetsectionid | optional target section id |
int | $targetcmid | optional target cm id |
|
protected |
Internal method to define the cm indentation level.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $indent | new value for indentation |
|
protected |
Internal method to define the cm visibility.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | cm ids |
int | $visible | the new visible value |
int | $coursevisible | the new course visible value |
|
protected |
Show course sections.
stateupdates | $updates | the affected course elements track |
stdClass | $course | the course object |
int[] | $ids | section ids |
int | $visible | the new visible value |
|
protected |
Checks related to course modules: all given cm exist.
stdClass | $course | The course where given $cmids belong. |
array | $cmids | List of course module ids to validate. |
string | $info | additional information in case of error. |
moodle_exception | if any id is not valid |
|
protected |
Checks related to sections: course format support them, all given sections exist and topic 0 is not included.
stdClass | $course | The course where given $sectionids belong. |
array | $sectionids | List of sections to validate. |
string | null | $info | additional information in case of error (default null). |
moodle_exception | if any id is not valid |