null,1=>null,2=>null); include('include/functions.php'); $PAGE = (isset($_GET['page'])) ? $_GET['page'] : 'home'; ### CONFIGURATION ### if (!file_exists('config.xml')) { $ERRORS['fatal']['ErrorConfigFile'] = true; } else { $CONF = load_config('config.xml'); } if (!file_exists('include/nconvert.exe')) { $ERRORS['fatal']['ErrorNconvert'] = true; } ### HEADER ### $CONF = array_merge($CONF, GetLanguage()); include('language/'.$CONF['user_lang'].'/'.$CONF['user_lang'].'.php'); include('include/header.php'); ### PROCESSUS ### if ($PAGE == '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'] = true; } if ($CONF['silentORNOT'] == 'block' AND !is_dir_empty($CONF['DIRsortie'])) { $ERRORS['fatal']['ErrorFolderOut'] = true; } else if ($CONF['silentORNOT'] == 'erase' AND !is_dir_empty($CONF['DIRsortie'])) { $ERRORS['notice']['EraseFolderOut'] = true; } } } else if ($PAGE == 'setup') { if (isset($_GET['ErrorConfig'])) { $ERRORS['notice']['ErrorConfig'] = true; } if (isset($_POST['DIRsource'])) { include('include/save_config.php'); } } else if ($PAGE = 'process') { include('include/main.php'); } ### ERREURS ### if (isset($ERRORS['fatal'])) { $PAGE_CONTENT[1] .= '
'; foreach ($ERRORS['fatal'] as $key => $i) { $PAGE_CONTENT[1] .= '
'.l10n('fatal.'.$key).'
'; } $PAGE_CONTENT[1] .= '
'; } if (isset($ERRORS['notice'])) { $PAGE_CONTENT[1] .= '
'; foreach ($ERRORS['notice'] as $key => $i) { $PAGE_CONTENT[1] .= '
'.l10n('notice.'.$key).'
'; } $PAGE_CONTENT[1] .= '
'; } ### AFFICHAGE ### if ($PAGE == 'home') { if (isset($ERRORS['fatal'])) { $PAGE_CONTENT[2] .= ' '; } else { include('include/display_config.php'); $PAGE_CONTENT[2] .= '
'.l10n('Ready').' PHP OPT
'; } } else if ($PAGE == 'setup') { if (isset($ERRORS['fatal'])) { $PAGE_CONTENT[2] .= ''; } else { include('include/setup.php'); } } else if ($PAGE = 'process') { ### Affichage des fichiers traités ### $PAGE_CONTENT[0] .= '

'.l10n('Source files').'

'.l10n('%d files', count($FilesSource)).'
'; unset($FilesSource); unset($FilesSortie); $PAGE_CONTENT[2] .= '
'.l10n('Finish %d seconds', intval((microtime(true)-$TIME_START))).'
'; } ### FIN ### echo $PAGE_CONTENT[0]; echo $PAGE_CONTENT[1]; echo $PAGE_CONTENT[2]; echo ' '; ?>