class ModuleHelper

Module helper class

Methods

static  stdClass
getModule( string $name, string $title = null)

Get module by name (real, eg 'Breadcrumbs' or folder, eg 'mod_breadcrumbs')

static  array
getModules( string $position)

Get modules by position

static  boolean
isEnabled( string $module)

Checks if a module is enabled. A given module will only be returned if it meets the following criteria: it is enabled, it is assigned to the current menu item or all items, and the user meets the access level requirements.

static  string
renderModule( object $module, array $attribs = array())

Render the module.

static  string
getLayoutPath( string $module, string $layout = 'default')

Get the path to a layout for a module

static  array
getModuleList()

Module list

static  array
cleanModuleList( array $modules)

Clean the module list

static  string
moduleCache( object $module, object $moduleparams, object $cacheparams)

Module cache helper

static  boolean
isAdminMultilang()

Method to determine if filtering by language is enabled in back-end for modules.

static  stdClass
getModuleById( string $id)

Get module by id

Details

static stdClass getModule( string $name, string $title = null)

Get module by name (real, eg 'Breadcrumbs' or folder, eg 'mod_breadcrumbs')

Parameters

string $name The name of the module
string $title The title of the module, optional

Return Value

stdClass The Module object

static array getModules( string $position)

Get modules by position

Parameters

string $position The position of the module

Return Value

array An array of module objects

static boolean isEnabled( string $module)

Checks if a module is enabled. A given module will only be returned if it meets the following criteria: it is enabled, it is assigned to the current menu item or all items, and the user meets the access level requirements.

Parameters

string $module The module name

Return Value

boolean See description for conditions.

static string renderModule( object $module, array $attribs = array())

Render the module.

Parameters

object $module A module object.
array $attribs An array of attributes for the module (probably from the XML).

Return Value

string The HTML content of the module output.

static string getLayoutPath( string $module, string $layout = 'default')

Get the path to a layout for a module

Parameters

string $module The name of the module
string $layout The name of the module layout. If alternative layout, in the form template:filename.

Return Value

string The path to the module layout

static array getModuleList()

Module list

Return Value

array

static array cleanModuleList( array $modules)

Clean the module list

Parameters

array $modules Array with module objects

Return Value

array

static string moduleCache( object $module, object $moduleparams, object $cacheparams)

Module cache helper

Caching modes: To be set in XML: 'static' One cache file for all pages with the same module parameters 'oldstatic' 1.5 definition of module caching, one cache file for all pages with the same module id and user aid, 'itemid' Changes on itemid change, to be called from inside the module: 'safeuri' Id created from $cacheparams->modeparams array, 'id' Module sets own cache id's

Parameters

object $module Module object
object $moduleparams Module parameters
object $cacheparams Module cache parameters - id or URL parameters, depending on the module cache mode

Return Value

string

See also

\JFilterInput::clean()

static boolean isAdminMultilang()

Method to determine if filtering by language is enabled in back-end for modules.

Return Value

boolean True if enabled; false otherwise.

static stdClass getModuleById( string $id)

Get module by id

Parameters

string $id The id of the module

Return Value

stdClass The Module object