Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
|
Namespaces | |
namespace | mod_subsection |
| |
namespace | mod_subsection\courseformat |
| |
namespace | mod_subsection\event |
| |
namespace | mod_subsection\local\callbacks |
| |
namespace | mod_subsection\output |
| |
namespace | mod_subsection\privacy |
| |
Functions | |
mod_subsection_get_course_content_items (core_course\local\entity\content_item $contentitem, stdClass $user, stdClass $course) | |
Get the course content items for the subsection module. | |
mod_subsection_get_fontawesome_icon_map () | |
Get icon mapping for font-awesome. | |
subsection_add_instance ($moduleinstance, $mform=null) | |
Saves a new instance of the mod_subsection into the database. | |
subsection_cm_info_dynamic (cm_info $cm) | |
Sets dynamic information about a course module. | |
subsection_cm_info_view (cm_info $cm) | |
Sets the special subsection display on course page. | |
subsection_delete_instance ($id) | |
Removes an instance of the mod_subsection from the database. | |
subsection_extend_navigation ($subsectionnode, $course, $module, $cm) | |
Extends the global navigation tree by adding mod_subsection nodes if there is a relevant content. | |
subsection_extend_settings_navigation ($settingsnav, $subsectionnode=null) | |
Extends the settings navigation with the mod_subsection settings. | |
subsection_get_coursemodule_info (stdClass $coursemodule) | |
Add a get_coursemodule_info function to add 'extra' information for the course (see resource). | |
subsection_get_file_areas ($course, $cm, $context) | |
Returns the lists of all browsable file areas within the given module context. | |
subsection_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) | |
File browsing support for mod_subsection file areas. | |
subsection_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, $options=[]) | |
Serves the files from the mod_subsection file areas. | |
subsection_supports ($feature) | |
Return if the plugin supports $feature. | |
subsection_update_instance ($moduleinstance, $mform=null) | |
Updates an instance of the mod_subsection in the database. | |
xmldb_subsection_uninstall () | |
Custom uninstallation procedure. | |
xmldb_subsection_upgrade ($oldversion) | |
Execute mod_subsection upgrade from the given old version. | |
Variables | |
$addons | |
$callbacks | |
$capabilities | |
$plugin = 2025040800 | |
$plugin | component = 'mod_subsection' |
$plugin | maturity = MATURITY_STABLE |
$plugin | version = 2025041401 |
mod_subsection_get_course_content_items | ( | core_course\local\entity\content_item | $contentitem, |
stdClass | $user, | ||
stdClass | $course ) |
Get the course content items for the subsection module.
This function is called when the course content is being generated for the activity chooser. However, here this module is never shown in the activity chooser so we return an empty array.
core_course\local\entity\content_item | $contentitem | |
stdClass | $user | |
stdClass | $course |
array |
subsection_add_instance | ( | $moduleinstance, | |
$mform = null ) |
Saves a new instance of the mod_subsection into the database.
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the instance.
object | $moduleinstance | An object from the form. |
mod_subsection_mod_form | $mform | The form. |
int | The id of the newly inserted record. |
subsection_cm_info_dynamic | ( | cm_info | $cm | ) |
Sets dynamic information about a course module.
This function is called from cm_info when displaying the module mod_subsection can be displayed inline on course page and therefore have no course link
cm_info | $cm |
subsection_cm_info_view | ( | cm_info | $cm | ) |
Sets the special subsection display on course page.
cm_info | $cm | Course-module object |
subsection_delete_instance | ( | $id | ) |
Removes an instance of the mod_subsection from the database.
int | $id | Id of the module instance. |
bool | True if successful, false on failure. |
subsection_extend_navigation | ( | $subsectionnode, | |
$course, | |||
$module, | |||
$cm ) |
Extends the global navigation tree by adding mod_subsection nodes if there is a relevant content.
This can be called by an AJAX request so do not rely on $PAGE as it might not be set up properly.
navigation_node | $subsectionnode | An object representing the navigation tree node. |
stdClass | $course | |
stdClass | $module | |
cm_info | $cm |
subsection_extend_settings_navigation | ( | $settingsnav, | |
$subsectionnode = null ) |
Extends the settings navigation with the mod_subsection settings.
This function is called when the context for the page is a mod_subsection module. This is not called by AJAX so it is safe to rely on the $PAGE.
settings_navigation | $settingsnav | { |
navigation_node | $subsectionnode | { |
subsection_get_coursemodule_info | ( | stdClass | $coursemodule | ) |
Add a get_coursemodule_info function to add 'extra' information for the course (see resource).
Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. See get_array_of_activities() in course/lib.php.
stdClass | $coursemodule | The coursemodule object (record). |
cached_cm_info|bool | An object on information that the courses will know about. False if not found. |
subsection_get_file_areas | ( | $course, | |
$cm, | |||
$context ) |
Returns the lists of all browsable file areas within the given module context.
The file area 'intro' for the activity introduction field is added automatically by {
stdClass | $course | |
stdClass | $cm | |
stdClass | $context |
string[]. |
subsection_get_file_info | ( | $browser, | |
$areas, | |||
$course, | |||
$cm, | |||
$context, | |||
$filearea, | |||
$itemid, | |||
$filepath, | |||
$filename ) |
File browsing support for mod_subsection file areas.
file_browser | $browser | |
array | $areas | |
stdClass | $course | |
stdClass | $cm | |
stdClass | $context | |
string | $filearea | |
int | $itemid | |
string | $filepath | |
string | $filename |
file_info|null | file_info instance or null if not found. |
subsection_pluginfile | ( | $course, | |
$cm, | |||
$context, | |||
$filearea, | |||
$args, | |||
$forcedownload, | |||
$options = [] ) |
Serves the files from the mod_subsection file areas.
stdClass | $course | The course object. |
stdClass | $cm | The course module object. |
stdClass | $context | The mod_subsection's context. |
string | $filearea | The name of the file area. |
array | $args | Extra arguments (itemid, path). |
bool | $forcedownload | Whether or not force download. |
array | $options | Additional options affecting the file serving. |
subsection_supports | ( | $feature | ) |
Return if the plugin supports $feature.
string | $feature | Constant representing the feature. |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
subsection_update_instance | ( | $moduleinstance, | |
$mform = null ) |
Updates an instance of the mod_subsection in the database.
Given an object containing all the necessary data (defined in mod_form.php), this function will update an existing instance with new data.
object | $moduleinstance | An object from the form in mod_form.php. |
mod_subsection_mod_form | $mform | The form. |
bool | True if successful, false otherwise. |
xmldb_subsection_uninstall | ( | ) |
Custom uninstallation procedure.
xmldb_subsection_upgrade | ( | $oldversion | ) |
Execute mod_subsection upgrade from the given old version.
int | $oldversion |
bool |
$addons |
$callbacks |
$capabilities |