'home', 'header' => null, 'content' => null, 'msgs' => null, 'end' => null, ); include('include/functions.php'); if (isset($_GET['page'])) $PAGE['section'] = $_GET['page']; ### CONFIGURATION ### if (!file_exists('config.xml')) { $ERRORS['fatal'][] = 'ErrorConfigFile'; } else { $CONF = load_config('config.xml'); } if (!file_exists('include/nconvert.exe')) { $ERRORS['fatal'][] = 'ErrorNconvert'; } $CONF = array_merge($CONF, GetLanguage()); include('language/'.$CONF['user_lang'].'/common.lang.php'); ### PROCESSUS ### switch ($PAGE['section']) { case 'home': if (!isset($ERRORS['fatal'])) { if (!file_exists($CONF['DIRsource'])) { mkdir($CONF['DIRsource']); } if (!file_exists($CONF['DIRsortie'])) { mkdir($CONF['DIRsortie']); } if (is_dir_empty($CONF['DIRsource'])) { $ERRORS['fatal'][] = 'ErrorFolderIn'; } if ($CONF['silentORNOT'] == 'block' AND !is_dir_empty($CONF['DIRsortie'])) { $ERRORS['fatal'][] = 'ErrorFolderOut'; } else if ($CONF['silentORNOT'] == 'erase' AND !is_dir_empty($CONF['DIRsortie'])) { $ERRORS['notice'][] = 'EraseFolderOut'; } } break; case 'setup': if (isset($_POST['submit'])) { include('include/save_config.php'); } break; case 'process': include('include/main.php'); break; } ### AFFICHAGE ### switch ($PAGE['section']) { case 'home': include('include/display_config.php'); if (isset($ERRORS['fatal'])) { $PAGE['end'] .= ' '; } else { $PAGE['end'] .= '
'.l10n('Ready').' PHP OPT
'; } break; case 'setup': if (isset($ERRORS['fatal'])) { $PAGE['end'] .= ' '; } else { include('include/setup.php'); } break; case 'process': ### Affichage des fichiers traités et création du log ### $nb_files = count($FilesSource); $time = intval((microtime(true)-$TIME_START)); $logfile = print_log($nb_files, $time); $PAGE['content'] .= '

'.l10n('Source files').'

'.l10n('%d files', $nb_files).'
Log : '.$logfile.'
'; unset($FilesSource); unset($FilesSortie); $PAGE['end'] .= '
'.l10n('Finish %d seconds', $time).'
'; break; } ### ERREURS ### // erreurs fatales if (isset($ERRORS['fatal'])) { $PAGE['msgs'] .= '
'; foreach ($ERRORS['fatal'] as $key) { $PAGE['msgs'] .= '
'.l10n('fatal.'.$key).'
'; } $PAGE['msgs'] .= '
'; } // informations if (isset($ERRORS['notice'])) { $PAGE['msgs'] .= '
'; foreach ($ERRORS['notice'] as $key) { $PAGE['msgs'] .= '
'.l10n('notice.'.$key).'
'; } $PAGE['msgs'] .= '
'; } // erreurs de configuration if (isset($ERRORS['conf'])) { $PAGE['msgs'] .= '
'; foreach ($ERRORS['conf'] as $key) { $PAGE['msgs'] .= '
'.l10n('notice.'.$key[1].' %s', ''.$key[0].'').'
'; } $PAGE['msgs'] .= '
'; } ### FIN ### include('include/header.php'); echo $PAGE['content']; echo $PAGE['msgs']; echo $PAGE['end']; echo ' '; ?>