Ignore:
Timestamp:
Jan 1, 2012, 10:09:17 PM (12 years ago)
Author:
mistic100
Message:

fix detection regex and watermark position

File:
1 edited

Legend:

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

    r10337 r12819  
    11<?php
    22// Quelques traitements
    3 $_POST['copyPOS'] = implode('-', $_POST['copyPOS']);
     3if ($_POST['copyPOS'][0] == 'center' and $_POST['copyPOS'][1] == 'center') {
     4  $_POST['copyPOS'] = 'center';
     5} else {
     6  $_POST['copyPOS'] = implode('-', $_POST['copyPOS']);
     7}
    48$_POST['copyCOLOR'] = str_replace('#', null, $_POST['copyCOLOR']);
    59$_POST['prefixe_mini'] = delete_special_car($_POST['prefixe_mini']);
     
    913// Vérifications
    1014if (!is_decimal($_POST['Qhd']) OR $_POST['Qhd'] > 100) {
    11         $_POST['Qhd'] = 100;
    12         $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100');
     15  $_POST['Qhd'] = 100;
     16  $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100');
    1317}
    1418if (!is_decimal($_POST['Qnormal']) OR $_POST['Qnormal'] > 100) {
    15         $_POST['Qnormal'] = 100;
    16         $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100');
     19  $_POST['Qnormal'] = 100;
     20  $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100');
    1721}
    1822if (!is_decimal($_POST['Qthumbnail']) OR $_POST['Qthumbnail'] > 100) {
    19         $_POST['Qthumbnail'] = 100;
    20         $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100');
     23  $_POST['Qthumbnail'] = 100;
     24  $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100');
    2125}
    2226if (!is_decimal($_POST['DIMhd'])) {
    23         $_POST['DIMhd'] = 2560;
    24         $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer');
     27  $_POST['DIMhd'] = 2560;
     28  $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer');
    2529}
    2630if (!is_decimal($_POST['DIMnormal']) OR $_POST['DIMnormal'] > $_POST['DIMhd']) {
    27         $_POST['DIMnormal'] = 800;
    28         $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer');
     31  $_POST['DIMnormal'] = 800;
     32  $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer');
    2933}
    3034if (!is_decimal($_POST['DIMthumbnail']) OR $_POST['DIMthumbnail'] > $_POST['DIMnormal']) {
    31         $_POST['DIMthumbnail'] = 120;
    32         $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer');
     35  $_POST['DIMthumbnail'] = 120;
     36  $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer');
    3337}
    3438if (!is_decimal($_POST['DPI'])) {
    35         $_POST['DPI'] = 72;
    36         $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer');
     39  $_POST['DPI'] = 72;
     40  $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer');
    3741}
    3842if (!is_decimal($_POST['copySIZE'])) {
    39         $_POST['copySIZE'] = 0.05;
    40         $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal');
     43  $_POST['copySIZE'] = 0.05;
     44  $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal');
    4145}
    42        
     46 
    4347
    4448// Plugins : supprime les plugins manquants & charge les actions de configuration
     
    4650
    4751foreach ($_POST['Plugins'] as $plugin_id => $plugin_config) {
    48         if (isset($plugin_config['delete'])) {
    49                 unset($_POST['Plugins'][$plugin_id]);
    50         } else if (file_exists('plugins/'.$plugin_id.'/setup.php')) {
    51                 include('plugins/'.$plugin_id.'/setup.php');
    52         }
     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  }
    5357}
    5458
     
    6569
    6670if (!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>';
     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>';
    7074}
    7175
Note: See TracChangeset for help on using the changeset viewer.