|
Moodle
2.2.1
http://www.collinsharper.com
|
Data about a single module on a course. This contains most of the fields in the course_modules table, plus additional data when required.
This object has many public fields; code should treat all these fields as read-only and set data only using the supplied set functions. Setting the fields directly is not supported and may cause problems later.
Definition at line 286 of file modinfolib.php.
| __construct | ( | course_modinfo $ | modinfo, |
| $ | course, | ||
| $ | mod, | ||
| $ | info | ||
| ) |
Constructor should not be called directly; use get_fast_modinfo.
| course_modinfo | $modinfo | Parent object |
| object | $course | Course row |
| object | $mod | Module object from the modinfo field of course table |
| object | $info | Entire object from modinfo field of course table |
Definition at line 863 of file modinfolib.php.

Note: Will collect view data, if not already obtained.
Definition at line 669 of file modinfolib.php.
| get_after_link | ( | ) |
Note: Will collect view data, if not already obtained.
Definition at line 660 of file modinfolib.php.
| get_content | ( | ) |
Obtains content to display on main (view) page. Note: Will collect view data, if not already obtained.
Definition at line 627 of file modinfolib.php.

| get_course | ( | ) |
Definition at line 717 of file modinfolib.php.

| get_custom_data | ( | ) |
Definition at line 652 of file modinfolib.php.
Note: Will collect view data, if not already obtained.
Definition at line 636 of file modinfolib.php.
| get_icon_url | ( | $ | output = null | ) |
| moodle_core_renderer | $output | Output render to use, or null for default (global) |
Definition at line 678 of file modinfolib.php.
| get_modinfo | ( | ) |
Definition at line 710 of file modinfolib.php.

| get_on_click | ( | ) |
Definition at line 645 of file modinfolib.php.
| get_url | ( | ) |
Definition at line 618 of file modinfolib.php.

| has_view | ( | ) |
Definition at line 611 of file modinfolib.php.
If dynamic data for this course-module is not yet available, gets it.
This function is automatically called when constructing course_modinfo, so users don't need to call it.
Dynamic data is data which does not come directly from the cache but is calculated at runtime based on the current user. Primarily this concerns whether the user can access the module or not.
As part of this function, the module's _cm_info_dynamic function from its lib.php will be called (if it exists).
Definition at line 959 of file modinfolib.php.
| set_after_edit_icons | ( | $ | afterediticons | ) |
Sets HTML that displays after edit icons on course view page.
| string | $afterediticons | HTML string (empty string if none) |
Definition at line 780 of file modinfolib.php.
| set_after_link | ( | $ | afterlink | ) |
Sets HTML that displays after link on course view page.
| string | $afterlink | HTML string (empty string if none) |
Definition at line 771 of file modinfolib.php.

| set_available | ( | $ | available, |
| $ | showavailability = 0, |
||
| $ | availableinfo = '' |
||
| ) |
Sets the 'available' flag and related details. This flag is normally used to make course modules unavailable until a certain date or condition is met. (When a course module is unavailable, it is still visible to users who have viewhiddenactivities permission.)
When this is function is called, user-visible status is recalculated automatically.
Note: May not be called from _cm_info_view (only _cm_info_dynamic).
| bool | $available | False if this item is not 'available' |
| int | $showavailability | 0 = do not show this item at all if it's not available, 1 = show this item greyed out with the following message |
| string | $availableinfo | Information about why this is not available which displays to those who have viewhiddenactivities, and to everyone if showavailability is set; note that this function replaces the existing data (if any) |
Definition at line 834 of file modinfolib.php.
| set_content | ( | $ | content | ) |
Sets content to display on course view page below link (if present).
| string | $content | New content as HTML string (empty string if none) |
Definition at line 729 of file modinfolib.php.
| set_extra_classes | ( | $ | extraclasses | ) |
Sets extra classes to include in CSS.
| string | $extraclasses | Extra classes (empty string if none) |
Definition at line 738 of file modinfolib.php.
| set_icon_url | ( | moodle_url $ | iconurl | ) |
Sets the external full url that points to the icon being used by the activity. Useful for external-tool modules (lti...) If set, takes precedence over $icon and $iconcomponent
| moodle_url | $iconurl | full external url pointing to icon image for activity |
Definition at line 750 of file modinfolib.php.
| set_name | ( | $ | name | ) |
Changes the name (text of link) for this module instance. Note: May not be called from _cm_info_view (only _cm_info_dynamic).
| string | $name | Name of activity / link text |
Definition at line 790 of file modinfolib.php.
| set_no_view_link | ( | ) |
Turns off the view link for this module instance. Note: May not be called from _cm_info_view (only _cm_info_dynamic).
Definition at line 800 of file modinfolib.php.
| set_on_click | ( | $ | onclick | ) |
Sets value of on-click attribute for JavaScript. Note: May not be called from _cm_info_view (only _cm_info_dynamic).
| string | $onclick | New onclick attribute which should be HTML-escaped (empty string if none) |
Definition at line 761 of file modinfolib.php.
| set_user_visible | ( | $ | uservisible | ) |
Sets the 'uservisible' flag. This can be used (by setting false) to prevent access and display of this module link for the current user. Note: May not be called from _cm_info_view (only _cm_info_dynamic).
| bool | $uservisible |
Definition at line 812 of file modinfolib.php.
| $added |
Definition at line 346 of file modinfolib.php.
| $available |
Definition at line 537 of file modinfolib.php.
| $availablefrom |
Definition at line 431 of file modinfolib.php.
| $availableinfo |
Definition at line 545 of file modinfolib.php.
| $availableuntil |
Definition at line 438 of file modinfolib.php.
| $completion |
Definition at line 403 of file modinfolib.php.
| $completionexpected |
Definition at line 424 of file modinfolib.php.
| $completiongradeitemnumber |
Definition at line 411 of file modinfolib.php.
| $completionview |
Definition at line 417 of file modinfolib.php.
| $conditionscompletion |
Definition at line 515 of file modinfolib.php.
| $conditionsgrade |
Definition at line 522 of file modinfolib.php.
Definition at line 560 of file modinfolib.php.
Definition at line 333 of file modinfolib.php.
| $extra |
Definition at line 462 of file modinfolib.php.
| $groupingid |
Definition at line 382 of file modinfolib.php.
| $groupmembersonly |
Definition at line 390 of file modinfolib.php.
Definition at line 376 of file modinfolib.php.
| $icon |
Definition at line 468 of file modinfolib.php.
| $iconcomponent |
Definition at line 474 of file modinfolib.php.
| $id |
Definition at line 321 of file modinfolib.php.
Definition at line 340 of file modinfolib.php.
| $indent |
Definition at line 396 of file modinfolib.php.
Definition at line 327 of file modinfolib.php.
Definition at line 481 of file modinfolib.php.
| $modplural |
Definition at line 530 of file modinfolib.php.
| $module |
Definition at line 487 of file modinfolib.php.
| $name |
Definition at line 494 of file modinfolib.php.
Definition at line 355 of file modinfolib.php.
| $section |
Definition at line 507 of file modinfolib.php.
| $sectionnum |
Definition at line 501 of file modinfolib.php.
| $showavailability |
Definition at line 446 of file modinfolib.php.
| $showdescription |
Definition at line 454 of file modinfolib.php.
| $uservisible |
Definition at line 553 of file modinfolib.php.
| $visible |
Definition at line 362 of file modinfolib.php.
| $visibleold |
Definition at line 369 of file modinfolib.php.
| const STATE_BASIC = 0 |
State: Only basic data from modinfo cache is available.
Definition at line 290 of file modinfolib.php.
| const STATE_DYNAMIC = 1 |
State: Dynamic data is available too.
Definition at line 295 of file modinfolib.php.
| const STATE_VIEW = 2 |
State: View data (for course page) is available.
Definition at line 300 of file modinfolib.php.