CMS Made Simple API

ModuleOperations
in package

FinalYes

A singleton utility class to allow for working with modules.

Tags
since
0.9
license

GPL

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
bool

CreateXMLPackage()

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
throws
CmsFileSystemException
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_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
since
1.11.8
author

Robert Campbell

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
CMSModule

get_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>

GetInstalledModuleInfo()

Return the information stored in the database about all installed modules.

public GetInstalledModuleInfo() : array<string|int, mixed>
Tags
since
2.0
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
since
1.10
Return values
CMSModule

GetSyntaxHighlighter()

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
since
1.10
Return values
CMSModule

GetSyntaxModule()

Alias for the GetSyntaxHiglighter method.

public GetSyntaxModule([string $module_name = '' ]) : CMSModule
Parameters
$module_name : string = ''
Tags
see
ModuleOperations::GetSyntaxHighlighter
since
1.10
Return values
CMSModule

GetWYSIWYGModule()

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
since
1.10
Return values
CMSModule

InstallModule()

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
bool

IsOptionalSystemModule()

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
bool

IsSystemModule()

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
bool

set_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.


        
On this page

Search results