|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| enum FORUM_FORCESUBSCRIBE |
| enum FORUM_MODE_NESTED |
| enum FORUM_MODE_THREADED |
| enum FORUM_TRACKING_OFF |
| enum FORUM_TRACKING_ON |
| forum_add_attachment | ( | $ | post, |
| $ | forum, | ||
| $ | cm, | ||
| $ | mform = null, |
||
| &$ | message = null |
||
| ) |
If successful, this function returns the name of the file
object
| object | $post | is a full post record, including course and forum |
| object | $forum | |
| object | $cm | |
| mixed | $mform | |
| string | $message |
Definition at line 4164 of file lib.php.


| forum_add_discussion | ( | $ | discussion, |
| $ | mform = null, |
||
| &$ | message = null, |
||
| $ | userid = null |
||
| ) |
Given an object containing all the necessary data, create a new discussion and return the id
object object object
| object | $post | |
| mixed | $mform | |
| string | $message | |
| int | $userid |
Definition at line 4284 of file lib.php.


| forum_add_instance | ( | $ | forum, |
| $ | mform | ||
| ) |
STANDARD FUNCTIONS ///////////////////////////////////////////////////////////.
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.
object object
| object | $forum | add forum instance (with magic quotes) |
all users should be subscribed initially Note: forum_get_potential_subscribers should take the forum context, but that does not exist yet, becuase the forum is only half build at this stage. However, because the forum is brand new, we know that there are no role assignments or overrides in the forum context, so using the course context gives the same list of users.
Definition at line 60 of file lib.php.


| forum_add_new_post | ( | $ | post, |
| $ | mform, | ||
| &$ | message | ||
| ) |
| forum_change_discussionid | ( | $ | postid, |
| $ | discussionid | ||
| ) |
| forum_check_throttling | ( | $ | forum, |
| $ | cm = null |
||
| ) |
| forum_cm_info_view | ( | cm_info $ | cm | ) |
| forum_convert_to_roles | ( | $ | forum, |
| $ | forummodid, | ||
| $ | teacherroles = array(), |
||
| $ | studentroles = array(), |
||
| $ | guestroles = array(), |
||
| $ | cmid = NULL |
||
| ) |
Converts a forum to use the Roles System
object object
| object | $forum | a forum object with the same attributes as a record from the forum database table |
| int | $forummodid | the id of the forum module, from the modules table |
| array | $teacherroles | array of roles that have archetype teacher |
| array | $studentroles | array of roles that have archetype student |
| array | $guestroles | array of roles that have archetype guest |
| int | $cmid | the course_module id for this forum instance |
Definition at line 7077 of file lib.php.

| forum_count_discussion_replies | ( | $ | forumid, |
| $ | forumsort = "", |
||
| $ | limit = -1, |
||
| $ | page = -1, |
||
| $ | perpage = 0 |
||
| ) |
| forum_count_discussions | ( | $ | forum, |
| $ | cm, | ||
| $ | course | ||
| ) |
| forum_count_replies | ( | $ | post, |
| $ | children = true |
||
| ) |
| forum_count_unrated_posts | ( | $ | discussionid, |
| $ | userid | ||
| ) |
| forum_count_user_posts | ( | $ | forumid, |
| $ | userid | ||
| ) |
| forum_cron | ( | ) |
Function to be run periodically according to the moodle cron Finds all posts that have yet to be mailed out, and mails them out to all subscribers
object object object CONTEXT_MODULE CONTEXT_COURSE SITEID FORMAT_PLAIN
Finished iteration, let's close the resultset
We have finishied all digest emails, update $CFG->digestmailtimelast
Definition at line 383 of file lib.php.

| forum_delete_discussion | ( | $ | discussion, |
| $ | fulldelete, | ||
| $ | course, | ||
| $ | cm, | ||
| $ | forum | ||
| ) |
Deletes a discussion and handles all associated cleanup.
object
| object | $discussion | Discussion to delete |
| bool | $fulldelete | True when deleting entire forum |
| object | $course | Course |
| object | $cm | Course-module |
| object | $forum | Forum |
Definition at line 4359 of file lib.php.


| forum_delete_instance | ( | $ | id | ) |
| forum_delete_post | ( | $ | post, |
| $ | children, | ||
| $ | course, | ||
| $ | cm, | ||
| $ | forum, | ||
| $ | skipcompletion = false |
||
| ) |
Deletes a single forum post.
object
| object | $post | Forum post object |
| mixed | $children | Whether to delete children. If false, returns false if there are any children (without deleting the post). If true, recursively deletes all children. If set to special value 'ignore', deletes post regardless of children (this is for use only when deleting all posts in a disussion). |
| object | $course | Course |
| object | $cm | Course-module |
| object | $forum | Forum |
| bool | $skipcompletion | True to skip updating completion state if it would otherwise be updated, i.e. when deleting entire forum anyway. |
Definition at line 4412 of file lib.php.


| forum_discussion_update_last_post | ( | $ | discussionid | ) |
| forum_discussions_user_has_posted_in | ( | $ | forumid, |
| $ | userid | ||
| ) |
| forum_extend_settings_navigation | ( | settings_navigation $ | settingsnav, |
| navigation_node $ | forumnode | ||
| ) |
This function is used to extend the global navigation by add forum nodes if there is relevant content.
| navigation_node | $navref | |
| stdClass | $course | |
| stdClass | $module | |
| stdClass | $cm | Adds module specific settings to the settings block |
| settings_navigation | $settings | The settings navigation object |
| navigation_node | $forumnode | The node to add module settings to |
Definition at line 7417 of file lib.php.

| forum_forcesubscribe | ( | $ | forumid, |
| $ | value = 1 |
||
| ) |
| forum_get_all_discussion_posts | ( | $ | discussionid, |
| $ | sort, | ||
| $ | tracking = false |
||
| ) |
Gets all posts in discussion including top parent.
object object object
| int | $discussionid | |
| string | $sort | |
| bool | $tracking | does user track the forum? |
Definition at line 1744 of file lib.php.


| forum_get_child_posts | ( | $ | parent, |
| $ | forumid | ||
| ) |
| forum_get_completion_state | ( | $ | course, |
| $ | cm, | ||
| $ | userid, | ||
| $ | type | ||
| ) |
Obtains the automatic completion state for this forum based on any conditions in forum settings.
object object
| object | $course | Course |
| object | $cm | Course-module |
| int | $userid | User ID |
| bool | $type | Type of comparison (or/and; can be used as return value if no conditions) |
| forum_get_course_forum | ( | $ | courseid, |
| $ | type | ||
| ) |
| forum_get_courses_user_posted_in | ( | $ | user, |
| $ | discussionsonly = false, |
||
| $ | includecontexts = true, |
||
| $ | limitfrom = null, |
||
| $ | limitnum = null |
||
| ) |
Gets all of the courses where the provided user has posted in a forum.
moodle_database $DB The database connection
| stdClass | $user | The user who's posts we are looking for |
| bool | $discussionsonly | If true only look for discussions started by the user |
| bool | $includecontexts | If set to trye contexts for the courses will be preloaded |
| int | $limitfrom | The offset of records to return |
| int | $limitnum | The number of records to return |
Definition at line 7791 of file lib.php.

| forum_get_discussion_posts | ( | $ | discussion, |
| $ | sort, | ||
| $ | forumid | ||
| ) |
| forum_get_discussions | ( | $ | cm, |
| $ | forumsort = "d.timemodified DESC", |
||
| $ | fullpost = true, |
||
| $ | unused = -1, |
||
| $ | limit = -1, |
||
| $ | userlastmodified = false, |
||
| $ | page = -1, |
||
| $ | perpage = 0 |
||
| ) |
Get all discussions in a forum
object object object CONTEXT_MODULE VISIBLEGROUPS
| object | $cm | |
| string | $forumsort | |
| bool | $fullpost | |
| int | $unused | |
| int | $limit | |
| bool | $userlastmodified | |
| int | $page | |
| int | $perpage |
User must have perms to view discussions
Users must fulfill timed posts
Definition at line 2531 of file lib.php.


| forum_get_discussions_count | ( | $ | cm | ) |
| forum_get_discussions_unread | ( | $ | cm | ) |
| forum_get_file_areas | ( | $ | course, |
| $ | cm, | ||
| $ | context | ||
| ) |
| forum_get_file_info | ( | $ | browser, |
| $ | areas, | ||
| $ | course, | ||
| $ | cm, | ||
| $ | context, | ||
| $ | filearea, | ||
| $ | itemid, | ||
| $ | filepath, | ||
| $ | filename | ||
| ) |
File browsing support for forum module.
| object | $browser | |
| object | $areas | |
| object | $course | |
| object | $cm | |
| object | $context | |
| string | $filearea | |
| int | $itemid | |
| string | $filepath | |
| string | $filename |
Definition at line 4033 of file lib.php.

| forum_get_firstpost_from_discussion | ( | $ | discussionid | ) |
| forum_get_forcesubscribed | ( | $ | forum | ) |
| forum_get_forums_user_posted_in | ( | $ | user, |
| array $ | courseids = null, |
||
| $ | discussionsonly = false, |
||
| $ | limitfrom = null, |
||
| $ | limitnum = null |
||
| ) |
Gets all of the forums a user has posted in for one or more courses.
moodle_database $DB
| stdClass | $user | |
| array | $courseids | An array of courseids to search or if not provided all courses the user has posted within |
| bool | $discussionsonly | If true then only forums where the user has started a discussion will be returned. |
| int | $limitfrom | The offset of records to return |
| int | $limitnum | The number of records to return |
Definition at line 7843 of file lib.php.

| forum_get_participants | ( | $ | forumid | ) |
| forum_get_post_from_log | ( | $ | log | ) |
| forum_get_post_full | ( | $ | postid | ) |
| forum_get_posts_by_user | ( | $ | user, |
| array $ | courses, | ||
| $ | musthaveaccess = false, |
||
| $ | discussionsonly = false, |
||
| $ | limitfrom = 0, |
||
| $ | limitnum = 50 |
||
| ) |
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.
moodle_database $DB
| stdClass | $user | The user whose posts we want to get |
| array | $courses | The courses to search |
| bool | $musthaveaccess | If set to true errors will be thrown if the user cannot access one or more of the courses to search |
| bool | $discussionsonly | If set to true only discussion starting posts will be returned. |
| int | $limitfrom | The offset of records to return |
| int | $limitnum | The number of records to return |
Definition at line 7901 of file lib.php.

| forum_get_potential_subscribers | ( | $ | forumcontext, |
| $ | groupid, | ||
| $ | fields, | ||
| $ | sort | ||
| ) |
Get the list of potential subscribers to a forum.
| object | $forumcontext | the forum context. |
| integer | $groupid | the id of a group, or 0 for all groups. |
| string | $fields | the list of fields to return for each user. As for get_users_by_capability. |
| string | $sort | sort order. As for get_users_by_capability. |
Definition at line 2819 of file lib.php.


| forum_get_ratings | ( | $ | context, |
| $ | postid, | ||
| $ | sort = "u.firstname ASC" |
||
| ) |
Returns a list of ratings for a particular post - sorted.
TODO: Check if this function is actually used anywhere. Up until the fix for MDL-27471 this function wasn't even returning.
| stdClass | $context | |
| int | $postid | |
| string | $sort |
| forum_get_readable_forums | ( | $ | userid, |
| $ | courseid = 0 |
||
| ) |
An array of forum objects that the user is allowed to read/search through.
object object object
| int | $userid | |
| int | $courseid | if 0, we look for forums throughout the whole site. |
group access
hidden timed discussions
qanda access
Definition at line 1824 of file lib.php.


| forum_get_recent_mod_activity | ( | &$ | activities, |
| &$ | index, | ||
| $ | timestart, | ||
| $ | courseid, | ||
| $ | cmid, | ||
| $ | userid = 0, |
||
| $ | groupid = 0 |
||
| ) |
| forum_get_separate_modules | ( | $ | courseid | ) |
| forum_get_subscribe_link | ( | $ | forum, |
| $ | context, | ||
| $ | messages = array(), |
||
| $ | cantaccessagroup = false, |
||
| $ | fakelink = true, |
||
| $ | backtoindex = false, |
||
| $ | subscribed_forums = null |
||
| ) |
Generate and return the subscribe or unsubscribe link for a forum.
| object | $forum | the forum. Fields used are $forum->id and $forum->forcesubscribe. |
| object | $context | the context object for this forum. |
| array | $messages | text used for the link in its various states (subscribed, unsubscribed, forcesubscribed or cantsubscribe). Any strings not passed in are taken from the $defaultmessages array at the top of the function. |
| bool | $cantaccessagroup | |
| bool | $fakelink | |
| bool | $backtoindex | |
| array | $subscribed_forums |
Definition at line 4664 of file lib.php.

| forum_get_subscribed_forums | ( | $ | course | ) |
| forum_get_tracking_link | ( | $ | forum, |
| $ | messages = array(), |
||
| $ | fakelink = true |
||
| ) |
| forum_get_unmailed_posts | ( | $ | starttime, |
| $ | endtime, | ||
| $ | now = null |
||
| ) |
| forum_get_user_discussions | ( | $ | courseid, |
| $ | userid, | ||
| $ | groupid = 0 |
||
| ) |
| forum_get_user_grades | ( | $ | forum, |
| $ | userid = 0 |
||
| ) |
| forum_get_user_involved_discussions | ( | $ | forumid, |
| $ | userid | ||
| ) |
| forum_get_user_posted_time | ( | $ | did, |
| $ | userid | ||
| ) |
| forum_get_user_posts | ( | $ | forumid, |
| $ | userid | ||
| ) |
| forum_go_back_to | ( | $ | default | ) |
| forum_grade_item_delete | ( | $ | forum | ) |
Delete grade item for given forum
object
| object | $forum | object |
Definition at line 1587 of file lib.php.


| forum_grade_item_update | ( | $ | forum, |
| $ | grades = NULL |
||
| ) |
Create/update grade item for given forum
object GRADE_TYPE_NONE GRADE_TYPE_VALUE GRADE_TYPE_SCALE
| object | $forum | object with extra cmidnumber |
| mixed | $grades | optional array/object of grade(s); 'reset' means reset grades in gradebook |
Definition at line 1551 of file lib.php.


| forum_is_forcesubscribed | ( | $ | forum | ) |
| forum_is_subscribed | ( | $ | userid, |
| $ | forum | ||
| ) |
| forum_make_mail_html | ( | $ | course, |
| $ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | post, | ||
| $ | userfrom, | ||
| $ | userto | ||
| ) |
Builds and returns the body of the email notification in html format.
object
| object | $course | |
| object | $cm | |
| object | $forum | |
| object | $discussion | |
| object | $post | |
| object | $userfrom | |
| object | $userto |
Definition at line 1064 of file lib.php.


| forum_make_mail_post | ( | $ | course, |
| $ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | post, | ||
| $ | userfrom, | ||
| $ | userto, | ||
| $ | ownpost = false, |
||
| $ | reply = false, |
||
| $ | link = false, |
||
| $ | rate = false, |
||
| $ | footer = "" |
||
| ) |
Given the data about a posting, builds up the HTML to display it and returns the HTML in a string. This is designed for sending via HTML email.
object
| object | $course | |
| object | $cm | |
| object | $forum | |
| object | $discussion | |
| object | $post | |
| object | $userform | |
| object | $userto | |
| bool | $ownpost | |
| bool | $reply | |
| bool | $link | |
| bool | $rate | |
| string | $footer |
Definition at line 3005 of file lib.php.


| forum_make_mail_text | ( | $ | course, |
| $ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | post, | ||
| $ | userfrom, | ||
| $ | userto, | ||
| $ | bare = false |
||
| ) |
Builds and returns the body of the email notification in plain text.
object object CONTEXT_MODULE
| object | $course | |
| object | $cm | |
| object | $forum | |
| object | $discussion | |
| object | $post | |
| object | $userfrom | |
| object | $userto | |
| boolean | $bare |
Definition at line 985 of file lib.php.


| forum_mark_old_posts_as_mailed | ( | $ | endtime, |
| $ | now = null |
||
| ) |
| forum_move_attachments | ( | $ | discussion, |
| $ | forumfrom, | ||
| $ | forumto | ||
| ) |
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.
object
| object | $discussion | |
| int | $forumfrom | source forum id |
| int | $forumto | target forum id |
Definition at line 3880 of file lib.php.

| forum_page_type_list | ( | $ | pagetype, |
| $ | parentcontext, | ||
| $ | currentcontext | ||
| ) |
| forum_pluginfile | ( | $ | course, |
| $ | cm, | ||
| $ | context, | ||
| $ | filearea, | ||
| $ | args, | ||
| $ | forcedownload | ||
| ) |
Serves the forum attachments. Implements needed access control ;-)
| object | $course | |
| object | $cm | |
| object | $context | |
| string | $filearea | |
| array | $args | |
| bool | $forcedownload |
Definition at line 4096 of file lib.php.

| forum_post_subscription | ( | $ | post, |
| $ | forum | ||
| ) |
| forum_print_attachments | ( | $ | post, |
| $ | cm, | ||
| $ | type | ||
| ) |
Returns attachments as formated text/html optionally with separate images
object object object
| object | $post | |
| object | $cm | |
| string | $type | html/text/separateimages |
Definition at line 3924 of file lib.php.


| forum_print_discussion | ( | $ | course, |
| $ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | post, | ||
| $ | mode, | ||
| $ | canreply = NULL, |
||
| $ | canrate = false |
||
| ) |
Prints a forum discussion
CONTEXT_MODULE FORUM_MODE_FLATNEWEST FORUM_MODE_FLATOLDEST FORUM_MODE_THREADED FORUM_MODE_NESTED
| stdClass | $course | |
| stdClass | $cm | |
| stdClass | $forum | |
| stdClass | $discussion | |
| stdClass | $post | |
| int | $mode | |
| mixed | $canreply | |
| bool | $canrate |
Definition at line 5485 of file lib.php.

| forum_print_discussion_header | ( | &$ | post, |
| $ | forum, | ||
| $ | group = -1, |
||
| $ | datestring = "", |
||
| $ | cantrack = true, |
||
| $ | forumtracked = true, |
||
| $ | canviewparticipants = true, |
||
| $ | modcontext = NULL |
||
| ) |
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()
object object
| object | $post | The post object (passed by reference for speed). |
| object | $forum | The forum object. |
| int | $group | Current group. |
| string | $datestring | Format to use for the dates. |
| boolean | $cantrack | Is tracking enabled for this forum. |
| boolean | $forumtracked | Is the user tracking this forum. |
| boolean | $canviewparticipants | True if user has the viewparticipants permission for this course |
Definition at line 3612 of file lib.php.


| forum_print_latest_discussions | ( | $ | course, |
| $ | forum, | ||
| $ | maxdiscussions = -1, |
||
| $ | displayformat = 'plain', |
||
| $ | sort = '', |
||
| $ | currentgroup = -1, |
||
| $ | groupmode = -1, |
||
| $ | page = -1, |
||
| $ | perpage = 100, |
||
| $ | cm = NULL |
||
| ) |
Prints the discussion view screen for a forum.
object object
| object | $course | The current course object. |
| object | $forum | Forum to be printed. |
| int | $maxdiscussions | . |
| string | $displayformat | The display format to use (optional). |
| string | $sort | Sort arguments for database query (optional). |
| int | $groupmode | Group mode of the forum (optional). |
| void | $unused | (originally current group) |
| int | $page | Page mode, page to display (optional). |
| int | $perpage | The maximum number of discussions per page(optional) |
Get the number of discussions found
Show the paging bar
Show the paging bar
Definition at line 5197 of file lib.php.

| forum_print_mode_form | ( | $ | id, |
| $ | mode, | ||
| $ | forumtype = '' |
||
| ) |
Print the drop down that allows the user to select how they want to have the discussion displayed.
| int | $id | forum id if $forumtype is 'single', discussion id for any other forum type |
| mixed | $mode | forum layout mode |
| string | $forumtype | optional |
Definition at line 3793 of file lib.php.

| forum_print_overview | ( | $ | courses, |
| &$ | htmlarray | ||
| ) |
| forum_print_post | ( | $ | post, |
| $ | discussion, | ||
| $ | forum, | ||
| &$ | cm, | ||
| $ | course, | ||
| $ | ownpost = false, |
||
| $ | reply = false, |
||
| $ | link = false, |
||
| $ | footer = "", |
||
| $ | highlight = "", |
||
| $ | postisread = null, |
||
| $ | dummyifcantsee = true, |
||
| $ | istracked = null, |
||
| $ | return = false |
||
| ) |
Print a forum post
object object FORUM_MODE_THREADED PORTFOLIO_FORMAT_PLAINHTML PORTFOLIO_FORMAT_FILE PORTFOLIO_FORMAT_RICHHTML PORTFOLIO_ADD_TEXT_LINK CONTEXT_MODULE
| object | $post | The post to print. |
| object | $discussion | |
| object | $forum | |
| object | $cm | |
| object | $course | |
| boolean | $ownpost | Whether this post belongs to the current user. |
| boolean | $reply | Whether to print a 'reply' link at the bottom of the message. |
| boolean | $link | Just print a shortened version of the post as a link to the full post. |
| string | $footer | Extra stuff to print after the message. |
| string | $highlight | Space-separated list of terms to highlight. |
| int | $post_read | true, false or -99. If we already know whether this user has read this post, pass that in, otherwise, pass in -99, and this function will work it out. |
| boolean | $dummyifcantsee | When forum_user_can_see_post says that the current user can't see this post, if this argument is true (the default) then print a dummy 'you can't see this post' post. If false, don't output anything at all. |
| bool | null | $istracked |
Definition at line 3136 of file lib.php.


| forum_print_posts_flat | ( | $ | course, |
| &$ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | post, | ||
| $ | mode, | ||
| $ | reply, | ||
| $ | forumtracked, | ||
| $ | posts | ||
| ) |
object object FORUM_MODE_FLATNEWEST
| object | $course | |
| object | $cm | |
| object | $forum | |
| object | $discussion | |
| object | $post | |
| object | $mode | |
| bool | $reply | |
| bool | $forumtracked | |
| array | $posts |
Definition at line 5598 of file lib.php.


| forum_print_posts_nested | ( | $ | course, |
| &$ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | parent, | ||
| $ | reply, | ||
| $ | forumtracked, | ||
| $ | posts | ||
| ) |
| forum_print_posts_threaded | ( | $ | course, |
| &$ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | parent, | ||
| $ | depth, | ||
| $ | reply, | ||
| $ | forumtracked, | ||
| $ | posts | ||
| ) |
| forum_print_recent_activity | ( | $ | course, |
| $ | viewfullnames, | ||
| $ | timestart | ||
| ) |
Given a course and a date, prints a summary of all the new messages posted in the course since that date
object object object CONTEXT_MODULE VISIBLEGROUPS
| object | $course | |
| bool | $viewfullnames | capability |
| int | $timestart |
Definition at line 1346 of file lib.php.

| forum_print_recent_mod_activity | ( | $ | activity, |
| $ | courseid, | ||
| $ | detail, | ||
| $ | modnames, | ||
| $ | viewfullnames | ||
| ) |
| forum_rating_permissions | ( | $ | contextid, |
| $ | component, | ||
| $ | ratingarea | ||
| ) |
| forum_rating_validate | ( | $ | params | ) |
Validates a submitted rating
| array | $params | submitted data context => object the context in which the rated items exists [required] component => The component for this module - should always be mod_forum [required] ratingarea => object the context in which the rated items exists [required] itemid => int the ID of the object being rated [required] scaleid => int the scale from which the user can select a rating. Used for bounds checking. [required] rating => int the submitted rating [required] rateduserid => int the id of the user whose items have been rated. NOT the user who submitted the ratings. 0 to update all. [required] aggregation => int the aggregation method to apply when calculating grades ie RATING_AGGREGATE_AVERAGE [required] |
Definition at line 3508 of file lib.php.

| forum_reset_course_form_defaults | ( | $ | course | ) |
| forum_reset_course_form_definition | ( | &$ | mform | ) |
Called by course/reset.php
| $mform | form passed by reference |
Definition at line 7035 of file lib.php.

| forum_reset_gradebook | ( | $ | courseid, |
| $ | type = '' |
||
| ) |
| forum_reset_userdata | ( | $ | data | ) |
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.
object object
| $data | the data submitted from the reset course. |
updating dates - shift may be negative too
Definition at line 6884 of file lib.php.

| forum_scale_used | ( | $ | forumid, |
| $ | scaleid | ||
| ) |
| forum_scale_used_anywhere | ( | $ | scaleid | ) |
| forum_search_form | ( | $ | course, |
| $ | search = '' |
||
| ) |
| forum_search_posts | ( | $ | searchterms, |
| $ | courseid = 0, |
||
| $ | limitfrom = 0, |
||
| $ | limitnum = 50, |
||
| &$ | totalcount, | ||
| $ | extrasql = '' |
||
| ) |
Returns a list of posts found using an array of search terms.
object object object
| array | $searchterms | array of search terms, e.g. word +word -word |
| int | $courseid | if 0, we search through the whole site |
| int | $limitfrom | |
| int | $limitnum | |
| int | &$totalcount | |
| string | $extrasql |
Definition at line 1933 of file lib.php.

| forum_set_return | ( | ) |
| forum_shorten_post | ( | $ | message | ) |
Given a post object that we already know has a long message this function truncates the message nicely to the first sane place between $CFG->forum_longpost and $CFG->forum_shortpost
object
| string | $message |
Definition at line 3737 of file lib.php.

| forum_subscribe | ( | $ | userid, |
| $ | forumid | ||
| ) |
| forum_subscribed_users | ( | $ | course, |
| $ | forum, | ||
| $ | groupid = 0, |
||
| $ | context = null, |
||
| $ | fields = null |
||
| ) |
Returns list of user objects that are subscribed to this forum
object object
| object | $course | the course |
| forum | $forum | the forum |
| integer | $groupid | group id, or 0 for all. |
| object | $context | the forum context, to save re-fetching it where possible. |
| string | $fields | requested user fields (with "u." table prefix) |
Definition at line 2849 of file lib.php.


| forum_supports | ( | $ | feature | ) |
Indicates API features that the forum supports.
FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_COMPLETION_HAS_RULES FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES
| string | $feature |
| forum_tp_add_read_record | ( | $ | userid, |
| $ | postid | ||
| ) |
| forum_tp_can_track_forums | ( | $ | forum = false, |
| $ | user = false |
||
| ) |
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).
object object object
| mixed | $forum | The forum object to test, or the int id (optional). |
| mixed | $userid | The user object to check for (optional). |
Definition at line 6562 of file lib.php.


| forum_tp_count_discussion_read_records | ( | $ | userid, |
| $ | discussionid | ||
| ) |
| forum_tp_count_discussion_unread_posts | ( | $ | userid, |
| $ | discussionid | ||
| ) |
| forum_tp_count_forum_posts | ( | $ | forumid, |
| $ | groupid = false |
||
| ) |
| forum_tp_count_forum_read_records | ( | $ | userid, |
| $ | forumid, | ||
| $ | groupid = false |
||
| ) |
| forum_tp_count_forum_unread_posts | ( | $ | cm, |
| $ | course | ||
| ) |
| forum_tp_delete_read_records | ( | $ | userid = -1, |
| $ | postid = -1, |
||
| $ | discussionid = -1, |
||
| $ | forumid = -1 |
||
| ) |
| forum_tp_get_course_unread_posts | ( | $ | userid, |
| $ | courseid | ||
| ) |
| forum_tp_get_discussion_read_records | ( | $ | userid, |
| $ | discussionid | ||
| ) |
| forum_tp_get_read_records | ( | $ | userid = -1, |
| $ | postid = -1, |
||
| $ | discussionid = -1, |
||
| $ | forumid = -1 |
||
| ) |
| forum_tp_get_untracked_forums | ( | $ | userid, |
| $ | courseid | ||
| ) |
| forum_tp_is_post_old | ( | $ | post, |
| $ | time = null |
||
| ) |
| forum_tp_is_post_read | ( | $ | userid, |
| $ | post | ||
| ) |
| forum_tp_is_tracked | ( | $ | forum, |
| $ | user = false |
||
| ) |
Tells whether a specific forum is tracked by the user. A user can optionally be specified. If not specified, the current user is assumed.
object object object
| mixed | $forum | If int, the id of the forum being checked; if object, the forum object |
| int | $userid | The id of the user being checked (optional). |
Definition at line 6608 of file lib.php.


| forum_tp_mark_discussion_read | ( | $ | user, |
| $ | discussionid | ||
| ) |
| forum_tp_mark_forum_read | ( | $ | user, |
| $ | forumid, | ||
| $ | groupid = false |
||
| ) |
| forum_tp_mark_post_read | ( | $ | userid, |
| $ | post, | ||
| $ | forumid | ||
| ) |
| forum_tp_mark_posts_read | ( | $ | user, |
| $ | postids | ||
| ) |
| forum_tp_start_tracking | ( | $ | forumid, |
| $ | userid = false |
||
| ) |
| forum_tp_stop_tracking | ( | $ | forumid, |
| $ | userid = false |
||
| ) |
| forum_unsubscribe | ( | $ | userid, |
| $ | forumid | ||
| ) |
| forum_update_grades | ( | $ | forum, |
| $ | userid = 0, |
||
| $ | nullifnone = true |
||
| ) |
| forum_update_instance | ( | $ | forum, |
| $ | mform | ||
| ) |
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.
object
| object | $forum | forum instance (with magic quotes) |
Definition at line 131 of file lib.php.

| forum_update_post | ( | $ | post, |
| $ | mform, | ||
| &$ | message | ||
| ) |
| forum_update_subscriptions_button | ( | $ | courseid, |
| $ | forumid | ||
| ) |
| forum_user_can_post | ( | $ | forum, |
| $ | discussion, | ||
| $ | user = NULL, |
||
| $ | cm = NULL, |
||
| $ | course = NULL, |
||
| $ | context = NULL |
||
| ) |
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.
object object DEBUG_DEVELOPER CONTEXT_MODULE VISIBLEGROUPS
| object | $forum | forum object |
| object | $discussion | |
| object | $user | |
| object | $cm | |
| object | $course | |
| object | $context |
Definition at line 4949 of file lib.php.


| forum_user_can_post_discussion | ( | $ | forum, |
| $ | currentgroup = null, |
||
| $ | unused = -1, |
||
| $ | cm = NULL, |
||
| $ | context = NULL |
||
| ) |
| forum_user_can_see_discussion | ( | $ | forum, |
| $ | discussion, | ||
| $ | context, | ||
| $ | user = NULL |
||
| ) |
| forum_user_can_see_post | ( | $ | forum, |
| $ | discussion, | ||
| $ | post, | ||
| $ | user = NULL, |
||
| $ | cm = NULL |
||
| ) |
| forum_user_can_view_post | ( | $ | post, |
| $ | course, | ||
| $ | cm, | ||
| $ | forum, | ||
| $ | discussion, | ||
| $ | user = NULL |
||
| ) |
| forum_user_complete | ( | $ | course, |
| $ | user, | ||
| $ | mod, | ||
| $ | forum | ||
| ) |
| forum_user_enrolled | ( | $ | cp | ) |
| forum_user_has_posted | ( | $ | forumid, |
| $ | did, | ||
| $ | userid | ||
| ) |
| forum_user_has_posted_discussion | ( | $ | forumid, |
| $ | userid | ||
| ) |
| forum_user_outline | ( | $ | course, |
| $ | user, | ||
| $ | mod, | ||
| $ | forum | ||
| ) |
| object | $course | |
| object | $user | |
| object | $mod | TODO this is not used in this function, refactor |
| object | $forum |
Definition at line 1121 of file lib.php.

| forum_user_unenrolled | ( | $ | cp | ) |