<?php
 /***************************************************************************
 *   Copyright (C) 2008 by oscim   Project lossim                          *
 *   a@oscim.fr                                                            *
 *       [created : 14.03.2008, 17:53:41] @oscim                           *
 ***************************************************************************/
 $error='';

 if (isset($_POST['mod_menu'])) {
  $handle=fopen("../include/config/config_menu.inc",'w+');
  fclose($handle);
  copy("data/config_menu.inc-dist","../include/config/config_menu.inc");
  $handle=fopen("../include/menu/menu.inc",'w+');
  fclose($handle);
  copy("data/menu.inc-dist","../include/menu/menu.inc");
 }
  if (isset($_POST['mod_menu'])) {
  $handle=fopen("../include/menu/links.inc",'w+');
  fclose($handle);
  copy("data/links.inc-dist","../include/menu/links.inc");
 }

  if (isset($_POST['mod_rub'])) {

  $handle=fopen("../include/config/rubrique.inc",'w+');
  fclose($handle);
  copy("data/rubrique.inc-dist","../include/config/rubrique.inc");
 }



$tit=$det=$error_mess='';
// Si le fichier a les bonnes permissions on le modifie sinon on dit ce qu'il faut faire
// if (file_exists("../include/sys_config_modules.php"))  {
//
// 	if(is_writable("../include/sys_config_modules.php") OR $os_du_serveur == "windows") {
//
// 		$error = false;
// 		$error_mess = '';
//
// 		$cfg_public = new configfile('../include/sys_config_modules.php');
//
// 			$cfg_public->prefix = '_PX_config_module';
//
// 		if (!empty($_POST['mod_menu'])) $cfg_public->addVar('menu','true');
// 		if (!empty($_POST['mod_rub'])) $cfg_public->addVar('rubrique','true');
//
// 			if (!$cfg_public->saveFile()) {
// 				 $error_mess .= 'Error: Impossible to create the configuration file. pour cfg_public';
// 				$error = true;
// 			}
// 			else  $error_mess .= 'Ok. pour cfg_public ';
// 	} else { $tit=NOT_WRITE; $det=NOT_WRITE_DETAIL; }
//  }else { $tit=NOT_EXIST; $det=NOT_EXIST_DETAIL; }
//
// echo "<h2>$tit</h2>\n<p>$det</p>\n<p>$error_mess</p>\n";
?>
<form name='formt' enctype="multipart/form-data" action='setup.php?etape=2' Method='POST'>
	<?php post_hidden($_POST) ?>
	<?php if($error == false) print"<input type='hidden' name='success_mod' value='1' />";?>
	<input type='submit' name='boutton' value='La Suite'>
</form>