Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cApiCecChainItem
  • cApiCecHook
  • cApiCecRegistry
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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!');
}
Package: Core\CEC
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
Methods summary
public static
# setBreakCondition( mixed $condition, mixed $defaultReturnValue = NULL )

Temporaly setting of break condition and optional the default return value.

Temporaly setting of break condition and optional the default return value.

Parameters

$condition
mixed
$condition
$defaultReturnValue
mixed
$defaultReturnValue
public static
# setDefaultReturnValue( mixed $defaultReturnValue )

Temporaly setting of default return value.

Temporaly setting of default return value.

Parameters

$defaultReturnValue
mixed
$defaultReturnValue
public static
# setReturnArgumentPos( integer $pos )

Temporaly setting of position in argument to return.

Temporaly setting of position in argument to return.

Parameters

$pos
integer
$pos Position, feasible value greater 0

Throws

cInvalidArgumentException
if the given position is less than 1
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.

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

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

Returns

mixed
Parameter changed/processed by chain functions.
public static mixed
# executeWhileBreakCondition( )

CEC function to process chains untill a break condition occurs.

CEC function to process chains untill a break condition occurs.

Gets the desired CEC iterator and executes each registered chain function as long as defined break condition doesn't occur. 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.

Returns

mixed
The break condition or it's default value
private static
# _reset( )

Resets some properties to defaults

Resets some properties to defaults

private static
# _debug( mixed $var, string $msg = '' )

Used to debug some status informations.

Used to debug some status informations.

Parameters

$var
mixed
$var The variable to dump
$msg
string
$msg Additional message

Todo

Implement cec_hook debug mode for automatic logging when activated. Writes the debug value into a logfile (see contenido/data/log/cec_hook_debug.log).
Properties summary
private static integer $_breakCondition NULL
#

Temporaly stored break condition.

Temporaly stored break condition.

private static mixed $_defaultReturnValue NULL
#

Temporaly stored default return value of CEC functions

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.

Temporaly stored position of argument to return. It's used by cApiCecHook::executeAndReturn() to store/extract the return value into/from arguments list.

CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0