[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/forum/ -> lib.php (summary)

(no description)

Copyright: 1999 onwards Martin Dougiamas {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 7994 lines (302 kb)
Included or required: 7 times
Referenced: 14 times
Includes or requires: 1 file
 mod/forum/deprecatedlib.php

Defines 130 functions

  forum_add_instance()
  forum_instance_created()
  forum_update_instance()
  forum_delete_instance()
  forum_supports()
  forum_get_completion_state()
  forum_get_email_message_id()
  forum_cron_minimise_user_record()
  forum_cron()
  forum_user_outline()
  forum_user_complete()
  forum_filter_user_groups_discussions()
  forum_is_user_group_discussion()
  forum_print_overview()
  forum_print_recent_activity()
  forum_get_user_grades()
  forum_update_grades()
  forum_grade_item_update()
  forum_grade_item_delete()
  forum_scale_used()
  forum_scale_used_anywhere()
  forum_get_post_full()
  forum_get_all_discussion_posts()
  forum_get_readable_forums()
  forum_search_posts()
  forum_get_unmailed_posts()
  forum_mark_old_posts_as_mailed()
  forum_get_user_posts()
  forum_get_user_involved_discussions()
  forum_count_user_posts()
  forum_get_post_from_log()
  forum_get_firstpost_from_discussion()
  forum_count_discussion_replies()
  forum_count_discussions()
  forum_get_discussions()
  forum_get_discussion_neighbours()
  forum_get_default_sort_order()
  forum_get_discussions_unread()
  forum_get_discussions_count()
  forum_get_course_forum()
  forum_print_post()
  forum_rating_permissions()
  forum_rating_validate()
  mod_forum_rating_can_see_item_ratings()
  forum_print_discussion_header()
  forum_get_discussion_subscription_icon()
  forum_get_discussion_subscription_icon_preloaders()
  forum_print_mode_form()
  forum_search_form()
  forum_set_return()
  forum_go_back_to()
  forum_move_attachments()
  forum_print_attachments()
  forum_get_file_areas()
  forum_get_file_info()
  forum_pluginfile()
  forum_add_attachment()
  forum_add_new_post()
  forum_update_post()
  forum_add_discussion()
  forum_delete_discussion()
  forum_delete_post()
  forum_trigger_content_uploaded_event()
  forum_count_replies()
  forum_post_subscription()
  forum_get_subscribe_link()
  forum_user_has_posted_discussion()
  forum_discussions_user_has_posted_in()
  forum_user_has_posted()
  forum_get_user_posted_time()
  forum_user_can_post_discussion()
  forum_user_can_post()
  forum_user_can_see_timed_discussion()
  forum_user_can_see_group_discussion()
  forum_user_can_see_discussion()
  forum_user_can_see_post()
  forum_print_latest_discussions()
  forum_print_discussion()
  forum_print_posts_flat()
  forum_print_posts_threaded()
  forum_print_posts_nested()
  forum_get_recent_mod_activity()
  forum_print_recent_mod_activity()
  forum_change_discussionid()
  forum_update_subscriptions_button()
  forum_tp_mark_posts_read()
  forum_tp_add_read_record()
  forum_tp_mark_post_read()
  forum_tp_mark_forum_read()
  forum_tp_mark_discussion_read()
  forum_tp_is_post_read()
  forum_tp_is_post_old()
  forum_tp_get_course_unread_posts()
  forum_tp_count_forum_unread_posts()
  forum_tp_delete_read_records()
  forum_tp_get_untracked_forums()
  forum_tp_can_track_forums()
  forum_tp_is_tracked()
  forum_tp_start_tracking()
  forum_tp_stop_tracking()
  forum_tp_clean_read_records()
  forum_discussion_update_last_post()
  forum_get_view_actions()
  forum_get_post_actions()
  forum_check_throttling()
  forum_check_blocking_threshold()
  forum_reset_gradebook()
  forum_reset_userdata()
  forum_reset_course_form_definition()
  forum_reset_course_form_defaults()
  forum_get_layout_modes()
  forum_get_forum_types()
  forum_get_forum_types_all()
  forum_get_extra_capabilities()
  forum_extend_settings_navigation()
  forum_cm_info_view()
  forum_page_type_list()
  forum_get_courses_user_posted_in()
  forum_get_forums_user_posted_in()
  forum_get_posts_by_user()
  forum_set_user_maildigest()
  forum_get_user_maildigest_bulk()
  forum_get_user_digest_options()
  forum_get_context()
  forum_view()
  forum_discussion_view()
  forum_discussion_pin()
  forum_discussion_unpin()
  mod_forum_myprofile_navigation()
  forum_is_author_hidden()

Functions
Functions that are not part of a class:

forum_add_instance($forum, $mform = null)   X-Ref
Given an object containing all the necessary data,
(defined by the form in mod_form.php) this function
will create a new instance and return the id number
of the new instance.

param: stdClass $forum add forum instance
param: mod_forum_mod_form $mform
return: int intance id

forum_instance_created($context, $forum)   X-Ref
Handle changes following the creation of a forum instance.
This function is typically called by the course_module_created observer.

param: object $context the forum context
param: stdClass $forum The forum object
return: void

forum_update_instance($forum, $mform)   X-Ref
Given an object containing all the necessary data,
(defined by the form in mod_form.php) this function
will update an existing instance with new data.

param: object $forum forum instance (with magic quotes)
return: bool success

forum_delete_instance($id)   X-Ref
Given an ID of an instance of this module,
this function will permanently delete the instance
and any data that depends on it.

param: int $id forum instance id
return: bool success

forum_supports($feature)   X-Ref
Indicates API features that the forum supports.

param: string $feature
return: mixed True if yes (some features may use other values)

forum_get_completion_state($course,$cm,$userid,$type)   X-Ref
Obtains the automatic completion state for this forum based on any conditions
in forum settings.

param: object $course Course
param: object $cm Course-module
param: int $userid User ID
param: bool $type Type of comparison (or/and; can be used as return value if no conditions)
return: bool True if completed, false if not. (If no conditions, then return

forum_get_email_message_id($postid, $usertoid)   X-Ref
Create a message-id string to use in the custom headers of forum notification emails

message-id is used by email clients to identify emails and to nest conversations

param: int $postid The ID of the forum post we are notifying the user about
param: int $usertoid The ID of the user being notified
return: string A unique message-id

forum_cron_minimise_user_record(stdClass $user)   X-Ref
Removes properties from user record that are not necessary
for sending post notifications.

param: stdClass $user
return: void, $user parameter is modified

forum_cron()   X-Ref
Function to be run periodically according to the scheduled task.

Finds all posts that have yet to be mailed out, and mails them
out to all subscribers as well as other maintance tasks.

NOTE: Since 2.7.2 this function is run by scheduled task rather
than standard cron.


forum_user_outline($course, $user, $mod, $forum)   X-Ref

param: object $course
param: object $user
param: object $mod TODO this is not used in this function, refactor
param: object $forum
return: object A standard object with 2 variables: info (number of posts for this user) and time (last modified)

forum_user_complete($course, $user, $mod, $forum)   X-Ref

param: object $coure
param: object $user
param: object $mod
param: object $forum

forum_filter_user_groups_discussions($discussions)   X-Ref
Filters the forum discussions according to groups membership and config.

param: array $discussions Discussions with new posts array
return: array Forums with the number of new posts

forum_is_user_group_discussion(cm_info $cm, $discussiongroupid)   X-Ref
Returns whether the discussion group is visible by the current user or not.

param: cm_info $cm The discussion course module
param: int $discussiongroupid The discussion groupid
return: bool

forum_print_overview($courses,&$htmlarray)   X-Ref

param: array $courses
param: array $htmlarray

forum_print_recent_activity($course, $viewfullnames, $timestart)   X-Ref
Given a course and a date, prints a summary of all the new
messages posted in the course since that date

param: object $course
param: bool $viewfullnames capability
param: int $timestart
return: bool success

forum_get_user_grades($forum, $userid = 0)   X-Ref
Return grade for given user or all users.

param: object $forum
param: int $userid optional user id, 0 means all users
return: array array of grades, false if none

forum_update_grades($forum, $userid=0, $nullifnone=true)   X-Ref
Update activity grades

param: object $forum
param: int $userid specific user only, 0 means all
param: boolean $nullifnone return null if grade does not exist
return: void

forum_grade_item_update($forum, $grades=NULL)   X-Ref
Create/update grade item for given forum

param: stdClass $forum Forum object with extra cmidnumber
param: mixed $grades Optional array/object of grade(s); 'reset' means reset grades in gradebook
return: int 0 if ok

forum_grade_item_delete($forum)   X-Ref
Delete grade item for given forum

param: stdClass $forum Forum object
return: grade_item

forum_scale_used($forumid,$scaleid)   X-Ref
This function returns if a scale is being used by one forum

param: int $forumid
param: int $scaleid negative number
return: bool

forum_scale_used_anywhere($scaleid)   X-Ref
Checks if scale is being used by any instance of forum

This is used to find out if scale used anywhere

param: $scaleid int
return: boolean True if the scale is used by any forum

forum_get_post_full($postid)   X-Ref
Gets a post with all info ready for forum_print_post
Most of these joins are just to get the forum id

param: int $postid
return: mixed array of posts or false

forum_get_all_discussion_posts($discussionid, $sort, $tracking=false)   X-Ref
Gets all posts in discussion including top parent.

param: int $discussionid
param: string $sort
param: bool $tracking does user track the forum?
return: array of posts

forum_get_readable_forums($userid, $courseid=0)   X-Ref
An array of forum objects that the user is allowed to read/search through.

param: int $userid
param: int $courseid if 0, we look for forums throughout the whole site.
return: array of forum objects, or false if no matches

forum_search_posts($searchterms, $courseid=0, $limitfrom=0, $limitnum=50,&$totalcount, $extrasql='')   X-Ref
Returns a list of posts found using an array of search terms.

param: array $searchterms array of search terms, e.g. word +word -word
param: int $courseid if 0, we search through the whole site
param: int $limitfrom
param: int $limitnum
param: int &$totalcount
param: string $extrasql
return: array|bool Array of posts found or false

forum_get_unmailed_posts($starttime, $endtime, $now=null)   X-Ref
Returns a list of all new posts that have not been mailed yet

param: int $starttime posts created after this time
param: int $endtime posts created before this
param: int $now used for timed discussions only
return: array

forum_mark_old_posts_as_mailed($endtime, $now=null)   X-Ref
Marks posts before a certain time as being mailed already

param: int $endtime
param: int $now Defaults to time()
return: bool

forum_get_user_posts($forumid, $userid)   X-Ref
Get all the posts for a user in a forum suitable for forum_print_post

return: array

forum_get_user_involved_discussions($forumid, $userid)   X-Ref
Get all the discussions user participated in

param: int $forumid
param: int $userid
return: array Array or false

forum_count_user_posts($forumid, $userid)   X-Ref
Get all the posts for a user in a forum suitable for forum_print_post

param: int $forumid
param: int $userid
return: array of counts or false

forum_get_post_from_log($log)   X-Ref
Given a log entry, return the forum post details for it.

param: object $log
return: array|null

forum_get_firstpost_from_discussion($discussionid)   X-Ref
Given a discussion id, return the first post from the discussion

param: int $dicsussionid
return: array

forum_count_discussion_replies($forumid, $forumsort="", $limit=-1, $page=-1, $perpage=0)   X-Ref
Returns an array of counts of replies to each discussion

param: int $forumid
param: string $forumsort
param: int $limit
param: int $page
param: int $perpage
return: array

forum_count_discussions($forum, $cm, $course)   X-Ref

param: object $forum
param: object $cm
param: object $course
return: mixed

forum_get_discussions($cm, $forumsort="", $fullpost=true, $unused=-1, $limit=-1,$userlastmodified=false, $page=-1, $perpage=0, $groupid = -1)   X-Ref
Get all discussions in a forum

param: object $cm
param: string $forumsort
param: bool $fullpost
param: int $unused
param: int $limit
param: bool $userlastmodified
param: int $page
param: int $perpage
param: int $groupid if groups enabled, get discussions for this group overriding the current group.
return: array

forum_get_discussion_neighbours($cm, $discussion, $forum)   X-Ref
Gets the neighbours (previous and next) of a discussion.

The calculation is based on the timemodified when time modified or time created is identical
It will revert to using the ID to sort consistently. This is better tha skipping a discussion.

For blog-style forums, the calculation is based on the original creation time of the
blog post.

Please note that this does not check whether or not the discussion passed is accessible
by the user, it simply uses it as a reference to find the neighbours. On the other hand,
the returned neighbours are checked and are accessible to the current user.

param: object $cm The CM record.
param: object $discussion The discussion record.
param: object $forum The forum instance record.
return: array That always contains the keys 'prev' and 'next'. When there is a result

forum_get_default_sort_order($desc = true, $compare = 'd.timemodified', $prefix = 'd', $pinned = true)   X-Ref
Get the sql to use in the ORDER BY clause for forum discussions.

This has the ordering take timed discussion windows into account.

param: bool $desc True for DESC, False for ASC.
param: string $compare The field in the SQL to compare to normally sort by.
param: string $prefix The prefix being used for the discussion table.
param: bool $pinned sort pinned posts to the top
return: string

forum_get_discussions_unread($cm)   X-Ref

param: object $cm
return: array

forum_get_discussions_count($cm)   X-Ref

param: object $cm
return: array

forum_get_course_forum($courseid, $type)   X-Ref

param: int $courseid
param: string $type

forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=false, $reply=false, $link=false,$footer="", $highlight="", $postisread=null, $dummyifcantsee=true, $istracked=null, $return=false)   X-Ref
Print a forum post

param: object $post The post to print.
param: object $discussion
param: object $forum
param: object $cm
param: object $course
param: boolean $ownpost Whether this post belongs to the current user.
param: boolean $reply Whether to print a 'reply' link at the bottom of the message.
param: boolean $link Just print a shortened version of the post as a link to the full post.
param: string $footer Extra stuff to print after the message.
param: string $highlight Space-separated list of terms to highlight.
param: int $post_read true, false or -99. If we already know whether this user
param: boolean $dummyifcantsee When forum_user_can_see_post says that
param: bool|null $istracked
return: void

forum_rating_permissions($contextid, $component, $ratingarea)   X-Ref
Return rating related permissions

param: string $options the context id
return: array an associative array of the user's rating permissions

forum_rating_validate($params)   X-Ref
Validates a submitted rating

param: array $params submitted data
return: boolean true if the rating is valid. Will throw rating_exception if not

mod_forum_rating_can_see_item_ratings($params)   X-Ref
Can the current user see ratings for a given itemid?

param: array $params submitted data
return: bool

forum_print_discussion_header(&$post, $forum, $group = -1, $datestring = "",$cantrack = true, $forumtracked = true, $canviewparticipants = true, $modcontext = null,$canviewhiddentimedposts = false)   X-Ref
This function prints the overview of a discussion in the forum listing.
It needs some discussion information and some post information, these
happen to be combined for efficiency in the $post parameter by the function
that calls this one: forum_print_latest_discussions()

param: object $post The post object (passed by reference for speed).
param: object $forum The forum object.
param: int $group Current group.
param: string $datestring Format to use for the dates.
param: boolean $cantrack Is tracking enabled for this forum.
param: boolean $forumtracked Is the user tracking this forum.
param: boolean $canviewparticipants True if user has the viewparticipants permission for this course
param: boolean $canviewhiddentimedposts True if user has the viewhiddentimedposts permission for this forum

forum_get_discussion_subscription_icon($forum, $discussionid, $returnurl = null, $includetext = false)   X-Ref
Return the markup for the discussion subscription toggling icon.

param: stdClass $forum The forum object.
param: int $discussionid The discussion to create an icon for.
return: string The generated markup.

forum_get_discussion_subscription_icon_preloaders()   X-Ref
Return a pair of spans containing classes to allow the subscribe and
unsubscribe icons to be pre-loaded by a browser.

return: string The generated markup

forum_print_mode_form($id, $mode, $forumtype='')   X-Ref
Print the drop down that allows the user to select how they want to have
the discussion displayed.

param: int $id forum id if $forumtype is 'single',
param: mixed $mode forum layout mode
param: string $forumtype optional

forum_search_form($course, $search='')   X-Ref

param: object $course
param: string $search
return: string

forum_set_return()   X-Ref


forum_go_back_to($default)   X-Ref

param: string|\moodle_url $default
return: string

forum_move_attachments($discussion, $forumfrom, $forumto)   X-Ref
Given a discussion object that is being moved to $forumto,
this function checks all posts in that discussion
for attachments, and if any are found, these are
moved to the new forum directory.

param: object $discussion
param: int $forumfrom source forum id
param: int $forumto target forum id
return: bool success

forum_print_attachments($post, $cm, $type)   X-Ref
Returns attachments as formated text/html optionally with separate images

param: object $post
param: object $cm
param: string $type html/text/separateimages
return: mixed string or array of (html text withouth images and image HTML)

forum_get_file_areas($course, $cm, $context)   X-Ref
Lists all browsable file areas

param: stdClass $course course object
param: stdClass $cm course module object
param: stdClass $context context object
return: array

forum_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename)   X-Ref
File browsing support for forum module.

param: stdClass $browser file browser object
param: stdClass $areas file areas
param: stdClass $course course object
param: stdClass $cm course module
param: stdClass $context context module
param: string $filearea file area
param: int $itemid item ID
param: string $filepath file path
param: string $filename file name
return: file_info instance or null if not found

forum_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array()   X-Ref
Serves the forum attachments. Implements needed access control ;-)

param: stdClass $course course object
param: stdClass $cm course module object
param: stdClass $context context object
param: string $filearea file area
param: array $args extra arguments
param: bool $forcedownload whether or not force download
param: array $options additional options affecting the file serving
return: bool false if file not found, does not return if found - justsend the file

forum_add_attachment($post, $forum, $cm, $mform=null, $unused=null)   X-Ref
If successful, this function returns the name of the file

param: object $post is a full post record, including course and forum
param: object $forum
param: object $cm
param: mixed $mform
param: string $unused
return: bool

forum_add_new_post($post, $mform, $unused = null)   X-Ref
Add a new post in an existing discussion.

param: object $post
param: mixed $mform
param: string $unused formerly $message, renamed in 2.8 as it was unused.
return: int

forum_update_post($post, $mform, &$message)   X-Ref
Update a post

param: object $post
param: mixed $mform
param: string $message
return: bool

forum_add_discussion($discussion, $mform=null, $unused=null, $userid=null)   X-Ref
Given an object containing all the necessary data,
create a new discussion and return the id

param: object $post
param: mixed $mform
param: string $unused
param: int $userid
return: object

forum_delete_discussion($discussion, $fulldelete, $course, $cm, $forum)   X-Ref
Deletes a discussion and handles all associated cleanup.

param: object $discussion Discussion to delete
param: bool $fulldelete True when deleting entire forum
param: object $course Course
param: object $cm Course-module
param: object $forum Forum
return: bool

forum_delete_post($post, $children, $course, $cm, $forum, $skipcompletion=false)   X-Ref
Deletes a single forum post.

param: object $post Forum post object
param: mixed $children Whether to delete children. If false, returns false
param: object $course Course
param: object $cm Course-module
param: object $forum Forum
param: bool $skipcompletion True to skip updating completion state if it
return: bool

forum_trigger_content_uploaded_event($post, $cm, $name)   X-Ref
Sends post content to plagiarism plugin

param: object $post Forum post object
param: object $cm Course-module
param: string $name
return: bool

forum_count_replies($post, $children=true)   X-Ref

param: object $post
param: bool $children
return: int

forum_post_subscription($fromform, $forum, $discussion)   X-Ref
Given a new post, subscribes or unsubscribes as appropriate.
Returns some text which describes what happened.

param: object $fromform The submitted form
param: stdClass $forum The forum record
param: stdClass $discussion The forum discussion record
return: string

forum_get_subscribe_link($forum, $context, $messages = array()   X-Ref
Generate and return the subscribe or unsubscribe link for a forum.

param: object $forum the forum. Fields used are $forum->id and $forum->forcesubscribe.
param: object $context the context object for this forum.
param: array $messages text used for the link in its various states
param: bool $cantaccessagroup
param: bool $fakelink
param: bool $backtoindex
param: array $subscribed_forums
return: string

forum_user_has_posted_discussion($forumid, $userid, $groupid = null)   X-Ref
Returns true if user created new discussion already.

param: int $forumid  The forum to check for postings
param: int $userid   The user to check for postings
param: int $groupid  The group to restrict the check to
return: bool

forum_discussions_user_has_posted_in($forumid, $userid)   X-Ref

param: int $forumid
param: int $userid
return: array

forum_user_has_posted($forumid, $did, $userid)   X-Ref

param: int $forumid
param: int $did
param: int $userid
return: bool

forum_get_user_posted_time($did, $userid)   X-Ref
Returns creation time of the first user's post in given discussion

param: int $did Discussion id
param: int $userid User id
return: int|bool post creation time stamp or return false

forum_user_can_post_discussion($forum, $currentgroup=null, $unused=-1, $cm=NULL, $context=NULL)   X-Ref

param: object $forum
param: object $currentgroup
param: int $unused
param: object $cm
param: object $context
return: bool

forum_user_can_post($forum, $discussion, $user=NULL, $cm=NULL, $course=NULL, $context=NULL)   X-Ref
This function checks whether the user can reply to posts in a forum
discussion. Use forum_user_can_post_discussion() to check whether the user
can start discussions.

param: object $forum forum object
param: object $discussion
param: object $user
param: object $cm
param: object $course
param: object $context
return: bool

forum_user_can_see_timed_discussion($discussion, $user, $context)   X-Ref
Check to ensure a user can view a timed discussion.

param: object $discussion
param: object $user
param: object $context
return: boolean returns true if they can view post, false otherwise

forum_user_can_see_group_discussion($discussion, $cm, $context)   X-Ref
Check to ensure a user can view a group discussion.

param: object $discussion
param: object $cm
param: object $context
return: boolean returns true if they can view post, false otherwise

forum_user_can_see_discussion($forum, $discussion, $context, $user=NULL)   X-Ref

param: object $forum
param: object $discussion
param: object $context
param: object $user
return: bool

forum_user_can_see_post($forum, $discussion, $post, $user=NULL, $cm=NULL)   X-Ref

param: object $forum
param: object $discussion
param: object $post
param: object $user
param: object $cm
return: bool

forum_print_latest_discussions($course, $forum, $maxdiscussions = -1, $displayformat = 'plain', $sort = '',$currentgroup = -1, $groupmode = -1, $page = -1, $perpage = 100, $cm = null)   X-Ref
Prints the discussion view screen for a forum.

param: object $course The current course object.
param: object $forum Forum to be printed.
param: int $maxdiscussions .
param: string $displayformat The display format to use (optional).
param: string $sort Sort arguments for database query (optional).
param: int $groupmode Group mode of the forum (optional).
param: void $unused (originally current group)
param: int $page Page mode, page to display (optional).
param: int $perpage The maximum number of discussions per page(optional)
param: boolean $subscriptionstatus Whether the user is currently subscribed to the discussion in some fashion.

forum_print_discussion($course, $cm, $forum, $discussion, $post, $mode, $canreply=NULL, $canrate=false)   X-Ref
Prints a forum discussion

param: stdClass $course
param: stdClass $cm
param: stdClass $forum
param: stdClass $discussion
param: stdClass $post
param: int $mode
param: mixed $canreply
param: bool $canrate

forum_print_posts_flat($course, &$cm, $forum, $discussion, $post, $mode, $reply, $forumtracked, $posts)   X-Ref

param: object $course
param: object $cm
param: object $forum
param: object $discussion
param: object $post
param: object $mode
param: bool $reply
param: bool $forumtracked
param: array $posts
return: void

forum_print_posts_threaded($course, &$cm, $forum, $discussion, $parent, $depth, $reply, $forumtracked, $posts)   X-Ref

return: void

forum_print_posts_nested($course, &$cm, $forum, $discussion, $parent, $reply, $forumtracked, $posts)   X-Ref

return: void

forum_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0)   X-Ref
Returns all forum posts since a given time in specified forum.


forum_print_recent_mod_activity($activity, $courseid, $detail, $modnames, $viewfullnames)   X-Ref
Outputs the forum post indicated by $activity.

param: object $activity      the activity object the forum resides in
param: int    $courseid      the id of the course the forum resides in
param: bool   $detail        not used, but required for compatibilty with other modules
param: int    $modnames      not used, but required for compatibilty with other modules
param: bool   $viewfullnames not used, but required for compatibilty with other modules

forum_change_discussionid($postid, $discussionid)   X-Ref
recursively sets the discussion field to $discussionid on $postid and all its children
used when pruning a post

param: int $postid
param: int $discussionid
return: bool

forum_update_subscriptions_button($courseid, $forumid)   X-Ref
Prints the editing button on subscribers page

param: int $courseid
param: int $forumid
return: string

forum_tp_mark_posts_read($user, $postids)   X-Ref
Mark posts as read.

param: object $user object
param: array $postids array of post ids
return: boolean success

forum_tp_add_read_record($userid, $postid)   X-Ref
Mark post as read.

param: int $userid
param: int $postid

forum_tp_mark_post_read($userid, $post, $forumid)   X-Ref
If its an old post, do nothing. If the record exists, the maintenance will clear it up later.

return: bool

forum_tp_mark_forum_read($user, $forumid, $groupid=false)   X-Ref
Marks a whole forum as read, for a given user

param: object $user
param: int $forumid
param: int|bool $groupid
return: bool

forum_tp_mark_discussion_read($user, $discussionid)   X-Ref
Marks a whole discussion as read, for a given user

param: object $user
param: int $discussionid
return: bool

forum_tp_is_post_read($userid, $post)   X-Ref

param: int $userid
param: object $post

forum_tp_is_post_old($post, $time=null)   X-Ref

param: object $post
param: int $time Defautls to time()

forum_tp_get_course_unread_posts($userid, $courseid)   X-Ref
Returns the count of records for the provided user and course.
Please note that group access is ignored!

param: int $userid
param: int $courseid
return: array

forum_tp_count_forum_unread_posts($cm, $course)   X-Ref
Returns the count of records for the provided user and forum and [optionally] group.

param: object $cm
param: object $course
return: int

forum_tp_delete_read_records($userid=-1, $postid=-1, $discussionid=-1, $forumid=-1)   X-Ref
Deletes read records for the specified index. At least one parameter must be specified.

param: int $userid
param: int $postid
param: int $discussionid
param: int $forumid
return: bool

forum_tp_get_untracked_forums($userid, $courseid)   X-Ref
Get a list of forums not tracked by the user.

param: int $userid The id of the user to use.
param: int $courseid The id of the course being checked.
return: mixed An array indexed by forum id, or false.

forum_tp_can_track_forums($forum=false, $user=false)   X-Ref
Determine if a user can track forums and optionally a particular forum.
Checks the site settings, the user settings and the forum settings (if
requested).

param: mixed $forum The forum object to test, or the int id (optional).
param: mixed $userid The user object to check for (optional).
return: boolean

forum_tp_is_tracked($forum, $user=false)   X-Ref
Tells whether a specific forum is tracked by the user. A user can optionally
be specified. If not specified, the current user is assumed.

param: mixed $forum If int, the id of the forum being checked; if object, the forum object
param: int $userid The id of the user being checked (optional).
return: boolean

forum_tp_start_tracking($forumid, $userid=false)   X-Ref

param: int $forumid
param: int $userid

forum_tp_stop_tracking($forumid, $userid=false)   X-Ref

param: int $forumid
param: int $userid

forum_tp_clean_read_records()   X-Ref
Clean old records from the forum_read table.

return: void

forum_discussion_update_last_post($discussionid)   X-Ref
Sets the last post for a given discussion

param: into $discussionid
return: bool|int

forum_get_view_actions()   X-Ref
List the actions that correspond to a view of this module.
This is used by the participation report.

Note: This is not used by new logging system. Event with
crud = 'r' and edulevel = LEVEL_PARTICIPATING will
be considered as view action.

return: array

forum_get_post_actions()   X-Ref
List the actions that correspond to a post of this module.
This is used by the participation report.

Note: This is not used by new logging system. Event with
crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING
will be considered as post action.

return: array

forum_check_throttling($forum, $cm = null)   X-Ref
Returns a warning object if a user has reached the number of posts equal to
the warning/blocking setting, or false if there is no warning to show.

param: int|stdClass $forum the forum id or the forum object
param: stdClass $cm the course module
return: stdClass|bool returns an object with the warning information, else

forum_check_blocking_threshold($thresholdwarning)   X-Ref
Throws an error if the user is no longer allowed to post due to having reached
or exceeded the number of posts specified in 'Post threshold for blocking'
setting.

param: stdClass $thresholdwarning the warning information returned

forum_reset_gradebook($courseid, $type='')   X-Ref
Removes all grades from gradebook

param: int $courseid
param: string $type optional

forum_reset_userdata($data)   X-Ref
This function is used by the reset_course_userdata function in moodlelib.
This function will remove all posts from the specified forum
and clean up any related data.

param: $data the data submitted from the reset course.
return: array status array

forum_reset_course_form_definition(&$mform)   X-Ref
Called by course/reset.php

param: $mform form passed by reference

forum_reset_course_form_defaults($course)   X-Ref
Course reset form defaults.

return: array

forum_get_layout_modes()   X-Ref
Returns array of forum layout modes

return: array

forum_get_forum_types()   X-Ref
Returns array of forum types chooseable on the forum editing form

return: array

forum_get_forum_types_all()   X-Ref
Returns array of all forum layout modes

return: array

forum_get_extra_capabilities()   X-Ref
Returns all other caps used in module

return: array

forum_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $forumnode)   X-Ref
Adds module specific settings to the settings block

param: settings_navigation $settings The settings navigation object
param: navigation_node $forumnode The node to add module settings to

forum_cm_info_view(cm_info $cm)   X-Ref
Adds information about unread messages, that is only required for the course view page (and
similar), to the course-module object.

param: cm_info $cm Course-module object

forum_page_type_list($pagetype, $parentcontext, $currentcontext)   X-Ref
Return a list of page types

param: string $pagetype current page type
param: stdClass $parentcontext Block's parent context
param: stdClass $currentcontext Current context of block

forum_get_courses_user_posted_in($user, $discussionsonly = false, $includecontexts = true, $limitfrom = null, $limitnum = null)   X-Ref
Gets all of the courses where the provided user has posted in a forum.

param: stdClass $user The user who's posts we are looking for
param: bool $discussionsonly If true only look for discussions started by the user
param: bool $includecontexts If set to trye contexts for the courses will be preloaded
param: int $limitfrom The offset of records to return
param: int $limitnum The number of records to return
return: array An array of courses

forum_get_forums_user_posted_in($user, array $courseids = null, $discussionsonly = false, $limitfrom = null, $limitnum = null)   X-Ref
Gets all of the forums a user has posted in for one or more courses.

param: stdClass $user
param: array $courseids An array of courseids to search or if not provided
param: bool $discussionsonly If true then only forums where the user has started
param: int $limitfrom The offset of records to return
param: int $limitnum The number of records to return
return: array An array of forums the user has posted within in the provided courses

forum_get_posts_by_user($user, array $courses, $musthaveaccess = false, $discussionsonly = false, $limitfrom = 0, $limitnum = 50)   X-Ref
Returns posts made by the selected user in the requested courses.

This method can be used to return all of the posts made by the requested user
within the given courses.
For each course the access of the current user and requested user is checked
and then for each post access to the post and forum is checked as well.

This function is safe to use with usercapabilities.

param: stdClass $user The user whose posts we want to get
param: array $courses The courses to search
param: bool $musthaveaccess If set to true errors will be thrown if the user
param: bool $discussionsonly If set to true only discussion starting posts
param: int $limitfrom The offset of records to return
param: int $limitnum The number of records to return
return: stdClass An object the following properties

forum_set_user_maildigest($forum, $maildigest, $user = null)   X-Ref
Set the per-forum maildigest option for the specified user.

param: stdClass $forum The forum to set the option for.
param: int $maildigest The maildigest option.
param: stdClass $user The user object. This defaults to the global $USER object.

forum_get_user_maildigest_bulk($digests, $user, $forumid)   X-Ref
Determine the maildigest setting for the specified user against the
specified forum.

param: Array $digests An array of forums and user digest settings.
param: stdClass $user The user object containing the id and maildigest default.
param: int $forumid The ID of the forum to check.
return: int The calculated maildigest setting for this user and forum.

forum_get_user_digest_options($user = null)   X-Ref
Retrieve the list of available user digest options.

param: stdClass $user The user object. This defaults to the global $USER object.
return: array The mapping of values to digest options.

forum_get_context($forumid, $context = null)   X-Ref
Determine the current context if one was not already specified.

If a context of type context_module is specified, it is immediately
returned and not checked.

param: int $forumid The ID of the forum
param: context_module $context The current context.
return: context_module The context determined

forum_view($forum, $course, $cm, $context)   X-Ref
Mark the activity completed (if required) and trigger the course_module_viewed event.

param: stdClass $forum   forum object
param: stdClass $course  course object
param: stdClass $cm      course module object
param: stdClass $context context object

forum_discussion_view($modcontext, $forum, $discussion)   X-Ref
Trigger the discussion viewed event

param: stdClass $modcontext module context object
param: stdClass $forum      forum object
param: stdClass $discussion discussion object

forum_discussion_pin($modcontext, $forum, $discussion)   X-Ref
Set the discussion to pinned and trigger the discussion pinned event

param: stdClass $modcontext module context object
param: stdClass $forum      forum object
param: stdClass $discussion discussion object

forum_discussion_unpin($modcontext, $forum, $discussion)   X-Ref
Set discussion to unpinned and trigger the discussion unpin event

param: stdClass $modcontext module context object
param: stdClass $forum      forum object
param: stdClass $discussion discussion object

mod_forum_myprofile_navigation(core_user\output\myprofile\tree $tree, $user, $iscurrentuser, $course)   X-Ref
Add nodes to myprofile page.

param: \core_user\output\myprofile\tree $tree Tree object
param: stdClass $user user object
param: bool $iscurrentuser
param: stdClass $course Course object
return: bool

forum_is_author_hidden($post, $forum)   X-Ref
Checks whether the author's name and picture for a given post should be hidden or not.

param: object $post The forum post.
param: object $forum The forum object.
return: bool



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1