Mail
in package
implements
ActionInterface
uses
ActionTrait, BackwardCompatibility
Handles mail configuration, as well as reviewing the mail queue.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : static
- $processedBirthdayEmails : array<string|int, mixed>
Methods
- browse() : void
- Display the mail queue.
- 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.
- clear() : void
- This function clears the mail queue of all emails, and at the end redirects to browse.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- getConfigVars() : array<string|int, mixed>
- Gets the configuration variables for this admin area.
- 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_getMailQueue() : array<string|int, mixed>
- This function grabs the mail queue items from the database, according to the params given.
- list_getMailQueueSize() : int
- Returns the total count of items in the mail queue.
- load() : static
- Static wrapper for constructor.
- settings() : void
- Allows to view and modify the mail settings.
- subActionProvider() : null|array<string|int, mixed>
- Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
- test() : void
- Test mail sending ability.
- timeSince() : string
- Little utility function to calculate how long ago a time was.
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
- pauseMailQueueClear() : void
- Used for pausing the mail queue.
Properties
$subaction
public
string
$subaction
= 'browse'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['browse' => 'browse', 'clear' => 'clear', 'settings' => 'settings', 'test' => 'test']
Available sub-actions.
$obj
protected
static static
$obj
An instance of this class. This is used by the load() method to prevent multiple instantiations.
$processedBirthdayEmails
protected
static array<string|int, mixed>
$processedBirthdayEmails
= []
Processed version of Lang::$txtBirthdayEmails. This is used internally by the settings() method.
Methods
browse()
Display the mail queue.
public
browse() : void
..
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.
clear()
This function clears the mail queue of all emails, and at the end redirects to browse.
public
clear() : void
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
getConfigVars()
Gets the configuration variables for this admin area.
public
static getConfigVars() : array<string|int, mixed>
Return values
array<string|int, mixed> —$config_vars for the news area.
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_getMailQueue()
This function grabs the mail queue items from the database, according to the params given.
public
static list_getMailQueue(int $start, int $items_per_page, string $sort) : array<string|int, mixed>
Callback for $listOptions['get_items'] in $this->browse()
Parameters
- $start : int
-
The item to start with (for pagination purposes)
- $items_per_page : int
-
How many items to show on each page
- $sort : string
-
A string indicating how to sort the results
Return values
array<string|int, mixed> —An array with info about the mail queue items
list_getMailQueueSize()
Returns the total count of items in the mail queue.
public
static list_getMailQueueSize() : int
Callback for $listOptions['get_count'] in $this->browse
Return values
int —The total number of mail queue items
load()
Static wrapper for constructor.
public
static load() : static
Return values
static —An instance of this class.
settings()
Allows to view and modify the mail settings.
public
settings() : 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>test()
Test mail sending ability.
public
test() : void
timeSince()
Little utility function to calculate how long ago a time was.
public
static timeSince(int $time_diff) : string
Parameters
- $time_diff : int
-
The time difference, in seconds
Return values
string —A string indicating how many days, hours, minutes or seconds (depending on $time_diff)
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed
pauseMailQueueClear()
Used for pausing the mail queue.
protected
pauseMailQueueClear() : void