Detailed Description
Definition at line 27 of file lib.php.
Constructor & Destructor Documentation
#@- Construct function of comment class, initialise class members
- Parameters:
-
| stdClass | $options | |
| object | $options | { context => context context to use for the comment [required] component => string which plugin will comment being added to [required] itemid => int the id of the associated item (forum post, glossary item etc) [required] area => string comment area cm => stdClass course module course => course course object client_id => string an unique id to identify comment area autostart => boolean automatically expend comments showcount => boolean display the number of comments displaycancel => boolean display cancel button notoggle => boolean don't show/hide button linktext => string title of show/hide button } |
Definition at line 160 of file lib.php.
Member Function Documentation
Returns true if the user can delete this comment
- Parameters:
-
- Returns:
- bool
Definition at line 881 of file lib.php.
Returns true if the user can add comments against this comment description
- Returns:
- bool
Definition at line 871 of file lib.php.
Returns true if the user is able to view comments
- Returns:
- bool
Definition at line 862 of file lib.php.
Returns the number of comments associated with the details of this object
moodle_database $DB
- Returns:
- int
Definition at line 600 of file lib.php.
Delete a comment
- Parameters:
-
- Returns:
- mixed
Definition at line 726 of file lib.php.
delete by context, commentarea and itemid
- Parameters:
-
| stdClass | array | $param | { contextid => int the context in which the comments exist [required] commentarea => string the comment area [optional] itemid => int comment itemid [optional] } |
- Returns:
- boolean
Definition at line 693 of file lib.php.
Returns the course module associated with the comment
- Returns:
- stdClass
Definition at line 915 of file lib.php.
Returns the comment area associated with the commentarea
- Returns:
- stdClass
Definition at line 933 of file lib.php.
Return matched comments
- Parameters:
-
- Returns:
- mixed
Definition at line 541 of file lib.php.
Returns the component associated with the comment
- Returns:
- string
Definition at line 890 of file lib.php.
Returns the context associated with the comment
- Returns:
- stdClass
Definition at line 898 of file lib.php.
Returns the course id associated with the comment
- Returns:
- int
Definition at line 906 of file lib.php.
Returns the item id associated with the comment
- Returns:
- int
Definition at line 924 of file lib.php.
Returns HTML to display a pagination bar
stdClass $CFG core_renderer $OUTPUT
- Parameters:
-
- Returns:
- string
Definition at line 616 of file lib.php.
Receive nonjs comment parameters
- Parameters:
-
| moodle_page | $page | The page object to initialise comments within If not provided the global $PAGE is used |
Definition at line 277 of file lib.php.
Initialises the JavaScript that enchances the comment API.
- Parameters:
-
| moodle_page | $page | The moodle page object that the JavaScript should be initialised for. |
Definition at line 425 of file lib.php.
Prepare comment code in html
- Parameters:
-
- Returns:
- mixed
Definition at line 448 of file lib.php.
Returns an array containing comments in HTML format.
core_renderer $OUTPUT
- Parameters:
-
| stdClass | $cmt | { id => int comment id content => string comment content format => int comment text format timecreated => int comment's timecreated profileurl => string link to user profile fullname => comment author's full name avatar => string user's avatar delete => boolean does user have permission to delete comment? } |
| bool | $nonjs | |
- Returns:
- array
Definition at line 817 of file lib.php.
Print comments
- Parameters:
-
| int | $page | |
| boolean | $return | return comments list string or print it out |
| boolean | $nonjs | print nonjs comments list or not? |
- Returns:
- mixed
Definition at line 747 of file lib.php.
Delete page_comments in whole course, used by course reset
- Parameters:
-
| stdClass | $context | course context |
Definition at line 708 of file lib.php.
Sets the value of the autostart option.
If set to true then the comments will be loaded during page load. Normally this happens only once the user expands the comment section.
- Parameters:
-
Definition at line 391 of file lib.php.
Sets the component.
This method shouldn't be public, changing the component once it has been set potentially invalidates permission checks. A coding_error is now thrown if code attempts to change the component.
- Parameters:
-
- Returns:
- void
Definition at line 306 of file lib.php.
Sets the displaycancel option
If set to true then a cancel button will be shown when using the form to post comments.
- Parameters:
-
Definition at line 403 of file lib.php.
Sets the displaytotalcount option
If set to true then the total number of comments will be displayed when printing comments.
- Parameters:
-
Definition at line 415 of file lib.php.
Sets the value of the notoggle option.
If set to true then the user will not be able to expand and collase the comment section.
- Parameters:
-
Definition at line 379 of file lib.php.
Determines if the user can post a comment
- Parameters:
-
Definition at line 328 of file lib.php.
Determines if the user can view the comment.
- Parameters:
-
Definition at line 319 of file lib.php.
Revoke validate callbacks
- Parameters:
-
| stdClass | $params | addtionall parameters need to add to callbacks |
Definition at line 848 of file lib.php.
Field Documentation
$autostart = false [protected] |
$displaycancel = false [protected] |
$displaytotalcount = false [protected] |
$notoggle = false [protected] |
$totalcommentcount = null [protected] |
The documentation for this class was generated from the following file:
- C:/xampp/htdocs/moodle/comment/lib.php