|
Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Files | |
| file | access.php |
| Plugin capabilities. | |
| file | activity.php |
| Search area for mod_wiki activities. | |
| file | activity_base.php |
| Activity base class. | |
| file | backup_wiki_activity_task.class.php |
| Defines backup_wiki_activity_task class. | |
| file | backup_wiki_settingslib.php |
| @subpackage backup-moodle2 | |
| file | backup_wiki_stepslib.php |
| @subpackage backup-moodle2 | |
| file | cognitive_depth.php |
| Cognitive depth indicator - wiki. | |
| file | collaborative_page.php |
| Search area for mod_wiki collaborative pages. | |
| file | comment_created.php |
| The mod_wiki comment created event. | |
| file | comment_deleted.php |
| The mod_wiki comment deleted event. | |
| file | comments_viewed.php |
| The mod_wiki comments viewed event. | |
| file | course_module_instance_list_viewed.php |
| The mod_wiki instance list viewed event. | |
| file | course_module_viewed.php |
| The mod_wiki course module viewed event. | |
| file | create_form.php |
| This file contains all necessary code to define and process an edit form. | |
| file | edit_form.php |
| This file contains all necessary code to define and process an edit form. | |
| file | external.php |
| Wiki module external API. | |
| file | filesedit_form.php |
| Edit wiki files form. | |
| file | lib.php |
| Provides support for the conversion of moodle1 backup to the moodle2 format Based off of a template @ http://docs.moodle.org/dev/Backup_1.9_conversion_for_developers. | |
| file | lib.php |
| Library of functions and constants for module wiki. | |
| file | lib.php |
| mod_wiki data generator. | |
| file | locallib.php |
| This contains functions and classes that will be used by scripts in wiki module. | |
| file | mod_form.php |
| This file defines de main wiki configuration form. | |
| file | page_created.php |
| The mod_wiki page created event. | |
| file | page_deleted.php |
| The mod_wiki page deleted event. | |
| file | page_diff_viewed.php |
| The mod_wiki diff viewed event. | |
| file | page_history_viewed.php |
| The mod_wiki history viewed event. | |
| file | page_locks_deleted.php |
| The mod_wiki page locks deleted (override locks) event. | |
| file | page_map_viewed.php |
| The mod_wiki map viewed event. | |
| file | page_updated.php |
| The mod_wiki page updated event. | |
| file | page_version_deleted.php |
| The mod_wiki page version deleted event. | |
| file | page_version_restored.php |
| The mod_wiki version restored event. | |
| file | page_version_viewed.php |
| The mod_wiki version viewed event. | |
| file | page_viewed.php |
| The mod_wiki page viewed event. | |
| file | pagelib.php |
| This file contains several classes uses to render the diferent pages of the wiki module. | |
| file | parser.php |
| Library of functions and constants for module wiki. | |
| file | provider.php |
| Data provider. | |
| file | renderer.php |
| Moodle Wiki 2.0 Renderer. | |
| file | restore_wiki_activity_task.class.php |
| @subpackage backup-moodle2 | |
| file | restore_wiki_stepslib.php |
| @subpackage backup-moodle2 | |
| file | services.php |
| Wiki external functions and service definitions. | |
| file | social_breadth.php |
| Social breadth indicator - wiki. | |
| file | tag.php |
| Tag areas in component mod_wiki. | |
| file | upgrade.php |
| This file keeps track of upgrades to the wiki module. | |
| file | version.php |
| Code fragment to define the version of wiki This fragment is called by moodle_needs_upgrading() and /admin/index.php. | |
| file | wikieditor.php |
| This file contains all necessary code to define a wiki editor. | |
| file | wikifiletable.php |
| This file contains all necessary code to define a wiki file table form element. | |
Namespaces | |
| namespace | mod_wiki\analytics\indicator |
| | |
| namespace | mod_wiki\event |
| | |
| namespace | mod_wiki\privacy |
| | |
| namespace | mod_wiki\search |
| | |
Classes | |
| class | backup_wiki_activity_structure_step |
| Define all the backup steps that will be used by the backup_wiki_activity_task. More... | |
| class | backup_wiki_activity_task |
| Provides all the settings and steps to perform one complete backup of the activity. More... | |
| class | creole_parser |
| class | generic_parser |
| class | html_parser |
| class | mod_wiki\analytics\indicator\activity_base |
| Activity base class. More... | |
| class | mod_wiki\analytics\indicator\cognitive_depth |
| Cognitive depth indicator - wiki. More... | |
| class | mod_wiki\analytics\indicator\social_breadth |
| Social breadth indicator - wiki. More... | |
| class | mod_wiki\event\comment_created |
| The mod_wiki comment created event class. More... | |
| class | mod_wiki\event\comment_deleted |
| The mod_wiki comment deleted event class. More... | |
| class | mod_wiki\event\comments_viewed |
| The mod_wiki comments viewed event class. More... | |
| class | mod_wiki\event\course_module_instance_list_viewed |
| The mod_wiki instance list viewed event class. More... | |
| class | mod_wiki\event\course_module_viewed |
| The mod_wiki course module viewed event class. More... | |
| class | mod_wiki\event\page_created |
| The mod_wiki page created event class. More... | |
| class | mod_wiki\event\page_deleted |
| class | mod_wiki\event\page_diff_viewed |
| class | mod_wiki\event\page_history_viewed |
| The mod_wiki history viewed event class. More... | |
| class | mod_wiki\event\page_locks_deleted |
| class | mod_wiki\event\page_map_viewed |
| class | mod_wiki\event\page_updated |
| class | mod_wiki\event\page_version_deleted |
| class | mod_wiki\event\page_version_restored |
| class | mod_wiki\event\page_version_viewed |
| class | mod_wiki\event\page_viewed |
| class | mod_wiki\privacy\provider |
| Data provider class. More... | |
| class | mod_wiki\search\activity |
| Search area for mod_wiki activities. More... | |
| class | mod_wiki\search\collaborative_page |
| Search area for mod_wiki collaborative pages. More... | |
| class | mod_wiki_create_form |
| class | mod_wiki_edit_form |
| class | mod_wiki_external |
| class | mod_wiki_filesedit_form |
| class | mod_wiki_generator |
| class | mod_wiki_mod_form |
| class | mod_wiki_renderer |
| class | moodle1_mod_wiki_handler |
| Wiki conversion handler. More... | |
| class | MoodleQuickForm_wikieditor |
| class | MoodleQuickForm_wikifiletable |
| class | nwiki_parser |
| class | page_wiki |
| Class page_wiki contains the common code between all pages. More... | |
| class | page_wiki_admin |
| This class will let user to delete wiki pages and page versions. More... | |
| class | page_wiki_comments |
| Class that models the behavior of wiki's view comments page. More... | |
| class | page_wiki_confirmrestore |
| class | page_wiki_create |
| Class that models the behavior of wiki's create page. More... | |
| class | page_wiki_deletecomment |
| Class that models the behavior of wiki's delete comment confirmation page. More... | |
| class | page_wiki_diff |
| Class that models the behavior of wiki's view differences. More... | |
| class | page_wiki_edit |
| Wiki page editing page. More... | |
| class | page_wiki_editcomment |
| Class that models the behavior of wiki's edit comment. More... | |
| class | page_wiki_handlecomments |
| class | page_wiki_history |
| Class that models the behavior of wiki's history page. More... | |
| class | page_wiki_lock |
| class | page_wiki_map |
| Class that models the behavior of wiki's map page. More... | |
| class | page_wiki_overridelocks |
| class | page_wiki_prettyview |
| class | page_wiki_preview |
| class | page_wiki_restoreversion |
| Class that models the behavior of wiki's restore version page. More... | |
| class | page_wiki_save |
| Class that models the behavior of wiki's save page. More... | |
| class | page_wiki_search |
| Wiki page search page. More... | |
| class | page_wiki_view |
| View a wiki page. More... | |
| class | page_wiki_viewversion |
| Class that models the behavior of wiki's view an old version of a page. More... | |
| class | parser_utils |
| class | restore_wiki_activity_structure_step |
| Define all the restore steps that will be used by the restore_wiki_activity_task. More... | |
| class | restore_wiki_activity_task |
| wiki restore task that provides all the settings and steps to perform one complete restore of the activity More... | |
| class | wiki_files_tree |
| class | wiki_parser_proxy |
| Generic parser implementation. More... | |
Functions | |
| after_parsing () | |
| before_parsing () | |
| Before and after parsing... | |
| format_image ($src, $alt, $caption="", $align='left') | |
| format_link ($text) | |
| Format links. | |
| generate_header ($text, $level) | |
| Header generation. | |
| generate_list ($listitems) | |
| List generation function from an array of array(level, text) | |
| generate_table ($table) | |
| Table generation functions. | |
| get_repeated_sections (&$text, $repeated=array()) | |
| get_repeated_sections_callback ($match) | |
| get_section ($header, $text, $clean=false) | |
| Section editing. | |
| line_break_block_rule ($match) | |
| Generic block rules. | |
| link ($link, $anchor="") | |
| Link internal callback. | |
| list_block_rule ($match) | |
| mod_wiki_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_wiki_get_fontawesome_icon_map () | |
| Get icon mapping for font-awesome. | |
| mod_wiki_get_tagged_pages ($tag, $exclusivemode=false, $fromctx=0, $ctx=0, $rec=1, $page=0) | |
| Returns wiki pages tagged with a specified tag. More... | |
| nowiki_block_rule ($match) | |
| nowiki_tag_rule ($match) | |
| Generic tag rules. | |
| process_toc () | |
| Table of contents processing after parsing. | |
| real_path ($url) | |
| set_options ($options) | |
| Set options. | |
| wiki_add_comment ($context, $pageid, $content, $editor) | |
| Add comments ro database. More... | |
| wiki_add_instance ($wiki) | |
| Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance. More... | |
| wiki_add_progress ($pageid, $oldversionid, $versionid, $progress) | |
| wiki_add_subwiki ($wikiid, $groupid, $userid=0) | |
| Add a new sub wiki instance. More... | |
| wiki_build_tree ($page, $node, &$keys) | |
| Generate wiki's page tree. More... | |
| wiki_can_create_pages ($context, $user=null) | |
| Check if the user can create pages in a certain wiki. More... | |
| wiki_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... | |
| wiki_cm_info_dynamic (cm_info $cm) | |
| Sets dynamic information about a course module. More... | |
| wiki_comment_permissions ($comment_param) | |
| wiki_comment_validate ($comment_param) | |
| wiki_count_wiki_page_versions ($pageid) | |
| Count the number of page version. More... | |
| wiki_create_page ($swid, $title, $format, $userid) | |
| Create a new wiki page, if the page exists, return existing pageid. More... | |
| wiki_delete_comment ($idcomment, $context, $pageid) | |
| Delete comments from database. More... | |
| wiki_delete_comments_wiki () | |
| Delete al comments from wiki. | |
| wiki_delete_instance ($id) | |
| Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. More... | |
| mixed | wiki_delete_links ($linkid=null, $topageid=null, $frompageid=null, $subwikiid=null) |
| Deletes wiki_links. More... | |
| wiki_delete_locks ($pageid, $userid=null, $section=null, $delete_from_db=true, $delete_section_and_page=false) | |
| Deletes wiki_locks that are not in use. More... | |
| wiki_delete_old_locks () | |
| Deletes wiki_locks that expired 1 hour ago. | |
| wiki_delete_page_versions ($deleteversions, $context=null) | |
| Delete specificed versions of a page or versions created by users if version is 0 then it will remove all versions of the page. More... | |
| wiki_delete_pages ($context, $pageids=null, $subwikiid=null) | |
| Delete pages and all related data. More... | |
| wiki_delete_synonym ($subwikiid, $pageid=null) | |
| Delete wiki synonyms related to subwikiid or page. More... | |
| wiki_extend_navigation (navigation_node $navref, $course, $module, $cm) | |
| wiki_get_comment ($commentid) | |
| wiki_get_comments ($contextid, $pageid) | |
| Returns all comments by context and pageid. More... | |
| wiki_get_contributions ($swid, $userid) | |
| Get pages which user have been edited. More... | |
| wiki_get_current_version ($pageid) | |
| Get latest version of wiki page. More... | |
| wiki_get_extra_capabilities () | |
| Returns all other caps used in wiki module. More... | |
| wiki_get_first_page ($subwikid, $module=null) | |
| Get first page of wiki instace. More... | |
| wiki_get_formats () | |
| Text format supported by wiki module. | |
| wiki_get_last_version ($pageid) | |
| Alias of wiki_get_current_version @TODO, does the exactly same thing as wiki_get_current_version, should be removed. More... | |
| wiki_get_linked_from_pages ($pageid) | |
| Get linked from page. More... | |
| wiki_get_linked_pages ($pageid) | |
| Get linked pages from page. More... | |
| wiki_get_linked_to_pages ($pageid) | |
| Get linked from page. More... | |
| wiki_get_missing_or_empty_pages ($swid) | |
| Get missing or empty pages in wiki. More... | |
| object | wiki_get_orphaned_pages ($swid) |
| Return a list of orphaned wikis for one specific subwiki. More... | |
| wiki_get_page ($pageid) | |
| Get a wiki page by pageid. More... | |
| wiki_get_page_by_title ($swid, $title) | |
| Get a wiki page by page title. More... | |
| wiki_get_page_list ($swid, $sort='title ASC') | |
| Get pages list in wiki. More... | |
| wiki_get_possible_subwiki_by_group ($wikiid, $groupid, $userid=0) | |
| Get a sub wiki instance by wiki id, group id and user id. More... | |
| wiki_get_section_page ($page, $section) | |
| Get page section. More... | |
| wiki_get_subwiki ($subwikiid) | |
| Get a sub wiki instace by instance id. More... | |
| wiki_get_subwiki_by_group ($wikiid, $groupid, $userid=0) | |
| Get a sub wiki instance by wiki id and group id. More... | |
| wiki_get_subwiki_by_group_and_user_with_validation ($wiki, $groupid, $userid) | |
| Utility function for getting a subwiki by group and user, validating that the user can view it. More... | |
| wiki_get_subwikis ($wikiid) | |
| Get sub wiki instances with same wiki id. More... | |
| wiki_get_updated_pages_by_subwiki ($swid) | |
| Get updated pages from wiki. More... | |
| wiki_get_user_info ($userid) | |
| Get user data. | |
| wiki_get_version ($versionid) | |
| Get a version record by record id. More... | |
| wiki_get_visible_subwikis ($wiki, $cm=null, $context=null) | |
| Get all the possible subwikis visible to the user in a wiki. More... | |
| wiki_get_wiki ($wikiid) | |
| Get a wiki instance. More... | |
| wiki_get_wiki_from_pageid ($pageid) | |
| Get a wiki instance by pageid. More... | |
| wiki_get_wiki_page_id ($pageid, $id) | |
| wiki_get_wiki_page_version ($pageid, $version) | |
| Get a specific version of page. More... | |
| wiki_get_wiki_page_versions ($pageid, $limitfrom, $limitnum) | |
| Get version list. More... | |
| wiki_grades ($wikiid) | |
| Must return an array of grades for a given instance of this module, indexed by user. More... | |
| wiki_increment_pageviews ($page) | |
| Increase page view nubmer. More... | |
| wiki_is_page_section_locked ($pageid, $userid, $section=null) | |
| Checks if a page-section is locked. More... | |
| wiki_make_cache_expire ($pagename) | |
| wiki_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
| Return a list of page types. More... | |
| wiki_page_view ($wiki, $page, $course, $cm, $context, $uid=null, $other=null, $subwiki=null) | |
| Mark the activity completed (if required) and trigger the page_viewed event. More... | |
| wiki_parse_content ($markup, $pagecontent, $options=array()) | |
| Parses a string with the wiki markup language in $markup. More... | |
| wiki_parser_get_token ($markup, $name) | |
| Returns the token used by a wiki language to represent a given tag or "object" (bold -> **) More... | |
| wiki_parser_link ($link, $options=null) | |
| This function is the parser callback to parse wiki links. More... | |
| wiki_parser_real_path ($url, $context, $component, $filearea, $swid) | |
| Returns an absolute path link, unless there is no such link. More... | |
| wiki_parser_table ($table) | |
| Returns the table fully parsed (HTML) More... | |
| wiki_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
| wiki_print_edit_form_default_fields ($format, $pageid, $version=-1, $upload=false, $deleteuploads=array()) | |
| Prints default edit form fields and buttons. More... | |
| wiki_print_page_content ($page, $context, $subwikiid) | |
| $CFG | wiki_print_recent_activity ($course, $viewfullnames, $timestart) |
| Given a course and a time, this module should find recent activity that has occurred in wiki activities and print it out. More... | |
| wiki_print_upload_table ($context, $filearea, $fileitemid, $deleteuploads=array()) | |
| Prints a table with the files attached to a wiki page. More... | |
| wiki_refresh_cachedcontent ($page, $newcontent=null) | |
| wiki_refresh_page_links ($page, $links) | |
| wiki_reset_course_form_definition (&$mform) | |
| wiki_reset_userdata ($data) | |
| Implements callback to reset course. More... | |
| wiki_restore_page ($wikipage, $version, $context) | |
| Restore a page with specified version. More... | |
| wiki_save_page ($wikipage, $newcontent, $userid) | |
| Save page content. More... | |
| wiki_save_section ($wikipage, $sectiontitle, $sectioncontent, $userid) | |
| wiki_scale_used () | |
| wiki_scale_used_anywhere ($scaleid) | |
| Checks if scale is being used by any instance of wiki. More... | |
| wiki_search_all ($swid, $search) | |
| Search wiki title and content. More... | |
| wiki_search_content ($swid, $search) | |
| Search wiki content. More... | |
| wiki_search_form ($cm, $search='', $subwiki=null) | |
| wiki_search_title ($swid, $search) | |
| Search wiki title. More... | |
| wiki_set_lock ($pageid, $userid, $section=null, $insert=false) | |
| Inserts or updates a wiki_locks record. | |
| wiki_supports ($feature) | |
| Indicates API features that the wiki supports. More... | |
| wiki_trim_string ($text, $limit=25) | |
| This function trims any given text and returns it with some dots at the end. More... | |
| wiki_update_instance ($wiki) | |
| Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data. More... | |
| wiki_user_can_edit ($subwiki) | |
| Checks if current user can edit a subwiki. More... | |
| wiki_user_can_view ($subwiki, $wiki=null) | |
| Checks if current user can view a subwiki. More... | |
| wiki_view ($wiki, $course, $cm, $context) | |
| Mark the activity completed (if required) and trigger the course_module_viewed event. More... | |
| xmldb_wiki_upgrade ($oldversion) | |
Variables | |
| $capabilities | |
| *author Jordi Piguillem *author Kenneth Riba **license | $comesfrom = 'editorview' |
| *author Jordi Piguillem *author Kenneth Riba **license | $content |
| *author Jordi Piguillem *author Kenneth Riba **license | $deleteuploads = array() |
| *author Jordi Piguillem *author Kenneth Riba **license | $editor |
| $functions | |
| $maxheaderdepth = 3 | |
| $plugin = 2020060900 | |
| $printable = false | |
| $repeated_sections | |
| *author Jordi Piguillem *author Kenneth Riba **license | $section = null |
| $section_editing = true | |
| $tagareas | |
| $toc = array() | |
| *author Jordi Piguillem *author Kenneth Riba **license | $upload = false |
| *author Jordi Piguillem *author Kenneth Riba **license | $version = -1 |
| $wiki_page_id | |
| $plugin | component = 'mod_wiki' |
| const | EQUAL '=' |
| const | FORMAT_CREOLE '37' |
| const | FORMAT_NWIKI '38' |
| *author Jordi Piguillem *author Kenneth Riba **license | http |
| **author Josep Arús **license | http |
| **author Josep Arús **license | http |
| **author Josep Arús **license | http |
| **author Josep Arús **license | http |
| **author Josep Arús **license | http |
| if (!defined( 'MOODLE_INTERNAL')) | |
| if (!defined( 'MOODLE_INTERNAL')) | |
| const | IMPROVEMENT '+' |
| const | LOCK_TIMEOUT 30 |
| const | NO_VALID_RATE '-999' |
| $plugin | version = 2020061500 |
| const | WIKI_REFRESH_CACHE_TIME 30 |
| const | WORST '-' |
| mod_wiki_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_wiki_get_tagged_pages | ( | $tag, | |
$exclusivemode = false, |
|||
$fromctx = 0, |
|||
$ctx = 0, |
|||
$rec = 1, |
|||
$page = 0 |
|||
| ) |
Returns wiki pages tagged with a specified tag.
This is a callback used by the tag area mod_wiki/wiki_pages to search for wiki pages 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 |
| wiki_add_comment | ( | $context, | |
| $pageid, | |||
| $content, | |||
| $editor | |||
| ) |
Add comments ro database.
| object | $context,. | Current context |
| int | $pageid,. | Current pageid |
| string | $content,. | Content of the comment |
| string | editor. Version of editor we are using. |
| wiki_add_instance | ( | $wiki | ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will create a new instance and return the id number of the new instance.
| object | $instance | An object from the form in mod.html |
| int | The id of the newly inserted wiki record |
| wiki_add_subwiki | ( | $wikiid, | |
| $groupid, | |||
$userid = 0 |
|||
| ) |
Add a new sub wiki instance.
| int | $wikiid | |
| int | $groupid |
| int::$insertid |
| wiki_build_tree | ( | $page, | |
| $node, | |||
| & | $keys | ||
| ) |
Generate wiki's page tree.
| page_wiki | $page,. | A wiki page object |
| navigation_node | $node,. | Starting navigation_node |
| array | $keys,. | An array to store keys |
| an | array with all tree nodes |
| wiki_can_create_pages | ( | $context, | |
$user = null |
|||
| ) |
Check if the user can create pages in a certain wiki.
| context | $context | Wiki's context. |
| integer | stdClass | $user | A user id or object. By default (null) checks the permissions of the current user. |
| bool | True if user can create pages, false otherwise. |
| wiki_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 |
| wiki_cm_info_dynamic | ( | cm_info | $cm | ) |
Sets dynamic information about a course module.
This callback is called from cm_info when checking module availability (incl. $cm->uservisible)
Main viewing capability in mod_wiki is 'mod/wiki:viewpage' instead of the expected standardised 'mod/wiki:view'. The method cm_info::is_user_access_restricted_by_capability() does not work for wiki, we need to implement this callback.
| cm_info | $cm |
| wiki_count_wiki_page_versions | ( | $pageid | ) |
Count the number of page version.
| int | $pageid |
| wiki_create_page | ( | $swid, | |
| $title, | |||
| $format, | |||
| $userid | |||
| ) |
Create a new wiki page, if the page exists, return existing pageid.
| int | $swid | |
| string | $title | |
| string | $format | |
| int | $userid |
| wiki_delete_comment | ( | $idcomment, | |
| $context, | |||
| $pageid | |||
| ) |
Delete comments from database.
| $idcomment. | Id of comment which will be deleted |
| $context. | Current context |
| $pageid. | Current pageid |
| wiki_delete_instance | ( | $id | ) |
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
| int | $id | Id of the module instance |
| boolean | Success/Failure |
| mixed wiki_delete_links | ( | $linkid = null, |
|
$topageid = null, |
|||
$frompageid = null, |
|||
$subwikiid = null |
|||
| ) |
Deletes wiki_links.
It can be sepecific link or links attached in subwiki
$DB database object
| int | $linkid | id of the link to be deleted |
| int | $topageid | links to the specific page |
| int | $frompageid | links from specific page |
| int | $subwikiid | links to subwiki |
| wiki_delete_locks | ( | $pageid, | |
$userid = null, |
|||
$section = null, |
|||
$delete_from_db = true, |
|||
$delete_section_and_page = false |
|||
| ) |
Deletes wiki_locks that are not in use.
(F.Ex. after submitting the changes). If no userid is present, it deletes ALL the wiki_locks of a specific page.
| int | $pageid | page id. |
| int | $userid | id of user for which lock is deleted. |
| string | $section | section to be deleted. |
| bool | $delete_from_db | deleted from db. |
| bool | $delete_section_and_page | delete section and page version. |
| wiki_delete_page_versions | ( | $deleteversions, | |
$context = null |
|||
| ) |
Delete specificed versions of a page or versions created by users if version is 0 then it will remove all versions of the page.
| array | $deleteversions | delete versions for a page |
| context_module | $context | module context |
| wiki_delete_pages | ( | $context, | |
$pageids = null, |
|||
$subwikiid = null |
|||
| ) |
Delete pages and all related data.
| mixed | $context | context in which page needs to be deleted. |
| mixed | $pageids | id's of pages to be deleted |
| int | $subwikiid | id of the subwiki for which all pages should be deleted |
| wiki_delete_synonym | ( | $subwikiid, | |
$pageid = null |
|||
| ) |
Delete wiki synonyms related to subwikiid or page.
| int | $subwikiid | id of sunbwiki |
| int | $pageid | id of page |
| wiki_get_comments | ( | $contextid, | |
| $pageid | |||
| ) |
Returns all comments by context and pageid.
| int | $contextid | Current context id |
| int | $pageid | Current pageid |
| wiki_get_contributions | ( | $swid, | |
| $userid | |||
| ) |
Get pages which user have been edited.
| int | $swid | |
| int | $userid |
| wiki_get_current_version | ( | $pageid | ) |
Get latest version of wiki page.
| int | $pageid |
| object |
| wiki_get_extra_capabilities | ( | ) |
Returns all other caps used in wiki module.
| array |
| wiki_get_first_page | ( | $subwikid, | |
$module = null |
|||
| ) |
Get first page of wiki instace.
| int | $subwikiid | |
| int | $module,wiki | instance object |
| wiki_get_last_version | ( | $pageid | ) |
Alias of wiki_get_current_version @TODO, does the exactly same thing as wiki_get_current_version, should be removed.
| int | $pageid |
| object |
| wiki_get_linked_from_pages | ( | $pageid | ) |
Get linked from page.
| int | $pageid |
| wiki_get_linked_pages | ( | $pageid | ) |
Get linked pages from page.
| int | $pageid |
| wiki_get_linked_to_pages | ( | $pageid | ) |
Get linked from page.
| int | $pageid |
| wiki_get_missing_or_empty_pages | ( | $swid | ) |
Get missing or empty pages in wiki.
| int | $swid | sub wiki id |
| object wiki_get_orphaned_pages | ( | $swid | ) |
Return a list of orphaned wikis for one specific subwiki.
| int | $swid | sub wiki id |
| wiki_get_page | ( | $pageid | ) |
Get a wiki page by pageid.
| int | $pageid |
| object |
| wiki_get_page_by_title | ( | $swid, | |
| $title | |||
| ) |
Get a wiki page by page title.
| int | $swid,sub | wiki id |
| string | $title |
| object |
| wiki_get_page_list | ( | $swid, | |
$sort = 'title ASC' |
|||
| ) |
Get pages list in wiki.
| int | $swid | sub wiki id |
| string | $sort | How to sort the pages. By default, title ASC. |
| wiki_get_possible_subwiki_by_group | ( | $wikiid, | |
| $groupid, | |||
$userid = 0 |
|||
| ) |
Get a sub wiki instance by wiki id, group id and user id.
If the wiki doesn't exist in DB it will return an isntance with id -1.
| int | $wikiid | Wiki ID. |
| int | $groupid | Group ID. |
| int | $userid | User ID. |
| object | Subwiki instance. |
| wiki_get_section_page | ( | $page, | |
| $section | |||
| ) |
Get page section.
| int | $pageid | |
| string | $section |
| wiki_get_subwiki | ( | $subwikiid | ) |
Get a sub wiki instace by instance id.
| int | $subwikiid |
| object |
| wiki_get_subwiki_by_group | ( | $wikiid, | |
| $groupid, | |||
$userid = 0 |
|||
| ) |
Get a sub wiki instance by wiki id and group id.
| int | $wikiid | |
| int | $groupid |
| object |
| wiki_get_subwiki_by_group_and_user_with_validation | ( | $wiki, | |
| $groupid, | |||
| $userid | |||
| ) |
Utility function for getting a subwiki by group and user, validating that the user can view it.
If the subwiki doesn't exists in DB yet it'll have id -1.
| stdClass | $wiki | The wiki. |
| int | $groupid | Group ID. 0 means the subwiki doesn't use groups. |
| int | $userid | User ID. 0 means the subwiki doesn't use users. |
| stdClass | Subwiki. If it doesn't exists in DB yet it'll have id -1. If the user can't view the subwiki this function will return false. |
| moodle_exception |
| wiki_get_subwikis | ( | $wikiid | ) |
Get sub wiki instances with same wiki id.
| int | $wikiid |
| wiki_get_updated_pages_by_subwiki | ( | $swid | ) |
Get updated pages from wiki.
| int | $pageid |
| wiki_get_version | ( | $versionid | ) |
Get a version record by record id.
| int | $versionid,the | version id |
| object |
| wiki_get_visible_subwikis | ( | $wiki, | |
$cm = null, |
|||
$context = null |
|||
| ) |
Get all the possible subwikis visible to the user in a wiki.
It will return all the subwikis that can be created in a wiki, even if they don't exist in DB yet.
| stdClass | $wiki | Wiki to get the subwikis from. |
| cm_info | stdClass | $cm | Optional. The course module object. |
| context_module | $context | Optional. Context of wiki module. |
| array | List of subwikis. |
| wiki_get_wiki | ( | $wikiid | ) |
Get a wiki instance.
| int | $wikiid | the instance id of wiki |
| wiki_get_wiki_from_pageid | ( | $pageid | ) |
Get a wiki instance by pageid.
| int | $pageid |
| object |
| wiki_get_wiki_page_version | ( | $pageid, | |
| $version | |||
| ) |
Get a specific version of page.
| int | $pageid | |
| int | $version |
| wiki_get_wiki_page_versions | ( | $pageid, | |
| $limitfrom, | |||
| $limitnum | |||
| ) |
Get version list.
| int | $pageid | |
| int | $limitfrom | |
| int | $limitnum |
| wiki_grades | ( | $wikiid | ) |
Must return an array of grades for a given instance of this module, indexed by user.
It also returns a maximum allowed grade.
Example: $return->grades = array of grades; $return->maxgrade = maximum allowed grade;
return $return;
| int | $wikiid | ID of an instance of this module |
| mixed | Null or object with an array of grades and with the maximum grade |
| wiki_increment_pageviews | ( | $page | ) |
Increase page view nubmer.
| int | $page,database | record |
| wiki_is_page_section_locked | ( | $pageid, | |
| $userid, | |||
$section = null |
|||
| ) |
Checks if a page-section is locked.
| true | if the combination of section and page is locked, FALSE otherwise. |
| wiki_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 |
| wiki_page_view | ( | $wiki, | |
| $page, | |||
| $course, | |||
| $cm, | |||
| $context, | |||
$uid = null, |
|||
$other = null, |
|||
$subwiki = null |
|||
| ) |
Mark the activity completed (if required) and trigger the page_viewed event.
| stdClass | $wiki | Wiki object. |
| stdClass | $page | Page object. |
| stdClass | $course | Course object. |
| stdClass | $cm | Course module object. |
| stdClass | $context | Context object. |
| int | $uid | Optional User ID. |
| array | $other | Optional Other params: title, wiki ID, group ID, groupanduser, prettyview. |
| stdClass | $subwiki | Optional Subwiki. |
| wiki_parse_content | ( | $markup, | |
| $pagecontent, | |||
$options = array() |
|||
| ) |
Parses a string with the wiki markup language in $markup.
| Array | or false when something wrong has happened. |
Returned array contains the following fields: 'parsed_text' => String. Contains the parsed wiki content. 'unparsed_text' => String. Constains the original wiki content. 'link_count' => Array of array('destination' => ..., 'new' => "is new?"). Contains the internal wiki links found in the wiki content. 'deleted_sections' => the list of deleted sections. '' =>
| wiki_parser_get_token | ( | $markup, | |
| $name | |||
| ) |
Returns the token used by a wiki language to represent a given tag or "object" (bold -> **)
| A | string when it has only one token at the beginning (f. ex. lists). An array composed by 2 strings when it has 2 tokens, one at the beginning and one at the end (f. ex. italics). Returns false otherwise. |
| wiki_parser_link | ( | $link, | |
$options = null |
|||
| ) |
This function is the parser callback to parse wiki links.
It returns the necesary information to print a link.
NOTE: Empty pages and non-existent pages must be print in red color.
!!!!!! IMPORTANT !!!!!! It is critical that you call format_string on the content before it is used.
| string | page_wiki | $link | name of a page |
| array | $options |
| array | Array('content' => string, 'url' => string, 'new' => bool, 'link_info' => array) |
@TODO Doc return and options
| wiki_parser_real_path | ( | $url, | |
| $context, | |||
| $component, | |||
| $filearea, | |||
| $swid | |||
| ) |
Returns an absolute path link, unless there is no such link.
| string | $url | Link's URL or filename |
| stdClass | $context | filearea params |
| string | $component | The component the file is associated with |
| string | $filearea | The filearea the file is stored in |
| int | $swid | Sub wiki id |
| string | URL for files full path |
| wiki_parser_table | ( | $table | ) |
Returns the table fully parsed (HTML)
| HTML | for the table $table |
| wiki_print_edit_form_default_fields | ( | $format, | |
| $pageid, | |||
$version = -1, |
|||
$upload = false, |
|||
$deleteuploads = array() |
|||
| ) |
Prints default edit form fields and buttons.
| string | $format | Edit form format (html, creole...) |
| integer | $version | Version number. A negative number means no versioning. |
| $CFG wiki_print_recent_activity | ( | $course, | |
| $viewfullnames, | |||
| $timestart | |||
| ) |
Given a course and a time, this module should find recent activity that has occurred in wiki activities and print it out.
Return true if there was output, or false is there was none.
@global $DB @uses CONTEXT_MODULE @uses VISIBLEGROUPS
| object | $course | |
| bool | $viewfullnames | capability |
| int | $timestart |
| boolean |
| wiki_print_upload_table | ( | $context, | |
| $filearea, | |||
| $fileitemid, | |||
$deleteuploads = array() |
|||
| ) |
Prints a table with the files attached to a wiki page.
| object | $context | |
| string | $filearea | |
| int | $fileitemid | |
| array | deleteuploads |
| wiki_reset_userdata | ( | $data | ) |
Implements callback to reset course.
| stdClass | $data |
| boolean|array |
| wiki_restore_page | ( | $wikipage, | |
| $version, | |||
| $context | |||
| ) |
Restore a page with specified version.
| stdClass | $wikipage | wiki page record |
| stdClass | $version | wiki page version to restore |
| context_module | $context | context of wiki module |
| stdClass | restored page |
| wiki_save_page | ( | $wikipage, | |
| $newcontent, | |||
| $userid | |||
| ) |
Save page content.
| object | $wikipage | |
| string | $newcontent | |
| int | $userid |
| wiki_scale_used | ( | ) |
| wiki_scale_used_anywhere | ( | $scaleid | ) |
Checks if scale is being used by any instance of wiki.
This function was added in 1.9
This is used to find out if scale used anywhere
| $scaleid | int |
| boolean | True if the scale is used by any wiki |
| wiki_search_all | ( | $swid, | |
| $search | |||
| ) |
Search wiki title and content.
| int | $swid | sub wiki id |
| string | $search |
| wiki_search_content | ( | $swid, | |
| $search | |||
| ) |
Search wiki content.
| int | $swid | sub wiki id |
| string | $search |
| wiki_search_title | ( | $swid, | |
| $search | |||
| ) |
Search wiki title.
| int | $swid | sub wiki id |
| string | $search |
| wiki_supports | ( | $feature | ) |
Indicates API features that the wiki supports.
@uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_COMPLETION_HAS_RULES @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES
| string | $feature |
| mixed | True if yes (some features may use other values) |
| wiki_trim_string | ( | $text, | |
$limit = 25 |
|||
| ) |
This function trims any given text and returns it with some dots at the end.
| string | $text | |
| string | $limit |
| string |
| wiki_update_instance | ( | $wiki | ) |
Given an object containing all the necessary data, (defined by the form in mod.html) this function will update an existing instance with new data.
| object | $instance | An object from the form in mod.html |
| boolean | Success/Fail |
| wiki_user_can_edit | ( | $subwiki | ) |
Checks if current user can edit a subwiki.
| $subwiki |
| wiki_user_can_view | ( | $subwiki, | |
$wiki = null |
|||
| ) |
Checks if current user can view a subwiki.
| stdClass | $subwiki | usually record from {wiki_subwikis}. Must contain fields 'wikiid', 'groupid', 'userid'. If it also contains fields 'course' and 'groupmode' from table {wiki} it will save extra DB query. |
| stdClass | $wiki | optional wiki object if known |
| bool |
| wiki_view | ( | $wiki, | |
| $course, | |||
| $cm, | |||
| $context | |||
| ) |
Mark the activity completed (if required) and trigger the course_module_viewed event.
| stdClass | $wiki | Wiki object. |
| stdClass | $course | Course object. |
| stdClass | $cm | Course module object. |
| stdClass | $context | Context object. |
| $tagareas |