1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-06 00:14:25 +03:00
ifhub.club/engine/modules/viewer/plugs/function.router.php

44 lines
1.2 KiB
PHP
Raw Normal View History

<?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 Smarty $oSmarty
* @return string
*/
function smarty_function_router($aParams,&$oSmarty) {
if(empty($aParams['page'])) {
$oSmarty->trigger_error("Router: missing 'page' parametr");
return ;
}
require_once(Config::Get('path.root.engine').'/classes/Router.class.php');
2009-08-19 13:47:19 +03:00
if(!$sPath = Router::GetPath($aParams['page'])) {
$oSmarty->trigger_error("Router: unknown 'page' given");
return ;
}
/**
* Возвращаем полный адрес к указаному Action
*/
return (isset($aParams['extend']))
? $sPath . $aParams['extend'] ."/"
: $sPath;
}
?>