Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/wiki/locallib.php File Reference

Go to the source code of this file.

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  WIKI_REFRESH_CACHE_TIME
enum  FORMAT_CREOLE
enum  FORMAT_NWIKI
enum  NO_VALID_RATE
enum  IMPROVEMENT
enum  EQUAL
enum  WORST
enum  LOCK_TIMEOUT

Functions

 wiki_get_wiki ($wikiid)
 wiki_get_subwikis ($wikiid)
 wiki_get_subwiki_by_group ($wikiid, $groupid, $userid=0)
 wiki_get_subwiki ($subwikiid)
 wiki_add_subwiki ($wikiid, $groupid, $userid=0)
 wiki_get_wiki_from_pageid ($pageid)
 wiki_get_page ($pageid)
 wiki_get_current_version ($pageid)
 wiki_get_last_version ($pageid)
 wiki_get_section_page ($page, $section)
 wiki_get_page_by_title ($swid, $title)
 wiki_get_version ($versionid)
 wiki_get_first_page ($subwikid, $module=null)
 wiki_save_section ($wikipage, $sectiontitle, $sectioncontent, $userid)
 wiki_save_page ($wikipage, $newcontent, $userid)
 wiki_refresh_cachedcontent ($page, $newcontent=null)
 wiki_restore_page ($wikipage, $newcontent, $userid)
 wiki_refresh_page_links ($page, $links)
 wiki_create_page ($swid, $title, $format, $userid)
 wiki_make_cache_expire ($pagename)
 wiki_get_wiki_page_version ($pageid, $version)
 wiki_get_wiki_page_versions ($pageid, $limitfrom, $limitnum)
 wiki_count_wiki_page_versions ($pageid)
 wiki_get_linked_to_pages ($pageid)
 wiki_get_linked_from_pages ($pageid)
 wiki_get_contributions ($swid, $userid)
 wiki_get_missing_or_empty_pages ($swid)
 wiki_get_page_list ($swid)
 wiki_get_orphaned_pages ($swid)
 wiki_search_title ($swid, $search)
 wiki_search_content ($swid, $search)
 wiki_search_all ($swid, $search)
 wiki_get_user_info ($userid)
 wiki_increment_pageviews ($page)
 wiki_get_formats ()
 wiki_parse_content ($markup, $pagecontent, $options=array())
 wiki_parser_link ($link, $options=null)
 wiki_parser_table ($table)
 wiki_parser_real_path ($url, $context, $component, $filearea, $swid)
 wiki_parser_get_token ($markup, $name)
 wiki_user_can_view ($subwiki)
 wiki_user_can_edit ($subwiki)
 wiki_is_page_section_locked ($pageid, $userid, $section=null)
 wiki_set_lock ($pageid, $userid, $section=null, $insert=false)
 wiki_delete_locks ($pageid, $userid=null, $section=null, $delete_from_db=true, $delete_section_and_page=false)
 wiki_delete_old_locks ()
 wiki_delete_links ($linkid=null, $topageid=null, $frompageid=null, $subwikiid=null)
 wiki_delete_synonym ($subwikiid, $pageid=null)
 wiki_delete_pages ($context, $pageids=null, $subwikiid=null)
 wiki_delete_page_versions ($deleteversions)
 wiki_get_comment ($commentid)
 wiki_get_comments ($contextid, $pageid)
 wiki_add_comment ($context, $pageid, $content, $editor)
 wiki_delete_comment ($idcomment, $context, $pageid)
 wiki_delete_comments_wiki ()
 wiki_add_progress ($pageid, $oldversionid, $versionid, $progress)
 wiki_get_wiki_page_id ($pageid, $id)
 wiki_print_page_content ($page, $context, $subwikiid)
 wiki_trim_string ($text, $limit=25)
 wiki_print_edit_form_default_fields ($format, $pageid, $version=-1, $upload=false, $deleteuploads=array())
 wiki_print_upload_table ($context, $filearea, $fileitemid, $deleteuploads=array())
 wiki_build_tree ($page, $node, &$keys)
 wiki_get_linked_pages ($pageid)
 wiki_get_updated_pages_by_subwiki ($swid)

Enumeration Type Documentation

enum EQUAL

Definition at line 44 of file locallib.php.

Definition at line 40 of file locallib.php.

Definition at line 41 of file locallib.php.

Definition at line 43 of file locallib.php.

Definition at line 47 of file locallib.php.

Definition at line 42 of file locallib.php.

Definition at line 39 of file locallib.php.

enum WORST

Definition at line 45 of file locallib.php.


Function Documentation

wiki_add_comment ( context,
pageid,
content,
editor 
)

Add comments ro database

Parameters:
object$context,.Current context
int$pageid,.Current pageid
string$content,.Content of the comment
stringeditor. Version of editor we are using.

Definition at line 1176 of file locallib.php.

Here is the call graph for this function:

wiki_add_progress ( pageid,
oldversionid,
versionid,
progress 
)

Definition at line 1241 of file locallib.php.

Here is the call graph for this function:

wiki_add_subwiki ( wikiid,
groupid,
userid = 0 
)

Add a new sub wiki instance

Parameters:
int$wikiid
int$groupid
Returns:
int $insertid

Definition at line 96 of file locallib.php.

Here is the caller graph for this function:

wiki_build_tree ( page,
node,
&$  keys 
)

Generate wiki's page tree

Parameters:
$page.A wiki page object
$node.Starting navigation_node
$keys.An array to store keys
Returns:
an array with all tree nodes

Definition at line 1402 of file locallib.php.

Here is the call graph for this function:

Count the number of page version

Parameters:
int$pageid

Definition at line 404 of file locallib.php.

wiki_create_page ( swid,
title,
format,
userid 
)

Create a new wiki page, if the page exists, return existing pageid

Parameters:
int$swid
string$title
string$format
int$userid

Definition at line 322 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_delete_comment ( idcomment,
context,
pageid 
)

Delete comments from database

Parameters:
$idcomment.Id of comment which will be deleted
$context.Current context
$pageid.Current pageid

Definition at line 1207 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Delete al comments from wiki

Definition at line 1228 of file locallib.php.

Here is the call graph for this function:

wiki_delete_links ( linkid = null,
topageid = null,
frompageid = null,
subwikiid = null 
)

Deletes wiki_links. It can be sepecific link or links attached in subwiki

mixed $DB database object

Parameters:
int$linkidid of the link to be deleted
int$topageidlinks to the specific page
int$frompageidlinks from specific page
int$subwikiidlinks to subwiki

Definition at line 1030 of file locallib.php.

Here is the caller graph for this function:

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.

Definition at line 988 of file locallib.php.

Here is the caller graph for this function:

Deletes wiki_locks that expired 1 hour ago.

Definition at line 1015 of file locallib.php.

Here is the caller graph for this function:

wiki_delete_page_versions ( deleteversions)

Delete specificed versions of a page or versions created by users if version is 0 then it will remove all versions of the page

Parameters:
array$deleteversionsdelete versions for a page

delete page-versions

Definition at line 1134 of file locallib.php.

Here is the caller graph for this function:

wiki_delete_pages ( context,
pageids = null,
subwikiid = null 
)

Delete pages and all related data

Parameters:
mixed$contextcontext in which page needs to be deleted.
mixed$pageidsid's of pages to be deleted
int$subwikiidid of the subwiki for which all pages should be deleted

Delete page and all it's relevent data

Definition at line 1078 of file locallib.php.

Here is the call graph for this function:

wiki_delete_synonym ( subwikiid,
pageid = null 
)

Delete wiki synonyms related to subwikiid or page

Parameters:
int$subwikiidid of sunbwiki
int$pageidid of page

Definition at line 1061 of file locallib.php.

Here is the caller graph for this function:

wiki_get_comment ( commentid)

Definition at line 1151 of file locallib.php.

Here is the caller graph for this function:

wiki_get_comments ( contextid,
pageid 
)

Returns all comments by context and pageid

Parameters:
$context.Current context
$pageid.Current pageid

Definition at line 1162 of file locallib.php.

Here is the caller graph for this function:

wiki_get_contributions ( swid,
userid 
)

Get pages which user have been edited

Parameters:
int$swid
int$userid

Definition at line 432 of file locallib.php.

wiki_get_current_version ( pageid)

Get latest version of wiki page

Parameters:
int$pageid
Returns:
object

Definition at line 140 of file locallib.php.

Here is the caller graph for this function:

wiki_get_first_page ( subwikid,
module = null 
)

Get first page of wiki instace

Parameters:
int$subwikiid
int$module,wikiinstance object

Definition at line 199 of file locallib.php.

Text format supported by wiki module

Definition at line 556 of file locallib.php.

Here is the caller graph for this function:

wiki_get_last_version ( pageid)

Alias of wiki_get_current_version , does the exactly same thing as wiki_get_current_version, should be removed

Parameters:
int$pageid
Returns:
object

Definition at line 158 of file locallib.php.

Here is the call graph for this function:

Get linked from page

Parameters:
int$pageid

Definition at line 422 of file locallib.php.

wiki_get_linked_pages ( pageid)

Get linked pages from page

Parameters:
int$pageid

Definition at line 1429 of file locallib.php.

Here is the caller graph for this function:

wiki_get_linked_to_pages ( pageid)

Get linked from page

Parameters:
int$pageid

Definition at line 413 of file locallib.php.

Get missing or empty pages in wiki

Parameters:
int$swidsub wiki id

Definition at line 448 of file locallib.php.

Return a list of orphaned wikis for one specific subwiki object

Parameters:
int$swidsub wiki id

Definition at line 484 of file locallib.php.

Here is the caller graph for this function:

wiki_get_page ( pageid)

Get a wiki page by pageid

Parameters:
int$pageid
Returns:
object

Definition at line 130 of file locallib.php.

wiki_get_page_by_title ( swid,
title 
)

Get a wiki page by page title

Parameters:
int$swid,subwiki id
string$title
Returns:
object

Definition at line 179 of file locallib.php.

Here is the caller graph for this function:

wiki_get_page_list ( swid)

Get pages list in wiki

Parameters:
int$swidsub wiki id

Definition at line 473 of file locallib.php.

Here is the caller graph for this function:

wiki_get_section_page ( page,
section 
)

Get page section

Parameters:
int$pageid
string$section

Definition at line 167 of file locallib.php.

Here is the call graph for this function:

wiki_get_subwiki ( subwikiid)

Get a sub wiki instace by instance id

Parameters:
int$subwikiid
Returns:
object

Definition at line 84 of file locallib.php.

Here is the caller graph for this function:

wiki_get_subwiki_by_group ( wikiid,
groupid,
userid = 0 
)

Get a sub wiki instance by wiki id and group id

Parameters:
int$wikiid
int$groupid
Returns:
object

Definition at line 74 of file locallib.php.

Here is the caller graph for this function:

wiki_get_subwikis ( wikiid)

Get sub wiki instances with same wiki id

Parameters:
int$wikiid

Definition at line 63 of file locallib.php.

Get updated pages from wiki

Parameters:
int$pageid

Definition at line 1444 of file locallib.php.

wiki_get_user_info ( userid)

Get user data

Definition at line 534 of file locallib.php.

Here is the caller graph for this function:

wiki_get_version ( versionid)

Get a version record by record id

Parameters:
int$versionid,theversion id
Returns:
object

Definition at line 189 of file locallib.php.

Here is the caller graph for this function:

wiki_get_wiki ( wikiid)

Get a wiki instance

Parameters:
int$wikiidthe instance id of wiki

Definition at line 53 of file locallib.php.

Here is the caller graph for this function:

Get a wiki instance by pageid

Parameters:
int$pageid
Returns:
object

Definition at line 113 of file locallib.php.

Here is the caller graph for this function:

wiki_get_wiki_page_id ( pageid,
id 
)

Definition at line 1250 of file locallib.php.

Here is the caller graph for this function:

wiki_get_wiki_page_version ( pageid,
version 
)

Get a specific version of page

Parameters:
int$pageid
int$version

Definition at line 384 of file locallib.php.

wiki_get_wiki_page_versions ( pageid,
limitfrom,
limitnum 
)

Get version list

Parameters:
int$pageid
int$limitfrom
int$limitnum

Definition at line 395 of file locallib.php.

Increase page view nubmer

Parameters:
int$page,databaserecord

Definition at line 543 of file locallib.php.

Here is the caller graph for this function:

wiki_is_page_section_locked ( pageid,
userid,
section = null 
)

Checks if a page-section is locked.

Returns:
true if the combination of section and page is locked, FALSE otherwise.

Definition at line 948 of file locallib.php.

Here is the caller graph for this function:

wiki_make_cache_expire ( pagename)

Definition at line 367 of file locallib.php.

Here is the caller graph for this function:

wiki_parse_content ( markup,
pagecontent,
options = array() 
)

Parses a string with the wiki markup language in $markup.

Returns:
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. '' =>

Author:
Josep Arús Pous

Definition at line 574 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_parser_get_token ( markup,
name 
)

Returns the token used by a wiki language to represent a given tag or "object" (bold -> **)

Returns:
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.
Author:
Josep Arús Pous

Definition at line 711 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
linkname of a page
$options
Returns:

Doc return and options

Definition at line 615 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_parser_real_path ( url,
context,
component,
filearea,
swid 
)

Returns an absolute path link, unless there is no such link.

Parameters:
string$urlLink's URL or filename
stdClass$contextfilearea params
string$componentThe component the file is associated with
string$fileareaThe filearea the file is stored in
int$swidSub wiki id
Returns:
string URL for files full path

Definition at line 688 of file locallib.php.

wiki_parser_table ( table)

Returns the table fully parsed (HTML)

Returns:
HTML for the table $table
Author:
Josep Arús Pous

Definition at line 652 of file locallib.php.

Here is the call graph for this function:

wiki_print_edit_form_default_fields ( format,
pageid,
version = -1,
upload = false,
deleteuploads = array() 
)

Prints default edit form fields and buttons

Parameters:
string$formatEdit form format (html, creole...)
integer$versionVersion number. A negative number means no versioning.

Definition at line 1317 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_print_page_content ( page,
context,
subwikiid 
)

Definition at line 1255 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_print_upload_table ( context,
filearea,
fileitemid,
deleteuploads = array() 
)

Prints a table with the files attached to a wiki page

Parameters:
object$context
string$filearea
int$fileitemid
arraydeleteuploads

Definition at line 1366 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_refresh_cachedcontent ( page,
newcontent = null 
)

Definition at line 261 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_refresh_page_links ( page,
links 
)

Definition at line 290 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_restore_page ( wikipage,
newcontent,
userid 
)

Restore a page

Definition at line 285 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_save_page ( wikipage,
newcontent,
userid 
)

Save page content

Parameters:
object$wikipage
string$newcontent
int$userid

Definition at line 235 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_save_section ( wikipage,
sectiontitle,
sectioncontent,
userid 
)

Definition at line 211 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_search_all ( swid,
search 
)

Search wiki title and content

Parameters:
int$swidsub wiki id
string$search

Definition at line 525 of file locallib.php.

Here is the caller graph for this function:

wiki_search_content ( swid,
search 
)

Search wiki content

Parameters:
int$swidsub wiki id
string$search

Definition at line 514 of file locallib.php.

wiki_search_title ( swid,
search 
)

Search wiki title

Parameters:
int$swidsub wiki id
string$search

Definition at line 503 of file locallib.php.

Here is the caller graph for this function:

wiki_set_lock ( pageid,
userid,
section = null,
insert = false 
)

Inserts or updates a wiki_locks record.

Definition at line 965 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_trim_string ( text,
limit = 25 
)

This function trims any given text and returns it with some dots at the end

Parameters:
string$text
string$limit
Returns:
string

Definition at line 1301 of file locallib.php.

Here is the call graph for this function:

wiki_user_can_edit ( subwiki)

Checks if current user can edit a subwiki

Parameters:
$subwiki

Definition at line 813 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

wiki_user_can_view ( subwiki)

Checks if current user can view a subwiki

Parameters:
$subwiki

Definition at line 721 of file locallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations