* @since 1.0 * @package MammutCMS * @subpackage Module */ class MMMDABBoard extends \MCMS\Module\AdminBase { public function irunIndex(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 = get_configfile_array(__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__ . 'ipage.' . $action . '.php'); $response->setFragment('CONTENT', ob_get_clean()); } public function irunUpdate(Request $request, Response $response, $activeInstance) { $system = System::getInstance(); $param = $request->getParam(); $system->setSiteParam($param['site'], $param['instance'], 'layout', empty($param['layout']) ? '' : $param['layout']); $system->setSiteParam($param['site'], $param['instance'], 'ppp', empty($param['ppp']) ? 25 : abs((int) $param['ppp'])); $response->setRedirectURL($_SERVER['PHP_SELF'] . '?cat=co.mcms.mmpimaincontent:site&site=' . $param['site'] . '&action=instances'); } }