Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Functions | Variables
locallib.php File Reference

This contains functions and classes that will be used by scripts in wiki module. More...

Functions

 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...
 
 wiki_add_comment ($context, $pageid, $content, $editor)
 Add comments ro database. 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_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.
 
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_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_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_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_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_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)
 
 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_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_search_all ($swid, $search)
 Search wiki title and content. More...
 
 wiki_search_content ($swid, $search)
 Search wiki content. More...
 
 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_trim_string ($text, $limit=25)
 This function trims any given text and returns it with some dots at the end. 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...
 

Variables

const EQUAL '='
 
const FORMAT_CREOLE '37'
 
const FORMAT_NWIKI '38'
 
const IMPROVEMENT '+'
 
const LOCK_TIMEOUT 30
 
const NO_VALID_RATE '-999'
 
const WIKI_REFRESH_CACHE_TIME 30
 
const WORST '-'
 

Detailed Description

This contains functions and classes that will be used by scripts in wiki module.

Author
Jordi Piguillem
Marc Alier
David Jimenez
Josep Arus
Daniel Serrano
Kenneth Riba
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later