Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
|
Namespaces | |
namespace | mod_book |
| |
namespace | mod_book\analytics\indicator |
| |
namespace | mod_book\event |
| |
namespace | mod_book\output |
| |
namespace | mod_book\plugininfo |
| |
namespace | mod_book\privacy |
| |
namespace | mod_book\search |
| |
Functions | |
book_add_fake_block ($chapters, $chapter, $book, $cm, $edit=null) | |
Add the book TOC sticky block to the default region. | |
book_add_instance ($data, $mform) | |
Add book instance. | |
book_check_updates_since (cm_info $cm, $from, $filter=array()) | |
Check if the module has any update that affects the current user since a given time. | |
book_cron () | |
No cron in book. | |
book_delete_instance ($id) | |
Delete book instance by activity id. | |
book_export_contents ($cm, $baseurl) | |
Export book resource contents. | |
book_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $booknode) | |
Adds module specific settings to the settings block. | |
book_get_chapter_title ($chid, $chapters, $book, $context) | |
Returns the title for a given chapter. | |
book_get_file_areas ($course, $cm, $context) | |
Lists all browsable file areas. | |
book_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) | |
File browsing support for book module chapter area. | |
book_get_nav_classes () | |
Returns list of available navigation link CSS classes. | |
book_get_nav_types () | |
book_get_numbering_types () | |
Returns list of available numbering types. | |
book_get_post_actions () | |
Return write actions. | |
book_get_toc ($chapters, $chapter, $book, $cm, $edit) | |
Generate toc structure. | |
book_get_view_actions () | |
Return read actions. | |
book_grades ($bookid) | |
No grading in book. | |
book_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. | |
book_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
Serves the book attachments. | |
book_preload_chapters ($book) | |
Preload book chapters and fix toc structure if necessary. | |
book_print_recent_activity ($course, $viewfullnames, $timestart) | |
Given a course and a time, this module should find recent activity that has occurred in book activities and print it out. | |
book_reset_course_form_definition (&$mform) | |
The elements to add the course reset form. | |
book_reset_userdata ($data) | |
This function is used by the reset_course_userdata function in moodlelib. | |
book_scale_used () | |
book_scale_used_anywhere ($scaleid) | |
Checks if scale is being used by any instance of book. | |
book_supports ($feature) | |
Supported features. | |
book_update_instance ($data, $mform) | |
Update book instance. | |
book_view ($book, $chapter, $islastchapter, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. | |
mod_book_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0) | |
This function receives a calendar event and returns the action associated with it, or null if there is none. | |
mod_book_get_fontawesome_icon_map () | |
Get icon mapping for font-awesome. | |
mod_book_get_tagged_chapters ($tag, $exclusivemode=false, $fromctx=0, $ctx=0, $rec=true, $page=0) | |
Returns book chapters tagged with a specified tag. | |
xmldb_book_upgrade ($oldversion) | |
Book module upgrade task. | |
Variables | |
$capabilities | |
$functions | |
$logs | |
$plugin = 2024041600 | |
$tagareas | |
const | BOOK_NUM_BULLETS '2' |
const | BOOK_NUM_INDENTED '3' |
const | BOOK_NUM_NONE '0' |
The following defines are used to define how the chapters and subchapters of a book should be displayed in that table of contents. | |
const | BOOK_NUM_NUMBERS '1' |
$plugin | component = 'mod_book' |
$plugin | cron = 0 |
$plugin | version = 2024042200 |
book_add_fake_block | ( | $chapters, | |
$chapter, | |||
$book, | |||
$cm, | |||
$edit = null ) |
Add the book TOC sticky block to the default region.
array | $chapters | The Chapters in the book |
stdClass | $chapter | The current chapter |
stdClass | $book | The book |
stdClass | $cm | The course module |
bool | null | $edit | Whether the user is editing |
book_add_instance | ( | $data, | |
$mform ) |
Add book instance.
stdClass | $data | |
stdClass | $mform |
int | new book instance id |
book_check_updates_since | ( | cm_info | $cm, |
$from, | |||
$filter = array() ) |
Check if the module has any update that affects the current user since a given time.
cm_info | $cm | course module data |
int | $from | the time to check updates from |
array | $filter | if we need to check only specific updates |
stdClass | an object with the different type of areas indicating if they were updated or not |
book_cron | ( | ) |
No cron in book.
bool |
book_delete_instance | ( | $id | ) |
Delete book instance by activity id.
int | $id |
bool | success |
book_export_contents | ( | $cm, | |
$baseurl ) |
Export book resource contents.
stdClass | $cm | Course module object |
string | $baseurl | Base URL for file downloads |
array | of file content |
book_extend_settings_navigation | ( | settings_navigation | $settingsnav, |
navigation_node | $booknode ) |
Adds module specific settings to the settings block.
settings_navigation | $settingsnav | The settings navigation object |
navigation_node | $booknode | The node to add module settings to |
void |
book_get_chapter_title | ( | $chid, | |
$chapters, | |||
$book, | |||
$context ) |
Returns the title for a given chapter.
int | $chid | |
array | $chapters | |
stdClass | $book | |
context_module | $context |
string |
book_get_file_areas | ( | $course, | |
$cm, | |||
$context ) |
Lists all browsable file areas.
object | $course | |
object | $cm | |
object | $context |
array |
book_get_file_info | ( | $browser, | |
$areas, | |||
$course, | |||
$cm, | |||
$context, | |||
$filearea, | |||
$itemid, | |||
$filepath, | |||
$filename ) |
book_get_nav_classes | ( | ) |
Returns list of available navigation link CSS classes.
array |
book_get_nav_types | ( | ) |
book_get_numbering_types | ( | ) |
Returns list of available numbering types.
array |
book_get_post_actions | ( | ) |
Return write actions.
Note: This is not used by new logging system. Event with crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING will be considered as post action.
array |
book_get_toc | ( | $chapters, | |
$chapter, | |||
$book, | |||
$cm, | |||
$edit ) |
Generate toc structure.
array | $chapters | |
stdClass | $chapter | |
stdClass | $book | |
stdClass | $cm | |
bool | $edit |
string |
book_get_view_actions | ( | ) |
Return read actions.
Note: This is not used by new logging system. Event with crud = 'r' and edulevel = LEVEL_PARTICIPATING will be considered as view action.
array |
book_grades | ( | $bookid | ) |
No grading in book.
int | $bookid |
null |
book_page_type_list | ( | $pagetype, | |
$parentcontext, | |||
$currentcontext ) |
Return a list of page types.
string | $pagetype | current page type |
stdClass | $parentcontext | Block's parent context |
stdClass | $currentcontext | Current context of block |
array |
book_pluginfile | ( | $course, | |
$cm, | |||
$context, | |||
$filearea, | |||
$args, | |||
$forcedownload, | |||
array | $options = array() ) |
Serves the book attachments.
Implements needed access control ;-)
stdClass | $course | course object |
cm_info | $cm | course module object |
context | $context | context object |
string | $filearea | file area |
array | $args | extra arguments |
bool | $forcedownload | whether or not force download |
array | $options | additional options affecting the file serving |
bool | false if file not found, does not return if found - just send the file |
book_preload_chapters | ( | $book | ) |
Preload book chapters and fix toc structure if necessary.
Returns array of chapters with standard 'pagenum', 'id, pagenum, subchapter, title, content, contentformat, hidden' and extra 'parent, number, subchapters, prev, next'. Please note the content/text of chapters is not included.
stdClass | $book |
array | of id=>chapter |
book_print_recent_activity | ( | $course, | |
$viewfullnames, | |||
$timestart ) |
Given a course and a time, this module should find recent activity that has occurred in book activities and print it out.
stdClass | $course | |
bool | $viewfullnames | |
int | $timestart |
bool | true if there was output, or false is there was none |
book_reset_course_form_definition | ( | & | $mform | ) |
The elements to add the course reset form.
MoodleQuickForm | $mform |
book_reset_userdata | ( | $data | ) |
This function is used by the reset_course_userdata function in moodlelib.
$data | the data submitted from the reset course. |
array | status array |
book_scale_used | ( | ) |
book_scale_used_anywhere | ( | $scaleid | ) |
Checks if scale is being used by any instance of book.
This is used to find out if scale used anywhere
int | $scaleid |
bool | true if the scale is used by any book |
book_supports | ( | $feature | ) |
Supported features.
string | $feature | FEATURE_xx constant for requested feature |
mixed | True if module supports feature, false if not, null if doesn't know or string for the module purpose. |
book_update_instance | ( | $data, | |
$mform ) |
Update book instance.
stdClass | $data | |
stdClass | $mform |
bool | true |
book_view | ( | $book, | |
$chapter, | |||
$islastchapter, | |||
$course, | |||
$cm, | |||
$context ) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
stdClass | $book | book object |
stdClass | $chapter | chapter object |
bool | $islaschapter | is the las chapter of the book? |
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $context | context object |
mod_book_core_calendar_provide_event_action | ( | calendar_event | $event, |
core_calendar\action_factory | $factory, | ||
int | $userid = 0 ) |
This function receives a calendar event and returns the action associated with it, or null if there is none.
This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.
calendar_event | $event | |
core_calendar\action_factory | $factory | |
int | $userid | User id to use for all capability checks, etc. Set to 0 for current user (default). |
core_calendar\local\event\entities\action_interface|null |
mod_book_get_tagged_chapters | ( | $tag, | |
$exclusivemode = false, | |||
$fromctx = 0, | |||
$ctx = 0, | |||
$rec = true, | |||
$page = 0 ) |
Returns book chapters tagged with a specified tag.
This is a callback used by the tag area mod_book/book_chapters to search for book chapters tagged with a specific tag.
core_tag_tag | $tag | |
bool | $exclusivemode | if set to true it means that no other entities tagged with this tag are displayed on the page and the per-page limit may be bigger |
int | $fromctx | context id where the link was displayed, may be used by callbacks to display items in the same context first |
int | $ctx | context id where to search for records |
bool | $rec | search in subcontexts as well |
int | $page | 0-based number of page being displayed |
core_tag\output\tagindex |
xmldb_book_upgrade | ( | $oldversion | ) |
Book module upgrade task.
int | $oldversion | the version we are upgrading from |
bool | always true |
$functions |
$logs |
$tagareas |
const BOOK_NUM_NONE '0' |
The following defines are used to define how the chapters and subchapters of a book should be displayed in that table of contents.
BOOK_NUM_NONE No special styling will applied and the editor will be able to do what ever thay want in the title BOOK_NUM_NUMBERS Chapters and subchapters are numbered (1, 1.1, 1.2, 2, ...) BOOK_NUM_BULLETS Subchapters are indented and displayed with bullets BOOK_NUM_INDENTED Subchapters are indented