Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
eZModule Class Reference

## Public Member Functions
| __construct ( $path, $file, $moduleName, $checkFileExistence=true)
| initialize ( $path, $file, $moduleName, $checkFileExistence=true)
| uri ()
| functionURI ( $function)
| title ()
| setTitle ( $title)
| setCurrentName ( $name)
| setCurrentView ( $name)
| singleFunction ()
| uiContextName ()
| uiComponentName ()
| setUIContextName ( $context)
| setUIComponentName ( $component)
| exitStatus ()
| setExitStatus ( $stat)
| errorCode ()
| setErrorCode ( $errorCode)
| errorModule ()
| setErrorModule ( $moduleName, $viewName)
| handleError ( $errorCode, $errorType=false, $parameters=array(), $userParameters=false)
| redirect ( $moduleName, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
| redirectToView ( $viewName='', $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
| redirectModule ( $module, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
| redirectionURI ( $moduleName, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
| currentRedirectionURI ()
| redirectCurrent ()
| redirectionURIForModule ( $module, $viewName, $parameters=array(), $unorderedParameters=null, $userParameters=false, $anchor=false)
| parameters ( $viewName='')
| unorderedParameters ( $viewName='')
| viewData ( $viewName='')
| redirectTo ( $uri)
| redirectURI ()
| setRedirectURI ( $uri)
| redirectStatus ()
| setRedirectStatus ( $status)
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr)
| setCurrentAction ( $actionName, $view='')
| currentAction ( $view='')
| setActionParameter ( $parameterName, $parameterValue, $view='')
| actionParameter ( $parameterName, $view='')
| hasActionParameter ( $parameterName, $view='')
| isCurrentAction ( $actionName, $view='')
| addHook ( $hookName, $function, $priority=1, $expandParameters=true, $append=false)
| runHooks ( $hookName, $parameters=null)
| setViewResult ( $result, $view='')
| hasViewResult ( $view='')
| viewResult ( $view='')
| forward ( $module, $functionName, $parameters=false)
| run ( $functionName, $parameters=array(), $overrideParameters=false, $userParameters=false)
| currentView ()
| currentModule ()
| getNamedParameters ()

## Static Public Member Functions
static | globalPathList ()
static | activeModuleRepositories ( $useExtensions=true)
static | setGlobalPathList ( $pathList)
static | addGlobalPathList ( $pathList)
static | exists ( $moduleName, $pathList=null, $showError=false)
static | findModule ( $moduleName, $module=null, $pathList=null, $showError=false)
static | accessAllowed (eZURI $uri)

## Public Attributes
| $ViewActionParameters
const | STATUS_IDLE = 0
const | STATUS_OK = 1
const | STATUS_FAILED = 2
const | STATUS_REDIRECT = 3
const | STATUS_RERUN = 4
const | HOOK_STATUS_OK = 0
const | HOOK_STATUS_CANCEL_RUN = 1
const | HOOK_STATUS_FAILED = 2
| $Functions
| $Module
| $Name
| $Path
| $ExitStatus
| $ErrorCode
| $RedirectURI
| $RedirectStatus
| $Title
| $HookList
| $ViewActions
| $ViewResult
| $ViewParameters
| $OriginalParameters
| $OriginalViewParameters
| $NamedParameters
| $OriginalUnorderedParameters
| $UserParameters
| $UIContext
| $UIComponent
| $UIComponentMatch
| $FunctionList
| $NavigationParts

## Static Public Attributes
static | $useExceptions

## Private Member Functions
| getAllowedRedirectHosts ()

## Detailed Description

The eZModule class is used to instanciate and use modules & views.

Loading the "content" module, and running the "history" view `<?php $contentModule = eZModule::findModule( 'content' ); $result = $contentModule->run( 'history', array( 1 ) ); ?>`

Running the CopyVersion action of the content/history view: `<?php $contentModule = eZModule::findModule( 'content' ); $contentModule->setCurrentView( 'history' ); $contentModule->setCurrentAction( 'CopyVersion' ); // we will copy version 3 $contentModule->setActionParameter( 'VersionID', 3 ); $contentModule->run( 'history', array( 20 ) ); ?>`

Definition at line 35 of file ezmodule.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZModule::__construct | ( |  | $path,
|  |  | $file,
|  |  | $moduleName,
|  |  | $checkFileExistence = `true`
| ) |  |

Constructor. Initializes the module.

Parameters

  string | $path | Relative path to the module, without the module name
  string | $file | Relative path to the module definition file module.php
  string | $moduleName |
  boolean | $checkFileExistence | Always set to false in the current code base, since the check is usually performed before the constructor is called

Definition at line 261 of file ezmodule.php.

References initialize().

## Member Function Documentation

## ◆ accessAllowed()

static eZModule::accessAllowed | ( | eZURI | $uri | ) |
| static

Checks if access is allowed to a module/view based on site.ini[SiteAccessRules]Rules[] settings

Since
  4.4

Parameters

  eZURI | $uri |

Returns
  array An associative array with: 'result' => bool Indicates if access is allowed 'module' => string Module name 'view' => string View name 'view_checked' => bool Indicates if view access has been checked

Definition at line 2087 of file ezmodule.php.

References eZURI\element(), and eZDebug\writeError().

Referenced by eZModuleOperator\modify().

## ◆ actionParameter()

eZModule::actionParameter | ( |  | $parameterName,
|  |  | $view = `''`
| ) |  |

Returns an action parameter value

Parameters

  string | $parameterName |
  string | $view | The view to return the parameter for. If omited, uses the current view

Returns
  mixed The parameter value, or null + error if not found

See also
  setActionParameter(), hasActionParameter()

Definition at line 1272 of file ezmodule.php.

References currentAction(), currentView(), eZHTTPTool\instance(), and eZDebug\writeError().

## ◆ activeModuleRepositories()

static eZModule::activeModuleRepositories | ( |  | $useExtensions = `true` | ) |
| static

Returns the list of active module repositories, as defined in module.ini

Parameters

  boolean | $useExtensions | If true, module.ini files in extensions will be scanned as well. If false, only the module.ini overrides in settings will be.

Returns
  array a path list of currently active modules

Definition at line 1897 of file ezmodule.php.

References eZExtension\activeExtensions(), eZExtension\baseDirectory(), and eZDebug\writeWarning().

Referenced by eZScript\initialize(), and eZSiteAccess\load().

## ◆ addGlobalPathList()

static eZModule::addGlobalPathList | ( |  | $pathList | ) |
| static

Adds a new entry to the global path list

Parameters

  array | string | $pathList | Either an array of path or a single path string

Returns
  void

See also
  setGlobalPathList(), globalPathList()

Definition at line 1965 of file ezmodule.php.

## ◆ addHook()

eZModule::addHook | ( |  | $hookName,
|  |  | $function,
|  |  | $priority = `1`,
|  |  | $expandParameters = `true`,
|  |  | $append = `false`
| ) |  |

Adds an entry to a hook. The entry is placed before all other existing entries (LIFO) unless $append is set to true.

Parameters

  string | $hookName | The hook name.
  string | $function | Either the name of the function to be run or an array where the first entry is the object and the second is the method name.
  integer | $priority | The hook priority in the hooks stack.
  boolean | $expandParameters | Wether or not to expand parameters. If set to true (default), the parameters will be sent as real function parameters to the hooked function/method. If set to false, they will be sent as a single array. In both cases, the eZModule object will be the first parameter sent to each hook.
  boolean | $append | If set to false (default), the hook will be added at the top of the hooks list. If set to true, it will be added at the end

Returns
  void

Definition at line 1405 of file ezmodule.php.

## ◆ attribute()

eZModule::attribute | ( |  | $attr | ) |

Returns the value of an attribute

Parameters

  string | $attr | Attribute name

Returns
  mixed The attribute value. If the attribute doesn't exist, a warning is thrown, and false is returned

Definition at line 1102 of file ezmodule.php.

References $FunctionList, $Functions, $Module, $Name, $Path, uri(), and eZDebug\writeError().

## ◆ attributes()

eZModule::attributes | ( |  | ) |

Returns the defined object attributes (as in persistent objects)

Returns
  array the persistent object attributes

Definition at line 1070 of file ezmodule.php.

Referenced by hasAttribute().

## ◆ currentAction()

eZModule::currentAction | ( |  | $view = `''` | ) |

Returns the current action name.

If the current action is not yet determined it will use the definitions in module.php in order to find out the current action. It first looks trough the `single_post_actions` array in the selected view mode, the key to each element is the name of the post-variable to match, if it matches the element value is set as the action.

'single_post_actions' => array( 'PreviewButton' => 'Preview',
'PublishButton' => 'Publish' )

If none of these matches it will use the elements from the `post_actions` array to find a match. It uses the element value for each element to match agains a post-variable, if it is found the contents of the post-variable is set as the action.

'post_actions' => array( 'BrowseActionName' )

Returns
  string The current action, or false if not set nor found

See also
  setCurrentAction(), isCurrentAction()

Definition at line 1175 of file ezmodule.php.

References currentView(), eZHTTPTool\instance(), and eZDebug\writeWarning().

Referenced by actionParameter(), hasActionParameter(), and isCurrentAction().

## ◆ currentModule()

eZModule::currentModule | ( |  | ) |

Returns the current module name

Returns
  string the current module name, or false if not set

Note
  This is a system-wide value

Definition at line 1866 of file ezmodule.php.

## ◆ currentRedirectionURI()

eZModule::currentRedirectionURI | ( |  | ) |

Creates the redirection URI for the current module, view & parameters

Returns
  string The redirection URI

See also
  redirectionURIForModule()

Definition at line 770 of file ezmodule.php.

References $OriginalUnorderedParameters, $OriginalViewParameters, $UserParameters, currentView(), and redirectionURIForModule().

Referenced by redirectCurrent().

## ◆ currentView()

eZModule::currentView | ( |  | ) |

Returns the current view name

Returns
  string The current view name, or false if not defined

Note
  This is a system-wide value

See also
  currentModule(), setCurrentView()

Definition at line 1851 of file ezmodule.php.

Referenced by actionParameter(), currentAction(), currentRedirectionURI(), forward(), hasActionParameter(), hasViewResult(), isCurrentAction(), parameters(), redirectionURIForModule(), setActionParameter(), setCurrentAction(), setViewResult(), unorderedParameters(), viewData(), and viewResult().

## ◆ errorCode()

eZModule::errorCode | ( |  | ) |

Returns the last error code. An error should only be returned if the module's status is eZModule::STATUS_FAILED

Returns
  int The error code, or 0 if no error occured

See also
  setErrorCode(), exitStatus(), setExitStatus()

Definition at line 536 of file ezmodule.php.

References $ErrorCode.

## ◆ errorModule()

eZModule::errorModule | ( |  | ) |

Returns the error module which will be ran if an error occurs

Returns
  array the error module name (keys: module, view)

See also
  handleError()

Definition at line 560 of file ezmodule.php.

Referenced by handleError().

## ◆ exists()

static eZModule::exists | ( |  | $moduleName,
|  |  | $pathList = `null`,
|  |  | $showError = `false`
| ) |  |
| static

Loads a module object by name

Parameters

  string | $moduleName | The name of the module to find (ex: content)
  | array|string | Either an array of path or a single path string. These will be used as additionnal locations that will be looked into
  boolean | $showError | If true an error will be shown if the module it not found.

Returns
  eZModule The eZModule object, or null if the module wasn't found

See also
  findModule()

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 1990 of file ezmodule.php.

References findModule().

Referenced by eZPolicyLimitation\allValuesAsArrayWithNames(), redirect(), redirectionURI(), and eZURLAliasML\urlToAction().

## ◆ exitStatus()

eZModule::exitStatus | ( |  | ) |

Returns the last exit status after a view has been executed

Returns
  int one of STATUS_* constants

See also
  setExitStatus()

Definition at line 509 of file ezmodule.php.

References $ExitStatus.

Referenced by handleError().

## ◆ findModule()

static eZModule::findModule | ( |  | $moduleName,
|  |  | $module = `null`,
|  |  | $pathList = `null`,
|  |  | $showError = `false`
| ) |  |
| static

Loads a module object by name. The only difference with exists() is that the $module parameter will be assigned the found module.

Parameters

  string | $moduleName | The name of the module to find (ex: content)
  mixed | $module | This parameter will receive the found module object
  | array|string | Either an array of path or a single path string. These will be used as additionnal locations that will be looked into
  boolean | $showError | If true an error will be shown if the module it not found.

Returns
  eZModule The eZModule object, or null if the module wasn't found

See also
  exists()

Definition at line 2011 of file ezmodule.php.

References globalPathList(), and eZDebug\writeWarning().

Referenced by exists(), and handleError().

## ◆ forward()

eZModule::forward | ( |  | $module,
|  |  | $functionName,
|  |  | $parameters = `false`
| ) |  |

Forwards the current execution to another module/view with the existing parameters.

Parameters

  eZModule | $module | The eZModule object the request will be forwarded to
  string | $functionName | The function to run in that module
  array | $parameters | An array of parameters that will be added to the request. These will be merged with the existing parameters

Returns
  array The forwarded module/view result

Definition at line 1598 of file ezmodule.php.

References $OriginalUnorderedParameters, $UserParameters, currentView(), setExitStatus(), and singleFunction().

## ◆ functionURI()

eZModule::functionURI | ( |  | $function | ) |

Returns the URI to a module's function

Parameters

  string | $function | The function to return the URI for

Returns
  string|null
  - the function's URI (content/edit, user/login, etc)
  - if $function is empty or the module is a singleView one, the module's uri (content/, user/...)
  - null if the function's not found

See also
  uri()

Definition at line 373 of file ezmodule.php.

References singleFunction(), and uri().

## ◆ getAllowedRedirectHosts()

eZModule::getAllowedRedirectHosts | ( |  | ) |
| private

Returns the set of hosts that are allowed for absolute redirection

Returns
  array

Definition at line 992 of file ezmodule.php.

Referenced by redirectTo().

## ◆ getNamedParameters()

eZModule::getNamedParameters | ( |  | ) |

Returns the named parameters array

Returns
  array

Definition at line 2071 of file ezmodule.php.

References $NamedParameters.

## ◆ globalPathList()

static eZModule::globalPathList | ( |  | ) |
| static

Returns the search path list for modules

Returns
  array

See also
  setGlobalPathList(), addGlobalPathList()

Definition at line 1881 of file ezmodule.php.

Referenced by findModule(), eZModuleFunctionInfo\loadDefinition(), and eZModuleOperationInfo\loadDefinition().

## ◆ handleError()

eZModule::handleError | ( |  | $errorCode,
|  |  | $errorType = `false`,
|  |  | $parameters = `array()`,
|  |  | $userParameters = `false`
| ) |  |

Runs the defined error module Sets the state of the module object to `failed` and sets the error code.

Parameters

  mixed | $errorCode |
  mixed | $errorType |
  array | $parameters |
  mixed | $userParameters |

See also
  setErrorModule(), errorModule()

Definition at line 593 of file ezmodule.php.

References errorModule(), exitStatus(), findModule(), eZError\KERNEL_ACCESS_DENIED, eZError\KERNEL_LANGUAGE_NOT_FOUND, eZError\KERNEL_MODULE_DISABLED, eZError\KERNEL_MODULE_NOT_FOUND, eZError\KERNEL_MODULE_VIEW_NOT_FOUND, eZError\KERNEL_NOT_AVAILABLE, eZError\KERNEL_NOT_FOUND, setErrorCode(), setExitStatus(), and eZDebug\writeWarning().

Referenced by eZNodeviewfunctions\contentViewGenerateError().

## ◆ hasActionParameter()

eZModule::hasActionParameter | ( |  | $parameterName,
|  |  | $view = `''`
| ) |  |

Checks if an action parameter is defined for a view

Parameters

  string | $parameterName |
  string | $view | The view to check the parameter for. If omited, uses the current view

Returns
  bool

See also
  setActionParameter(), actionParameter()

Definition at line 1324 of file ezmodule.php.

References currentAction(), currentView(), and eZHTTPTool\instance().

## ◆ hasAttribute()

eZModule::hasAttribute | ( |  | $attr | ) |

Checks if an attribute exists

Parameters

  string | $attr | Attribute name

Returns
  bool True if the attribute exists, false otherwise

Definition at line 1089 of file ezmodule.php.

References attributes().

## ◆ hasViewResult()

eZModule::hasViewResult | ( |  | $view = `''` | ) |

Checks if a view has a result set

Parameters

  string | $view | The view to test for. If omited, uses the current view

Returns
  bool

Definition at line 1561 of file ezmodule.php.

References currentView().

Referenced by run().

## ◆ initialize()

eZModule::initialize | ( |  | $path,
|  |  | $file,
|  |  | $moduleName,
|  |  | $checkFileExistence = `true`
| ) |  |

Initializes the module object.

Parameters

  string | $path | Directory where the module is declared, without the modulename component
  string | $file | Full (relative) path to the module.php file describing the module
  string | $moduleName | The module name (content, user...)
  bool | $checkFileExistence | Wether or not $file's existence should be checked

Returns
  void

Definition at line 280 of file ezmodule.php.

References $FunctionList, $Module, and STATUS_IDLE.

Referenced by __construct().

## ◆ isCurrentAction()

eZModule::isCurrentAction | ( |  | $actionName,
|  |  | $view = `''`
| ) |  |

Checks if the current action is the given one

Parameters

  string | $actionName | The action to check
  string | $view | The view to check the action for. Current view if omited.

Returns
  bool

See also
  currentAction(), setCurrentAction()

Definition at line 1373 of file ezmodule.php.

References currentAction(), and currentView().

## ◆ parameters()

eZModule::parameters | ( |  | $viewName = `''` | ) |

Returns the defined parameter for a view.

Parameters

  string | $viewName | The view to get parameters for. If not specified, the current view is used

Returns
  array The parameters definition

See also
  unorderedParameters(), viewData(), currentView(), currentModule()

Definition at line 891 of file ezmodule.php.

References currentView(), and viewData().

## ◆ redirect()

eZModule::redirect | ( |  | $moduleName,
|  |  | $viewName,
|  |  | $parameters = `array()`,
|  |  | $unorderedParameters = `null`,
|  |  | $userParameters = `false`,
|  |  | $anchor = `false`
| ) |  |

Redirects to another module / view

Note
  Use redirectModule() If the target module object is already available
  Use redirectToView() if you want to redirect to another view in the same module

See also
  redirectionURI(), redirectModule(), redirectToView()

Parameters

  string | $moduleName | Target module name
  string | $viewName | Target view name
  array | $parameters | View parameters array
  array | $unorderedParameters | Unordered parameters array
  array | $userParameters | User parameters array
  string | $anchor | Anchor to use in the redirection (prepended to the URL)

Returns
  bool true if the redirection was performed, false if the module wasn't found

Definition at line 668 of file ezmodule.php.

References exists(), redirectModule(), and eZDebug\writeError().

## ◆ redirectCurrent()

eZModule::redirectCurrent | ( |  | ) |

Redirects to the current module and view, it will use currentRedirectionURI() to figure out the URL.

Note
  By changing using setCurrentName() and setCurrentView() first it is possible to redirect to another module or view with the same parameters.

See also
  currentRedirectionURI(), redirectTo()

Returns
  void

Definition at line 793 of file ezmodule.php.

References currentRedirectionURI(), and redirectTo().

## ◆ redirectionURI()

eZModule::redirectionURI | ( |  | $moduleName,
|  |  | $viewName,
|  |  | $parameters = `array()`,
|  |  | $unorderedParameters = `null`,
|  |  | $userParameters = `false`,
|  |  | $anchor = `false`
| ) |  |

Creates the redirection URI for a given module, view & parameters. Unlike redirectionURIForModule(), the $module parameter is the module name

Parameters

  string | $moduleName | Redirection module name
  string | $viewName | Redirection view name
  array | $parameters | View parameters
  array | $unorderedParameters | Unordered parameters
  array | $userParameters | User parameters
  string | $anchor | Redirection URI anchor

Returns
  string|boolean The redirection URI, or false if the module isn't found

See also
  redirect(), redirectionURIForModule(), redirectToView(), redirectModule()

Definition at line 748 of file ezmodule.php.

References exists(), redirectionURIForModule(), and eZDebug\writeError().

## ◆ redirectionURIForModule()

eZModule::redirectionURIForModule | ( |  | $module,
|  |  | $viewName,
|  |  | $parameters = `array()`,
|  |  | $unorderedParameters = `null`,
|  |  | $userParameters = `false`,
|  |  | $anchor = `false`
| ) |  |

Creates the redirection URI for a given module, view & parameters. Unlike redirectionURI(), the $module parameter is a module object

Parameters

  string | $moduleName | Redirection module name
  string | $viewName | Redirection view name. If empty, the current view will be used
  array | $parameters | View parameters
  array | $unorderedParameters | Unordered parameters
  array | $userParameters | User parameters
  string | $anchor | Redirection URI anchor

Returns
  string|boolean The redirection URI, or false if the module isn't found

See also
  redirect(), redirectionURIForModule(), redirectToView(), redirectModule()

Definition at line 814 of file ezmodule.php.

References currentView().

Referenced by currentRedirectionURI(), redirectionURI(), and redirectModule().

## ◆ redirectModule()

eZModule::redirectModule | ( |  | $module,
|  |  | $viewName,
|  |  | $parameters = `array()`,
|  |  | $unorderedParameters = `null`,
|  |  | $userParameters = `false`,
|  |  | $anchor = `false`
| ) |  |

Redirects to another module / view.

The difference with redirect is that the $module parameter is an object instead of a string

Parameters

  eZModule | $moduleName | Target module name
  string | $viewName | Target view name
  array | $parameters | View parameters array
  array | $unorderedParameters | Unordered parameters array
  array | $userParameters | User parameters array
  string | $anchor | Redirection URI anchor

Returns
  boolean true. Just true.

Todo:
  Deprecate; have redirect() check if $module is an eZModule or a string

Definition at line 723 of file ezmodule.php.

References redirectionURIForModule(), and redirectTo().

Referenced by redirect(), and redirectToView().

## ◆ redirectStatus()

eZModule::redirectStatus | ( |  | ) |

Returns the redirection HTTP status (!)

See also
  setRedirectStatus();

Returns
  the HTTP Status header

Definition at line 1048 of file ezmodule.php.

References $RedirectStatus.

## ◆ redirectTo()

eZModule::redirectTo | ( |  | $uri | ) |

Sets the module to redirect at the end of the execution

Parameters

  string | $uri | the URI to redirect to

See also
  setRedirectURI(), setExitStatus()

Returns
  void

Definition at line 955 of file ezmodule.php.

References eZDB\checkTransactionCounter(), eZExecution\cleanExit(), getAllowedRedirectHosts(), eZSys\hostname(), setExitStatus(), and eZDebug\writeError().

Referenced by redirectCurrent(), and redirectModule().

## ◆ redirectToView()

eZModule::redirectToView | ( |  | $viewName = `''`,
|  |  | $parameters = `array()`,
|  |  | $unorderedParameters = `null`,
|  |  | $userParameters = `false`,
|  |  | $anchor = `false`
| ) |  |

Redirects to another view in the current module

See also
  redirectionURI(), redirectModule(), redirect()

Parameters

  string | $viewName | Target view name
  array | $parameters | View parameters
  array | $unorderedParameters | Unordered view parameters
  array | $userParameters | User parameters
  string | $anchor | Redirection URI anchor

Returns
  boolean true if successful, false if the view isn't found

Definition at line 698 of file ezmodule.php.

References redirectModule().

## ◆ redirectURI()

eZModule::redirectURI | ( |  | ) |

Returns the current redirection URI

Returns
  string

See also
  setRedirectURI()

Definition at line 1024 of file ezmodule.php.

References $RedirectURI.

## ◆ run()

eZModule::run | ( |  | $functionName,
|  |  | $parameters = `array()`,
|  |  | $overrideParameters = `false`,
|  |  | $userParameters = `false`
| ) |  |

Runs a function in the current module

Parameters

  string | $functionName | The function to run
  array | $parameters | An indexed list of parameters, these will be mapped onto real parameters names using the defined parameters names in the module/function definition. Any unspecified parameter will be assigned null.
  array | $overrideParameters | An asociative array of parameters that will ultimately override what's in $parameters
  array | $userParameters | User (custom view) parameters

Returns
  array The run result

Definition at line 1652 of file ezmodule.php.

References $Name, hasViewResult(), eZProcess\run(), setExitStatus(), singleFunction(), STATUS_OK, viewResult(), and eZDebug\writeError().

## ◆ runHooks()

eZModule::runHooks | ( |  | $hookName,
|  |  | $parameters = `null`
| ) |  |

Runs all hooks found in the hook list named $hookName.

Parameters

  string | $hookName |
  array | $parameters | Parameters to provide each function with

Returns
  integer The hook execution status, as one of the eZModule::HOOK_STATUS_* constants:
  - HOOK_STATUS_OK: means that every hook was executed correctly.
  - HOOK_STATUS_CANCEL_RUN: execution was cancelled by one hook
  - HOOK_STATUS_FAILED: only returned if the last hook failed. In any case, a warning is thrown.

Definition at line 1444 of file ezmodule.php.

References HOOK_STATUS_CANCEL_RUN, HOOK_STATUS_FAILED, HOOK_STATUS_OK, eZDebug\writeError(), and eZDebug\writeWarning().

## ◆ setActionParameter()

eZModule::setActionParameter | ( |  | $parameterName,
|  |  | $parameterValue,
|  |  | $view = `''`
| ) |  |

Sets an action parameter value

Parameters

  string | $parameterName |
  mixed | $parameterValue |
  string | $view | The view to set the action parameter for. If omited, the current view is used

Returns
  void

See also
  actionParameter(), hasActionParameter()

Definition at line 1255 of file ezmodule.php.

References currentView().

## ◆ setCurrentAction()

eZModule::setCurrentAction | ( |  | $actionName,
|  |  | $view = `''`
| ) |  |

Sets the current action for a view

Parameters

  string | $actionName | The action to make current
  string | $view | The view to set the action for. If omited, the current view is used

Returns
  void

See also
  currentAction(), isCurrentAction()

Definition at line 1142 of file ezmodule.php.

References currentView().

## ◆ setCurrentName()

eZModule::setCurrentName | ( |  | $name | ) |

Sets the name of the currently running module. The URIs will be updated accordingly

Parameters

  string | $name | The name to be set

Returns
  void

See also
  uri(), functionURI()

Definition at line 419 of file ezmodule.php.

## ◆ setCurrentView()

eZModule::setCurrentView | ( |  | $name | ) |

Sets the currently executed view

Parameters

  string | $name | The view name

Returns
  void

See also
  currentView()

Definition at line 437 of file ezmodule.php.

## ◆ setErrorCode()

eZModule::setErrorCode | ( |  | $errorCode | ) |

Sets the current error code.

Note
  For the error code to be used, the module's status needs to be set to eZModule::STATUS_FAILED

See also
  setExitStatus(), errorCode()

Returns
  void

Definition at line 548 of file ezmodule.php.

Referenced by handleError().

## ◆ setErrorModule()

eZModule::setErrorModule | ( |  | $moduleName,
|  |  | $viewName
| ) |  |

Sets the module to be used to handle errors

Parameters

  string | $moduleName |
  string | $viewName |

See also
  handleError(), errorModule()

Definition at line 576 of file ezmodule.php.

## ◆ setExitStatus()

eZModule::setExitStatus | ( |  | $stat | ) |

Sets the exit status. This status will be used to inform the user, perform a redirection...

Parameters

  int | $stat | One of the eZModule::STATUS_* constants

See also
  exitStatus()

Returns
  void

Definition at line 523 of file ezmodule.php.

Referenced by forward(), handleError(), redirectTo(), and run().

## ◆ setGlobalPathList()

static eZModule::setGlobalPathList | ( |  | $pathList | ) |
| static

Sets the value of the global path list used to search for modules.

Parameters

  array | string | $pathList | Either an array of path, or a single path as a string

Returns
  void

See also
  addGlobalPathList(), globalPathList()

Definition at line 1951 of file ezmodule.php.

Referenced by eZScript\initialize(), and eZSiteAccess\load().

## ◆ setRedirectStatus()

eZModule::setRedirectStatus | ( |  | $status | ) |

Sets the HTTP status which will be set when redirecting

Parameters

  string | $status | HTTP status

Note
  The status must be a valid HTTP status with number and text.

Definition at line 1060 of file ezmodule.php.

## ◆ setRedirectURI()

eZModule::setRedirectURI | ( |  | $uri | ) |

Sets the URI which will be redirected to when the function exits

Parameters

  string | $uri | The redirection URI

Returns
  void

Definition at line 1036 of file ezmodule.php.

## ◆ setTitle()

eZModule::setTitle | ( |  | $title | ) |

Sets the current view for the module to $title.

Parameters

  string | $title | The title to be set

See also
  title()

Definition at line 404 of file ezmodule.php.

## ◆ setUIComponentName()

eZModule::setUIComponentName | ( |  | $component | ) |

Sets the current component name

Parameters

  string | $component | The new component name

See also
  uiComponentName()

Returns
  void

Definition at line 497 of file ezmodule.php.

## ◆ setUIContextName()

eZModule::setUIContextName | ( |  | $context | ) |

Sets the current context

Parameters

  string | $context | The new context string

See also
  uiContextName()

Returns
  void

Definition at line 483 of file ezmodule.php.

## ◆ setViewResult()

eZModule::setViewResult | ( |  | $result,
|  |  | $view = `''`
| ) |  |

Sets the view result

Parameters

  string | $result | The (usually HTML) view result
  string | $view | The view to set the result for. If omited, the current view is used

Returns
  void

See also
  hasViewResult(), viewResult()

Definition at line 1548 of file ezmodule.php.

References currentView().

## ◆ singleFunction()

eZModule::singleFunction | ( |  | ) |

Checks if the module is a single view one

Returns
  bool

Definition at line 446 of file ezmodule.php.

Referenced by forward(), functionURI(), run(), and viewData().

## ◆ title()

eZModule::title | ( |  | ) |

Returns the title of the last ran view. Normally set by the view itself, and displayed as the page's title

Returns
  string

See also
  setTitle()

Definition at line 392 of file ezmodule.php.

References $Title.

## ◆ uiComponentName()

eZModule::uiComponentName | ( |  | ) |

Returns the UI component, by default the module name

Returns
  string The current UI component

See also
  setUIComponentName()

Definition at line 469 of file ezmodule.php.

References $UIComponent.

## ◆ uiContextName()

eZModule::uiContextName | ( |  | ) |

Returns the UI context

Returns
  string The current UI context. Default: 'navigation'

See also
  setUIContextName()

Definition at line 457 of file ezmodule.php.

References $UIContext.

## ◆ unorderedParameters()

eZModule::unorderedParameters | ( |  | $viewName = `''` | ) |

Returns the unordered parameters definition.

Parameters

  string | $viewName | The view to return parameters for. If npt specified, the current view is used

Returns
  the unordered parameter definition for the requested view

See also
  parameters(), viewData(), currentView(), currentModule()

Definition at line 914 of file ezmodule.php.

References currentView(), and viewData().

## ◆ uri()

eZModule::uri | ( |  | ) |

Returns the module's URI (/content, /user...)

Returns
  string The module's URI

See also
  functionURI()

Definition at line 356 of file ezmodule.php.

References $Name.

Referenced by attribute(), and functionURI().

## ◆ viewData()

eZModule::viewData | ( |  | $viewName = `''` | ) |

Returns data for a view

Parameters

  string | $viewName | The view to return data for. If omited, the current view is used

See also
  parameters(), unorderedParameters(), currentView(), currentModule()

Returns
  array

Definition at line 935 of file ezmodule.php.

References currentView(), and singleFunction().

Referenced by parameters(), and unorderedParameters().

## ◆ viewResult()

eZModule::viewResult | ( |  | $view = `''` | ) |

Returns the view result

Parameters

  string | $view | The view to return the result for, or the current one if omited

Returns
  string|null The view result, or null if not set

Definition at line 1576 of file ezmodule.php.

References currentView().

Referenced by run().

## Member Data Documentation

## ◆ $ErrorCode

eZModule::$ErrorCode

Definition at line 133 of file ezmodule.php.

Referenced by errorCode().

## ◆ $ExitStatus

eZModule::$ExitStatus

Definition at line 126 of file ezmodule.php.

Referenced by exitStatus().

## ◆ $FunctionList

eZModule::$FunctionList

Definition at line 245 of file ezmodule.php.

Referenced by attribute(), and initialize().

## ◆ $Functions

eZModule::$Functions

Definition at line 92 of file ezmodule.php.

Referenced by attribute().

## ◆ $HookList

eZModule::$HookList

Definition at line 161 of file ezmodule.php.

## ◆ $Module

eZModule::$Module

Definition at line 104 of file ezmodule.php.

Referenced by attribute(), and initialize().

## ◆ $Name

eZModule::$Name

Definition at line 110 of file ezmodule.php.

Referenced by attribute(), run(), and uri().

## ◆ $NamedParameters

eZModule::$NamedParameters

Definition at line 204 of file ezmodule.php.

Referenced by getNamedParameters().

## ◆ $NavigationParts

eZModule::$NavigationParts

Definition at line 246 of file ezmodule.php.

## ◆ $OriginalParameters

eZModule::$OriginalParameters

Definition at line 190 of file ezmodule.php.

## ◆ $OriginalUnorderedParameters

eZModule::$OriginalUnorderedParameters

Definition at line 211 of file ezmodule.php.

Referenced by currentRedirectionURI(), and forward().

## ◆ $OriginalViewParameters

eZModule::$OriginalViewParameters

Definition at line 197 of file ezmodule.php.

Referenced by currentRedirectionURI().

## ◆ $Path

eZModule::$Path

Definition at line 117 of file ezmodule.php.

Referenced by attribute().

## ◆ $RedirectStatus

eZModule::$RedirectStatus

Definition at line 147 of file ezmodule.php.

Referenced by redirectStatus().

## ◆ $RedirectURI

eZModule::$RedirectURI

Definition at line 140 of file ezmodule.php.

Referenced by redirectURI().

## ◆ $Title

eZModule::$Title

Definition at line 154 of file ezmodule.php.

Referenced by title().

## ◆ $UIComponent

eZModule::$UIComponent

Definition at line 234 of file ezmodule.php.

Referenced by uiComponentName().

## ◆ $UIComponentMatch

eZModule::$UIComponentMatch

Definition at line 242 of file ezmodule.php.

## ◆ $UIContext

eZModule::$UIContext

Definition at line 226 of file ezmodule.php.

Referenced by uiContextName().

## ◆ $useExceptions

eZModule::$useExceptions
| static

Definition at line 244 of file ezmodule.php.

## ◆ $UserParameters

eZModule::$UserParameters

Definition at line 218 of file ezmodule.php.

Referenced by currentRedirectionURI(), and forward().

## ◆ $ViewActionParameters

eZModule::$ViewActionParameters

Definition at line 37 of file ezmodule.php.

## ◆ $ViewActions

eZModule::$ViewActions

Definition at line 169 of file ezmodule.php.

## ◆ $ViewParameters

eZModule::$ViewParameters

Definition at line 183 of file ezmodule.php.

## ◆ $ViewResult

eZModule::$ViewResult

Definition at line 176 of file ezmodule.php.

## ◆ HOOK_STATUS_CANCEL_RUN

const eZModule::HOOK_STATUS_CANCEL_RUN = 1

Definition at line 78 of file ezmodule.php.

Referenced by runHooks().

## ◆ HOOK_STATUS_FAILED

const eZModule::HOOK_STATUS_FAILED = 2

Definition at line 84 of file ezmodule.php.

Referenced by runHooks().

## ◆ HOOK_STATUS_OK

const eZModule::HOOK_STATUS_OK = 0

Definition at line 72 of file ezmodule.php.

Referenced by runHooks().

## ◆ STATUS_FAILED

const eZModule::STATUS_FAILED = 2

Definition at line 54 of file ezmodule.php.

## ◆ STATUS_IDLE

const eZModule::STATUS_IDLE = 0

Definition at line 42 of file ezmodule.php.

Referenced by initialize().

## ◆ STATUS_OK

const eZModule::STATUS_OK = 1

Definition at line 48 of file ezmodule.php.

Referenced by run().

## ◆ STATUS_REDIRECT

const eZModule::STATUS_REDIRECT = 3

Definition at line 60 of file ezmodule.php.

## ◆ STATUS_RERUN

const eZModule::STATUS_RERUN = 4

Definition at line 66 of file ezmodule.php.

The documentation for this class was generated from the following file:

- ezmodule.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.