Home
in package
implements
ActionInterface
Uses
BackwardCompatibility
This is the home page of the moderation center.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $blocks : array<string|int, mixed>
- $obj : object
- $backcompat : array<string|int, mixed>
Methods
- call() : void
- Convenience method to load() and execute() an instance of this class.
- execute() : void
- Do the job.
- exportStatic() : void
- Provides a way to export a class's public static properties and methods to global namespace.
- load() : object
- Static wrapper for constructor.
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
- groupRequests() : void
- Show a list of all the group requests they can see.
- integrateModBlocks() : mixed
- Provides a home for the deprecated integrate_mod_centre_blocks hook.
- notes() : void
- Show an area for the moderator to type into.
- reportedMembers() : void
- Show a list of the most recent reported members.
- reportedPosts() : void
- Show a list of the most recent reported posts.
- watchedUsers() : void
- Show a list of the most active watched users.
Properties
$blocks
public
array<string|int, mixed>
$blocks
= ['g' => ['func' => 'groupRequests', 'sub_template' => 'group_requests_block', 'context_var' => 'group_requests', 'permissions' => ['can_moderate_groups']], 'r' => ['func' => 'reportedPosts', 'sub_template' => 'reported_posts_block', 'context_var' => 'reported_posts', 'permissions' => ['can_moderate_boards']], 'w' => [
'func' => 'watchedUsers',
'sub_template' => 'watched_users',
'context_var' => 'watched_users',
// There are two possible reasons to grant someone access to this.
'permissions' => ['can_moderate_boards', 'can_moderate_users'],
], 'rm' => ['func' => 'reportedMembers', 'sub_template' => 'reported_users_block', 'context_var' => 'reported_users', 'permissions' => ['can_moderate_users']]]
Blocks of data to show on the moderation center home page.
$obj
protected
static object
$obj
An instance of this class. This is used by the load() method to prevent mulitple instantiations.
$backcompat
private
static array<string|int, mixed>
$backcompat
= ['func_names' => ['call' => 'ModerationHome']]
BackwardCompatibility settings for this class.
Methods
call()
Convenience method to load() and execute() an instance of this class.
public
static call() : void
execute()
Do the job.
public
execute() : void
exportStatic()
Provides a way to export a class's public static properties and methods to global namespace.
public
static exportStatic() : void
To do so:
- Use this trait in the class.
- At the END of the class's file, call its exportStatic() method.
Although it might not seem that way at first glance, this approach conforms to section 2.3 of PSR 1, since executing this method is simply a dynamic means of declaring functions when the file is included; it has no other side effects.
Regarding the $backcompat items:
A class's static properties are not exported to global variables unless explicitly included in $backcompat['prop_names']. Likewise, a class's static methods are not exported as global functions unless explicitly included in $backcompat['func_names'].
$backcompat['prop_names'] is a simple array where the keys are the names of one or more of a class's static properties, and the values are the names of global variables. In each case, the global variable will be set to a reference to the static property. Static properties that are not named in this array will not be exported.
$backcompat['func_names'] is a simple array where the keys are the names of one or more of a class's static methods, and the values are the names that should be used for global functions that will encapsulate those methods. Methods that are not named in this array will not be exported.
Adding non-static properties or methods to the $backcompat arrays will produce runtime errors. It is the responsibility of the developer to make sure not to do this.
load()
Static wrapper for constructor.
public
static load() : object
Return values
object —An instance of this class.
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed
groupRequests()
Show a list of all the group requests they can see.
protected
groupRequests() : void
integrateModBlocks()
Provides a home for the deprecated integrate_mod_centre_blocks hook.
protected
static integrateModBlocks() : mixed
MOD AUTHORS: Please use the integrate_moderation_home_blocks instead.
notes()
Show an area for the moderator to type into.
protected
notes() : void
reportedMembers()
Show a list of the most recent reported members.
protected
reportedMembers() : void
reportedPosts()
Show a list of the most recent reported posts.
protected
reportedPosts() : void
watchedUsers()
Show a list of the most active watched users.
protected
watchedUsers() : void