SilverStripe\Comments\Extensions\CommentsExtension
Extension to {@link DataObject} to enable tracking comments.
Synopsis
class CommentsExtension
extends DataExtension
{
- // members
- private static array $comments = ;
- private static array $db = ;
- private static array $has_many = ;
- // methods
- public void populateDefaults()
- public void updateSettingsFields()
- public string getModerationRequired()
- public boolean getCommentsRequireLogin()
- public DataList AllComments()
- public DataList AllVisibleComments()
- public DataList Comments()
- public PaginatedList PagedComments()
- public boolean getCommentsEnabled()
- public string getCommentHolderID()
- public string|array getPostingRequiredPermission()
- public boolean canPostComment()
- public boolean canModerateComments()
- public string getCommentRSSLink()
- public string getCommentRSSLinkPage()
- public void CommentsForm()
- public bool attachedToSiteTree()
- public mixed getCommentsOption()
- public array getCommentsOptions()
- protected void updateModerationFields()
- public void updateCMSFields()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Tasks
Line | Task |
---|---|
153+ | Allow customization of other {@link Commenting} configuration |
463+ | Cleanup the passing of all this configuration based functionality |
Members
private
- $comments
—
array
Default configuration values - $db — array
-
$has_many
{@inheritDoc}
Methods
protected
- updateModerationFields() — Add moderation functions to the current fieldlist
public
- AllComments() — Returns the RelationList of all comments against this object. Can be used as a data source for a gridfield with write access.
- AllVisibleComments() — Returns all comments against this object, with with spam and unmoderated items excluded, for use in the frontend
- Comments() — Returns the root level comments, with spam and unmoderated items excluded, for use in the frontend
- CommentsForm() — Comments interface for the front end. Includes the CommentAddForm and the composition of the comments display.
- PagedComments() — Returns a paged list of the root level comments, with spam and unmoderated items excluded, for use in the frontend
- attachedToSiteTree() — Returns whether this extension instance is attached to a {@link SiteTree} object
- canModerateComments() — Determine if this member can moderate comments in the CMS
- canPostComment() — Determine if a user can post comments on this item
- getCommentHolderID() — Get the HTML ID for the comment holder in the template
- getCommentRSSLink() — Gets the RSS link to all comments
- getCommentRSSLinkPage() — Get the RSS link to all comments on this page
- getCommentsEnabled() — Determine if comments are enabled for this instance
- getCommentsOption() — Get the commenting option for this object.
- getCommentsOptions()
- getCommentsRequireLogin() — Determine if users must be logged in to post comments
- getModerationRequired() — Get comment moderation rules for this parent
- getPostingRequiredPermission() — Permission codes required in order to post (or empty if none required)
- populateDefaults() — CMS configurable options should default to the config values, but respect default values specified by the object
- updateCMSFields()
- updateSettingsFields() — If this extension is applied to a {@link SiteTree} record then append a Provide Comments checkbox to allow authors to trigger whether or not to display comments