Warnings
in package
implements
ActionInterface
uses
ActionTrait, BackwardCompatibility
Allows the moderator to view stuff related to warnings.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : static
Methods
- call() : void
- Convenience method to load() and execute() an instance of this class.
- canBeLogged() : bool
- Determines whether this action can be logged in the online log.
- canShowDebuggingInfo() : bool
- Determines whether debugging info should be shown.
- canShowInMaintenanceMode() : bool
- Determines whether this action allows access in maintenance mode.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- getOutputType() : OutputTypeInterface
- Gets the output type for this action.
- isAgreementAction() : bool
- Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
- isRestrictedGuestAccessAllowed() : bool
- Determines whether this action allows access if guest access is restricted.
- isSimpleAction() : bool
- Determines whether this is a simple action.
- list_getWarningCount() : int
- Callback for SMF\ItemList().
- list_getWarnings() : array<string|int, mixed>
- Callback for SMF\ItemList().
- list_getWarningTemplateCount() : int
- Callback for SMF\ItemList().
- list_getWarningTemplates() : array<string|int, mixed>
- Callback for SMF\ItemList().
- load() : static
- Static wrapper for constructor.
- log() : void
- Simply put, look at the warning log!
- subActionProvider() : null|array<string|int, mixed>
- Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
- templateEdit() : void
- Edit a warning template.
- templates() : void
- Load all the warning templates.
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
Properties
$subaction
public
string
$subaction
= 'log'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['log' => ['log', ['view_warning_any', 'moderate_forum']], 'templates' => ['templates', 'issue_warning'], 'templateedit' => ['templateEdit', 'issue_warning']]
Available sub-actions.
$obj
protected
static static
$obj
An instance of this class. This is used by the load() method to prevent multiple instantiations.
Methods
call()
Convenience method to load() and execute() an instance of this class.
public
static call() : void
canBeLogged()
Determines whether this action can be logged in the online log.
public
canBeLogged() : bool
Return values
boolcanShowDebuggingInfo()
Determines whether debugging info should be shown.
public
canShowDebuggingInfo() : bool
Return values
boolcanShowInMaintenanceMode()
Determines whether this action allows access in maintenance mode.
public
canShowInMaintenanceMode() : bool
Return values
bool —True if access is allowed, false otherwise.
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
getOutputType()
Gets the output type for this action.
public
getOutputType() : OutputTypeInterface
Return values
OutputTypeInterfaceisAgreementAction()
Determines whether this action can be accessed without accepting the registration agreement and privacy policy.
public
isAgreementAction() : bool
Return values
boolisRestrictedGuestAccessAllowed()
Determines whether this action allows access if guest access is restricted.
public
isRestrictedGuestAccessAllowed() : bool
Return values
bool —True if access is allowed, false otherwise.
isSimpleAction()
Determines whether this is a simple action.
public
isSimpleAction() : bool
Return values
boollist_getWarningCount()
Callback for SMF\ItemList().
public
static list_getWarningCount() : int
Return values
int —The total number of warnings that have been issued
list_getWarnings()
Callback for SMF\ItemList().
public
static list_getWarnings(int $start, int $items_per_page, string $sort) : array<string|int, mixed>
Parameters
- $start : int
-
The item to start with (for pagination purposes)
- $items_per_page : int
-
The number of items to show per page
- $sort : string
-
A string indicating how to sort the results
Return values
array<string|int, mixed> —An array of data about warning log entries
list_getWarningTemplateCount()
Callback for SMF\ItemList().
public
static list_getWarningTemplateCount() : int
Return values
int —The total number of warning templates
list_getWarningTemplates()
Callback for SMF\ItemList().
public
static list_getWarningTemplates(int $start, int $items_per_page, string $sort) : array<string|int, mixed>
Parameters
- $start : int
-
The item to start with (for pagination purposes)
- $items_per_page : int
-
The number of items to show per page
- $sort : string
-
A string indicating how to sort the results
Return values
array<string|int, mixed> —An array of info about the available warning templates
load()
Static wrapper for constructor.
public
static load() : static
Return values
static —An instance of this class.
log()
Simply put, look at the warning log!
public
log() : void
subActionProvider()
Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
public
static subActionProvider([null|string $sa = null ][, bool $return_config = false ][, string|null $activity = null ]) : null|array<string|int, mixed>
Parameters
- $sa : null|string = null
- $return_config : bool = false
- $activity : string|null = null
Return values
null|array<string|int, mixed>templateEdit()
Edit a warning template.
public
templateEdit() : void
templates()
Load all the warning templates.
public
templates() : void
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed