Documentation

TopicSplit
in package
implements ActionInterface, Routable uses ActionSuffixRouter, ActionTrait, BackwardCompatibility

Handles splitting of topics.

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>
$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
Splits a topic into two topics.
getOutputType()  : OutputTypeInterface
Gets the output type for this action.
index()  : string|null
Screen shown before the actual split.
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.
load()  : static
Static wrapper for constructor.
select()  : void
Allows the user to select the messages to be split.
split()  : void
Do the actual split.
splitSelection()  : void
Do the actual split of a selection of topics.
splitTopic()  : int
General function to split off a topic.
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().

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', 'split' => 'split', 'selectTopics' => 'select', 'splitSelection' => 'splitSelection']

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

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()

Splits a topic into two topics.

public execute() : void
  • Delegates to the other functions (based on the URL parameter 'sa').
  • Loads the SplitTopics template.
  • Requires the split_any permission.
  • Accessed via ?action=splittopics.

index()

Screen shown before the actual split.

public index() : string|null
  • Default sub action for ?action=splittopics.
  • Accessed via ?action=splittopics;sa=index.
  • Uses 'ask' sub template of the SplitTopics template.
  • Redirects to select if the message given turns out to be the first message of a topic.
  • Shows the user three ways to split the current topic.
Return values
string|null

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

Simple actions don't require the index template at all.

Return values
bool

load()

Static wrapper for constructor.

public static load() : static
Return values
static

An instance of this class.

select()

Allows the user to select the messages to be split.

public select() : void
  • Accessed via ?action=splittopics;sa=selectTopics.
  • Uses 'select' sub template of the SplitTopics template or (for XMLhttp) the 'split' sub template of the Xml template.
  • Supports XMLhttp for adding/removing a message to the selection.
  • Uses a session variable to store the selected topics.
  • Shows two independent page indexes for both the selected and not-selected messages (;topic=1.x;start2=y).

split()

Do the actual split.

public split() : void
  • Accessed via ?action=splittopics;sa=merge.
  • Uses the main SplitTopics template.
  • Supports three ways of splitting: (1) only one message is split off. (2) all messages after and including a given message are split off. (3) select topics to split (redirects to select()).
  • Uses splitTopic function to do the actual splitting.

splitSelection()

Do the actual split of a selection of topics.

public splitSelection() : void
  • Accessed via ?action=splittopics;sa=splitSelection.
  • Uses the main SplitTopics template.
  • Uses splitTopic function to do the actual splitting.

splitTopic()

General function to split off a topic.

public static splitTopic(int $split1_ID_TOPIC, array<string|int, mixed> $splitMessages, string $new_subject) : int
  • Creates a new topic and moves the messages with the IDs in array messagesToBeSplit to the new topic.
  • The subject of the newly created topic is set to 'newSubject'.
  • Marks the newly created message as read for the user splitting it.
  • Updates the statistics to reflect a newly created topic.
  • Logs the action in the moderation log.
  • A notification is sent to all users monitoring this topic.
Parameters
$split1_ID_TOPIC : int

The ID of the topic we're splitting

$splitMessages : array<string|int, mixed>

The IDs of the messages being split

$new_subject : string

The subject of the new topic

Return values
int

The ID of the new split topic.

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

        
On this page

Search results