Moderate
in package
implements
ModerateInterface
A base class for moderation.
Implement getList() approve() and delete() for a basic moderation component.
Table of Contents
Interfaces
- ModerateInterface
- A moderation component.
Properties
- $friendly_name : mixed
Methods
- __construct() : mixed
- complete() : void
- Process actions after the transaction is complete.
- getCssClassName() : string
- Return the class name for this controller, expressed in CSS style, i.e. with dashes
- getFriendlyName() : string
- Return the 'friendly' name of this item
- getList() : array<string|int, string>|null
- Return an array of one or more items which need moderating.
- render() : string
- Render the moderation form.
- renderRow() : string
- Overwritable render function for a given approval row.
- setData() : bool
- Record extra data from the moderation form, if any.
Properties
$friendly_name
protected
mixed
$friendly_name
= '- No name -'
Methods
__construct()
public
__construct() : mixed
complete()
Process actions after the transaction is complete.
public
complete() : void
Tags
getCssClassName()
Return the class name for this controller, expressed in CSS style, i.e. with dashes
public
getCssClassName() : string
Example: When called from ModerateImages --> 'moderate-images'
Return values
string —Name of this PHP class, in a format suitable for use in CSS
getFriendlyName()
Return the 'friendly' name of this item
public
final getFriendlyName() : string
Return values
stringgetList()
Return an array of one or more items which need moderating.
public
getList() : array<string|int, string>|null
The array should have the following format: [] = array('id' => 'html') id record identifier html record preview html
Return values
array<string|int, string>|null —[ id => html ]
render()
Render the moderation form.
public
render() : string
Tags
Return values
stringrenderRow()
Overwritable render function for a given approval row.
public
renderRow(int $id, string $html, string $default_action) : string
This decorates the HTML snippet given the getList() method.
Parameters
- $id : int
- $html : string
-
inner html
- $default_action : string
-
pre-checked approval action
- 'app' = approve
- 'del' = delete
- '' = do nothing
Return values
stringsetData()
Record extra data from the moderation form, if any.
public
setData(mixed $id, array<string|int, mixed> $data) : bool
Parameters
- $id : mixed
- $data : array<string|int, mixed>