Module
in package
Module base class as well as management class.
Tags
Table of Contents
Properties
- $_author : string
- $_load_after : array<string|int, mixed>
- $_load_before : array<string|int, mixed>
- $_modules : array<string|int, Module>
- $_name : string
- $_nameless_version : string
- $_version : string
Methods
- __construct() : mixed
- determineModuleOrder() : array<string|int, mixed>
- Determine loading arrangement of modules.
- getAuthor() : string
- Get this module's author.
- getDebugInfo() : array<string|int, mixed>
- Get debug information to display on the external debug link page.
- getId() : int
- Get this module's ID.
- getIdFromName() : int|null
- Get a module ID from name.
- getLoadAfter() : array<string|int, mixed>
- Get the names of modules that this module should load after.
- getLoadBefore() : array<string|int, mixed>
- Get the names of modules that this module should load before.
- getModules() : array<string|int, Module>
- getName() : string
- getNameFromId() : string|null
- Get a module name from ID.
- getNamelessVersion() : string
- Get this module's supported NamelessMC version.
- getVersion() : string
- Get this module's version.
- loadPage() : void
- Call `onPageLoad()` function for all registered modules.
- onDisable() : mixed
- onEnable() : mixed
- onInstall() : mixed
- onPageLoad() : mixed
- Handle page loading for this module.
- onUninstall() : mixed
Properties
$_author
private
string
$_author
$_load_after
private
array<string|int, mixed>
$_load_after
$_load_before
private
array<string|int, mixed>
$_load_before
$_modules
private
static array<string|int, Module>
$_modules
= []
Array of all modules
$_name
private
string
$_name
$_nameless_version
private
string
$_nameless_version
$_version
private
string
$_version
Methods
__construct()
public
__construct(Module $module, string $name, string $author, string $version, string $nameless_version[, array<string|int, mixed> $load_before = [] ][, array<string|int, mixed> $load_after = [] ]) : mixed
Parameters
- $module : Module
- $name : string
- $author : string
- $version : string
- $nameless_version : string
- $load_before : array<string|int, mixed> = []
- $load_after : array<string|int, mixed> = []
determineModuleOrder()
Determine loading arrangement of modules.
public
static determineModuleOrder() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array with module order and any failed modules.
getAuthor()
Get this module's author.
public
getAuthor() : string
Return values
string —The author of this module.
getDebugInfo()
Get debug information to display on the external debug link page.
public
abstract getDebugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —Debug information for this module.
getId()
Get this module's ID.
public
getId() : int
Return values
int —The ID for the module
getIdFromName()
Get a module ID from name.
public
static getIdFromName(string $name) : int|null
Parameters
- $name : string
-
Module name
Return values
int|null —Module ID
getLoadAfter()
Get the names of modules that this module should load after.
public
getLoadAfter() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of module names that this module should load after.
getLoadBefore()
Get the names of modules that this module should load before.
public
getLoadBefore() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of module names that this module should load before.
getModules()
public
static getModules() : array<string|int, Module>
Return values
array<string|int, Module>getName()
public
getName() : string
Return values
stringgetNameFromId()
Get a module name from ID.
public
static getNameFromId(int $id) : string|null
Parameters
- $id : int
-
Module ID
Return values
string|null —Module name
getNamelessVersion()
Get this module's supported NamelessMC version.
public
getNamelessVersion() : string
Return values
string —The supported NamelessMC version of this module.
getVersion()
Get this module's version.
public
getVersion() : string
Return values
string —The version of this module.
loadPage()
Call `onPageLoad()` function for all registered modules.
public
static loadPage(User $user, Pages $pages, Cache $cache, FakeSmarty|Smarty|null $smarty, array<string|int, Navigation> $navs, Widgets $widgets, TemplateBase $template) : void
Parameters
- $user : User
-
User viewing the page.
- $pages : Pages
-
Instance of pages class.
- $cache : Cache
-
Instance of cache to pass.
- $smarty : FakeSmarty|Smarty|null
-
Instance of Smarty to pass
- $navs : array<string|int, Navigation>
-
Array of loaded navigation menus.
- $widgets : Widgets
-
Instance of widget class to pass.
- $template : TemplateBase
-
Template to pass.
onDisable()
public
abstract onDisable() : mixed
onEnable()
public
abstract onEnable() : mixed
onInstall()
public
abstract onInstall() : mixed
onPageLoad()
Handle page loading for this module.
public
abstract onPageLoad(User $user, Pages $pages, Cache $cache, FakeSmarty|Smarty $smarty, array<string|int, Navigation> $navs, Widgets $widgets, TemplateBase $template) : mixed
Often used to register permissions, sitemaps, widgets, etc.
Parameters
- $user : User
-
User viewing the page.
- $pages : Pages
-
Instance of pages class.
- $cache : Cache
-
Instance of cache to pass.
- $smarty : FakeSmarty|Smarty
-
Instance of smarty to pass, to be removed in 2.3.0
- $navs : array<string|int, Navigation>
-
Array of loaded navigation menus.
- $widgets : Widgets
-
Instance of widget class to pass.
- $template : TemplateBase
-
Active template to render.
onUninstall()
public
abstract onUninstall() : mixed