Documentation

Groups
in package
implements ActionInterface, Routable uses ActionRouter, ActionTrait, BackwardCompatibility

Shows group info.

Table of Contents

Interfaces

ActionInterface
Interface for all action classes.
Routable
Classes implementing this interface can build routes from URL query parameters and parse routes back into URL query parameters.

Properties

$subaction  : string
$subactions  : array<string|int, mixed>
$action_url  : string
$obj  : static

Methods

buildRoute()  : array<string|int, mixed>
Builds a routing path based on URL query parameters.
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.
index()  : void
This very simply lists the groups, nothing snazy.
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_getMembergroups()  : array<string|int, mixed>
Helper function to generate a list of membergroups for display
listMembergroupMembers_Href()  : bool
Gets the members of a supplied membergroup.
load()  : static
Static wrapper for constructor.
members()  : void
Display members of a group.
parseRoute()  : array<string|int, mixed>
Parses a route to get URL query parameters.
subActionProvider()  : null|array<string|int, mixed>
Called by Subs-Compat.php BackwardCompatibility wrapper functions to provide subaction execution for existing mods
__construct()  : mixed
Constructor. Protected to force instantiation via self::load().
buildActionRoute()  : array<string|int, mixed>
Builds a routing path for an action based on URL query parameters.
parseActionRoute()  : array<string|int, mixed>
Parses a route for an action to get URL query parameters.

Properties

$subaction

public string $subaction = 'index'

The requested sub-action. This should be set by the constructor.

$subactions

public static array<string|int, mixed> $subactions = ['index' => 'index', 'members' => 'members']

Available sub-actions.

$action_url

protected string $action_url = '?action=groups'

The action and area URL query to use in links to sub-actions.

$obj

protected static static $obj

An instance of this class. This is used by the load() method to prevent multiple instantiations.

Methods

buildRoute()

Builds a routing path based on URL query parameters.

public static buildRoute(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>

URL query parameters.

Return values
array<string|int, mixed>

Contains two elements: ['route' => [], 'params' => []]. The 'route' element contains the routing path. The 'params' element contains any $params that weren't incorporated into the route.

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
bool

canShowDebuggingInfo()

Determines whether debugging info should be shown.

public canShowDebuggingInfo() : bool
Return values
bool

canShowInMaintenanceMode()

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

It allows moderators and users to access the group showing functions. It handles permission checks, and puts the moderation bar on as required.

index()

This very simply lists the groups, nothing snazy.

public index() : void

isAgreementAction()

Determines whether this action can be accessed without accepting the registration agreement and privacy policy.

public isAgreementAction() : bool
Return values
bool

isRestrictedGuestAccessAllowed()

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
bool

list_getMembergroups()

Helper function to generate a list of membergroups for display

public static list_getMembergroups(int $start, int $items_per_page, string $sort, string $membergroup_type) : array<string|int, mixed>
Parameters
$start : int

What item to start with (not used here)

$items_per_page : int

How many items to show on each page (not used here)

$sort : string

An SQL query indicating how to sort the results

$membergroup_type : string

Should be 'post_count' for post groups or anything else for regular groups

Return values
array<string|int, mixed>

An array of group member info for the list

listMembergroupMembers_Href()

Gets the members of a supplied membergroup.

public static listMembergroupMembers_Href(array<string|int, mixed> &$members, int $membergroup[, int $limit = null ]) : bool

Returns them as a link for display.

Parameters
$members : array<string|int, mixed>

The IDs of the members.

$membergroup : int

The ID of the group.

$limit : int = null

How many members to show (null for no limit).

Return values
bool

True if there are more members to display, false otherwise.

load()

Static wrapper for constructor.

public static load() : static
Return values
static

An instance of this class.

members()

Display members of a group.

public members() : void

It shows a list of members that are part of a given membergroup. It is called by ?action=groups;sa=members;group=x It allows sorting on several columns. It redirects to itself.

Tags
todo

use SMF\ItemList

parseRoute()

Parses a route to get URL query parameters.

public static parseRoute(array<string|int, mixed> $route[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
Parameters
$route : array<string|int, mixed>

Array of routing path components.

$params : array<string|int, mixed> = []

Any existing URL query parameters.

Return values
array<string|int, mixed>

URL query parameters

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>

__construct()

Constructor. Protected to force instantiation via self::load().

protected __construct() : mixed

buildActionRoute()

Builds a routing path for an action based on URL query parameters.

protected static buildActionRoute(array<string|int, mixed> &$params) : array<string|int, mixed>

The 'action', 'area', and 'sa' parameters will be mapped to route path components in that order. The 'action' parameter is required, whereas 'area' and 'sa' are optional and will be silently skipped if not set.

The parameters are passed by reference and parameters are removed from the array when recognized. This lets wrapper methods continue parsing the remainder of the parameters without worrying about duplicate elements.

Parameters
$params : array<string|int, mixed>

URL query parameters.

Return values
array<string|int, mixed>

The route path elements.

parseActionRoute()

Parses a route for an action to get URL query parameters.

protected static parseActionRoute(array<string|int, mixed> &$route) : array<string|int, mixed>

The first element of the route path is mapped to the 'action' parameter.

For the 'admin', 'moderate', and 'profile' actions, the second element of the route is mapped to the 'area' parameter and the third element is mapped to the 'sa' parameter.

For all other actions, the second element of the route path is mapped to the 'sa' parameter.

The route passed by reference and route path elements are removed from the route when recognized. This lets wrapper methods continue parsing the remainder of the route without worrying about duplicate elements.

Parameters
$route : array<string|int, mixed>

Array of routing path components.

Return values
array<string|int, mixed>

URL query parameters


        
On this page

Search results