$value) { if ($value['tag'] == 'param') { $name = $value['attributes']['name']; $language[$name] = $value['attributes']['default']; } } while(!feof($fp)){ $buffer = fgets($fp,4096); if (strstr($buffer,"\$mosConfig_lang =")){ $config .= "\$mosConfig_lang = \"{$lang[0]}\";\n"; } elseif (strstr($buffer,"\$mosConfig_locale =")){ $config .= "\$mosConfig_locale = \"{$language['locale']}\";\n"; } elseif (strstr($buffer,"\$mosConfig_charset =")){ $config .= "\$mosConfig_charset = \"{$language['charset']}\";\n"; } else { $config .= $buffer; } } fclose($fp); if ($fp = fopen("../configuration.php","w")){ fputs($fp, $config, strlen($config)); fclose($fp); $request->setAttribute('msg', T_('Configuration succesfully updated!')); } else { $request->setAttribute('msg', T_('Error! Make sure that configuration.php is writeable.')); } return $controller->redirect(); } } ?>