* @since 1.0 * @package MCMS * @subpackage Module */ class Setup extends AdminBase { public function runIndex(Request $request, Response $response, $activeInstance) { $system = System::getInstance(); $param = $request->getParam(); $action = 'index'; $allowed = array('en','en_EN','de','de_DE'); $langu = '_default_'; foreach(Locale::getLocaleList($_SERVER['HTTP_ACCEPT_LANGUAGE']) as $l) { if(in_array($l, $allowed)) { $langu = $l; break; } } // $lang = array_from_file(__DIR__ . __DS__ . 'locale' . __DS__ . '_default_.php', 'lang'); // ($langu != '_default_') and ($l2 = get_configfile_array(__DIR__ . __DS__ . 'locale' . __DS__ . $langu . '.php', 'lang')); // $lang = array_merge($lang, $l2); // unset($l2, $langu, $allowed); ob_start(); include (__DIR__ . __DS__ . '_layout_'.__DS__.'tpl.'. $action . '.php'); $response->setFragment('CONTENT', ob_get_clean()); } public function runUpdate(Request $request, Response $response, $activeInstance) { $system = System::getInstance(); $param = $request->getParam(); $system->setSiteParam($param['site'], $param['instance'], 'layout', empty($param['layout']) ? '' : $param['layout']); $response->setRedirectURL($_SERVER['PHP_SELF'] . '?cat=co.mcms.mmpimaincontent:site&site=' . $param['site'] . '&action=instances'); } }