ModuleOperations
in package
A singleton utility class to allow for working with modules.
Tags
Table of Contents
Methods
- ActivateModule() : bool
- Activate a module
- CreateXMLPackage() : string
- Creates an xml data package from the module directory.
- FindAllModules() : array<string|int, mixed>
- A function to return a list of all modules that appear to exist properly in the modules' directory.
- get_instance() : ModuleOperations
- Get the only permitted instance of this object. It will be created if necessary
- get_module_dependencies() : array<string|int, mixed>
- A function to return a list of dependencies from a module.
- get_module_instance() : CMSModule
- A function to return the object reference to the module object if the module is not already loaded, it will be loaded. Version checks are done with the module to allow only loading versions of modules that are greater than the specified value.
- get_modules_with_capability() : array<string|int, mixed>
- Returns an array of installed modules that have a certain capabilies This method will force the loading of all modules regardless of the module settings.
- GetAllModuleInfo() : array<string|int, mixed>
- Return all of the information we know about modules.
- GetAllModuleNames() : array<string|int, mixed>
- Return an array of the names of all modules that we currently know about
- GetFilePickerModule() : FilePickerInterface
- Return the current filepicker module object.
- GetInstalledModuleInfo() : array<string|int, mixed>
- Return the information stored in the database about all installed modules.
- GetInstalledModules() : array<string|int, mixed>
- Returns an array of the names of all installed modules.
- GetLoadedModules() : array<string|int, mixed>
- Returns a hash of all loaded modules. This will include all modules loaded into memory at the current time
- GetSearchModule() : CMSModule
- Return the current search module object
- GetSyntaxHighlighter() : CMSModule
- Return the current syntax highlighter module object
- GetSyntaxModule() : CMSModule
- Alias for the GetSyntaxHiglighter method.
- GetWYSIWYGModule() : CMSModule
- Return the current wysiwyg module object
- InstallModule() : array<string|int, mixed>
- Install a module into the database
- IsModuleActive() : bool
- Test if a module is active
- IsOptionalSystemModule() : bool
- Test if the specified module name is an optional system module
- IsSystemModule() : bool
- Test if the specified module name is a system module
- set_module_classname() : mixed
- Allow setting the classname for a module... useful when the module class file itself is within a namespace.
Methods
ActivateModule()
Activate a module
public
ActivateModule(string $module_name[, bool $activate = true ]) : bool
Parameters
- $module_name : string
- $activate : bool = true
-
flag indicating wether to activate or deactivate the module
Return values
boolCreateXMLPackage()
Creates an xml data package from the module directory.
public
CreateXMLPackage(CMSModule $modinstance, string &$message, int &$filecount) : string
Parameters
- $modinstance : CMSModule
-
The instance of the module object
- $message : string
-
Reference to a string which will be filled with the message created by the run of the method
- $filecount : int
-
Reference to an interger which will be filled with the total # of files in the package
Tags
Return values
string —an XML string comprising the module and its files
FindAllModules()
A function to return a list of all modules that appear to exist properly in the modules' directory.
public
FindAllModules() : array<string|int, mixed>
Return values
array<string|int, mixed> —of module names for all modules that exist in the module directory.
get_instance()
Get the only permitted instance of this object. It will be created if necessary
public
static get_instance() : ModuleOperations
Return values
ModuleOperationsget_module_dependencies()
A function to return a list of dependencies from a module.
public
get_module_dependencies(string $module_name) : array<string|int, mixed>
this method works by reading the dependencies from the database.
Parameters
- $module_name : string
-
The module name
Tags
Return values
array<string|int, mixed> —Hash of module names and dependencies
get_module_instance()
A function to return the object reference to the module object if the module is not already loaded, it will be loaded. Version checks are done with the module to allow only loading versions of modules that are greater than the specified value.
public
get_module_instance(string $module_name[, string $version = '' ][, bool $force = FALSE ]) : CMSModule
Parameters
- $module_name : string
-
The module name
- $version : string = ''
-
an optional version string.
- $force : bool = FALSE
-
an optional flag to indicate wether the module should be force loaded if necesary.
Return values
CMSModuleget_modules_with_capability()
Returns an array of installed modules that have a certain capabilies This method will force the loading of all modules regardless of the module settings.
public
static get_modules_with_capability(string $capability[, mixed $args = '' ]) : array<string|int, mixed>
Parameters
- $capability : string
-
The capability name
- $args : mixed = ''
-
Capability arguments
Return values
array<string|int, mixed> —List of all the module objects with that capability
GetAllModuleInfo()
Return all of the information we know about modules.
public
GetAllModuleInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>GetAllModuleNames()
Return an array of the names of all modules that we currently know about
public
GetAllModuleNames() : array<string|int, mixed>
Return values
array<string|int, mixed>GetFilePickerModule()
Return the current filepicker module object.
public
GetFilePickerModule() : FilePickerInterface
This method returns module object for the currently selected search module.
Tags
Return values
FilePickerInterfaceGetInstalledModuleInfo()
Return the information stored in the database about all installed modules.
public
GetInstalledModuleInfo() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>GetInstalledModules()
Returns an array of the names of all installed modules.
public
GetInstalledModules([bool $include_all = FALSE ]) : array<string|int, mixed>
Parameters
- $include_all : bool = FALSE
-
Include even inactive modules
Return values
array<string|int, mixed>GetLoadedModules()
Returns a hash of all loaded modules. This will include all modules loaded into memory at the current time
public
GetLoadedModules() : array<string|int, mixed>
Return values
array<string|int, mixed> —The hash of all loaded modules
GetSearchModule()
Return the current search module object
public
GetSearchModule() : CMSModule
This method returns module object for the currently selected search module.
Tags
Return values
CMSModuleGetSyntaxHighlighter()
Return the current syntax highlighter module object
public
GetSyntaxHighlighter([string $module_name = '' ]) : CMSModule
This method retrieves the specified syntax highlighter module, or uses the current current user preference for the syntax hightlighter module for a name.
Parameters
- $module_name : string = ''
-
allows bypassing the automatic detection process and specifying a wysiwyg module.
Tags
Return values
CMSModuleGetSyntaxModule()
Alias for the GetSyntaxHiglighter method.
public
GetSyntaxModule([string $module_name = '' ]) : CMSModule
Parameters
- $module_name : string = ''
Tags
Return values
CMSModuleGetWYSIWYGModule()
Return the current wysiwyg module object
public
GetWYSIWYGModule([string $module_name = '' ]) : CMSModule
This method makes an attempt to find the appropriate wysiwyg module given the current request context and admin user preference.
Parameters
- $module_name : string = ''
-
allows bypassing the automatic detection process and specifying a wysiwyg module.
Tags
Return values
CMSModuleInstallModule()
Install a module into the database
public
InstallModule(string $module) : array<string|int, mixed>
Parameters
- $module : string
-
The name of the module to install
Return values
array<string|int, mixed> —Returns a tuple of whether the install process was successful and a message if applicable
IsModuleActive()
Test if a module is active
public
IsModuleActive(string $module_name) : bool
Parameters
- $module_name : string
Return values
boolIsOptionalSystemModule()
Test if the specified module name is an optional system module
public
IsOptionalSystemModule(string $module_name) : bool
Parameters
- $module_name : string
-
The module name
Return values
boolIsSystemModule()
Test if the specified module name is a system module
public
IsSystemModule(string $module_name) : bool
Parameters
- $module_name : string
-
The module name
Return values
boolset_module_classname()
Allow setting the classname for a module... useful when the module class file itself is within a namespace.
public
static set_module_classname(string $module, string $classname) : mixed
Parameters
- $module : string
-
The module name
- $classname : string
-
The class name.