Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Files | |
file | access.php |
Book module capability definition. | |
file | activity.php |
Search area for mod_book activities. | |
file | activity_base.php |
Activity base class. | |
file | backup_book_activity_task.class.php |
Description of book backup task. | |
file | backup_book_settingslib.php |
Description of book backup settings. | |
file | backup_book_stepslib.php |
Define all the backup steps that will be used by the backup_book_activity_task. | |
file | behat_mod_book_generator.php |
Behat data generator for mod_book. | |
file | booktool.php |
Subplugin info class. | |
file | chapter.php |
Search area for mod_book chapters. | |
file | chapter_created.php |
The mod_book chapter created event. | |
file | chapter_deleted.php |
The mod_book chapter deleted event. | |
file | chapter_updated.php |
The mod_book chapter updated event. | |
file | chapter_viewed.php |
The mod_book chapter viewed event. | |
file | cognitive_depth.php |
Cognitive depth indicator - book. | |
file | course_module_instance_list_viewed.php |
The mod_book instance list viewed event. | |
file | course_module_viewed.php |
The mod_book course module viewed event. | |
file | edit_form.php |
Chapter edit form. | |
file | external.php |
Book external API. | |
file | lib.php |
Provides support for the conversion of moodle1 backup to the moodle2 format. | |
file | lib.php |
Book module core interaction API. | |
file | lib.php |
mod_book data generator. | |
file | locallib.php |
Book module local lib functions. | |
file | log.php |
Book module log events definition. | |
file | mod_form.php |
Instance add/edit form. | |
file | provider.php |
Privacy Subsystem implementation for mod_book. | |
file | restore_book_activity_task.class.php |
Description of book restore task. | |
file | restore_book_stepslib.php |
Define all the restore steps that will be used by the restore_book_activity_task. | |
file | services.php |
Book external functions and service definitions. | |
file | settings.php |
Book plugin settings. | |
file | social_breadth.php |
Social breadth indicator - book. | |
file | tag.php |
Tag areas in component mod_book. | |
file | upgrade.php |
Book module upgrade code. | |
file | version.php |
Book plugin version info. | |
Namespaces | |
namespace | mod_book\analytics\indicator |
| |
namespace | mod_book\event |
| |
namespace | mod_book\plugininfo |
| |
namespace | mod_book\privacy |
| |
namespace | mod_book\search |
| |
Classes | |
class | backup_book_activity_structure_step |
Structure step to backup one book activity. More... | |
class | backup_book_activity_task |
class | behat_mod_book_generator |
Behat data generator for mod_book. More... | |
class | book_chapter_edit_form |
class | book_file_info |
File browsing support class. More... | |
class | mod_book\analytics\indicator\activity_base |
Activity base class. More... | |
class | mod_book\analytics\indicator\cognitive_depth |
Cognitive depth indicator - book. More... | |
class | mod_book\analytics\indicator\social_breadth |
Social breadth indicator - book. More... | |
class | mod_book\event\chapter_created |
The mod_book chapter created event class. More... | |
class | mod_book\event\chapter_deleted |
The mod_book chapter deleted event class. More... | |
class | mod_book\event\chapter_updated |
The mod_book chapter updated event class. More... | |
class | mod_book\event\chapter_viewed |
The mod_book chapter viewed event class. More... | |
class | mod_book\event\course_module_instance_list_viewed |
The mod_book instance list viewed event class. More... | |
class | mod_book\event\course_module_viewed |
The mod_book course module viewed event class. More... | |
class | mod_book\plugininfo\booktool |
class | mod_book\privacy\provider |
The mod_book module does not store any data. More... | |
class | mod_book\search\activity |
Search area for mod_book activities. More... | |
class | mod_book\search\chapter |
Search area for mod_book chapters. More... | |
class | mod_book_external |
class | mod_book_generator |
class | mod_book_mod_form |
class | moodle1_mod_book_handler |
Book conversion handler. More... | |
class | restore_book_activity_structure_step |
Structure step to restore one book activity. More... | |
class | restore_book_activity_task |
Functions | |
book_add_fake_block ($chapters, $chapter, $book, $cm, $edit=null) | |
Add the book TOC sticky block to the default region. More... | |
book_add_instance ($data, $mform) | |
Add book instance. More... | |
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. More... | |
book_cron () | |
No cron in book. More... | |
book_delete_instance ($id) | |
Delete book instance by activity id. More... | |
book_export_contents ($cm, $baseurl) | |
Export book resource contents. More... | |
book_extend_settings_navigation (settings_navigation $settingsnav, navigation_node $booknode) | |
Adds module specific settings to the settings block. More... | |
book_get_chapter_title ($chid, $chapters, $book, $context) | |
Returns the title for a given chapter. More... | |
book_get_file_areas ($course, $cm, $context) | |
Lists all browsable file areas. More... | |
book_get_file_info ($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) | |
File browsing support for book module chapter area. More... | |
book_get_nav_classes () | |
Returns list of available navigation link CSS classes. More... | |
book_get_nav_types () | |
Returns list of available navigation link types. More... | |
book_get_numbering_types () | |
Returns list of available numbering types. More... | |
book_get_post_actions () | |
Return write actions. More... | |
book_get_toc ($chapters, $chapter, $book, $cm, $edit) | |
Generate toc structure. More... | |
book_get_view_actions () | |
Return read actions. More... | |
book_grades ($bookid) | |
No grading in book. More... | |
book_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. More... | |
book_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
Serves the book attachments. More... | |
book_preload_chapters ($book) | |
Preload book chapters and fix toc structure if necessary. More... | |
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. More... | |
book_reset_course_form_definition (&$mform) | |
The elements to add the course reset form. More... | |
book_reset_userdata ($data) | |
This function is used by the reset_course_userdata function in moodlelib. More... | |
book_scale_used () | |
book_scale_used_anywhere ($scaleid) | |
Checks if scale is being used by any instance of book. More... | |
book_supports ($feature) | |
Supported features. More... | |
book_update_instance ($data, $mform) | |
Update book instance. More... | |
book_view ($book, $chapter, $islastchapter, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. More... | |
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. More... | |
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. More... | |
xmldb_book_upgrade ($oldversion) | |
Book module upgrade task. More... | |
Variables | |
$capabilities | |
$functions | |
$logs | |
$plugin = 2020060900 | |
$tagareas | |
const | BOOK_LINK_IMAGE '1' |
const | BOOK_LINK_TEXT '2' |
const | BOOK_LINK_TOCONLY '0' |
The following defines are used to define the navigation style used within a book. More... | |
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. More... | |
const | BOOK_NUM_NUMBERS '1' |
$plugin | component = 'mod_book' |
$plugin | cron = 0 |
$plugin | version = 2020061500 |
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 | |||
) |
File browsing support for book module chapter area.
object | $browser | |
object | $areas | |
object | $course | |
object | $cm | |
object | $context | |
string | $filearea | |
int | $itemid | |
string | $filepath | |
string | $filename |
object | file_info instance or null if not found |
book_get_nav_classes | ( | ) |
Returns list of available navigation link CSS classes.
array |
book_get_nav_types | ( | ) |
Returns list of available navigation link types.
array |
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.
moodleform | $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 |
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_LINK_TOCONLY '0' |
The following defines are used to define the navigation style used within a book.
BOOK_LINK_TOCONLY Only the table of contents is shown, in a side region. BOOK_LINK_IMAGE Arrows link to previous/next/exit pages, in addition to the TOC. BOOK_LINK_TEXT Page names and arrows link to previous/next/exit pages, in addition to the TOC.
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