Ignore:
Timestamp:
Apr 12, 2011, 7:45:22 PM (14 years ago)
Author:
mistic100
Message:

new version 1.4, new plugin for Charlies Content, NConvert updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PHP_Optimisateur/include/save_config.php

    r9201 r10337  
    22// Quelques traitements
    33$_POST['copyPOS'] = implode('-', $_POST['copyPOS']);
    4 $_POST['copyCOLOR'] = str_replace('#','', $_POST['copyCOLOR']);
     4$_POST['copyCOLOR'] = str_replace('#', null, $_POST['copyCOLOR']);
    55$_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'], '/') . '/';
    88
    99// Vérifications
    1010if (!is_decimal($_POST['Qhd']) OR $_POST['Qhd'] > 100) {
    1111        $_POST['Qhd'] = 100;
    12         $Errors['ErrorConfig'] = 'notice';
     12        $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100');
    1313}
    1414if (!is_decimal($_POST['Qnormal']) OR $_POST['Qnormal'] > 100) {
    1515        $_POST['Qnormal'] = 100;
    16         $Errors['ErrorConfig'] = 'notice';
     16        $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100');
    1717}
    1818if (!is_decimal($_POST['Qthumbnail']) OR $_POST['Qthumbnail'] > 100) {
    1919        $_POST['Qthumbnail'] = 100;
    20         $Errors['ErrorConfig'] = 'notice';
     20        $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100');
    2121}
    2222if (!is_decimal($_POST['DIMhd'])) {
    2323        $_POST['DIMhd'] = 2560;
    24         $Errors['ErrorConfig'] = 'notice';
     24        $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer');
    2525}
    2626if (!is_decimal($_POST['DIMnormal']) OR $_POST['DIMnormal'] > $_POST['DIMhd']) {
    2727        $_POST['DIMnormal'] = 800;
    28         $Errors['ErrorConfig'] = 'notice';
     28        $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer');
    2929}
    3030if (!is_decimal($_POST['DIMthumbnail']) OR $_POST['DIMthumbnail'] > $_POST['DIMnormal']) {
    3131        $_POST['DIMthumbnail'] = 120;
    32         $Errors['ErrorConfig'] = 'notice';
     32        $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer');
    3333}
    3434if (!is_decimal($_POST['DPI'])) {
    3535        $_POST['DPI'] = 72;
    36         $Errors['ErrorConfig'] = 'notice';
     36        $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer');
     37}
     38if (!is_decimal($_POST['copySIZE'])) {
     39        $_POST['copySIZE'] = 0.05;
     40        $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal');
    3741}
    3842       
     
    4953}
    5054
     55
     56// écrase la configuration
     57unset($_POST['submit']);
     58$CONF = array_merge($CONF, array_settype($_POST));
     59
    5160// Contenu du fichier
    5261$content = '<?xml version="1.0" encoding="UTF-8"?>'."\r\n".'<config>'."\r\n";
     
    5564file_put_contents('config.xml', $content);
    5665
    57 if (isset($Errors['ErrorConfig'])) {
    58         header('Location:index.php?page=setup&ErrorConfig='.$Errors['ErrorConfig']);
    59 } else {
    60         header('Location:index.php');
     66if (!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>';
    6170}
     71
    6272?>
Note: See TracChangeset for help on using the changeset viewer.