Boards
in package
implements
ActionInterface
Uses
BackwardCompatibility
Manages and maintains the boards and categories of the forum.
Table of Contents
Interfaces
- ActionInterface
- Interface for all action classes.
Properties
- $subaction : string
- $subactions : array<string|int, mixed>
- $obj : object
- $backcompat : array<string|int, mixed>
Methods
- call() : void
- Convenience method to load() and execute() an instance of this class.
- editBoard() : void
- Modify a specific board... screen for editing and repositioning a board.
- editBoard2() : void
- Make changes to/delete a board.
- editBoardSettings() : void|array<string|int, mixed>
- Backward compatibility wrapper for the settings sub-action.
- editCategory() : void
- Modify a specific category.
- editCategory2() : void
- Function for handling a submitted form saving the category.
- execute() : void
- Dispatcher to whichever sub-action method is necessary.
- exportStatic() : void
- Provides a way to export a class's public static properties and methods to global namespace.
- getConfigVars() : array<string|int, mixed>
- Gets the configuration variables for this admin area.
- load() : object
- Static wrapper for constructor.
- main() : void
- The main control panel thing, the screen showing all boards and categories.
- modifyCat() : void
- Used to retrieve data for modifying a board category.
- settings() : void
- A screen to set a few general board and category settings.
- __construct() : mixed
- Constructor. Protected to force instantiation via self::load().
Properties
$subaction
public
string
$subaction
= 'main'
The requested sub-action. This should be set by the constructor.
$subactions
public
static array<string|int, mixed>
$subactions
= ['main' => ['main', 'manage_boards'], 'board' => ['editBoard', 'manage_boards'], 'board2' => ['editBoard2', 'manage_boards'], 'cat' => ['editCategory', 'manage_boards'], 'cat2' => ['editCategory2', 'manage_boards'], 'move' => ['main', 'manage_boards'], 'newcat' => ['editCategory', 'manage_boards'], 'newboard' => ['editBoard', 'manage_boards'], 'settings' => ['settings', 'admin_forum']]
Available sub-actions.
Format: 'sub-action' => array('function', 'permission')
$obj
protected
static object
$obj
An instance of this class. This is used by the load() method to prevent mulitple instantiations.
$backcompat
private
static array<string|int, mixed>
$backcompat
= ['func_names' => ['call' => 'ManageBoards', 'editBoardSettings' => 'EditBoardSettings']]
BackwardCompatibility settings for this class.
Methods
call()
Convenience method to load() and execute() an instance of this class.
public
static call() : void
editBoard()
Modify a specific board... screen for editing and repositioning a board.
public
editBoard() : void
called by ?action=admin;area=manageboards;sa=board uses the modify_board sub-template of the ManageBoards template. requires manage_boards permission. also used to show the confirm deletion of category screen (sub-template confirm_board_delete).
editBoard2()
Make changes to/delete a board.
public
editBoard2() : void
(function for handling a submitted form saving the board.)
It also handles deletion of a board.
Called by ?action=admin;area=manageboards;sa=board2 Redirects to ?action=admin;area=manageboards. It requires manage_boards permission.
editBoardSettings()
Backward compatibility wrapper for the settings sub-action.
public
static editBoardSettings([bool $return_config = false ]) : void|array<string|int, mixed>
Parameters
- $return_config : bool = false
-
Whether to return the config_vars array.
Return values
void|array<string|int, mixed> —Returns nothing or returns the config_vars array.
editCategory()
Modify a specific category.
public
editCategory() : void
(screen for editing and repositioning a category.)
Also used to show the confirm deletion of category screen (sub-template confirm_category_delete).
Called by ?action=admin;area=manageboards;sa=cat Requires manage_boards permission.
Tags
editCategory2()
Function for handling a submitted form saving the category.
public
editCategory2() : void
(complete the modifications to a specific category.)
It also handles deletion of a category.
It requires manage_boards permission. Called by ?action=admin;area=manageboards;sa=cat2 Redirects to ?action=admin;area=manageboards.
execute()
Dispatcher to whichever sub-action method is necessary.
public
execute() : void
exportStatic()
Provides a way to export a class's public static properties and methods to global namespace.
public
static exportStatic() : void
To do so:
- Use this trait in the class.
- At the END of the class's file, call its exportStatic() method.
Although it might not seem that way at first glance, this approach conforms to section 2.3 of PSR 1, since executing this method is simply a dynamic means of declaring functions when the file is included; it has no other side effects.
Regarding the $backcompat items:
A class's static properties are not exported to global variables unless explicitly included in $backcompat['prop_names']. Likewise, a class's static methods are not exported as global functions unless explicitly included in $backcompat['func_names'].
$backcompat['prop_names'] is a simple array where the keys are the names of one or more of a class's static properties, and the values are the names of global variables. In each case, the global variable will be set to a reference to the static property. Static properties that are not named in this array will not be exported.
$backcompat['func_names'] is a simple array where the keys are the names of one or more of a class's static methods, and the values are the names that should be used for global functions that will encapsulate those methods. Methods that are not named in this array will not be exported.
Adding non-static properties or methods to the $backcompat arrays will produce runtime errors. It is the responsibility of the developer to make sure not to do this.
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 boards area.
load()
Static wrapper for constructor.
public
static load() : object
Return values
object —An instance of this class.
main()
The main control panel thing, the screen showing all boards and categories.
public
main() : void
Called by ?action=admin;area=manageboards or ?action=admin;area=manageboards;sa=move. Requires manage_boards permission. It also handles the interface for moving boards.
Uses ManageBoards template, main sub-template.
modifyCat()
Used to retrieve data for modifying a board category.
public
modifyCat() : void
settings()
A screen to set a few general board and category settings.
public
settings() : void
__construct()
Constructor. Protected to force instantiation via self::load().
protected
__construct() : mixed