Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
block_comments

Namespaces

namespace  block_comments\event
  
 
namespace  block_comments\privacy
  
 

Classes

class  behat_block_comments
 Steps definitions to deal with the commenting system. More...
 
class  block_comments
 
class  block_comments\event\comment_created
 block_comments comment created event. More...
 
class  block_comments\event\comment_deleted
 block_comments comment deleted event. More...
 
class  block_comments\privacy\provider
 Privacy Subsystem implementation for block_comments. More...
 

Functions

 block_comments_comment_display ($comments, $args)
 Validate comment data before displaying comments.
 
 block_comments_comment_permissions ($args)
 Running addtional permission check on plugins.
 
 block_comments_comment_validate ($comment_param)
 Validate comment parameter before perform other comments actions.
 

Variables

 $capabilities
 
 $plugin = 2023100400
 
$plugin component = 'block_comments'
 
$plugin version = 2023100900
 

Detailed Description

Function Documentation

◆ block_comments_comment_display()

block_comments_comment_display ( $comments,
$args )

Validate comment data before displaying comments.

Parameters
stdClass$comment
stdClass$args
Return values
boolean

◆ block_comments_comment_permissions()

block_comments_comment_permissions ( $args)

Running addtional permission check on plugins.

Parameters
stdClass$args
Return values
array

◆ block_comments_comment_validate()

block_comments_comment_validate ( $comment_param)

Validate comment parameter before perform other comments actions.

Parameters
stdClass$comment_param{ context => context the context object courseid => int course id cm => stdClass course module object commentarea => string comment area itemid => int itemid }
Return values
boolean

Variable Documentation

◆ $capabilities

$capabilities
Initial value:
= array(
'block/comments:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/comments:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
)
const CONTEXT_SYSTEM
System context level - only one instance in every system.
Definition accesslib.php:122
const RISK_SPAM
Capability allows users to add content others may see - see
Definition accesslib.php:147
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition accesslib.php:115
const RISK_XSS
Capability allows user to add scripted content - see
Definition accesslib.php:143
const CONTEXT_BLOCK
Block context level - one instance for each block, sticky blocks are tricky because ppl think they sh...
Definition accesslib.php:136