Class cApiCecHook
Static CEC Hook class, provides some public methods to process registered chains at CEC (CONTENIDO Extension Chainer).
Usage:
// example of executing a cec without a parameter and return value cApiCecHook::execute('Contenido.Content.Somewhere'); // example of executing a cec with a parameter but without a return value $param = 'some value'; cApiCecHook::execute('Contenido.Content.Somewhere', $param); // example of executing a cec with multiple parameter but without a return value $param = array('foo' => $bar, 'foo2' => $bar2); $param = cApiCecHook::execute('Contenido.Content.Somewhere', $param); // example of executing a cec without a parameter but a return value (with predefined // default return value) cApiCecHook::setDefaultReturnValue('this is the default title'); $title = cApiCecHook::executeAndReturn('Contenido.Content.CreateTitletag'); // example of executing a cec with a parameter and a return value // (usually the modified version of passed parameter) $baseHref = cRegistry::getFrontendUrl(); $newBaseHref = cApiCecHook::executeAndReturn('Contenido.Frontend.BaseHrefGeneration', $baseHref); // example of executing a cec with a break condition and default return value cApiCecHook::setBreakCondition(false, true); // break condition = "false", default return value = "true" $allow = cApiCecHook::executeWhileBreakCondition('Contenido.Frontend.AllowEdit', $lang, $idcat, $idart, $auth->auth['uid']); if ($allow == false) { die('You're not coming in!'); } // another example of executing a cec with a break condition and default return value cApiCecHook::setBreakCondition(true, false); // break condition = "true", default return value = "false" $allow = cApiCecHook::executeWhileBreakCondition('Contenido.Frontend.CategoryAccess', $lang, $idcat, $auth->auth['uid']); if ($allow == false) { die('I said, you're not coming in!'); }
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Timo A. Hummel
Author: Murat Purc <murat@purc.de>
Located at classes/class.cec_hook.php
public static
|
#
setBreakCondition( mixed $condition, mixed $defaultReturnValue = NULL )
Temporaly setting of break condition and optional the default return value. |
public static
|
|
public static
|
|
public static
|
#
execute( )
Method to execute registered functions for CONTENIDO Extension Chainer (CEC). Gets the desired CEC iterator and executes each registered chain function by passing the given arguments to it. NOTE: the first param is interpeted as $chainName. NOTE: There is no restriction for number of passed parameter. |
public static
mixed
|
#
executeAndReturn( )
Method to execute registered functions for CONTENIDO Extension Chainer (CEC). Gets the desired CEC iterator and executes each registered chain function. You can pass as much parameters as you want. NOTE: the first param is interpeted as $chainName. NOTE: There is no restriction for number of passed parameter. NOTE: If no chain function is registered, $_defaultReturnValue will be returned. |
public static
mixed
|
|
private static
|
|
private static
|
private static
integer
|
$_breakCondition | NULL |
#
Temporaly stored break condition. |
private static
mixed
|
$_defaultReturnValue | NULL |
#
Temporaly stored default return value of CEC functions |
private static
integer
|
$_returnArgumentPos | 1 |
#
Temporaly stored position of argument to return. It's used by cApiCecHook::executeAndReturn() to store/extract the return value into/from arguments list. |