mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-06 00:14:25 +03:00
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?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;
|
|
}
|
|
}
|
|
?>
|