Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Namespaces | |
namespace | mod_wiki\analytics\indicator |
| |
namespace | mod_wiki\event |
| |
namespace | mod_wiki\output |
| |
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 | behat_mod_wiki |
Steps definitions related to mod_wiki. 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_updated |
class | mod_wiki\event\page_version_restored |
class | mod_wiki\event\page_version_viewed |
class | mod_wiki\event\page_viewed |
class | mod_wiki\output\action_bar |
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 |
Wiki module external functions. More... | |
class | mod_wiki_filesedit_form |
class | mod_wiki_generator |
mod_wiki data generator class. More... | |
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. | |
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. | |
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. | |
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. | |
wiki_add_progress ($pageid, $oldversionid, $versionid, $progress) | |
wiki_add_subwiki ($wikiid, $groupid, $userid=0) | |
Add a new sub wiki instance. | |
wiki_build_tree ($page, $node, &$keys) | |
Generate wiki's page tree. | |
wiki_can_create_pages ($context, $user=null) | |
Check if the user can create pages in a certain wiki. | |
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. | |
wiki_cm_info_dynamic (cm_info $cm) | |
Sets dynamic information about a course module. | |
wiki_comment_permissions ($comment_param) | |
Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions. | |
wiki_comment_validate ($comment_param) | |
Validate comment parameter before perform other comments actions. | |
wiki_count_wiki_page_versions ($pageid) | |
Count the number of page version. | |
wiki_create_page ($swid, $title, $format, $userid) | |
Create a new wiki page, if the page exists, return existing pageid. | |
wiki_delete_comment ($idcomment, $context, $pageid) | |
Delete comments from database. | |
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. | |
mixed | wiki_delete_links ($linkid=null, $topageid=null, $frompageid=null, $subwikiid=null) |
Deletes wiki_links. | |
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. | |
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. | |
wiki_delete_pages ($context, $pageids=null, $subwikiid=null) | |
Delete pages and all related data. | |
wiki_delete_synonym ($subwikiid, $pageid=null) | |
Delete wiki synonyms related to subwikiid or page. | |
wiki_extend_navigation (navigation_node $navref, stdClass $course, stdClass $instance, cm_info $cm) | |
Extends the global navigation tree by adding wiki nodes if there is a relevant content. | |
wiki_get_comment ($commentid) | |
wiki_get_comments ($contextid, $pageid) | |
Returns all comments by context and pageid. | |
wiki_get_contributions ($swid, $userid) | |
Get pages which user have been edited. | |
wiki_get_current_version ($pageid) | |
Get latest version of wiki page. | |
wiki_get_extra_capabilities () | |
Returns all other caps used in wiki module. | |
wiki_get_first_page ($subwikid, $module=null) | |
Get first page of wiki instace. | |
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. | |
wiki_get_linked_from_pages ($pageid) | |
Get linked from page. | |
wiki_get_linked_pages ($pageid) | |
Get linked pages from page. | |
wiki_get_linked_to_pages ($pageid) | |
Get linked from page. | |
wiki_get_missing_or_empty_pages ($swid) | |
Get missing or empty pages in wiki. | |
object | wiki_get_orphaned_pages ($swid) |
Return a list of orphaned wikis for one specific subwiki. | |
wiki_get_page ($pageid) | |
Get a wiki page by pageid. | |
wiki_get_page_by_title ($swid, $title) | |
Get a wiki page by page title. | |
wiki_get_page_list ($swid, $sort='title ASC') | |
Get pages list in wiki. | |
wiki_get_possible_subwiki_by_group ($wikiid, $groupid, $userid=0) | |
Get a sub wiki instance by wiki id, group id and user id. | |
wiki_get_section_page ($page, $section) | |
Get page section. | |
wiki_get_subwiki ($subwikiid) | |
Get a sub wiki instace by instance id. | |
wiki_get_subwiki_by_group ($wikiid, $groupid, $userid=0) | |
Get a sub wiki instance by wiki id and group id. | |
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. | |
wiki_get_subwikis ($wikiid) | |
Get sub wiki instances with same wiki id. | |
wiki_get_updated_pages_by_subwiki ($swid) | |
Get updated pages from wiki. | |
wiki_get_user_info ($userid) | |
Get user data. | |
wiki_get_version ($versionid) | |
Get a version record by record id. | |
wiki_get_visible_subwikis ($wiki, $cm=null, $context=null) | |
Get all the possible subwikis visible to the user in a wiki. | |
wiki_get_wiki ($wikiid) | |
Get a wiki instance. | |
wiki_get_wiki_from_pageid ($pageid) | |
Get a wiki instance by pageid. | |
wiki_get_wiki_page_id ($pageid, $id) | |
wiki_get_wiki_page_version ($pageid, $version) | |
Get a specific version of page. | |
wiki_get_wiki_page_versions ($pageid, $limitfrom, $limitnum) | |
Get version list. | |
wiki_grades ($wikiid) | |
Must return an array of grades for a given instance of this module, indexed by user. | |
wiki_increment_pageviews ($page) | |
Increase page view nubmer. | |
wiki_is_page_section_locked ($pageid, $userid, $section=null) | |
Checks if a page-section is locked. | |
wiki_make_cache_expire ($pagename) | |
wiki_page_type_list ($pagetype, $parentcontext, $currentcontext) | |
Return a list of page types. | |
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. | |
wiki_parse_content ($markup, $pagecontent, $options=array()) | |
Parses a string with the wiki markup language in $markup. | |
wiki_parser_get_token ($markup, $name) | |
Returns the token used by a wiki language to represent a given tag or "object" (bold -> **) | |
wiki_parser_link ($link, $options=null) | |
This function is the parser callback to parse wiki links. | |
wiki_parser_real_path ($url, $context, $component, $filearea, $swid) | |
Returns an absolute path link, unless there is no such link. | |
wiki_parser_table ($table) | |
Returns the table fully parsed (HTML) | |
wiki_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()) | |
file serving callback | |
wiki_print_edit_form_default_fields ($format, $pageid, $version=-1, $upload=false, $deleteuploads=array()) | |
Prints default edit form fields and buttons. | |
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. | |
wiki_print_upload_table ($context, $filearea, $fileitemid, $deleteuploads=array()) | |
Prints a table with the files attached to a wiki page. | |
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. | |
wiki_restore_page ($wikipage, $version, $context) | |
Restore a page with specified version. | |
wiki_save_page ($wikipage, $newcontent, $userid) | |
Save page content. | |
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. | |
wiki_search_all ($swid, $search) | |
Search wiki title and content. | |
wiki_search_content ($swid, $search) | |
Search wiki content. | |
wiki_search_form ($cm, $search='', $subwiki=null) | |
Search for wiki. | |
wiki_search_title ($swid, $search) | |
Search wiki title. | |
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. | |
wiki_trim_string ($text, $limit=25) | |
This function trims any given text and returns it with some dots at the end. | |
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. | |
wiki_user_can_edit ($subwiki) | |
Checks if current user can edit a subwiki. | |
wiki_user_can_view ($subwiki, $wiki=null) | |
Checks if current user can view a subwiki. | |
wiki_view ($wiki, $course, $cm, $context) | |
Mark the activity completed (if required) and trigger the course_module_viewed event. | |
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 = 2023041800 | |
$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 = 2023042400 |
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_comment_permissions | ( | $comment_param | ) |
Running addtional permission check on plugin, for example, plugins may have switch to turn on/off comments option, this callback will affect UI display, not like pluginname_comment_validate only throw exceptions.
Capability check has been done in comment->check_permissions(), we don't need to do it again here.
stdClass | $comment_param | { context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid } |
array |
wiki_comment_validate | ( | $comment_param | ) |
Validate comment parameter before perform other comments actions.
stdClass | $comment_param | { context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid } |
boolean |
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_extend_navigation | ( | navigation_node | $navref, |
stdClass | $course, | ||
stdClass | $instance, | ||
cm_info | $cm ) |
Extends the global navigation tree by adding wiki 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 | $navref | An object representing the navigation tree node of the workshop module instance |
stdClass | $course | the course object |
stdClass | $instance | the activity record object |
cm_info | $cm | the course module object |
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. |
stdClass[] |
wiki_get_possible_subwiki_by_group | ( | $wikiid, | |
$groupid, | |||
$userid = 0 ) |
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 | stdClass | $link | name of a page or page object. |
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_pluginfile | ( | $course, | |
$cm, | |||
$context, | |||
$filearea, | |||
$args, | |||
$forcedownload, | |||
array | $options = array() ) |
file serving callback
stdClass | $course | course object |
stdClass | $cm | course module object |
stdClass | $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 the file was not found, just send the file otherwise and do not return anything |
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_form | ( | $cm, | |
$search = '', | |||
$subwiki = null ) |
Search for wiki.
stdClass | $cm | course module object |
string | $search | searchword. |
stdClass | $subwiki | Optional Subwiki. |
Search | wiki input form |
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 module supports feature, false if not, null if doesn't know or string for the module purpose. |
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. |
$functions |
$tagareas |