Пример #1
0
function smarty_init()
{
    $smarty = new Smarty();
    $smarty->template_dir = util_getRootPath() . 'templates';
    $smarty->compile_dir = util_getRootPath() . 'templates_c';
    $smarty->assign('wwwRoot', util_getWwwRoot());
    $smarty->assign('cssRoot', util_getCssRoot());
    $smarty->assign('imgRoot', util_getImgRoot());
    $smarty->assign('sources', Model::factory('Source')->order_by_desc('isOfficial')->order_by_asc('displayOrder')->find_many());
    $smarty->assign('sUser', session_getUser());
    $smarty->assign('is_mirror', pref_isMirror());
    $smarty->assign('nick', session_getUserNick());
    $smarty->assign('contact_email', pref_getContactEmail());
    $smarty->assign('hostedBy', pref_getHostedBy());
    $smarty->assign('currentYear', date("Y"));
    $smarty->assign('bannerType', pref_getServerPreference('bannerType'));
    $smarty->assign('developmentMode', pref_getServerPreference('developmentMode'));
    $smarty->assign('isMobile', util_isMobile());
    smarty_registerFunction($smarty, 'getDebugInfo', 'smarty_function_getDebugInfo');
    $smarty->assign('GLOBALS', $GLOBALS);
    $GLOBALS['smarty_theSmarty'] = $smarty;
}
Пример #2
0
function util_assertNotMirror()
{
    if (pref_isMirror()) {
        smarty_displayWithoutSkin('common/mirror_message.ihtml');
        exit;
    }
}