function _getAgreement() { $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . Context::get('lang_type') . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } $db_info = Context::getDBInfo(); $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . $db_info->lang_type . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } $lang_selected = Context::loadLangSelected(); foreach ($lang_selected as $key => $val) { $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . $key . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } } return null; }
function dispTextyleToolConfigInfo() { Context::set('langs', Context::loadLangSelected()); Context::set('time_zone_list', $GLOBALS['time_zone']); Context::set('time_zone', $GLOBALS['_time_zone']); }
/** * Display Configuration(settings) page * @return void */ function dispAdminConfigGeneral() { Context::loadLang('modules/install/lang'); $db_info = Context::getDBInfo(); Context::set('selected_lang', $db_info->lang_type); if (strpos($db_info->default_url, 'xn--') !== FALSE) { $db_info->default_url = Context::decodeIdna($db_info->default_url); } Context::set('default_url', $db_info->default_url); Context::set('langs', Context::loadLangSupported()); // site lock Context::set('IP', $_SERVER['REMOTE_ADDR']); if (!$db_info->sitelock_title) { $db_info->sitelock_title = 'Maintenance in progress...'; } if (!in_array('127.0.0.1', $db_info->sitelock_whitelist)) { $db_info->sitelock_whitelist[] = '127.0.0.1'; } if (!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) { $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR']; } $db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist); Context::set('remote_addr', $_SERVER['REMOTE_ADDR']); Context::set('use_sitelock', $db_info->use_sitelock); Context::set('sitelock_title', $db_info->sitelock_title); Context::set('sitelock_message', htmlspecialchars($db_info->sitelock_message, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); $whitelist = implode("\r\n", $db_info->sitelock_whitelist); Context::set('sitelock_whitelist', $whitelist); if ($db_info->admin_ip_list) { $admin_ip_list = implode("\r\n", $db_info->admin_ip_list); } else { $admin_ip_list = ''; } Context::set('admin_ip_list', $admin_ip_list); Context::set('lang_selected', Context::loadLangSelected()); $oAdminModel = getAdminModel('admin'); $favicon_url = $oAdminModel->getFaviconUrl(); $mobicon_url = $oAdminModel->getMobileIconUrl(); Context::set('favicon_url', $favicon_url . '?' . $_SERVER['REQUEST_TIME']); Context::set('mobicon_url', $mobicon_url . '?' . $_SERVER['REQUEST_TIME']); $oDocumentModel = getModel('document'); $config = $oDocumentModel->getDocumentConfig(); Context::set('thumbnail_type', $config->thumbnail_type); $oModuleModel = getModel('module'); $config = $oModuleModel->getModuleConfig('module'); Context::set('siteTitle', $config->siteTitle); Context::set('htmlFooter', htmlspecialchars($config->htmlFooter)); // embed filter require_once _XE_PATH_ . 'classes/security/EmbedFilter.class.php'; $oEmbedFilter = EmbedFilter::getInstance(); context::set('embed_white_object', implode(PHP_EOL, $oEmbedFilter->whiteUrlList)); context::set('embed_white_iframe', implode(PHP_EOL, $oEmbedFilter->whiteIframeUrlList)); $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl'); $start_module = $oModuleModel->getSiteInfo(0, $columnList); Context::set('start_module', $start_module); Context::set('pwd', $pwd); $this->setTemplateFile('config_general'); $security = new Security(); $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.'); }
/** * Compile a xml_file * @return void */ function _compile() { $lang_selected = Context::loadLangSelected(); $this->lang_types = array_keys($lang_selected); // read xml file $buff = FileHandler::readFile($this->xml_file); $buff = str_replace('xml:lang', 'xml_lang', $buff); // xml parsing $xml_obj = parent::parse($buff); $item = $xml_obj->lang->item; if (!is_array($item)) { $item = array($item); } foreach ($item as $i) { $this->_parseItem($i, $var = '$lang->%s'); } }
function _getAgreement() { $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . config('locale.default_lang') . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } $lang_selected = Context::loadLangSelected(); foreach ($lang_selected as $key => $val) { $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . $key . '.txt'; if (is_readable($agreement_file)) { return FileHandler::readFile($agreement_file); } } return null; }
/** * Display Configuration(settings) page * @return void */ function dispAdminConfigGeneral() { Context::loadLang('modules/install/lang'); $db_info = Context::getDBInfo(); Context::set('selected_lang', $db_info->lang_type); Context::set('default_url', $db_info->default_url); Context::set('langs', Context::loadLangSupported()); Context::set('lang_selected', Context::loadLangSelected()); $admin_ip_list = preg_replace("/[,]+/", "\r\n", $db_info->admin_ip_list); Context::set('admin_ip_list', $admin_ip_list); $oAdminModel =& getAdminModel('admin'); $favicon_url = $oAdminModel->getFaviconUrl(); $mobicon_url = $oAdminModel->getMobileIconUrl(); Context::set('favicon_url', $favicon_url); Context::set('mobicon_url', $mobicon_url); $oDocumentModel =& getModel('document'); $config = $oDocumentModel->getDocumentConfig(); Context::set('thumbnail_type', $config->thumbnail_type); Context::set('IP', $_SERVER['REMOTE_ADDR']); $oModuleModel =& getModel('module'); $config = $oModuleModel->getModuleConfig('module'); Context::set('htmlFooter', $config->htmlFooter); $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl'); $start_module = $oModuleModel->getSiteInfo(0, $columnList); Context::set('start_module', $start_module); Context::set('pwd', $pwd); $this->setTemplateFile('config_general'); $security = new Security(); $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.'); }
/** * @brief Save the file of user-defined language code */ function makeCacheDefinedLangCode($site_srl = 0) { $args = new stdClass(); // Get the language file of the current site if (!$site_srl) { $site_module_info = Context::get('site_module_info'); $args->site_srl = (int) $site_module_info->site_srl; } else { $args->site_srl = $site_srl; } $output = executeQueryArray('module.getLang', $args); if (!$output->toBool() || !$output->data) { return; } // Set the cache directory $cache_path = _XE_PATH_ . 'files/cache/lang_defined/'; FileHandler::makeDir($cache_path); $langMap = array(); foreach ($output->data as $val) { $langMap[$val->lang_code][$val->name] = $val->value; } $lang_supported = Context::loadLangSelected(); $defaultLang = config('locale.default_lang'); if (!is_array($langMap[$defaultLang])) { $langMap[$defaultLang] = array(); } foreach ($lang_supported as $langCode => $langName) { if (!is_array($langMap[$langCode])) { $langMap[$langCode] = array(); } $langMap[$langCode] += $langMap[$defaultLang]; foreach ($lang_supported as $targetLangCode => $targetLangName) { if ($langCode == $targetLangCode || $langCode == $defaultLang) { continue; } if (!is_array($langMap[$targetLangCode])) { $langMap[$targetLangCode] = array(); } $langMap[$langCode] += $langMap[$targetLangCode]; } $buff = array("<?php if(!defined('__XE__')) exit();"); foreach ($langMap[$langCode] as $code => $value) { $buff[] = sprintf('$lang[\'%s\'] = \'%s\';', $code, addcslashes($value, "'")); } if (!@file_put_contents(sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $langCode), join(PHP_EOL, $buff), LOCK_EX)) { return; } } }
/** * Change shop configuration from backend */ public function dispShopToolConfigInfo(){ $currencies = require_once(_XE_PATH_.'modules/shop/shop.currencies.php'); Context::set('currencies',$currencies); Context::set('langs', Context::loadLangSelected()); Context::set('time_zone_list', $GLOBALS['time_zone']); Context::set('time_zone', $GLOBALS['_time_zone']); }
/** * @brief 관리자 설정 **/ function dispAdminConfig() { $db_info = Context::getDBInfo(); Context::set('selected_lang', $db_info->lang_type); Context::set('default_url', $db_info->default_url); Context::set('langs', Context::loadLangSupported()); Context::set('lang_selected', Context::loadLangSelected()); Context::set('ftp_info', Context::getFTPInfo()); $site_args->site_srl = 0; $output = executeQuery('module.getSiteInfo', $site_args); Context::set('start_module', $output->data); Context::set('layout', 'none'); $this->setTemplateFile('config'); }