Changeset 10337 for extensions/PHP_Optimisateur/include/save_config.php
- Timestamp:
- Apr 12, 2011, 7:45:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PHP_Optimisateur/include/save_config.php
r9201 r10337 2 2 // Quelques traitements 3 3 $_POST['copyPOS'] = implode('-', $_POST['copyPOS']); 4 $_POST['copyCOLOR'] = str_replace('#', '', $_POST['copyCOLOR']);4 $_POST['copyCOLOR'] = str_replace('#', null, $_POST['copyCOLOR']); 5 5 $_POST['prefixe_mini'] = delete_special_car($_POST['prefixe_mini']); 6 if (!preg_match('#(.*)/$#', $_POST['DIRsource'])) $_POST['DIRsource'] .='/';7 if (!preg_match('#(.*)/$#', $_POST['DIRsortie'])) $_POST['DIRsortie'] .='/';6 $_POST['DIRsource'] = rtrim($_POST['DIRsource'], '/') . '/'; 7 $_POST['DIRsortie'] = rtrim($_POST['DIRsortie'], '/') . '/'; 8 8 9 9 // Vérifications 10 10 if (!is_decimal($_POST['Qhd']) OR $_POST['Qhd'] > 100) { 11 11 $_POST['Qhd'] = 100; 12 $E rrors['ErrorConfig'] = 'notice';12 $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100'); 13 13 } 14 14 if (!is_decimal($_POST['Qnormal']) OR $_POST['Qnormal'] > 100) { 15 15 $_POST['Qnormal'] = 100; 16 $E rrors['ErrorConfig'] = 'notice';16 $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100'); 17 17 } 18 18 if (!is_decimal($_POST['Qthumbnail']) OR $_POST['Qthumbnail'] > 100) { 19 19 $_POST['Qthumbnail'] = 100; 20 $E rrors['ErrorConfig'] = 'notice';20 $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100'); 21 21 } 22 22 if (!is_decimal($_POST['DIMhd'])) { 23 23 $_POST['DIMhd'] = 2560; 24 $E rrors['ErrorConfig'] = 'notice';24 $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer'); 25 25 } 26 26 if (!is_decimal($_POST['DIMnormal']) OR $_POST['DIMnormal'] > $_POST['DIMhd']) { 27 27 $_POST['DIMnormal'] = 800; 28 $E rrors['ErrorConfig'] = 'notice';28 $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer'); 29 29 } 30 30 if (!is_decimal($_POST['DIMthumbnail']) OR $_POST['DIMthumbnail'] > $_POST['DIMnormal']) { 31 31 $_POST['DIMthumbnail'] = 120; 32 $E rrors['ErrorConfig'] = 'notice';32 $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer'); 33 33 } 34 34 if (!is_decimal($_POST['DPI'])) { 35 35 $_POST['DPI'] = 72; 36 $Errors['ErrorConfig'] = 'notice'; 36 $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer'); 37 } 38 if (!is_decimal($_POST['copySIZE'])) { 39 $_POST['copySIZE'] = 0.05; 40 $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal'); 37 41 } 38 42 … … 49 53 } 50 54 55 56 // écrase la configuration 57 unset($_POST['submit']); 58 $CONF = array_merge($CONF, array_settype($_POST)); 59 51 60 // Contenu du fichier 52 61 $content = '<?xml version="1.0" encoding="UTF-8"?>'."\r\n".'<config>'."\r\n"; … … 55 64 file_put_contents('config.xml', $content); 56 65 57 if ( isset($Errors['ErrorConfig'])) {58 header('Location:index.php?page=setup&ErrorConfig='.$Errors['ErrorConfig']);59 } else { 60 header('Location:index.php');66 if (!isset($ERRORS['conf'])) { 67 // header('Location:index.php'); 68 $PAGE['header'] .= '<meta http-equiv="refresh" content="3;url=index.php">'; 69 $PAGE['end'] .= '<div class="generic finish">'.l10n('Saved').'</div>'; 61 70 } 71 62 72 ?>
Note: See TracChangeset
for help on using the changeset viewer.