function buildMainPage($page_fields = null) { $this->_TMS->AddFileSection($this->loadModuleTpls($this->_module_name, array(array('tplName' => 'run')), true), true); if ($moduleList = xCore::getModuleList()) { $users = xCore::loadCommonClass('users'); //$maccess=$users->roles_tree->GetChildsParam($_SESSION['user']['id'], array('is_accesible'), true); foreach ($moduleList as $module) { if ($_SESSION['user']['type'] == '_SUPERADMIN' or $_SESSION['user']['maccess'][$module['name']]) { $i++; $this->_TMS->AddMassReplace('js_modules', $module); $this->_TMS->parseSection('js_modules', true); $lang = Common::getModuleLang($this->_module_name, $_SESSION['lang'], 'modules'); $m = array('name' => $module['name'], 'alias' => $lang[$module['name']], 'info' => $lang[$module['name'] . '_info']); $this->_TMS->AddMassReplace('fw_module', $m); $column1 .= $this->_TMS->parseSection('fw_module'); if ($i % 3 == 0) { $this->_TMS->AddReplace('fw_module_all', 'fw_module', $column1); $this->_TMS->parseSection('fw_module_all', true); $column1 = ''; } $this->_TMS->AddMassReplace('module_menu', $m); $menu_html = $this->_TMS->parseSection('module_menu'); switch ($module['moduleCategory']) { case 0: $mm['menu_content'] .= $menu_html; break; case 1: $mm['menu_control'] .= $menu_html; break; case 2: $mm['menu_special'] .= $menu_html; break; } } } $this->_TMS->AddReplace('fw_module_all', 'fw_module', $column1); $this->_TMS->parseSection('fw_module_all', true); } $this->_TMS->AddMassReplace('main', $mm); $this->_TMS->AddMassReplace('main', $this->getAdminPanelData()); $this->_TMS->AddMassReplace('main', $page_fields); return $this->_TMS->parseSection('main'); }
define("REAL_HTTP_HOST", $m[1]); require_once 'inc/core/helpers.php'; require_once 'conf/init.php'; require_once xConfig::get('PATH', 'CORE') . 'core.php'; require_once xConfig::get('PATH', 'ADM') . 'adm.class.php'; xRegistry::set('TMS', $TMS = new tMultiSection()); xPDO::setSource(DB_HOST, DB_NAME, DB_USER, DB_PASS); xRegistry::set('xPDO', xPDO::getInstance()); session_start(); @session_destroy(); @session_start(); $adm = new adminPanel(); $_SESSION['lang'] = $_COMMON_SITE_CONF['default_language']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($_POST['login'] && $_POST['password']) { $users = xCore::loadCommonClass('users'); if ($users->checkAndLoadUser($_POST['login'], $_POST['password'])) { if ($_POST['lang']) { $_SESSION['lang'] = $_POST['lang']; } if ($_POST['clearGSTORAGE']) { $_SESSION['clearGSTORAGE'] = 1; } header('location: admin.php?'); exit; } } echo $adm->showLogin(true); } else { echo $adm->showLogin(); }