本文整理汇总了PHP中OX_Delivery_Common_getFunctionFromComponentIdentifier函数的典型用法代码示例。如果您正苦于以下问题:PHP OX_Delivery_Common_getFunctionFromComponentIdentifier函数的具体用法?PHP OX_Delivery_Common_getFunctionFromComponentIdentifier怎么用?PHP OX_Delivery_Common_getFunctionFromComponentIdentifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OX_Delivery_Common_getFunctionFromComponentIdentifier函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OX_Delivery_Common_hook
function OX_Delivery_Common_hook($hookName, $aParams = array(), $functionName = '')
{
$return = null;
if (!empty($functionName)) {
$aParts = explode(':', $functionName);
if (count($aParts) === 3) {
$functionName = OX_Delivery_Common_getFunctionFromComponentIdentifier($functionName, $hookName);
}
if (function_exists($functionName)) {
$return = call_user_func_array($functionName, $aParams);
}
} else {
if (!empty($GLOBALS['_MAX']['CONF']['deliveryHooks'][$hookName])) {
$return = array();
$hooks = explode('|', $GLOBALS['_MAX']['CONF']['deliveryHooks'][$hookName]);
foreach ($hooks as $identifier) {
$functionName = OX_Delivery_Common_getFunctionFromComponentIdentifier($identifier, $hookName);
if (function_exists($functionName)) {
OX_Delivery_logMessage('calling on ' . $functionName, 7);
$return[$identifier] = call_user_func_array($functionName, $aParams);
}
}
}
}
return $return;
}
示例2: OX_Delivery_Common_hook
function OX_Delivery_Common_hook($hookName, $aParams = array(), $functionName = '')
{
$return = null;
// When a $functionname is passed in we use that function/component-identifier and execute the hook
if (!empty($functionName)) {
// Right now, we're allowing either a plain function to be executed, or a component-identifier
// we may remove the ability to pass a plain function in the future
$aParts = explode(':', $functionName);
if (count($aParts) === 3) {
$functionName = OX_Delivery_Common_getFunctionFromComponentIdentifier($functionName, $hookName);
}
if (function_exists($functionName)) {
$return = call_user_func_array($functionName, $aParams);
}
} else {
// When no $functionName is passed in, we execute all components which are registered for this hook
if (!empty($GLOBALS['_MAX']['CONF']['deliveryHooks'][$hookName])) {
$return = array();
$hooks = explode('|', $GLOBALS['_MAX']['CONF']['deliveryHooks'][$hookName]);
foreach ($hooks as $identifier) {
$functionName = OX_Delivery_Common_getFunctionFromComponentIdentifier($identifier, $hookName);
if (function_exists($functionName)) {
$return[$identifier] = call_user_func_array($functionName, $aParams);
}
}
}
}
return $return;
}
示例3: _adSelectCommon
function _adSelectCommon($aAds, $context, $source, $richMedia)
{
OX_Delivery_Common_hook('preAdSelect', array(&$aAds, &$context, &$source, &$richMedia));
if (!empty($aAds['ext_adselection'])) {
$adSelectFunction = OX_Delivery_Common_getFunctionFromComponentIdentifier($aAds['ext_adselection'], 'adSelect');
}
if (empty($adSelectFunction) || !function_exists($adSelectFunction)) {
$adSelectFunction = '_adSelect';
}
if (!empty($aAds['count_active'])) {
if (isset($aAds['zone_companion']) && isset($context)) {
foreach ($context as $contextEntry) {
if (isset($contextEntry['==']) && preg_match('/^companionid:/', $contextEntry['=='])) {
if ($aLinkedAd = _adSelectInnerLoop($adSelectFunction, $aAds, $context, $source, $richMedia, true)) {
return $aLinkedAd;
}
}
}
}
$aLinkedAd = _adSelectInnerLoop($adSelectFunction, $aAds, $context, $source, $richMedia);
if (is_array($aLinkedAd)) {
return $aLinkedAd;
}
}
return false;
}
示例4: _getAdRenderFunction
function _getAdRenderFunction($aBanner, $richMedia = true)
{
$functionName = false;
if (!empty($aBanner['ext_bannertype'])) {
return OX_Delivery_Common_getFunctionFromComponentIdentifier($aBanner['ext_bannertype'], 'adRender');
} else {
switch ($aBanner['contenttype']) {
case 'gif':
case 'jpeg':
case 'png':
$functionName = '_adRenderImage';
break;
case 'swf':
if ($richMedia) {
$functionName = '_adRenderFlash';
} else {
$functionName = '_adRenderImage';
}
break;
case 'txt':
$functionName = '_adRenderText';
break;
default:
switch ($aBanner['type']) {
case 'html':
$functionName = '_adRenderHtml';
break;
case 'url':
// External banner without a recognised content type - assume image...
$functionName = '_adRenderImage';
break;
case 'txt':
$functionName = '_adRenderText';
break;
default:
$functionName = '_adRenderHtml';
break;
}
break;
}
}
return $functionName;
}