[9201] | 1 | <?php |
---|
| 2 | // Quelques traitements |
---|
[12819] | 3 | if ($_POST['copyPOS'][0] == 'center' and $_POST['copyPOS'][1] == 'center') { |
---|
| 4 | $_POST['copyPOS'] = 'center'; |
---|
| 5 | } else { |
---|
| 6 | $_POST['copyPOS'] = implode('-', $_POST['copyPOS']); |
---|
| 7 | } |
---|
[10337] | 8 | $_POST['copyCOLOR'] = str_replace('#', null, $_POST['copyCOLOR']); |
---|
[9201] | 9 | $_POST['prefixe_mini'] = delete_special_car($_POST['prefixe_mini']); |
---|
[10337] | 10 | $_POST['DIRsource'] = rtrim($_POST['DIRsource'], '/') . '/'; |
---|
| 11 | $_POST['DIRsortie'] = rtrim($_POST['DIRsortie'], '/') . '/'; |
---|
[9201] | 12 | |
---|
| 13 | // Vérifications |
---|
| 14 | if (!is_decimal($_POST['Qhd']) OR $_POST['Qhd'] > 100) { |
---|
[12819] | 15 | $_POST['Qhd'] = 100; |
---|
| 16 | $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100'); |
---|
[9201] | 17 | } |
---|
| 18 | if (!is_decimal($_POST['Qnormal']) OR $_POST['Qnormal'] > 100) { |
---|
[12819] | 19 | $_POST['Qnormal'] = 100; |
---|
| 20 | $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100'); |
---|
[9201] | 21 | } |
---|
| 22 | if (!is_decimal($_POST['Qthumbnail']) OR $_POST['Qthumbnail'] > 100) { |
---|
[12819] | 23 | $_POST['Qthumbnail'] = 100; |
---|
| 24 | $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100'); |
---|
[9201] | 25 | } |
---|
| 26 | if (!is_decimal($_POST['DIMhd'])) { |
---|
[12819] | 27 | $_POST['DIMhd'] = 2560; |
---|
| 28 | $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer'); |
---|
[9201] | 29 | } |
---|
| 30 | if (!is_decimal($_POST['DIMnormal']) OR $_POST['DIMnormal'] > $_POST['DIMhd']) { |
---|
[12819] | 31 | $_POST['DIMnormal'] = 800; |
---|
| 32 | $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer'); |
---|
[9201] | 33 | } |
---|
| 34 | if (!is_decimal($_POST['DIMthumbnail']) OR $_POST['DIMthumbnail'] > $_POST['DIMnormal']) { |
---|
[12819] | 35 | $_POST['DIMthumbnail'] = 120; |
---|
| 36 | $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer'); |
---|
[9201] | 37 | } |
---|
| 38 | if (!is_decimal($_POST['DPI'])) { |
---|
[12819] | 39 | $_POST['DPI'] = 72; |
---|
| 40 | $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer'); |
---|
[9201] | 41 | } |
---|
[10337] | 42 | if (!is_decimal($_POST['copySIZE'])) { |
---|
[12819] | 43 | $_POST['copySIZE'] = 0.05; |
---|
| 44 | $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal'); |
---|
[10337] | 45 | } |
---|
[12819] | 46 | |
---|
[9201] | 47 | |
---|
| 48 | // Plugins : supprime les plugins manquants & charge les actions de configuration |
---|
| 49 | $PLUGIN_ACTION = 'save_config'; |
---|
| 50 | |
---|
| 51 | foreach ($_POST['Plugins'] as $plugin_id => $plugin_config) { |
---|
[12819] | 52 | if (isset($plugin_config['delete'])) { |
---|
| 53 | unset($_POST['Plugins'][$plugin_id]); |
---|
| 54 | } else if (file_exists('plugins/'.$plugin_id.'/setup.php')) { |
---|
| 55 | include('plugins/'.$plugin_id.'/setup.php'); |
---|
| 56 | } |
---|
[9201] | 57 | } |
---|
| 58 | |
---|
[10337] | 59 | |
---|
| 60 | // écrase la configuration |
---|
| 61 | unset($_POST['submit']); |
---|
| 62 | $CONF = array_merge($CONF, array_settype($_POST)); |
---|
| 63 | |
---|
[9201] | 64 | // Contenu du fichier |
---|
| 65 | $content = '<?xml version="1.0" encoding="UTF-8"?>'."\r\n".'<config>'."\r\n"; |
---|
| 66 | $content .= XMLcreate($_POST); |
---|
| 67 | $content .= '</config>'; |
---|
| 68 | file_put_contents('config.xml', $content); |
---|
| 69 | |
---|
[10337] | 70 | if (!isset($ERRORS['conf'])) { |
---|
[12819] | 71 | // header('Location:index.php'); |
---|
| 72 | $PAGE['header'] .= '<meta http-equiv="refresh" content="2;url=index.php">'; |
---|
| 73 | $PAGE['end'] .= '<div class="generic finish">'.l10n('Saved').'</div>'; |
---|
[9201] | 74 | } |
---|
[10337] | 75 | |
---|
| 76 | ?> |
---|