isLogin) { $theme = $user->theme; $theme = $user->theme; $i18n = new Internationalization(); if (MalioConfig::get('only_one_lang') != 'none') { $i18n->lang = MalioConfig::get('only_one_lang'); } else { $i18n->lang = $user->lang; } $smarty->assign('i18n', $i18n); } else { $theme = Config::get('theme'); } $can_backtoadmin = 0; if (Utils\Cookie::get('old_uid') && Utils\Cookie::get('old_email') && Utils\Cookie::get('old_key') && Utils\Cookie::get('old_ip') && Utils\Cookie::get('old_expire_in') && Utils\Cookie::get('old_local')) { $can_backtoadmin = 1; } $smarty->settemplatedir(BASE_PATH . '/resources/views/' . $theme . '/'); //设置模板文件存放目录 $smarty->setcompiledir(BASE_PATH . '/storage/framework/smarty/compile/'); //设置生成文件存放目录 $smarty->setcachedir(BASE_PATH . '/storage/framework/smarty/cache/'); //设置缓存文件存放目录 // add config $smarty->assign('config', Config::getPublicConfig()); $smarty->assign('malio_config', MalioConfig::getPublicConfig()); $smarty->assign('I18N', Internationalization::getPublicConfig()); $smarty->assign('user', $user); $smarty->assign('can_backtoadmin', $can_backtoadmin); if (self::$connection) { $smarty->assign('queryLog', self::$connection->connection('default')->getQueryLog()); $optTime = microtime(true) - self::$beginTime; $smarty->assign('optTime', $optTime * 1000); } return $smarty; } }