Exemplo n.º 1
0
Arquivo: index.php Projeto: klimjr/cms
                $smarty->assign('__lang', $__lang);
                $smarty->assign('user_id', $user_id);
                $content = $smarty->fetch($tpl);
                $data = array('head' => isset($__lang['add_' . $form]) ? $__lang['add_' . $form] : '', 'content' => $content, 'success' => isset($__lang['add_' . $form . '_success']) ? $__lang['add_' . $form . '_success'] : '', 'error' => isset($__lang['add_' . $form . '_error']) ? $__lang['add_' . $form . '_error'] : '');
                echo json_encode($data);
            }
            exit;
        }
        // Определение мобильного устройства
        require_once DOC . 'system/php-to-detect-mobile-phones.php';
        $mobile = detect_mobile_device() ? 1 : 0;
        if (isset($aStrings[1]) && $aStrings[1] == 'mebel') {
            $smarty->assign(array('body_class' => 'poliform_black'));
        }
        // Выгрузка переменных в шаблон
        $smarty->assign(array('template' => System_Settings::getSmarty_templateName(), 'this_url' => $this_url, 'langs' => $langs, 'current_lang' => $current_lang, 'default_lang' => $default_lang, '__lang' => $router::getLocalize(), 'mobile' => $mobile, 'options' => $options, 'user' => isset($_SESSION['siteuser']) ? $_SESSION['siteuser'] : array()));
        // Вывод страницы с логином для незарегистрированных пользователей
        /*
                if (!isset($_SESSION['siteuser']['id'])) {
                    $router::setTpl('login');
                    $smarty->display($router::getTpl());
                    exit;
                }*/
        // Вывод шаблона
        $smarty->displayAndCach($router::getTpl());
    } else {
        $smarty->displayCached();
    }
} catch (Exception $exc) {
    echo '<pre>Ресурс временно недоступен.</pre>';
    echo '<pre>';