1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-29 04:55:02 +03:00
This commit is contained in:
Mzhelskiy Maxim 2011-04-26 10:14:11 +00:00
parent e80ace1996
commit 05e640ddeb

View file

@ -0,0 +1,46 @@
<?php
/*-------------------------------------------------------
*
* LiveStreet Engine Social Networking
* Copyright © 2008 Mzhelskiy Maxim
*
*--------------------------------------------------------
*
* Official site: www.livestreet.ru
* Contact e-mail: rus.engine@gmail.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
---------------------------------------------------------
*/
/**
* Плагин для смарти
* Запускает блочные хуки из шаблона на выполнение
*
* @param array $aParams
* @param string $sContent
* @param Smarty $oSmarty
* @param bool $bRepeat
* @return string
*/
function smarty_block_hookb($aParams,$sContent,&$oSmarty,&$bRepeat) {
if(empty($aParams['run'])) {
$oSmarty->trigger_error("Hook: missing 'run' parametr");
return;
}
if ($sContent) {
$sHookName='template_block_'.strtolower($aParams['run']);
unset($aParams['run']);
$aParams['content']=$sContent;
$aResultHook=Engine::getInstance()->Hook_Run($sHookName,$aParams);
if (array_key_exists('template_result',$aResultHook)) {
echo join('',$aResultHook['template_result']);
return ;
}
echo $sContent;
}
}
?>