ModuleOperations View code

A singleton utility class to allow for working with modules.

since 0.9
package

CMS

license

GPL

Methods

get_instance() : \ModuleOperations

Get the only permitted instance of this object. It will be created if necessary

static
set_module_classname(string $module, string $classname) 

Allow setting the classname for a module.

static

.. useful when the module class file itself is within a namespace.

Arguments

string $module

The module name

string $classname

The class name.

CreateXMLPackage(\CMSModule &$modinstance, string &$message, integer &$filecount) : string

Creates an xml data package from the module directory.

Arguments

\CMSModule $modinstance

The instance of the module object

string $message

Reference to a string which will be filled with the message created by the run of the method

integer $filecount

Reference to an interger which will be filled with the total # of files in the package

Response

string

an XML string comprising the module and its files

FindAllModules() : array

A function to return a list of all modules that appear to exist properly in the modules directory.

Response

array

of module names for all modules that exist in the module directory.

GetInstalledModuleInfo() : array

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

Response

array

IsModuleActive(string $module_name) : boolean

Test if a module is active

Arguments

string $module_name

Response

boolean

ActivateModule(string $module_name, boolean $activate = true) : boolean

Activate a module

Arguments

string $module_name

boolean $activate

flag indicating wether to activate or deactivate the module

Response

boolean

GetLoadedModules() : array

Returns a hash of all loaded modules. This will include all modules loaded into memory at the current time

Response

array

The hash of all loaded modules

GetAllModuleNames() : array

Return an array of the names of all modules that we currently know about

Response

array

GetAllModuleInfo() : array

Return all of the information we know about modules.

Response

array

GetInstalledModules(boolean $include_all = FALSE) : array

Returns an array of the names of all installed modules.

Arguments

boolean $include_all

Include even inactive modules

Response

array

get_modules_with_capability(string $capability, mixed $args = '') : array

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.

static

Arguments

string $capability

The capability name

mixed $args

Capability arguments

Response

array

List of all the module objects with that capability

get_module_dependencies(string $module_name) : array

A function to return a list of dependencies from a module.

this method works by reading the dependencies from the database.

Arguments

string $module_name

The module name

Response

array

Hash of module names and dependencies

get_module_instance(string $module_name, string $version = '', boolean $force = FALSE) : \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.

Arguments

string $module_name

The module name

string $version

an optional version string.

boolean $force

an optional flag to indicate wether the module should be force loaded if necesary.

Response

\CMSModule

IsSystemModule(string $module_name) : boolean

Test if the specified module name is a system module

Arguments

string $module_name

The module name

Response

boolean

GetSyntaxHighlighter(string $module_name = '') : \CMSModule

Return the current syntax highlighter module object

This method retrieves the specified syntax highlighter module, or uses the current current user preference for the syntax hightlighter module for a name.

Arguments

string $module_name

allows bypassing the automatic detection process and specifying a wysiwyg module.

Response

\CMSModule

GetWYSIWYGModule(string $module_name = '') : \CMSModule

Return the current wysiwyg module object

deprecated

This method makes an attempt to find the appropriate wysiwyg module given the current request context and admin user preference.

Arguments

string $module_name

allows bypassing the automatic detection process and specifying a wysiwyg module.

Response

\CMSModule

GetSearchModule() : \CMSModule

Return the current search module object

This method returns module object for the currently selected search module.

Response

\CMSModule

GetFilePickerModule() : \CMSMS\FilePickerInterface

Return the current filepicker module object.

This method returns module object for the currently selected search module.

Response

\CMSMS\FilePickerInterface

GetSyntaxModule(string $module_name = '') : \CMSModule

Alias for the GetSyntaxHiglighter method.

deprecated

Arguments

string $module_name

Response

\CMSModule