Changeset 12819 for extensions


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

fix detection regex and watermark position

Location:
extensions/PHP_Optimisateur
Files:
1 deleted
21 edited

Legend:

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

    r10337 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.2                          |
     3|      PHP OPTIMISATEUR      |
     4|         Version 1.2        |
    55\***************************************/
    66
    77$PAGE['content'] .= '<div class="generic config">
    8                 <h2>'.l10n('Configuration').'</h2>
    9                 <ul>
    10                         <li>
    11                                 <span class="title">'.l10n('Folders').'</span>
    12                                 <table>
    13                                         <tr>
    14                                                 <td><b>'.l10n('FolderIn').' :</b></td>
    15                                                 <td>'.$CONF['DIRsource'].'</td>
    16                                         </tr>
    17                                         <tr>
    18                                                 <td><b>'.l10n('FolderOut').' :</b></td>
    19                                                 <td>'.$CONF['DIRsortie'].'</td>
    20                                         </tr>
    21                                 </table>
    22                         </li>
    23                         <li>
    24                                 <span class="title">'.l10n('Options').'</span>
    25                                 <table>
    26                                         <tr>
    27                                                 <td><b>'.l10n('silentORNOT').' :</b></td>
    28                                                 <td>'.l10n($CONF['silentORNOT']).'</td>
    29                                         </tr>
     8    <h2>'.l10n('Configuration').'</h2>
     9    <ul>
     10      <li>
     11        <span class="title">'.l10n('Folders').'</span>
     12        <table>
     13          <tr>
     14            <td><b>'.l10n('FolderIn').' :</b></td>
     15            <td>'.$CONF['DIRsource'].'</td>
     16          </tr>
     17          <tr>
     18            <td><b>'.l10n('FolderOut').' :</b></td>
     19            <td>'.$CONF['DIRsortie'].'</td>
     20          </tr>
     21        </table>
     22      </li>
     23      <li>
     24        <span class="title">'.l10n('Options').'</span>
     25        <table>
     26          <tr>
     27            <td><b>'.l10n('silentORNOT').' :</b></td>
     28            <td>'.l10n($CONF['silentORNOT']).'</td>
     29          </tr>
    3030
    31                                         <tr>
    32                                                 <td><b>'.l10n('DIRhighORNOT').' :</b></td>
    33                                                 <td>'.bool_to_string($CONF['DIRhighORNOT']).'</td>
    34                                         </tr>
    35                                         <tr>
    36                                                 <td><b>'.l10n('DIMhdORNOT').' :</b></td>
    37                                                 <td>'.bool_to_string($CONF['DIMhdORNOT']).'</td>
    38                                         </tr>
    39                                         <tr>
    40                                                 <td><b>'.l10n('renameORNOT').' :</b></td>
    41                                                 <td>'.bool_to_string($CONF['renameORNOT']).'</td>
    42                                         </tr>
    43                                         <tr>
    44                                                 <td><b>'.l10n('indexORNOT').' :</b></td>
    45                                                 <td>'.bool_to_string($CONF['indexORNOT']).'</td>
    46                                         </tr>
    47                                         <tr>
    48                                                 <td><b>'.l10n('prefixe_mini').' :</b></td>
    49                                                 <td>'.$CONF['prefixe_mini'].'</td>
    50                                         </tr>
    51                                 </table>
    52                         </li>
    53                         <li>
    54                                 <span class="title">'.l10n('Sizes and quality').'</span>
    55                                 <table>
    56                                         <tr>
    57                                                 <td><b>'.l10n('DIMhd').' :</b></td>
    58                                                 <td>'.$CONF['DIMhd'].' px</td>
    59                                         </tr>
    60                                         <tr>
    61                                                 <td><b>'.l10n('DIMnormal').' :</b></td>
    62                                                 <td>'.$CONF['DIMnormal'].' px</td>
    63                                         </tr>
    64                                         <tr>
    65                                                 <td><b>'.l10n('DIMthumbnail').' :</b></td>
    66                                                 <td>'.$CONF['DIMthumbnail'].' px</td>
    67                                         </tr>
    68                                         <tr>
    69                                                 <td><b>'.l10n('Qhd').' :</b></td>
    70                                                 <td>'.$CONF['Qhd'].' %</td>
    71                                         </tr>
    72                                         <tr>
    73                                                 <td><b>'.l10n('Qnormal').' :</b></td>
    74                                                 <td>'.$CONF['Qnormal'].' %</td>
    75                                         </tr>
    76                                         <tr>
    77                                                 <td><b>'.l10n('Qthumbnail').' :</b></td>
    78                                                 <td>'.$CONF['Qthumbnail'].' %</td>
    79                                         </tr>
    80                                         <tr>
    81                                                 <td><b>'.l10n('DPI').' :</b></td>
    82                                                 <td>'.$CONF['DPI'].' dpi</td>
    83                                         </tr>
    84                                 </table>
    85                         </li>
    86                         <li>
    87                                 <span class="title">'.l10n('Copyright').'</span>
    88                                 <table>
    89                                         <tr>
    90                                                 <td><b>'.l10n('Content').' :</b></td>
    91                                                 <td>'.$CONF['copyright'].'</td>
    92                                         </tr>
    93                                         <tr>
    94                                                 <td><b>'.l10n('copyONhd').' :</b></td>
    95                                                 <td>'.bool_to_string($CONF['copyONhd']).'</td>
    96                                         </tr>
    97                                         <tr>
    98                                                 <td><b>'.l10n('copyONnormal').' :</b></td>
    99                                                 <td>'.bool_to_string($CONF['copyONnormal']).'</td>
    100                                         </tr>
    101                                         <tr>
    102                                                 <td><b>'.l10n('copyPOS%s', '').' :</b></td>
    103                                                 <td>'.$CONF['copyPOS'].'</td>
    104                                         </tr>
    105                                         <tr>
    106                                                 <td><b>'.l10n('copySIZE').' :</b></td>
    107                                                 <td>'.$CONF['copySIZE'].'</td>
    108                                         </tr>
    109                                         <tr>
    110                                                 <td><b>'.l10n('copyCOLOR').' :</b></td>
    111                                                 <td>
    112                                                         #'.nice_hex_color($CONF['copyCOLOR']).'
    113                                                         <span class="color-display" style="background-color:#'.nice_hex_color($CONF['copyCOLOR']).';">&nbsp;</span>
    114                                                 </td>
    115                                         </tr>
    116                                         <tr>
    117                                                 <td><b>'.l10n('copyFONT').' :</b></td>
    118                                                 <td>'.$CONF['copyFONT'].'</td>
    119                                         </tr>
    120                                 </table>
    121                         </li>
    122                 </ul>
    123                
    124                 <h2>'.l10n('Plugins').'</h2>
    125                 <ul>';
    126                         // Affichage des plugins
    127                         $PLUGIN_ACTION = 'read_config';
    128                        
    129                         foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    130                                 $PAGE['content'] .= '<li>
    131                                         <div class="plugin-title">
    132                                                 <span class="title">'.$plugin_config['name'].' :</span>
    133                                                
    134                                                 <span class="plugin-active">';
    135                                                 if ($plugin_config['active']) {
    136                                                         $PAGE['content'] .= '<b class="new">'.l10n('Active').'</b>';
    137                                                 } else {
    138                                                         $PAGE['content'] .= '<b class="miss">'.l10n('Inactive').'</b>';
    139                                                 }
    140                                                 $PAGE['content'] .= '</span>
    141                                                
    142                                         </div>';
    143                                        
    144                                         // On affiche sa configuration
    145                                         if (file_exists('plugins/'.$plugin_id.'/setup.php')) {
    146                                                 include('plugins/'.$plugin_id.'/setup.php');
    147                                         }
    148                                 $PAGE['content'] .= '</li>';
    149                         }
    150                 $PAGE['content'] .= '</ul>
    151         </div>';
     31          <tr>
     32            <td><b>'.l10n('DIRhighORNOT').' :</b></td>
     33            <td>'.bool_to_string($CONF['DIRhighORNOT']).'</td>
     34          </tr>
     35          <tr>
     36            <td><b>'.l10n('DIMhdORNOT').' :</b></td>
     37            <td>'.bool_to_string($CONF['DIMhdORNOT']).'</td>
     38          </tr>
     39          <tr>
     40            <td><b>'.l10n('renameORNOT').' :</b></td>
     41            <td>'.bool_to_string($CONF['renameORNOT']).'</td>
     42          </tr>
     43          <tr>
     44            <td><b>'.l10n('indexORNOT').' :</b></td>
     45            <td>'.bool_to_string($CONF['indexORNOT']).'</td>
     46          </tr>
     47          <tr>
     48            <td><b>'.l10n('prefixe_mini').' :</b></td>
     49            <td>'.$CONF['prefixe_mini'].'</td>
     50          </tr>
     51        </table>
     52      </li>
     53      <li>
     54        <span class="title">'.l10n('Sizes and quality').'</span>
     55        <table>
     56          <tr>
     57            <td><b>'.l10n('DIMhd').' :</b></td>
     58            <td>'.$CONF['DIMhd'].' px</td>
     59          </tr>
     60          <tr>
     61            <td><b>'.l10n('DIMnormal').' :</b></td>
     62            <td>'.$CONF['DIMnormal'].' px</td>
     63          </tr>
     64          <tr>
     65            <td><b>'.l10n('DIMthumbnail').' :</b></td>
     66            <td>'.$CONF['DIMthumbnail'].' px</td>
     67          </tr>
     68          <tr>
     69            <td><b>'.l10n('Qhd').' :</b></td>
     70            <td>'.$CONF['Qhd'].' %</td>
     71          </tr>
     72          <tr>
     73            <td><b>'.l10n('Qnormal').' :</b></td>
     74            <td>'.$CONF['Qnormal'].' %</td>
     75          </tr>
     76          <tr>
     77            <td><b>'.l10n('Qthumbnail').' :</b></td>
     78            <td>'.$CONF['Qthumbnail'].' %</td>
     79          </tr>
     80          <tr>
     81            <td><b>'.l10n('DPI').' :</b></td>
     82            <td>'.$CONF['DPI'].' dpi</td>
     83          </tr>
     84        </table>
     85      </li>
     86      <li>
     87        <span class="title">'.l10n('Copyright').'</span>
     88        <table>
     89          <tr>
     90            <td><b>'.l10n('Content').' :</b></td>
     91            <td>'.$CONF['copyright'].'</td>
     92          </tr>
     93          <tr>
     94            <td><b>'.l10n('copyONhd').' :</b></td>
     95            <td>'.bool_to_string($CONF['copyONhd']).'</td>
     96          </tr>
     97          <tr>
     98            <td><b>'.l10n('copyONnormal').' :</b></td>
     99            <td>'.bool_to_string($CONF['copyONnormal']).'</td>
     100          </tr>
     101          <tr>
     102            <td><b>'.l10n('copyPOS%s', '').' :</b></td>
     103            <td>'.$CONF['copyPOS'].'</td>
     104          </tr>
     105          <tr>
     106            <td><b>'.l10n('copySIZE').' :</b></td>
     107            <td>'.$CONF['copySIZE'].'</td>
     108          </tr>
     109          <tr>
     110            <td><b>'.l10n('copyCOLOR').' :</b></td>
     111            <td>
     112              #'.nice_hex_color($CONF['copyCOLOR']).'
     113              <span class="color-display" style="background-color:#'.nice_hex_color($CONF['copyCOLOR']).';">&nbsp;</span>
     114            </td>
     115          </tr>
     116          <tr>
     117            <td><b>'.l10n('copyFONT').' :</b></td>
     118            <td>'.$CONF['copyFONT'].'</td>
     119          </tr>
     120        </table>
     121      </li>
     122    </ul>
     123   
     124    <h2>'.l10n('Plugins').'</h2>
     125    <ul>';
     126      // Affichage des plugins
     127      $PLUGIN_ACTION = 'read_config';
     128     
     129      foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
     130        $PAGE['content'] .= '<li>
     131          <div class="plugin-title">
     132            <span class="title">'.$plugin_config['name'].' :</span>
     133           
     134            <span class="plugin-active">';
     135            if ($plugin_config['active']) {
     136              $PAGE['content'] .= '<b class="new">'.l10n('Active').'</b>';
     137            } else {
     138              $PAGE['content'] .= '<b class="miss">'.l10n('Inactive').'</b>';
     139            }
     140            $PAGE['content'] .= '</span>
     141           
     142          </div>';
     143         
     144          // On affiche sa configuration
     145          if (file_exists('plugins/'.$plugin_id.'/setup.php')) {
     146            include('plugins/'.$plugin_id.'/setup.php');
     147          }
     148        $PAGE['content'] .= '</li>';
     149      }
     150    $PAGE['content'] .= '</ul>
     151  </div>';
    152152?>
  • extensions/PHP_Optimisateur/include/functions.php

    r10337 r12819  
    33// Affiche les textes localisés
    44function l10n($code) {
    5         global $Lang;
    6         if (isset($Lang[$code])) {
    7                 $args = func_get_args();
    8                 if (count($args) > 1) {
    9                         array_shift($args);
    10                         return vsprintf($Lang[$code], $args);
    11                 } else {
    12                         return $Lang[$code];
    13                 }
    14         } else {
    15                 return $code;
    16         }
     5  global $Lang;
     6  if (isset($Lang[$code])) {
     7    $args = func_get_args();
     8    if (count($args) > 1) {
     9      array_shift($args);
     10      return vsprintf($Lang[$code], $args);
     11    } else {
     12      return $Lang[$code];
     13    }
     14  } else {
     15    return $code;
     16  }
    1717}
    1818
    1919// Retourne la langue de l'utilisateur et les langues installées
    2020function GetLanguage() {
    21         // tableau avec les langues installées
    22         $dh = opendir('language');
    23         while ($file = readdir($dh)) {
    24                 if ($file !== '.' && $file !== '..' && is_dir('language/'.$file)) {
    25                         $name = (file_exists('language/'.$file.'/iso.txt')) ? file_get_contents('language/'.$file.'/iso.txt') : $file;
    26                         $languages[$file] = $name;
    27                 }
    28         }
    29         closedir($dh);
    30        
    31         // recherche du paramètre get ou session, ou langue du navigateur
    32         if (isset($_GET['Lang'])) {
    33                 $user_lang = $_GET['Lang'];
    34         } else if (isset($_SESSION['Lang']) AND $_SESSION['Lang'] != NULL) {
    35                 $user_lang = $_SESSION['Lang'];
    36         } else {
    37                 $user_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2);
    38         }
    39        
    40         // si langue navigateur cherche une correspondance dans la tableau
    41         if (strlen($user_lang) == 2) {
    42                 foreach (array_keys($languages) as $lang) {
    43                         if ($user_lang == substr($lang,0,2)) {
    44                                 $user_lang = $lang;
    45                                 break;
    46                         }
    47                 }
    48         }
    49        
    50         // si pas de correspondance OU get faux, langue par défaut
    51         if (!in_array($user_lang, array_keys($languages))) {
    52                 $user_lang = 'en_UK';
    53         }
    54        
    55         $_SESSION['Lang'] = $user_lang;
    56         return array('user_lang' => $_SESSION['Lang'], 'languages' => $languages);
     21  // tableau avec les langues installées
     22  $dh = opendir('language');
     23  while ($file = readdir($dh)) {
     24    if ($file !== '.' && $file !== '..' && is_dir('language/'.$file)) {
     25      $name = (file_exists('language/'.$file.'/iso.txt')) ? file_get_contents('language/'.$file.'/iso.txt') : $file;
     26      $languages[$file] = $name;
     27    }
     28  }
     29  closedir($dh);
     30 
     31  // recherche du paramètre get ou session, ou langue du navigateur
     32  if (isset($_GET['Lang'])) {
     33    $user_lang = $_GET['Lang'];
     34  } else if (isset($_SESSION['Lang']) AND $_SESSION['Lang'] != NULL) {
     35    $user_lang = $_SESSION['Lang'];
     36  } else {
     37    $user_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2);
     38  }
     39 
     40  // si langue navigateur cherche une correspondance dans la tableau
     41  if (strlen($user_lang) == 2) {
     42    foreach (array_keys($languages) as $lang) {
     43      if ($user_lang == substr($lang,0,2)) {
     44        $user_lang = $lang;
     45        break;
     46      }
     47    }
     48  }
     49 
     50  // si pas de correspondance OU get faux, langue par défaut
     51  if (!in_array($user_lang, array_keys($languages))) {
     52    $user_lang = 'en_UK';
     53  }
     54 
     55  $_SESSION['Lang'] = $user_lang;
     56  return array('user_lang' => $_SESSION['Lang'], 'languages' => $languages);
    5757}
    5858
    5959// Supprime tous les caractères speciaux
    6060function delete_special_car($string) {
    61         global $CONF;
    62        
    63         $search = array ('#[éèêë]#','#[ÊËÈÉ]#','#[àâäã]#','#[ÂÄÁÀ]#','#[îïíì]#','#[ÎÏÍÌ]#','#[ûùüúµ]#','#[ÛÙÚÜ]#','#[ôóòõö]#','#[ÓÒÖÔÕ]#','#[ç]#','#[Ç]#','#[ñ]#','#[Ñ]#','#[ýÿ]#','#[Ý]#','#[ \&\!\?\#\"\(\)\{\}\[\]\=\+\~\%]#','#[^a-zA-Z0-9_\.\-]#');
    64         $replace = array ('e','E','a','A','i','I','u','U','o','O','c','C',',n','N','y','Y','_','');
    65        
    66         if ($CONF['renameORNOT']) {
    67                 return preg_replace($search, $replace, $string);
    68         } else {
    69                 return str_replace(array('%','$',' '), '_', $string);
    70         }
     61  global $CONF;
     62 
     63  $search = array ('#[éèêë]#','#[ÊËÈÉ]#','#[àâäã]#','#[ÂÄÁÀ]#','#[îïíì]#','#[ÎÏÍÌ]#','#[ûùüúµ]#','#[ÛÙÚÜ]#','#[ôóòõö]#','#[ÓÒÖÔÕ]#','#[ç]#','#[Ç]#','#[ñ]#','#[Ñ]#','#[ýÿ]#','#[Ý]#','#[ \&\!\?\#\"\(\)\{\}\[\]\=\+\~\%]#','#[^a-zA-Z0-9_\.\-]#');
     64  $replace = array ('e','E','a','A','i','I','u','U','o','O','c','C',',n','N','y','Y','_','');
     65 
     66  if ($CONF['renameORNOT']) {
     67    return preg_replace($search, $replace, $string);
     68  } else {
     69    return str_replace(array('%','$',' '), '_', $string);
     70  }
    7171}
    7272
    7373// Teste si un dossier est vide
    7474function is_dir_empty($dir) {
    75         $array = scandir($dir);
    76         if (count($array) > 2) {
    77                 return false;
    78         } else {
    79                 return true;
    80         }
     75  $array = scandir($dir);
     76  if (count($array) > 2) {
     77    return false;
     78  } else {
     79    return true;
     80  }
    8181}
    8282
    8383// Supprime un repertoire non-vide
    8484function rrmdir($dir) {
    85         $dir = rtrim($dir, '/');
    86         $objects = scandir($dir);
    87        
    88         foreach ($objects as $object) {
    89                 if ($object !== '.' && $object !== '..') {
    90                         $path = $dir.'/'.$object;
    91                         if (filetype($path) == 'dir') rrmdir($path);
    92                         else unlink($path);
    93                 }
    94         }
    95 
    96         rmdir($dir);
     85  $dir = rtrim($dir, '/');
     86  $objects = scandir($dir);
     87 
     88  foreach ($objects as $object) {
     89    if ($object !== '.' && $object !== '..') {
     90      $path = $dir.'/'.$object;
     91      if (filetype($path) == 'dir') rrmdir($path);
     92      else unlink($path);
     93    }
     94  }
     95
     96  rmdir($dir);
    9797}
    9898
    9999// Parcours récursivement un dossier
    100100function recursive_readdir($dir, $array, $dirs=false) {
    101         # si $dirs=true liste les dossiers plutot que les fichiers
    102         global ${$array}; // Charge la tableau pour la sortie, déclaré à l'exterieur à cause de l'appel recursif de la fonction
    103         $dir = rtrim($dir, '/');
    104         $dh = opendir($dir);
    105        
    106         while (($file = readdir($dh)) !== false ) {
    107                 if ($file !== '.' && $file !== '..') {
    108                         $path = $dir.'/'.$file;
    109                         if (is_dir($path)) {
    110                                 if($dirs) ${$array}[] = $path;
    111                                 recursive_readdir($path, $array, $dirs);
    112                         } else {
    113                                 if(!$dirs) ${$array}[] = $path;
    114                         }
    115                 }
    116         }
    117         closedir($dh);
     101  # si $dirs=true liste les dossiers plutot que les fichiers
     102  global ${$array}; // Charge la tableau pour la sortie, déclaré à l'exterieur à cause de l'appel recursif de la fonction
     103  $dir = rtrim($dir, '/');
     104  $dh = opendir($dir);
     105 
     106  while (($file = readdir($dh)) !== false ) {
     107    if ($file !== '.' && $file !== '..') {
     108      $path = $dir.'/'.$file;
     109      if (is_dir($path)) {
     110        if($dirs) ${$array}[] = $path;
     111        recursive_readdir($path, $array, $dirs);
     112      } else {
     113        if(!$dirs) ${$array}[] = $path;
     114      }
     115    }
     116  }
     117  closedir($dh);
    118118}
    119119
    120120// Parse le fichier de configuration
    121121function XMLParse($xml) {
    122         $content = array();
    123         foreach ($xml as $nom => $elem) {
    124                 if (trim($elem) == '' AND $elem != '') {
    125                         $content[$nom] = XMLParse($elem->children());
    126                 } else {
    127                         $content[$nom] = utf8_encode(utf8_decode($elem));
    128                 }
    129         }
    130         return $content;
     122  $content = array();
     123  foreach ($xml as $nom => $elem) {
     124    if (trim($elem) == '' AND $elem != '') {
     125      $content[$nom] = XMLParse($elem->children());
     126    } else {
     127      $content[$nom] = utf8_encode(utf8_decode($elem));
     128    }
     129  }
     130  return $content;
    131131}
    132132
    133133// Crée le fichier de configuration
    134134function XMLCreate($array, $level=0) {
    135         $content = null;
    136         foreach ($array as $nom => $elem) {
    137                 if (is_array($elem)) {
    138                         for($i=0;$i<=$level;$i++) $content .= "\t";
    139                         $content .= '<'.$nom.'>'."\n";
    140                         $content .= XMLCreate($elem, $level+1);
    141                         for($i=0;$i<=$level;$i++) $content .= "\t";
    142                         $content .= '</'.$nom.'>'."\n";
    143                 } else {
    144                         for($i=0;$i<=$level;$i++) $content .= "\t";
    145                         $content .= '<'.$nom.'>'.$elem.'</'.$nom.'>'."\n";
    146                 }
    147         }
    148         return $content;
     135  $content = null;
     136  foreach ($array as $nom => $elem) {
     137    if (is_array($elem)) {
     138      for($i=0;$i<=$level;$i++) $content .= "  ";
     139      $content .= '<'.$nom.'>'."\n";
     140      $content .= XMLCreate($elem, $level+1);
     141      for($i=0;$i<=$level;$i++) $content .= "  ";
     142      $content .= '</'.$nom.'>'."\n";
     143    } else {
     144      for($i=0;$i<=$level;$i++) $content .= "  ";
     145      $content .= '<'.$nom.'>'.$elem.'</'.$nom.'>'."\n";
     146    }
     147  }
     148  return $content;
    149149}
    150150
    151151// Charge la configuration
    152152function load_config($file) {
    153         $config = simplexml_load_file($file);
    154         $config = XMLParse($config);
    155         $config = array_settype($config);
    156         return $config;
     153  $config = simplexml_load_file($file);
     154  $config = XMLParse($config);
     155  $config = array_settype($config);
     156  return $config;
    157157}
    158158
    159159// Convertit les booléens, entiers et flotants d'un tableau de 'string'
    160160function array_settype($array) {
    161         foreach ($array as $key => $value) {
    162                 if (is_array($value)) {
    163                         $array[$key] = array_settype($value);
    164                 } else {
    165                         if ($value === 'true') {
    166                                 $array[$key] = true;           
    167                         } else if ($value === 'false') {
    168                                 $array[$key] = false;   
    169                         } else if ($value == null) {
    170                                 // rien à faire ^^
    171                         } else if (preg_match('#^([0-9]*)$#', $value)) {
    172                                 settype($array[$key], 'int');           
    173                         } else if (preg_match('#^([0-9]*)(\.)([0-9]*)$#', $value)) {
    174                                 settype($array[$key], 'float');         
    175                         }
    176                 }
    177         }
    178                
    179         return $array;
     161  foreach ($array as $key => $value) {
     162    if (is_array($value)) {
     163      $array[$key] = array_settype($value);
     164    } else {
     165      if ($value === 'true') {
     166        $array[$key] = true;
     167      } else if ($value === 'false') {
     168        $array[$key] = false;
     169      } else if ($value == null) {
     170        // rien à faire ^^
     171      } else if (preg_match('#^([0-9]*)$#', $value)) {
     172        settype($array[$key], 'int');
     173      } else if (preg_match('#^([0-9]*)(\.)([0-9]*)$#', $value)) {
     174        settype($array[$key], 'float');
     175      }
     176    }
     177  }
     178   
     179  return $array;
    180180}
    181181
    182182// Booléen vers français ou texte
    183183function bool_to_string($string, $just_echo=0) {
    184         global $Lang;
    185         # $just_echo pour pouvoir afficher un booléen tel quel (echo true; n'affiche rien)
    186         if (is_bool($string)) {
    187                 if ($string) {
    188                         if ($just_echo) return 'true';
    189                         else return l10n('yes');
    190                 } else {
    191                         if ($just_echo) return 'false';
    192                         else return l10n('no');
    193                 }
    194         } else {
    195                 return $string;
    196         }
     184  global $Lang;
     185  # $just_echo pour pouvoir afficher un booléen tel quel (echo true; n'affiche rien)
     186  if (is_bool($string)) {
     187    if ($string) {
     188      if ($just_echo) return 'true';
     189      else return l10n('yes');
     190    } else {
     191      if ($just_echo) return 'false';
     192      else return l10n('no');
     193    }
     194  } else {
     195    return $string;
     196  }
    197197}
    198198
    199199// Converti une chaine de config (param:value;param:value[;]) en tableau associatif
    200200function ExplodeString($string, $sep1=';', $sep2=':') {
    201         $string = preg_replace('#[;]$#', '', $string);
    202         $result = array();
    203         $a = explode($sep1, $string);
    204        
    205         foreach ($a as $s) {
    206            $v = explode($sep2, $s);
    207            $result[$v[0]] = $v[1];
    208         }
    209         return $result;
     201  $string = preg_replace('#[;]$#', '', $string);
     202  $result = array();
     203  $a = explode($sep1, $string);
     204 
     205  foreach ($a as $s) {
     206     $v = explode($sep2, $s);
     207     $result[$v[0]] = $v[1];
     208  }
     209  return $result;
    210210}
    211211
    212212// Converti un tableau associatif en chaine de config (param:value;param:value;)
    213213function ImplodeArray($array, $sep1=';', $sep2=':') {
    214         $result = null;
    215         foreach ($array as $key => $value) {
    216                 $result .= $key.$sep2.$value.$sep1;
    217         }
    218         return $result;
     214  $result = null;
     215  foreach ($array as $key => $value) {
     216    $result .= $key.$sep2.$value.$sep1;
     217  }
     218  return $result;
    219219}
    220220
    221221// Convertit les couleurs 'numériques' et gère les 0 manquants
    222222function nice_hex_color($hex) {
    223         $hex = strval($hex);
    224         for ($i=strlen($hex); $i<6; $i++) {
    225                 $hex = '0'.$hex;
    226         }
    227         return $hex;
     223  $hex = strval($hex);
     224  for ($i=strlen($hex); $i<6; $i++) {
     225    $hex = '0'.$hex;
     226  }
     227  return $hex;
    228228}
    229229
    230230// Converti une couleur HEX et RGB
    231231function hex2RGB($hexStr, $returnAsString = false, $seperator = ',') {
    232         $hexStr = preg_replace("/[^0-9A-Fa-f]/", '', $hexStr); // Gets a proper hex string
    233        
    234         if (strlen($hexStr) == 6) { //If a proper hex code, convert using bitwise operation. No overhead... faster
    235                 $colorVal = hexdec($hexStr);
    236                 $rgbArray['r'] = 0xFF & ($colorVal >> 0x10);
    237                 $rgbArray['g'] = 0xFF & ($colorVal >> 0x8);
    238                 $rgbArray['b'] = 0xFF & $colorVal;
    239         } elseif (strlen($hexStr) == 3) { //if shorthand notation, need some string manipulations
    240                 $rgbArray['r'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));
    241                 $rgbArray['g'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));
    242                 $rgbArray['b'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));
    243         } else {
    244                 return false; //Invalid hex color code
    245         }
    246        
    247         return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array
     232  $hexStr = preg_replace("/[^0-9A-Fa-f]/", '', $hexStr); // Gets a proper hex string
     233 
     234  if (strlen($hexStr) == 6) { //If a proper hex code, convert using bitwise operation. No overhead... faster
     235    $colorVal = hexdec($hexStr);
     236    $rgbArray['r'] = 0xFF & ($colorVal >> 0x10);
     237    $rgbArray['g'] = 0xFF & ($colorVal >> 0x8);
     238    $rgbArray['b'] = 0xFF & $colorVal;
     239  } elseif (strlen($hexStr) == 3) { //if shorthand notation, need some string manipulations
     240    $rgbArray['r'] = hexdec(str_repeat(substr($hexStr, 0, 1), 2));
     241    $rgbArray['g'] = hexdec(str_repeat(substr($hexStr, 1, 1), 2));
     242    $rgbArray['b'] = hexdec(str_repeat(substr($hexStr, 2, 1), 2));
     243  } else {
     244    return false; //Invalid hex color code
     245  }
     246 
     247  return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array
    248248}
    249249
    250250// Verifie si une chaine est un nombre décimal (plus strict que is_numeric qui fonctionne avec les hexadecimaux)
    251251function is_decimal($num) {
    252         if((is_numeric($num) === true AND (float)$num == $num) OR $num === '0') {
    253                 return true;
    254         } else {
    255                 return false;
    256         }
     252  if((is_numeric($num) === true AND (float)$num == $num) OR $num === '0') {
     253    return true;
     254  } else {
     255    return false;
     256  }
    257257}
    258258
    259259// Charge le fichier de langue d'un plugin
    260260function load_plugin_lang($plugin_id) {
    261         global $CONF, $Lang;
    262         if (file_exists('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php')) {
    263                 include('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php');
    264         } else {
    265                 include('plugins/'.$plugin_id.'/language/en_UK.php');
    266         }
     261  global $CONF, $Lang;
     262  if (file_exists('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php')) {
     263    include('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php');
     264  } else {
     265    include('plugins/'.$plugin_id.'/language/en_UK.php');
     266  }
    267267}
    268268
    269269// fonction nconvert avec gestion du log
    270270function nconvert($param, $log=true) {
    271         global $LOG;
    272 
    273         exec('include\nconvert.exe '. $param .' 2>&1', $out);
    274        
    275         if ($log) {
    276                 for ($i=0; $i<=3; $i++)
    277                         unset($out[$i]);
    278                 if (count($out)) $LOG[] = array_values($out);
    279                 //$LOG[] = "\t" . $param;
    280         } else {
    281                 return $out;
    282         }
     271  global $LOG;
     272
     273  exec('include\nconvert.exe '. $param .' 2>&1', $out);
     274 
     275  if ($log) {
     276    for ($i=0; $i<=3; $i++)
     277      unset($out[$i]);
     278    if (count($out)) $LOG[] = array_values($out);
     279    //$LOG[] = "  " . $param;
     280  } else {
     281    return $out;
     282  }
    283283}
    284284
    285285// fonction mkdir avec gestion du log
    286286function mkdir_log($dir) {
    287         global $LOG;
    288         mkdir($dir, 0777, true);
    289         $LOG[] = 'Dir '.$dir.' created';
     287  global $LOG;
     288  mkdir($dir, 0777, true);
     289  $LOG[] = 'Dir '.$dir.' created';
    290290}
    291291
    292292// fonction copy avec gestion du log
    293293function copy_log($src, $dest) {
    294         global $LOG;
    295         copy($src, $dest);
    296         $LOG[] = 'Copy '.$src.' to '.$dest;
     294  global $LOG;
     295  copy($src, $dest);
     296  $LOG[] = 'Copy '.$src.' to '.$dest;
    297297}
    298298
    299299// fonction rename avec gestion du log
    300300function rename_log($path, $new_path, $move=false) {
    301         global $LOG;
    302         rename($path, $new_path);
    303         if ($move)
    304                 $LOG[] = 'Move '.$path.' to '.$new_path;
    305         else
    306                 $LOG[] = 'Rename '.$path.' into '.$new_path;
     301  global $LOG;
     302  rename($path, $new_path);
     303  if ($move)
     304    $LOG[] = 'Move '.$path.' to '.$new_path;
     305  else
     306    $LOG[] = 'Rename '.$path.' into '.$new_path;
    307307}
    308308
    309309// enregistre le log dans un fichier
    310310function print_log($nb, $s) {
    311         global $APPversion, $LOG;
    312        
    313         $config = file_get_contents('config.xml');
    314        
    315         $string =
    316                 "PHP Optimisateur " . $APPversion . "\r\n".
    317                 date('r') . "\r\n".
    318                 $nb . " files in " . $s . " seconds" . "\r\n\r\n".
    319                
    320                 $config . "\r\n\r\n";
    321        
    322         foreach ($LOG as $event) {
    323                 if (is_array($event)) {
    324                         $string .= implode("\r\n", $event) . "\r\n";
    325                 } else {
    326                         $string .= $event . "\r\n";
    327                 }
    328         }
    329        
    330         if (!file_exists('logs')) {
    331                 mkdir('logs', 0777, true);
    332         }
    333        
    334         $filename = 'log_' . date('Y-m-d_H-i-s') . '.txt';
    335         file_put_contents('logs/'.$filename, $string);
    336         return $filename;
     311  global $APPversion, $LOG;
     312 
     313  $config = file_get_contents('config.xml');
     314 
     315  $string =
     316    "PHP Optimisateur " . $APPversion . "\r\n".
     317    date('r') . "\r\n".
     318    $nb . " files in " . $s . " seconds" . "\r\n\r\n".
     319   
     320    $config . "\r\n\r\n";
     321 
     322  foreach ($LOG as $event) {
     323    if (is_array($event)) {
     324      $string .= implode("\r\n", $event) . "\r\n";
     325    } else {
     326      $string .= $event . "\r\n";
     327    }
     328  }
     329 
     330  if (!file_exists('logs')) {
     331    mkdir('logs', 0777, true);
     332  }
     333 
     334  $filename = 'log_' . date('Y-m-d_H-i-s') . '.txt';
     335  file_put_contents('logs/'.$filename, $string);
     336  return $filename;
    337337}
    338338
    339339// case insentive version of in_array
    340340function in_arrayi($needle, $haystack) {
    341         $needle = strtolower($needle);
    342         $haystack = array_map('strtolower', $haystack);
    343         return in_array($needle, $haystack);
     341  $needle = strtolower($needle);
     342  $haystack = array_map('strtolower', $haystack);
     343  return in_array($needle, $haystack);
    344344}
    345345
  • extensions/PHP_Optimisateur/include/header.php

    r10337 r12819  
    22echo '<?xml version="1.0" encoding="utf-8"?>
    33<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    4         "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
     4  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    55<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    66<head>
    7         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    8         <title>PHP Optimisateur '.$APPversion.'</title>
    9         <link href="template/favicon.png" rel="icon" type="image/x-icon" />
    10        
    11         <link rel="stylesheet" type="text/css" media="screen" href="template/css/screen.css"/>
    12         <link rel="stylesheet" type="text/css" media="screen" href="template/css/colorpicker.css"/>
    13         <link rel="stylesheet" type="text/css" media="screen" href="template/css/jqtransform.css"/>
    14        
    15         <script type="text/javascript" src="template/js/jquery.js"></script>
    16         <script type="text/javascript" src="template/js/colorpicker.js"></script>
    17         <script type="text/javascript" src="template/js/jqtransform.js"></script>
    18        
    19         <script language="javascript">
    20                 $(function(){
    21                         $("form").jqTransform({imgPath:"template/images/"});
    22                 });
    23                 function Load() {
    24                         $(\'#ready-text\').html(\''.l10n('Processing').'\');
    25                         $(\'#loader\').html(\'<img src="template/images/loader.gif" alt="Load..."/>\');
    26                         $(\'#overlay\').css(\'display\',\'block\');
    27                 }
    28        
    29                 jQuery().ready(function(){
    30                         jQuery("#languageSwitchLink").mouseover(function() {
    31                                 jQuery("#languageSwitchBox").toggle();
    32                         });
    33                         jQuery("#languageSwitchBox").mouseleave(function() {
    34                                 jQuery("#languageSwitchBox").toggle();
    35                         });
    36                 });
    37         </script>
    38        
    39         '.$PAGE['header'].'
    40        
     7  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     8  <title>PHP Optimisateur '.$APPversion.'</title>
     9  <link href="template/favicon.png" rel="icon" type="image/x-icon" />
     10 
     11  <link rel="stylesheet" type="text/css" media="screen" href="template/css/screen.css"/>
     12  <link rel="stylesheet" type="text/css" media="screen" href="template/css/colorpicker.css"/>
     13  <link rel="stylesheet" type="text/css" media="screen" href="template/css/jqtransform.css"/>
     14 
     15  <script type="text/javascript" src="template/js/jquery.js"></script>
     16  <script type="text/javascript" src="template/js/colorpicker.js"></script>
     17  <script type="text/javascript" src="template/js/jqtransform.js"></script>
     18 
     19  <script language="javascript">
     20    $(function(){
     21      $("form").jqTransform({imgPath:"template/images/"});
     22    });
     23    function Load() {
     24      $(\'#ready-text\').html(\''.l10n('Processing').'\');
     25      $(\'#loader\').html(\'<img src="template/images/loader.gif" alt="Load..."/>\');
     26      $(\'#overlay\').css(\'display\',\'block\');
     27    }
     28 
     29    jQuery().ready(function(){
     30      jQuery("#languageSwitchLink").mouseover(function() {
     31        jQuery("#languageSwitchBox").toggle();
     32      });
     33      jQuery("#languageSwitchBox").mouseleave(function() {
     34        jQuery("#languageSwitchBox").toggle();
     35      });
     36    });
     37  </script>
     38 
     39  '.$PAGE['header'].'
     40 
    4141</head>
    4242
     
    4646
    4747<div class="generic title">
    48         PHP Optimisateur '.$APPversion.'
    49        
    50         <div id="languageSwitchLink" title="Change Language">
    51                 <ul>
    52                         <li><a href="#"><img src="language/'.$CONF['user_lang'].'/flag.png" alt="'.$CONF['languages'][$CONF['user_lang']].'"/> '.$CONF['languages'][$CONF['user_lang']].'</a></li>
    53                 </ul>
    54         </div>
    55        
    56         <div id="languageSwitchBox" style="display:none;" class="generic">
    57                 <ul>';
    58                 foreach ($CONF['languages'] as $key => $name) {
    59                         echo '<li><a class="lang" href="index.php?Lang='.$key.'" title="'.$name.'"><img src="language/'.$key.'/flag.png" alt="'.$name.'"/> '.$name.'</a></li>';
    60                 }
    61                 echo ' </ul>
    62         </div>
    63        
     48  PHP Optimisateur '.$APPversion.'
     49 
     50  <div id="languageSwitchLink" title="Change Language">
     51    <ul>
     52      <li><a href="#"><img src="language/'.$CONF['user_lang'].'/flag.png" alt="'.$CONF['languages'][$CONF['user_lang']].'"/> '.$CONF['languages'][$CONF['user_lang']].'</a></li>
     53    </ul>
     54  </div>
     55 
     56  <div id="languageSwitchBox" style="display:none;" class="generic">
     57    <ul>';
     58    foreach ($CONF['languages'] as $key => $name) {
     59      echo '<li><a class="lang" href="index.php?Lang='.$key.'" title="'.$name.'"><img src="language/'.$key.'/flag.png" alt="'.$name.'"/> '.$name.'</a></li>';
     60    }
     61    echo ' </ul>
     62  </div>
     63 
    6464</div>';
    6565?>
  • extensions/PHP_Optimisateur/include/main.php

    r10337 r12819  
    22// Si mode silencieux vidage automatique du dossier de sortie
    33if ($CONF['silentORNOT'] == 'erase') {
    4         @rrmdir($CONF['DIRsortie']);
    5         @mkdir($CONF['DIRsortie']);
     4  @rrmdir($CONF['DIRsortie']);
     5  @mkdir($CONF['DIRsortie']);
    66}
    77
     
    1010// Les caractères '%' et '$' sont systématiquement échappés, ca génère des bugs dans les noms de fichiers
    1111function recursive_delete_special_car($dir) {
    12         $dir = rtrim($dir, '/');
    13         $dh = opendir($dir);
    14        
    15         while (($file = readdir($dh)) !== false ) {
    16                 if ($file !== '.' && $file !== '..') {
    17                         $path = $dir.'/'.$file;
    18                         $new_path = $dir.'/'.delete_special_car($file);
    19                        
    20                         if ($path != $new_path) {
    21                                 rename_log($path, $new_path);
    22                         }
    23                        
    24                         if (is_dir($new_path)) {
    25                                 recursive_delete_special_car($new_path);
    26                         }
    27                 }
    28         }
    29         closedir($dh);
     12  $dir = rtrim($dir, '/');
     13  $dh = opendir($dir);
     14 
     15  while (($file = readdir($dh)) !== false ) {
     16    if ($file !== '.' && $file !== '..') {
     17      $path = $dir.'/'.$file;
     18      $new_path = $dir.'/'.delete_special_car($file);
     19     
     20      if ($path != $new_path) {
     21        rename_log($path, $new_path);
     22      }
     23     
     24      if (is_dir($new_path)) {
     25        recursive_delete_special_car($new_path);
     26      }
     27    }
     28  }
     29  closedir($dh);
    3030}
    3131
     
    3838
    3939if ($CONF['copyONhd']) {
    40         $CONF['copyHD'] = '-text_font "'.$CONF['copyFONT'].'" '.$CONF['DIMnormal']*$CONF['copySIZE'].' -text_color '.$CONF['copyCOLOR'].' -text_flag '.$CONF['copyPOS'].' -text_pos 0 0 -text "'.$CONF['copyright'].'"';
     40  $CONF['copyHD'] = '-text_font "'.$CONF['copyFONT'].'" '.$CONF['DIMnormal']*$CONF['copySIZE'].' -text_color '.$CONF['copyCOLOR'].' -text_flag '.$CONF['copyPOS'].' -text_pos 0 0 -text "'.$CONF['copyright'].'"';
    4141} else {
    42         $CONF['copyHD'] = null;
     42  $CONF['copyHD'] = null;
    4343}
    4444
    4545if ($CONF['copyONnormal']) {
    46         $CONF['copyNormal'] = '-text_font "'.$CONF['copyFONT'].'" '.$CONF['DIMnormal']*$CONF['copySIZE'].' -text_color '.$CONF['copyCOLOR'].' -text_flag '.$CONF['copyPOS'].' -text_pos 0 0 -text "'.$CONF['copyright'].'"';
     46  $CONF['copyNormal'] = '-text_font "'.$CONF['copyFONT'].'" '.$CONF['DIMnormal']*$CONF['copySIZE'].' -text_color '.$CONF['copyCOLOR'].' -text_flag '.$CONF['copyPOS'].' -text_pos 0 0 -text "'.$CONF['copyright'].'"';
    4747} else {
    48         $CONF['copyNormal'] = null;
     48  $CONF['copyNormal'] = null;
    4949}
    5050
     
    5555### Plugins avant execution ###
    5656foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    57         if ($plugin_config['mode'] == 'Before' AND $plugin_config['active']) {
    58                 include('plugins/'.$plugin_id.'/main.php');
    59         }
     57  if ($plugin_config['mode'] == 'Before' AND $plugin_config['active']) {
     58    include('plugins/'.$plugin_id.'/main.php');
     59  }
    6060}
    6161
     
    7171// Boucle sur tous les fichiers
    7272for ($i=0; $i<count($FilesSource); $i++) {
    73         // Découpe le nom de fichier : dossier/fichier/extension
    74         preg_match('#^(.*)/(.*)\.([a-z0-9]{2,4})$#', $FilesSource[$i], $matches);
    75         $file['folder_src'] = $matches[1].'/'; // dossier d'entrée
    76         $file['folder_out'] = str_replace($CONF['DIRsource'], $CONF['DIRsortie'], $file['folder_src']); // dossier de sortie
    77         $file['name'] = $matches[2]; // nom final
    78         $file['ext'] = $matches[3]; // extension orginale
    79                        
    80         // Crée les sous-dossiers de sortie & 'pwg_high' & 'thumbnail'
    81         if (!file_exists($file['folder_out'].'pwg_high') AND $CONF['DIRhighORNOT']) {
    82                 mkdir_log($file['folder_out'].'pwg_high');
    83         }
    84         if (!file_exists($file['folder_out'].'thumbnail')) {
    85                 mkdir_log($file['folder_out'].'thumbnail');
    86         }
    87        
    88         if (!in_arrayi($file['ext'], $CONF['allowedExt'])) {
    89                 $BlockAll['main'] = true;
    90                 $LOG[] = 'Not image file : '.$FilesSource[$i];
    91         }
    92        
    93         if (!isset($BlockAll)) {
    94                 // Informations sur le fichier
    95                 exec('include\nconvert.exe -info "'.$FilesSource[$i].'"', $FileInfos);
    96                
    97                 for ($m=0; $m<=5; $m++) {
    98                         unset($FileInfos[$m]);
    99                 }
    100                 foreach ($FileInfos as $key) {
    101                         if ($key != '') {
    102                                 $a = explode(':', $key);
    103                                 $FileInfos[trim($a[0])] = trim($a[1]);
    104                         }
    105                 }
    106         }
    107                
    108         // Plugins pendant l'execution, haute priorité
    109         foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    110                 if ($plugin_config['mode'] == 'ProcessHigh' AND $plugin_config['active']) {
    111                         include('plugins/'.$plugin_id.'/main.php');
    112                 }
    113         }
    114        
    115         // Plugins pendant l'execution
    116         foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    117                 if ($plugin_config['mode'] == 'Process' AND $plugin_config['active']) {
    118                         include('plugins/'.$plugin_id.'/main.php');
    119                 }
    120         }
    121        
    122         // Compresse les fichiers dans le dossier de sortie
    123         if (!isset($BlockNormal) AND !isset($BlockAll)) {
    124                 nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
    125         }
    126         if (!isset($BlockThumbnail) AND !isset($BlockAll)) {
    127                 nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
    128         }
    129         if (!isset($BlockHigh) AND $CONF['DIRhighORNOT'] AND !isset($BlockAll)) {
    130                 if ($CONF['DIMhdORNOT']) {
    131                         nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
    132                 } else if (strtolower($file['ext']) != 'jpg') {
    133                         nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" "'.$FilesSource[$i].'"');
    134                 } else {
    135                         copy_log($FilesSource[$i], $file['folder_out'].'pwg_high/'.$file['name'].'.jpg');
    136                 }
    137         }
    138        
    139         // Réinitialise les variables
    140         unset($file, $FileInfos, $BlockNormal, $BlockThumbnail, $BlockHigh, $BlockAll);
    141         $LOG[] = "\r\n";
     73  // Découpe le nom de fichier : dossier/fichier/extension
     74  preg_match('#^(.*)/(.*)\.([a-z0-9]{2,4})$#i', $FilesSource[$i], $matches);
     75  $file['folder_src'] = $matches[1].'/'; // dossier d'entrée
     76  $file['folder_out'] = str_replace($CONF['DIRsource'], $CONF['DIRsortie'], $file['folder_src']); // dossier de sortie
     77  $file['name'] = $matches[2]; // nom final
     78  $file['ext'] = $matches[3]; // extension orginale
     79     
     80  // Crée les sous-dossiers de sortie & 'pwg_high' & 'thumbnail'
     81  if (!file_exists($file['folder_out'].'pwg_high') AND $CONF['DIRhighORNOT']) {
     82    mkdir_log($file['folder_out'].'pwg_high');
     83  }
     84  if (!file_exists($file['folder_out'].'thumbnail')) {
     85    mkdir_log($file['folder_out'].'thumbnail');
     86  }
     87 
     88  if (!in_arrayi($file['ext'], $CONF['allowedExt'])) {
     89    $BlockAll['main'] = true;
     90    $LOG[] = 'Not image file : '.$FilesSource[$i];
     91  }
     92 
     93  if (!isset($BlockAll)) {
     94    // Informations sur le fichier
     95    exec('include\nconvert.exe -info "'.$FilesSource[$i].'"', $FileInfos);
     96   
     97    for ($m=0; $m<=5; $m++) {
     98      unset($FileInfos[$m]);
     99    }
     100    foreach ($FileInfos as $key) {
     101      if ($key != '') {
     102        $a = explode(':', $key);
     103        $FileInfos[trim($a[0])] = trim($a[1]);
     104      }
     105    }
     106  }
     107   
     108  // Plugins pendant l'execution, haute priorité
     109  foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
     110    if ($plugin_config['mode'] == 'ProcessHigh' AND $plugin_config['active']) {
     111      include('plugins/'.$plugin_id.'/main.php');
     112    }
     113  }
     114 
     115  // Plugins pendant l'execution
     116  foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
     117    if ($plugin_config['mode'] == 'Process' AND $plugin_config['active']) {
     118      include('plugins/'.$plugin_id.'/main.php');
     119    }
     120  }
     121 
     122  // Compresse les fichiers dans le dossier de sortie
     123  if (!isset($BlockNormal) AND !isset($BlockAll)) {
     124    nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
     125  }
     126  if (!isset($BlockThumbnail) AND !isset($BlockAll)) {
     127    nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     128  }
     129  if (!isset($BlockHigh) AND $CONF['DIRhighORNOT'] AND !isset($BlockAll)) {
     130    if ($CONF['DIMhdORNOT']) {
     131      nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
     132    } else if (strtolower($file['ext']) != 'jpg') {
     133      nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" "'.$FilesSource[$i].'"');
     134    } else {
     135      copy_log($FilesSource[$i], $file['folder_out'].'pwg_high/'.$file['name'].'.jpg');
     136    }
     137  }
     138 
     139  // Réinitialise les variables
     140  unset($file, $FileInfos, $BlockNormal, $BlockThumbnail, $BlockHigh, $BlockAll);
     141  $LOG[] = "\r\n";
    142142}
    143143
     
    148148
    149149foreach($DirsSortie as $dir) {
    150         if (is_dir_empty($dir)) {
    151                 rmdir($dir);
    152         } else if ($CONF['indexORNOT']) {
    153                 copy_log('include/index.php', $dir.'/index.php');
    154         }
     150  if (is_dir_empty($dir)) {
     151    rmdir($dir);
     152  } else if ($CONF['indexORNOT']) {
     153    copy_log('include/index.php', $dir.'/index.php');
     154  }
    155155}
    156156
     
    160160### Plugins après execution ###
    161161foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    162         if ($plugin_config['mode'] == 'After' AND $plugin_config['active']) {
    163                 include('plugins/'.$plugin_id.'/main.php');
    164         }
     162  if ($plugin_config['mode'] == 'After' AND $plugin_config['active']) {
     163    include('plugins/'.$plugin_id.'/main.php');
     164  }
    165165}
    166166?>
  • 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
  • extensions/PHP_Optimisateur/include/setup.php

    r10337 r12819  
    66
    77foreach ($Available_Plugins as $plugin) {
    8         $plugin_id = str_replace('plugins/', '', $plugin); // id du plugin
    9         if (!array_key_exists($plugin_id, $CONF['Plugins'])) {
    10                 $CONF['Plugins'][$plugin_id] = load_config('plugins/'.$plugin_id.'/config.xml'); // configuration du plugin
    11                 $CONF['Plugins'][$plugin_id]['active'] = false;
    12                 $NewPlugins[$plugin_id] = true;
    13         }
     8  $plugin_id = str_replace('plugins/', '', $plugin); // id du plugin
     9  if (!array_key_exists($plugin_id, $CONF['Plugins'])) {
     10    $CONF['Plugins'][$plugin_id] = load_config('plugins/'.$plugin_id.'/config.xml'); // configuration du plugin
     11    $CONF['Plugins'][$plugin_id]['active'] = false;
     12    $NewPlugins[$plugin_id] = true;
     13  }
    1414}
    1515
     
    1717### Gestion des plugins manquants ###
    1818foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    19         if (!file_exists('plugins/'.$plugin_id)) {
    20                 $MissingPlugins[$plugin_id] = true;
    21         }
     19  if (!file_exists('plugins/'.$plugin_id)) {
     20    $MissingPlugins[$plugin_id] = true;
     21  }
    2222}
    2323
    2424
    2525### Formulaire ###
    26 $CONF['copyPOS'] = explode('-', $CONF['copyPOS']);
    2726$CONF['copyCOLOR'] = nice_hex_color($CONF['copyCOLOR']);
     27if ($CONF['copyPOS'] == 'center') {
     28  $CONF['copyPOS'] = array('center', 'center');
     29} else {
     30  $CONF['copyPOS'] = explode('-', $CONF['copyPOS']);
     31}
    2832
    2933$PAGE['content'] .= '<form action="index.php?page=setup" method="post">
    30         <div class="generic config">
    31                 <h2>'.l10n('Configuration').'</h2>
    32                 <ul>
    33                         <li>
    34                                 <span class="title">'.l10n('Folders').'</span>
    35                                 <table>
    36                                         <tr>
    37                                                 <td>'.l10n('FolderIn').' :</td>
    38                                                 <td><input type="text" name="DIRsource" value="'.$CONF['DIRsource'].'"/></td>
    39                                         </tr>
    40                                         <tr>
    41                                                 <td>'.l10n('FolderOut').' :</td>
    42                                                 <td><input type="text" name="DIRsortie" value="'.$CONF['DIRsortie'].'"/></td>
    43                                         </tr>
    44                                 </table>
    45                         </li>
    46                         <li>
    47                                 <span class="title">'.l10n('Options').'</span>
    48                                 <table>
    49                                         <tr>
    50                                                 <td>'.l10n('silentORNOT').' :</td>
    51                                                 <td>
    52                                                         <input type="radio" id="silentORNOT1" name="silentORNOT" value="erase" '.(($CONF['silentORNOT']=='erase')?'checked="checked"':'').'/>
    53                                                         <label for="silentORNOT1">'.l10n('erase').'</label>
    54                                                         <input type="radio" id="silentORNOT2" name="silentORNOT" value="block" '.(($CONF['silentORNOT']=='block')?'checked="checked"':'').'/>
    55                                                         <label for="silentORNOT2">'.l10n('block').'</label>
    56                                                         <input type="radio" id="silentORNOT3" name="silentORNOT" value="pass" '.(($CONF['silentORNOT']=='pass')?'checked="checked"':'').'/>
    57                                                         <label for="silentORNOT3">'.l10n('pass').'</label>
    58                                                 </td>
    59                                         </tr>
    60                                         <tr>
    61                                                 <td>'.l10n('DIRhighORNOT').' :</td>
    62                                                 <td>
    63                                                         <input type="radio" id="DIRhighORNOT1" name="DIRhighORNOT" value="true" '.(($CONF['DIRhighORNOT'])?'checked="checked"':'').'/>
    64                                                         <label for="DIRhighORNOT1">'.l10n('yes').'</label>
    65                                                         <input type="radio" id="DIRhighORNOT2" name="DIRhighORNOT" value="false" '.((!$CONF['DIRhighORNOT'])?'checked="checked"':'').'/>
    66                                                         <label for="DIRhighORNOT2">'.l10n('no').'</label>
    67                                                 </td>
    68                                         </tr>
    69                                         <tr>
    70                                                 <td>'.l10n('DIMhdORNOT').' :</td>
    71                                                 <td>
    72                                                         <input type="radio" id="DIMhdORNOT1" name="DIMhdORNOT" value="true" '.(($CONF['DIMhdORNOT'])?'checked="checked"':'').'/>
    73                                                         <label for="DIMhdORNOT1">'.l10n('yes').'</label>
    74                                                         <input type="radio" id="DIMhdORNOT" name="DIMhdORNOT" value="false" '.((!$CONF['DIMhdORNOT'])?'checked="checked"':'').'/>
    75                                                         <label for="DIMhdORNOT2">'.l10n('no').'</label>
    76                                                 </td>
    77                                         </tr>
    78                                         <tr>
    79                                                 <td>'.l10n('renameORNOT').' :</td>
    80                                                 <td>
    81                                                         <input type="radio" id="renameORNOT1" name="renameORNOT" value="true" '.(($CONF['renameORNOT'])?'checked="checked"':'').'/>
    82                                                         <label for="renameORNOT1">'.l10n('yes').'</label>
    83                                                         <input type="radio" id="renameORNOT2" name="renameORNOT" value="false" '.((!$CONF['renameORNOT'])?'checked="checked"':'').'/>
    84                                                         <label for="renameORNOT2">'.l10n('no').'</label>
    85                                                 </td>
    86                                         </tr>
    87                                         <tr>
    88                                                 <td>'.l10n('indexORNOT').' :</td>
    89                                                 <td>
    90                                                         <input type="radio" id="indexORNOT1" name="indexORNOT" value="true" '.(($CONF['indexORNOT'])?'checked="checked"':'').'/>
    91                                                         <label for="indexORNOT1">'.l10n('yes').'</label>
    92                                                         <input type="radio" id="indexORNOT2" name="indexORNOT" value="false" '.((!$CONF['indexORNOT'])?'checked="checked"':'').'/>
    93                                                         <label for="indexORNOT2">'.l10n('no').'</label>
    94                                                 </td>
    95                                         </tr>
    96                                         <tr>
    97                                                 <td>'.l10n('prefixe_mini').' :</td>
    98                                                 <td><input type="text" name="prefixe_mini" value="'.$CONF['prefixe_mini'].'" size="8"/></td>
    99                                         </tr>
    100                                 </table>
    101                         </li>
    102                         <li>
    103                                 <span class="title">'.l10n('Sizes and quality').'</span>
    104                                 <table>
    105                                         <tr>
    106                                                 <td>'.l10n('DIMhd').' :</td>
    107                                                 <td><input type="text" name="DIMhd" value="'.$CONF['DIMhd'].'" size="4"/>px</td>
    108                                         </tr>
    109                                         <tr>
    110                                                 <td>'.l10n('DIMnormal').' :</td>
    111                                                 <td><input type="text" name="DIMnormal" value="'.$CONF['DIMnormal'].'" size="3"/>px</td>
    112                                         </tr>
    113                                         <tr>
    114                                                 <td>'.l10n('DIMthumbnail').' :</td>
    115                                                 <td><input type="text" name="DIMthumbnail" value="'.$CONF['DIMthumbnail'].'" size="3"/>px</td>
    116                                         </tr>
    117                                         <tr>
    118                                                 <td>'.l10n('Qhd').' :</td>
    119                                                 <td><input type="text" name="Qhd" value="'.$CONF['Qhd'].'" size="3"/>%</td>
    120                                         </tr>
    121                                         <tr>
    122                                                 <td>'.l10n('Qnormal').' :</td>
    123                                                 <td><input type="text" name="Qnormal" value="'.$CONF['Qnormal'].'" size="3"/>%</td>
    124                                         </tr>
    125                                         <tr>
    126                                                 <td>'.l10n('Qthumbnail').' :</td>
    127                                                 <td><input type="text" name="Qthumbnail" value="'.$CONF['Qthumbnail'].'" size="3"/>%</td>
    128                                         </tr>
    129                                         <tr>
    130                                                 <td>'.l10n('DPI').' :</td>
    131                                                 <td><input type="text" name="DPI" value="'.$CONF['DPI'].'" size="3"/>dpi</td>
    132                                         </tr>
    133                                 </table>
    134                         </li>
    135                         <li>
    136                                 <span class="title">'.l10n('Copyright').'</span>
    137                                 <table>
    138                                         <tr>
    139                                                 <td>'.l10n('Content').' :</td>
    140                                                 <td><input type="text" name="copyright" value="'.$CONF['copyright'].'"/></td>
    141                                         </tr>
    142                                         <tr>
    143                                                 <td>'.l10n('copyONhd').' :</td>
    144                                                 <td>
    145                                                         <input type="radio" id="copyONhd1" name="copyONhd" value="true" '.(($CONF['copyONhd'])?'checked="checked"':'').'/>
    146                                                         <label for="copyONhd1">'.l10n('yes').'</label>
    147                                                         <input type="radio" id="copyONhd2" name="copyONhd" value="false" '.((!$CONF['copyONhd'])?'checked="checked"':'').'/>
    148                                                         <label for="copyONhd2">'.l10n('no').'</label>
    149                                                 </td>
    150                                         </tr>
    151                                         <tr>
    152                                                 <td>'.l10n('copyONnormal').' :</td>
    153                                                 <td>
    154                                                         <input type="radio" id="copyONnormal1" name="copyONnormal" value="true" '.(($CONF['copyONnormal'])?'checked="checked"':'').'/>
    155                                                         <label for="copyONnormal1">'.l10n('yes').'</label>
    156                                                         <input type="radio" id="copyONnormal2" name="copyONnormal" value="false" '.((!$CONF['copyONnormal'])?'checked="checked"':'').'/>
    157                                                         <label for="copyONnormal2">'.l10n('no').'</label>
    158                                                 </td>
    159                                         </tr>
    160                                         <tr>
    161                                                 <td>'.l10n('copyPOS%s', l10n('copyPOSv')).' :</td>
    162                                                 <td>
    163                                                         <input type="radio" id="copyPOS01" name="copyPOS[0]" value="top" '.(($CONF['copyPOS'][0]=='top')?'checked="checked"':'').'/>
    164                                                         <label for="copyPOS01">'.l10n('top').'</label>
    165                                                         <input type="radio" id="copyPOS02" name="copyPOS[0]" value="center" '.(($CONF['copyPOS'][0]=='center')?'checked="checked"':'').'/>
    166                                                         <label for="copyPOS02">'.l10n('center').'</label>
    167                                                         <input type="radio" id="copyPOS03" name="copyPOS[0]" value="bottom" '.(($CONF['copyPOS'][0]=='bottom')?'checked="checked"':'').'/>
    168                                                         <label for="copyPOS03">'.l10n('bottom').'</label>
    169                                                 </td>
    170                                         </tr>
    171                                         <tr>
    172                                                 <td>'.l10n('copyPOS%s', l10n('copyPOSh')).' :</td>
    173                                                 <td>
    174                                                         <input type="radio" id="copyPOS11" name="copyPOS[1]" value="left" '.(($CONF['copyPOS'][1]=='left')?'checked="checked"':'').'/>
    175                                                         <label for="copyPOS11">'.l10n('left').'</label>
    176                                                         <input type="radio" id="copyPOS12" name="copyPOS[1]" value="center" '.(($CONF['copyPOS'][1]=='center')?'checked="checked"':'').'/>
    177                                                         <label for="copyPOS12">'.l10n('center').'</label>
    178                                                         <input type="radio" id="copyPOS13" name="copyPOS[1]" value="right" '.(($CONF['copyPOS'][1]=='right')?'checked="checked"':'').'/>
    179                                                         <label for="copyPOS13">'.l10n('right').'</label>
    180                                                 </td>
    181                                         </tr>
    182                                         <tr>
    183                                                 <td>'.l10n('copySIZE').' :</td>
    184                                                 <td><input type="text" name="copySIZE" value="'.$CONF['copySIZE'].'" size="5"/></td>
    185                                         </tr>
    186                                         <tr>
    187                                                 <td>'.l10n('copyCOLOR').' :</td>
    188                                                 <td><input type="text" id="colorpicker" name="copyCOLOR" value="'.$CONF['copyCOLOR'].'" size="6"/></td>
    189                                                 <script type="text/javascript">
    190                                                         $("#colorpicker").ColorPicker({
    191                                                                 onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); },
    192                                                                 onChange: function(hsb, hex, rgb, el) { $("#colorpicker").val(hex); },
    193                                                                 onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
    194                                                         }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
    195                                                 </script>
    196                                         </tr>
    197                                         <tr>
    198                                                 <td>'.l10n('copyFONT').' :</td>
    199                                                 <td><input type="text" name="copyFONT" value="'.$CONF['copyFONT'].'"/></td>
    200                                         </tr>
    201                                 </table>
    202                         </li>
    203                 </ul>
    204         </div>
    205 
    206         <div class="generic config">
    207                 <h2>'.l10n('Plugins').'</h2>
    208                 <ul>';
    209                        
    210                         // Affichage des plugins
    211                         $PLUGIN_ACTION = 'edit_config';
    212                        
    213                         foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    214                                 $PAGE['content'] .= '<li>
    215                                         <div class="plugin-title">
    216                                                 <span class="title">'.$plugin_config['name'].' :</span>
    217                                                 <input type="hidden" name="Plugins['.$plugin_id.'][name]" value="'.$plugin_config['name'].'"/>
    218                                                 <input type="hidden" name="Plugins['.$plugin_id.'][mode]" value="'.$plugin_config['mode'].'"/>';
    219                                                
    220                                                 // Cas spéciaux dans le titre (nouveau, manquant)
    221                                                 if (isset($NewPlugins[$plugin_id])) {
    222                                                         $PAGE['content'] .= ' <b class="new">'.l10n('New !').'</b>';
    223                                                 } else if (isset($MissingPlugins[$plugin_id])) {
    224                                                         $PAGE['content'] .= ' <b class="miss">'.l10n('Missing !').'</b>';
    225                                                 }
    226                                                
    227                                                 // Si il est manquant on ne met que la checkbox de suppression, sinon boutons d'activation
    228                                                 $PAGE['content'] .= '<span class="plugin-active">';
    229                                                         if (isset($MissingPlugins[$plugin_id])) {
    230                                                                 $PAGE['content'] .= '<label><input type="checkbox" name="Plugins['.$plugin_id.'][delete]" value="true" checked="checked"/> '.l10n('erase').'</label>';
    231                                                         } else {
    232                                                                 $PAGE['content'] .= '<input type="radio" id="" id="active-'.$plugin_id.'" name="Plugins['.$plugin_id.'][active]" value="true" '.(($plugin_config['active'])?'checked="checked"':'').'/>
    233                                                                 <label for="active-'.$plugin_id.'">'.l10n('Active').'</label>
    234                                                                 <input type="radio" id="" id="inactive-'.$plugin_id.'"name="Plugins['.$plugin_id.'][active]" value="false" '.((!$plugin_config['active'])?'checked="checked"':'').'/>
    235                                                                 <label for="inactive-'.$plugin_id.'">'.l10n('Inactive').'</label>';
    236                                                         }
    237                                                 $PAGE['content'] .= '</span>
    238                                                
    239                                         </div>';
    240                                        
    241                                        
    242                                         // On affiche sa configuration
    243                                         if (!isset($MissingPlugins[$plugin_id]) AND file_exists('plugins/'.$plugin_id.'/setup.php')) {
    244                                                 include('plugins/'.$plugin_id.'/setup.php');
    245                                         }
    246                                 $PAGE['content'] .= '</li>';
    247                         }
    248                        
    249                 $PAGE['content'] .= '</ul>
    250         </div>';
    251        
    252 
    253         $PAGE['end'] .= '<div class="generic link">
    254                 <input type="submit" name="submit" value="'.l10n('Valid').'"/>
    255                 <input type="reset" onclick="location.href=\'index.php\'" value="'.l10n('Back').'"/>
    256         </div>
     34  <div class="generic config">
     35    <h2>'.l10n('Configuration').'</h2>
     36    <ul>
     37      <li>
     38        <span class="title">'.l10n('Folders').'</span>
     39        <table>
     40          <tr>
     41            <td>'.l10n('FolderIn').' :</td>
     42            <td><input type="text" name="DIRsource" value="'.$CONF['DIRsource'].'"/></td>
     43          </tr>
     44          <tr>
     45            <td>'.l10n('FolderOut').' :</td>
     46            <td><input type="text" name="DIRsortie" value="'.$CONF['DIRsortie'].'"/></td>
     47          </tr>
     48        </table>
     49      </li>
     50      <li>
     51        <span class="title">'.l10n('Options').'</span>
     52        <table>
     53          <tr>
     54            <td>'.l10n('silentORNOT').' :</td>
     55            <td>
     56              <input type="radio" id="silentORNOT1" name="silentORNOT" value="erase" '.(($CONF['silentORNOT']=='erase')?'checked="checked"':'').'/>
     57              <label for="silentORNOT1">'.l10n('erase').'</label>
     58              <input type="radio" id="silentORNOT2" name="silentORNOT" value="block" '.(($CONF['silentORNOT']=='block')?'checked="checked"':'').'/>
     59              <label for="silentORNOT2">'.l10n('block').'</label>
     60              <input type="radio" id="silentORNOT3" name="silentORNOT" value="pass" '.(($CONF['silentORNOT']=='pass')?'checked="checked"':'').'/>
     61              <label for="silentORNOT3">'.l10n('pass').'</label>
     62            </td>
     63          </tr>
     64          <tr>
     65            <td>'.l10n('DIRhighORNOT').' :</td>
     66            <td>
     67              <input type="radio" id="DIRhighORNOT1" name="DIRhighORNOT" value="true" '.(($CONF['DIRhighORNOT'])?'checked="checked"':'').'/>
     68              <label for="DIRhighORNOT1">'.l10n('yes').'</label>
     69              <input type="radio" id="DIRhighORNOT2" name="DIRhighORNOT" value="false" '.((!$CONF['DIRhighORNOT'])?'checked="checked"':'').'/>
     70              <label for="DIRhighORNOT2">'.l10n('no').'</label>
     71            </td>
     72          </tr>
     73          <tr>
     74            <td>'.l10n('DIMhdORNOT').' :</td>
     75            <td>
     76              <input type="radio" id="DIMhdORNOT1" name="DIMhdORNOT" value="true" '.(($CONF['DIMhdORNOT'])?'checked="checked"':'').'/>
     77              <label for="DIMhdORNOT1">'.l10n('yes').'</label>
     78              <input type="radio" id="DIMhdORNOT" name="DIMhdORNOT" value="false" '.((!$CONF['DIMhdORNOT'])?'checked="checked"':'').'/>
     79              <label for="DIMhdORNOT2">'.l10n('no').'</label>
     80            </td>
     81          </tr>
     82          <tr>
     83            <td>'.l10n('renameORNOT').' :</td>
     84            <td>
     85              <input type="radio" id="renameORNOT1" name="renameORNOT" value="true" '.(($CONF['renameORNOT'])?'checked="checked"':'').'/>
     86              <label for="renameORNOT1">'.l10n('yes').'</label>
     87              <input type="radio" id="renameORNOT2" name="renameORNOT" value="false" '.((!$CONF['renameORNOT'])?'checked="checked"':'').'/>
     88              <label for="renameORNOT2">'.l10n('no').'</label>
     89            </td>
     90          </tr>
     91          <tr>
     92            <td>'.l10n('indexORNOT').' :</td>
     93            <td>
     94              <input type="radio" id="indexORNOT1" name="indexORNOT" value="true" '.(($CONF['indexORNOT'])?'checked="checked"':'').'/>
     95              <label for="indexORNOT1">'.l10n('yes').'</label>
     96              <input type="radio" id="indexORNOT2" name="indexORNOT" value="false" '.((!$CONF['indexORNOT'])?'checked="checked"':'').'/>
     97              <label for="indexORNOT2">'.l10n('no').'</label>
     98            </td>
     99          </tr>
     100          <tr>
     101            <td>'.l10n('prefixe_mini').' :</td>
     102            <td><input type="text" name="prefixe_mini" value="'.$CONF['prefixe_mini'].'" size="8"/></td>
     103          </tr>
     104        </table>
     105      </li>
     106      <li>
     107        <span class="title">'.l10n('Sizes and quality').'</span>
     108        <table>
     109          <tr>
     110            <td>'.l10n('DIMhd').' :</td>
     111            <td><input type="text" name="DIMhd" value="'.$CONF['DIMhd'].'" size="4"/>px</td>
     112          </tr>
     113          <tr>
     114            <td>'.l10n('DIMnormal').' :</td>
     115            <td><input type="text" name="DIMnormal" value="'.$CONF['DIMnormal'].'" size="3"/>px</td>
     116          </tr>
     117          <tr>
     118            <td>'.l10n('DIMthumbnail').' :</td>
     119            <td><input type="text" name="DIMthumbnail" value="'.$CONF['DIMthumbnail'].'" size="3"/>px</td>
     120          </tr>
     121          <tr>
     122            <td>'.l10n('Qhd').' :</td>
     123            <td><input type="text" name="Qhd" value="'.$CONF['Qhd'].'" size="3"/>%</td>
     124          </tr>
     125          <tr>
     126            <td>'.l10n('Qnormal').' :</td>
     127            <td><input type="text" name="Qnormal" value="'.$CONF['Qnormal'].'" size="3"/>%</td>
     128          </tr>
     129          <tr>
     130            <td>'.l10n('Qthumbnail').' :</td>
     131            <td><input type="text" name="Qthumbnail" value="'.$CONF['Qthumbnail'].'" size="3"/>%</td>
     132          </tr>
     133          <tr>
     134            <td>'.l10n('DPI').' :</td>
     135            <td><input type="text" name="DPI" value="'.$CONF['DPI'].'" size="3"/>dpi</td>
     136          </tr>
     137        </table>
     138      </li>
     139      <li>
     140        <span class="title">'.l10n('Copyright').'</span>
     141        <table>
     142          <tr>
     143            <td>'.l10n('Content').' :</td>
     144            <td><input type="text" name="copyright" value="'.$CONF['copyright'].'"/></td>
     145          </tr>
     146          <tr>
     147            <td>'.l10n('copyONhd').' :</td>
     148            <td>
     149              <input type="radio" id="copyONhd1" name="copyONhd" value="true" '.(($CONF['copyONhd'])?'checked="checked"':'').'/>
     150              <label for="copyONhd1">'.l10n('yes').'</label>
     151              <input type="radio" id="copyONhd2" name="copyONhd" value="false" '.((!$CONF['copyONhd'])?'checked="checked"':'').'/>
     152              <label for="copyONhd2">'.l10n('no').'</label>
     153            </td>
     154          </tr>
     155          <tr>
     156            <td>'.l10n('copyONnormal').' :</td>
     157            <td>
     158              <input type="radio" id="copyONnormal1" name="copyONnormal" value="true" '.(($CONF['copyONnormal'])?'checked="checked"':'').'/>
     159              <label for="copyONnormal1">'.l10n('yes').'</label>
     160              <input type="radio" id="copyONnormal2" name="copyONnormal" value="false" '.((!$CONF['copyONnormal'])?'checked="checked"':'').'/>
     161              <label for="copyONnormal2">'.l10n('no').'</label>
     162            </td>
     163          </tr>
     164          <tr>
     165            <td>'.l10n('copyPOS%s', l10n('copyPOSv')).' :</td>
     166            <td>
     167              <input type="radio" id="copyPOS01" name="copyPOS[0]" value="top" '.(($CONF['copyPOS'][0]=='top')?'checked="checked"':'').'/>
     168              <label for="copyPOS01">'.l10n('top').'</label>
     169              <input type="radio" id="copyPOS02" name="copyPOS[0]" value="center" '.(($CONF['copyPOS'][0]=='center')?'checked="checked"':'').'/>
     170              <label for="copyPOS02">'.l10n('center').'</label>
     171              <input type="radio" id="copyPOS03" name="copyPOS[0]" value="bottom" '.(($CONF['copyPOS'][0]=='bottom')?'checked="checked"':'').'/>
     172              <label for="copyPOS03">'.l10n('bottom').'</label>
     173            </td>
     174          </tr>
     175          <tr>
     176            <td>'.l10n('copyPOS%s', l10n('copyPOSh')).' :</td>
     177            <td>
     178              <input type="radio" id="copyPOS11" name="copyPOS[1]" value="left" '.(($CONF['copyPOS'][1]=='left')?'checked="checked"':'').'/>
     179              <label for="copyPOS11">'.l10n('left').'</label>
     180              <input type="radio" id="copyPOS12" name="copyPOS[1]" value="center" '.(($CONF['copyPOS'][1]=='center')?'checked="checked"':'').'/>
     181              <label for="copyPOS12">'.l10n('center').'</label>
     182              <input type="radio" id="copyPOS13" name="copyPOS[1]" value="right" '.(($CONF['copyPOS'][1]=='right')?'checked="checked"':'').'/>
     183              <label for="copyPOS13">'.l10n('right').'</label>
     184            </td>
     185          </tr>
     186          <tr>
     187            <td>'.l10n('copySIZE').' :</td>
     188            <td><input type="text" name="copySIZE" value="'.$CONF['copySIZE'].'" size="5"/></td>
     189          </tr>
     190          <tr>
     191            <td>'.l10n('copyCOLOR').' :</td>
     192            <td><input type="text" id="colorpicker" name="copyCOLOR" value="'.$CONF['copyCOLOR'].'" size="6"/></td>
     193            <script type="text/javascript">
     194              $("#colorpicker").ColorPicker({
     195                onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); },
     196                onChange: function(hsb, hex, rgb, el) { $("#colorpicker").val(hex); },
     197                onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
     198              }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
     199            </script>
     200          </tr>
     201          <tr>
     202            <td>'.l10n('copyFONT').' :</td>
     203            <td><input type="text" name="copyFONT" value="'.$CONF['copyFONT'].'"/></td>
     204          </tr>
     205        </table>
     206      </li>
     207    </ul>
     208  </div>
     209
     210  <div class="generic config">
     211    <h2>'.l10n('Plugins').'</h2>
     212    <ul>';
     213     
     214      // Affichage des plugins
     215      $PLUGIN_ACTION = 'edit_config';
     216     
     217      foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
     218        $PAGE['content'] .= '<li>
     219          <div class="plugin-title">
     220            <span class="title">'.$plugin_config['name'].' :</span>
     221            <input type="hidden" name="Plugins['.$plugin_id.'][name]" value="'.$plugin_config['name'].'"/>
     222            <input type="hidden" name="Plugins['.$plugin_id.'][mode]" value="'.$plugin_config['mode'].'"/>';
     223           
     224            // Cas spéciaux dans le titre (nouveau, manquant)
     225            if (isset($NewPlugins[$plugin_id])) {
     226              $PAGE['content'] .= ' <b class="new">'.l10n('New !').'</b>';
     227            } else if (isset($MissingPlugins[$plugin_id])) {
     228              $PAGE['content'] .= ' <b class="miss">'.l10n('Missing !').'</b>';
     229            }
     230           
     231            // Si il est manquant on ne met que la checkbox de suppression, sinon boutons d'activation
     232            $PAGE['content'] .= '<span class="plugin-active">';
     233              if (isset($MissingPlugins[$plugin_id])) {
     234                $PAGE['content'] .= '<label><input type="checkbox" name="Plugins['.$plugin_id.'][delete]" value="true" checked="checked"/> '.l10n('erase').'</label>';
     235              } else {
     236                $PAGE['content'] .= '<input type="radio" id="" id="active-'.$plugin_id.'" name="Plugins['.$plugin_id.'][active]" value="true" '.(($plugin_config['active'])?'checked="checked"':'').'/>
     237                <label for="active-'.$plugin_id.'">'.l10n('Active').'</label>
     238                <input type="radio" id="" id="inactive-'.$plugin_id.'"name="Plugins['.$plugin_id.'][active]" value="false" '.((!$plugin_config['active'])?'checked="checked"':'').'/>
     239                <label for="inactive-'.$plugin_id.'">'.l10n('Inactive').'</label>';
     240              }
     241            $PAGE['content'] .= '</span>
     242           
     243          </div>';
     244         
     245         
     246          // On affiche sa configuration
     247          if (!isset($MissingPlugins[$plugin_id]) AND file_exists('plugins/'.$plugin_id.'/setup.php')) {
     248            include('plugins/'.$plugin_id.'/setup.php');
     249          }
     250        $PAGE['content'] .= '</li>';
     251      }
     252     
     253    $PAGE['content'] .= '</ul>
     254  </div>';
     255 
     256
     257  $PAGE['end'] .= '<div class="generic link">
     258    <input type="submit" name="submit" value="'.l10n('Valid').'"/>
     259    <input type="reset" onclick="location.href=\'index.php\'" value="'.l10n('Back').'"/>
     260  </div>
    257261</form>';
    258262?>
  • extensions/PHP_Optimisateur/index.php

    r10338 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |                         Version 1.4                           |
     3|            PHP OPTIMISATEUR           |
     4|              Version 1.4              |
    55\***************************************/
    66
     
    1414$LOG = array();
    1515$PAGE = array(
    16         'section' => 'home',
    17         'header' => null,
    18         'content' => null,
    19         'msgs' => null,
    20         'end' => null,
     16  'section' => 'home',
     17  'header' => null,
     18  'content' => null,
     19  'msgs' => null,
     20  'end' => null,
    2121);
    2222
     
    2828### CONFIGURATION ###
    2929if (!file_exists('config.xml')) {
    30         $ERRORS['fatal'][] = 'ErrorConfigFile';
     30  $ERRORS['fatal'][] = 'ErrorConfigFile';
    3131} else {
    32         $CONF = load_config('config.xml');
     32  $CONF = load_config('config.xml');
    3333}
    3434
    3535if (!file_exists('include/nconvert.exe')) {
    36         $ERRORS['fatal'][] = 'ErrorNconvert';
     36  $ERRORS['fatal'][] = 'ErrorNconvert';
    3737}
    3838
     
    4444### PROCESSUS ###
    4545switch ($PAGE['section']) {
    46         case 'home':
    47                 if (!isset($ERRORS['fatal'])) {
    48                         if (!file_exists($CONF['DIRsource'])) {
    49                                 mkdir($CONF['DIRsource']);
    50                         }
    51                         if (!file_exists($CONF['DIRsortie'])) {
    52                                 mkdir($CONF['DIRsortie']);
    53                         }
    54                         if (is_dir_empty($CONF['DIRsource'])) {
    55                                 $ERRORS['fatal'][] = 'ErrorFolderIn';
    56                         }
    57                         if ($CONF['silentORNOT'] == 'block' AND !is_dir_empty($CONF['DIRsortie'])) {
    58                                 $ERRORS['fatal'][] = 'ErrorFolderOut';
    59                         } else if ($CONF['silentORNOT'] == 'erase' AND !is_dir_empty($CONF['DIRsortie'])) {
    60                                 $ERRORS['notice'][] = 'EraseFolderOut';
    61                         }
    62                 }
    63                 break;
    64                
    65         case 'setup':
    66                 if (isset($_POST['submit'])) {
    67                         include('include/save_config.php');
    68                 }
    69                 break;
    70        
    71         case 'process':
    72                 include('include/main.php');
    73                 break;
     46  case 'home':
     47    if (!isset($ERRORS['fatal'])) {
     48      if (!file_exists($CONF['DIRsource'])) {
     49        mkdir($CONF['DIRsource']);
     50      }
     51      if (!file_exists($CONF['DIRsortie'])) {
     52        mkdir($CONF['DIRsortie']);
     53      }
     54      if (is_dir_empty($CONF['DIRsource'])) {
     55        $ERRORS['fatal'][] = 'ErrorFolderIn';
     56      }
     57      if ($CONF['silentORNOT'] == 'block' AND !is_dir_empty($CONF['DIRsortie'])) {
     58        $ERRORS['fatal'][] = 'ErrorFolderOut';
     59      } else if ($CONF['silentORNOT'] == 'erase' AND !is_dir_empty($CONF['DIRsortie'])) {
     60        $ERRORS['notice'][] = 'EraseFolderOut';
     61      }
     62    }
     63    break;
     64   
     65  case 'setup':
     66    if (isset($_POST['submit'])) {
     67      include('include/save_config.php');
     68    }
     69    break;
     70 
     71  case 'process':
     72    include('include/main.php');
     73    break;
    7474}
    7575
     
    7878### AFFICHAGE ###
    7979switch ($PAGE['section']) {
    80         case 'home':
    81                 include('include/display_config.php');
    82                
    83                 if (isset($ERRORS['fatal'])) {
    84                         $PAGE['end'] .= '
    85                         <div class="generic link">
    86                                 <a class="input-submit" href="index.php">'.l10n('Reload').'</a>
    87                                 <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
    88                         </div>';
     80  case 'home':
     81    include('include/display_config.php');
     82   
     83    if (isset($ERRORS['fatal'])) {
     84      $PAGE['end'] .= '
     85      <div class="generic link">
     86        <a class="input-submit" href="index.php">'.l10n('Reload').'</a>
     87        <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
     88      </div>';
    8989
    90                 } else {
    91                         $PAGE['end'] .= '
    92                         <div class="generic finish">
    93                                 <span id="ready-text">'.l10n('Ready').'</span>
    94                                 <span id="loader"><img src="template/favicon.png" alt="PHP OPT"/></span>
    95                         </div>
    96                         <div class="generic link">
    97                                 <a class="input-submit" href="index.php?page=process" onclick="Load();">'.l10n('Launch').'</a>
    98                                 <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
    99                         </div>';
    100                 }
    101                 break;
    102                
    103         case 'setup':
    104                 if (isset($ERRORS['fatal'])) {
    105                         $PAGE['end'] .= '
    106                         <div class="generic link">
    107                                 <a class="input-submit" href="index.php">'.l10n('Back').'</a>
    108                                 <a class="input-submit" href="index.php?page=setup">'.l10n('Reload').'</a>
    109                         </div>';
     90    } else {
     91      $PAGE['end'] .= '
     92      <div class="generic finish">
     93        <span id="ready-text">'.l10n('Ready').'</span>
     94        <span id="loader"><img src="template/favicon.png" alt="PHP OPT"/></span>
     95      </div>
     96      <div class="generic link">
     97        <a class="input-submit" href="index.php?page=process" onclick="Load();">'.l10n('Launch').'</a>
     98        <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
     99      </div>';
     100    }
     101    break;
     102   
     103  case 'setup':
     104    if (isset($ERRORS['fatal'])) {
     105      $PAGE['end'] .= '
     106      <div class="generic link">
     107        <a class="input-submit" href="index.php">'.l10n('Back').'</a>
     108        <a class="input-submit" href="index.php?page=setup">'.l10n('Reload').'</a>
     109      </div>';
    110110
    111                 } else {
    112                         include('include/setup.php');
    113                 }
    114                 break;
    115        
    116         case 'process':
    117                 ### Affichage des fichiers traités et création du log ###
    118                 $nb_files = count($FilesSource);
    119                 $time = intval((microtime(true)-$TIME_START));
    120                 $logfile = print_log($nb_files, $time);
    121                
    122                 $PAGE['content'] .= '
    123                 <div class="generic files">
    124                         <h2>'.l10n('Source files').'</h2>
    125                         <ul>';
    126                                 foreach ($FilesSource as $value) {
    127                                         $PAGE['content'] .= '<li>'.$value.'</li>';
    128                                 }
    129                         $PAGE['content'] .= '</ul>
    130                         <i>'.l10n('%d files', $nb_files).'</i><br>
    131                         <b>Log :</b> <a href="logs/'.$logfile.'">'.$logfile.'</a>
    132                 </div>';
    133                
     111    } else {
     112      include('include/setup.php');
     113    }
     114    break;
     115 
     116  case 'process':
     117    ### Affichage des fichiers traités et création du log ###
     118    $nb_files = count($FilesSource);
     119    $time = intval((microtime(true)-$TIME_START));
     120    $logfile = print_log($nb_files, $time);
     121   
     122    $PAGE['content'] .= '
     123    <div class="generic files">
     124      <h2>'.l10n('Source files').'</h2>
     125      <ul>';
     126        foreach ($FilesSource as $value) {
     127          $PAGE['content'] .= '<li>'.$value.'</li>';
     128        }
     129      $PAGE['content'] .= '</ul>
     130      <i>'.l10n('%d files', $nb_files).'</i><br>
     131      <b>Log :</b> <a href="logs/'.$logfile.'">'.$logfile.'</a>
     132    </div>';
     133   
    134134
    135                 unset($FilesSource);
    136                 unset($FilesSortie);
    137                
    138                 $PAGE['end'] .= '
    139                 <div class="generic finish">'.l10n('Finish %d seconds', $time).'</div>
    140                 <div class="generic link">
    141                         <a class="input-submit" href="index.php">'.l10n('Back').'</a>
    142                         <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
    143                 </div>';
    144                 break;
     135    unset($FilesSource);
     136    unset($FilesSortie);
     137   
     138    $PAGE['end'] .= '
     139    <div class="generic finish">'.l10n('Finish %d seconds', $time).'</div>
     140    <div class="generic link">
     141      <a class="input-submit" href="index.php">'.l10n('Back').'</a>
     142      <a class="input-submit" href="index.php?page=setup">'.l10n('Config').'</a>
     143    </div>';
     144    break;
    145145}
    146146
     
    150150// erreurs fatales
    151151if (isset($ERRORS['fatal'])) {
    152         $PAGE['msgs'] .= '<div class="generic error">';
    153                 foreach ($ERRORS['fatal'] as $key) {
    154                         $PAGE['msgs'] .= '<div>'.l10n('fatal.'.$key).'</div>';
    155                 }
    156         $PAGE['msgs'] .= '</div>';
     152  $PAGE['msgs'] .= '<div class="generic error">';
     153    foreach ($ERRORS['fatal'] as $key) {
     154      $PAGE['msgs'] .= '<div>'.l10n('fatal.'.$key).'</div>';
     155    }
     156  $PAGE['msgs'] .= '</div>';
    157157}
    158158// informations
    159159if (isset($ERRORS['notice'])) {
    160         $PAGE['msgs'] .= '<div class="generic notice">';
    161                 foreach ($ERRORS['notice'] as $key) {
    162                         $PAGE['msgs'] .= '<div>'.l10n('notice.'.$key).'</div>';
    163                 }
    164         $PAGE['msgs'] .= '</div>';
     160  $PAGE['msgs'] .= '<div class="generic notice">';
     161    foreach ($ERRORS['notice'] as $key) {
     162      $PAGE['msgs'] .= '<div>'.l10n('notice.'.$key).'</div>';
     163    }
     164  $PAGE['msgs'] .= '</div>';
    165165}
    166166// erreurs de configuration
    167167if (isset($ERRORS['conf'])) {
    168         $PAGE['msgs'] .= '<div class="generic notice conf">';
    169                 foreach ($ERRORS['conf'] as $key) {
    170                         $PAGE['msgs'] .= '<div>'.l10n('notice.'.$key[1].' %s', '<i>'.$key[0].'</i>').'</div>';
    171                 }
    172         $PAGE['msgs'] .= '</div>';
     168  $PAGE['msgs'] .= '<div class="generic notice conf">';
     169    foreach ($ERRORS['conf'] as $key) {
     170      $PAGE['msgs'] .= '<div>'.l10n('notice.'.$key[1].' %s', '<i>'.$key[0].'</i>').'</div>';
     171    }
     172  $PAGE['msgs'] .= '</div>';
    173173}
    174174
     
    183183echo '
    184184<div class="generic footer">
    185         2010/2011 - <a href="http://www.strangeplanet.fr">Damien Sorel</a> - <a href="http://fr.piwigo.org/forum/viewtopic.php?id=19117">Forum</a> - <a href="http://fr.piwigo.org/doc/doku.php?id=tools:php_o">Documentation</a>
     185  2010/2011 - <a href="http://www.strangeplanet.fr">Damien Sorel</a> - <a href="http://fr.piwigo.org/forum/viewtopic.php?id=19117">Forum</a> - <a href="http://fr.piwigo.org/doc/doku.php?id=tools:php_o">Documentation</a>
    186186</div>
    187187
  • extensions/PHP_Optimisateur/plugins/charlies_content/main.php

    r10338 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |         Plugin Charlie's Content 1.0          |
     3|            PHP OPTIMISATEUR           |
     4|     Plugin Charlie's Content 1.0      |
    55\***************************************/
    66
     
    88
    99$CC_charlies_exts = array( // all extensions supported by Charlies' Content
    10         'flv','swf','pls','m3u','wav','mid','au','aif','mp3','pdf',
    11         'asf','wmv','divx','xvid','aiff','aac','bmp','gsm','mov','mpg',
    12         'mpeg','mp4','m4a','psd','qt','qtif','qif','qti','snd','tif',
    13         'tiff','3g2','3pg','zip','rar','gpx','3gp',
     10  'flv','swf','pls','m3u','wav','mid','au','aif','mp3','pdf',
     11  'asf','wmv','divx','xvid','aiff','aac','bmp','gsm','mov','mpg',
     12  'mpeg','mp4','m4a','psd','qt','qtif','qif','qti','snd','tif',
     13  'tiff','3g2','3pg','zip','rar','gpx','3gp',
    1414);
    1515$CC_video_exts = array( // extensions tested with FFmpeg
    16         'wmv','mov','mkv','mp4','mpg','flv','asf','xvid','divx','mpeg',
    17         'avi','rm', # <-- additional formats
     16  'wmv','mov','mkv','mp4','mpg','flv','asf','xvid','divx','mpeg',
     17  'avi','rm', # <-- additional formats
    1818);
    1919$CC_video_time = $CONF['Plugins']['charlies_content']['video_time'];
     
    2121if (!function_exists('ffmpeg')) {
    2222function ffmpeg($param, $log=true) {
    23         global $LOG;
     23  global $LOG;
    2424
    25         exec('include\ffmpeg.exe '. $param .' 2>&1', $out);
    26        
    27         if ($log) {
    28                 $LOG[] = 'FFmpeg conversion : ' . $param;
    29         } else {
    30                 return $out;
    31         }
     25  exec('include\ffmpeg.exe '. $param .' 2>&1', $out);
     26 
     27  if ($log) {
     28    $LOG[] = 'FFmpeg conversion : ' . $param;
     29  } else {
     30    return $out;
     31  }
    3232}
    3333}
    3434
    3535if (in_arrayi($file['ext'], $CC_video_exts)) {
    36         // copie la video
    37         copy_log($FilesSource[$i], $FilesSortie[$i]);
    38        
    39         // infos sur le fichier
    40         $infos = ffmpeg('-i "'. $FilesSource[$i] .'"', false);
    41         $infos = implode('|', $infos);
    42        
    43         // taille de la video
    44         if (preg_match('#\, (\d+)x(\d+)#s', $infos, $sizes)) {
    45                 $FileInfos = array(
    46                         'Width' => $sizes[1],
    47                         'Height' => $sizes[2],
    48                 );
    49         }
     36  // copie la video
     37  copy_log($FilesSource[$i], $FilesSortie[$i]);
     38 
     39  // infos sur le fichier
     40  $infos = ffmpeg('-i "'. $FilesSource[$i] .'"', false);
     41  $infos = implode('|', $infos);
     42 
     43  // taille de la video
     44  if (preg_match('#\, (\d+)x(\d+)#s', $infos, $sizes)) {
     45    $FileInfos = array(
     46      'Width' => $sizes[1],
     47      'Height' => $sizes[2],
     48    );
     49  }
    5050
    51         // position de la miniature
    52         $second = 10;
    53         if ($CC_video_time == 'rand') {
    54                 if (preg_match('#Duration: ((\d+):(\d+):(\d+))#s', $infos, $time)) {
    55                         $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
    56                         $second = rand(1, ($total - 1));
    57                 }
    58         } else if (is_int($CC_video_time)) {
    59                 $second = $CC_video_time;
    60         }
    61        
    62         // création d'un ficher pleine taille temporaire
    63         mkdir('temp', 0777, true);
    64         ffmpeg('-i "'. $FilesSource[$i] .'" -an -ss '.$second.' -t 1 -r 1 -y -vcodec mjpeg -f mjpeg "temp/'.$file['name'].'.jpg"');     
    65        
    66         // miniature, utilise Create Custom Thumbs si activé
    67         if (
    68                 isset($CONF['Plugins']['create_custom_thumbs'])
    69                 AND $CONF['Plugins']['create_custom_thumbs']['active']
    70         ) {
    71                 unset($BlockAll);
    72                 $CCT_filesource = 'temp/'.$file['name'].'.jpg';
    73                 include('plugins/create_custom_thumbs/main.php');
    74                 $BlockAll['main'] = true;
    75        
    76         } else {
    77                 nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "temp/'.$file['name'].'.jpg"');
    78         }
     51  // position de la miniature
     52  $second = 10;
     53  if ($CC_video_time == 'rand') {
     54    if (preg_match('#Duration: ((\d+):(\d+):(\d+))#s', $infos, $time)) {
     55      $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
     56      $second = rand(1, ($total - 1));
     57    }
     58  } else if (is_int($CC_video_time)) {
     59    $second = $CC_video_time;
     60  }
     61 
     62  // création d'un ficher pleine taille temporaire
     63  mkdir('temp', 0777, true);
     64  ffmpeg('-i "'. $FilesSource[$i] .'" -an -ss '.$second.' -t 1 -r 1 -y -vcodec mjpeg -f mjpeg "temp/'.$file['name'].'.jpg"'); 
     65 
     66  // miniature, utilise Create Custom Thumbs si activé
     67  if (
     68    isset($CONF['Plugins']['create_custom_thumbs'])
     69    AND $CONF['Plugins']['create_custom_thumbs']['active']
     70  ) {
     71    unset($BlockAll);
     72    $CCT_filesource = 'temp/'.$file['name'].'.jpg';
     73    include('plugins/create_custom_thumbs/main.php');
     74    $BlockAll['main'] = true;
     75 
     76  } else {
     77    nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "temp/'.$file['name'].'.jpg"');
     78  }
    7979
    80         // suppression des fichiers temporaires
    81         @rrmdir('temp');
    82        
    83         $BlockThumbnail['charlies_content'] = true;
    84         $BlockNormal['charlies_content'] = true;
    85         $BlockHigh['charlies_content'] = true;
    86        
     80  // suppression des fichiers temporaires
     81  @rrmdir('temp');
     82 
     83  $BlockThumbnail['charlies_content'] = true;
     84  $BlockNormal['charlies_content'] = true;
     85  $BlockHigh['charlies_content'] = true;
     86 
    8787} else if (in_arrayi($file['ext'], $CC_charlies_exts)) {
    88         // copie le fichier
    89         copy_log($FilesSource[$i], $FilesSortie[$i]);
    90        
    91         $BlockThumbnail['charlies_content'] = true;
    92         $BlockNormal['charlies_content'] = true;
    93         $BlockHigh['charlies_content'] = true;
     88  // copie le fichier
     89  copy_log($FilesSource[$i], $FilesSortie[$i]);
     90 
     91  $BlockThumbnail['charlies_content'] = true;
     92  $BlockNormal['charlies_content'] = true;
     93  $BlockHigh['charlies_content'] = true;
    9494}
    9595
  • extensions/PHP_Optimisateur/plugins/charlies_content/setup.php

    r10337 r12819  
    33
    44switch ($PLUGIN_ACTION) {
    5         // Affichage simple de la configuration
    6         case 'read_config':
    7                 // vérifie que ffmpeg est bien présent
    8                 if (!file_exists('include/ffmpeg.exe') AND $plugin_config['active']) {
    9                         $ERRORS['fatal'][] = 'charlies_content.error_ffmpeg';
    10                 }
    11                                
    12                 $PAGE['content'] .= '
    13                 <table>
    14                         <tr>
    15                                 <td>'.l10n('charlies_content.video_time').' :</td>
    16                                 <td>'.bool_to_string($plugin_config['video_time']).($plugin_config['video_time']!=='rand' ? ' sec':'om').'</td>
    17                         </tr>
    18                 </table>';
    19                 break;
    20        
    21        
    22         // Actions avant enregistrement
    23         case 'save_config':
    24                 if (!is_decimal($_POST['Plugins']['charlies_content']['video_time']) AND $_POST['Plugins']['charlies_content']['video_time'] != 'rand') {
    25                         $_POST['Plugins']['charlies_content']['video_time'] = 'rand';
    26                         $ERRORS['conf'][] = array(l10n('charlies_content.video_time'), 'must_be_integer');
    27                 }
     5  // Affichage simple de la configuration
     6  case 'read_config':
     7    // vérifie que ffmpeg est bien présent
     8    if (!file_exists('include/ffmpeg.exe') AND $plugin_config['active']) {
     9      $ERRORS['fatal'][] = 'charlies_content.error_ffmpeg';
     10    }
     11       
     12    $PAGE['content'] .= '
     13    <table>
     14      <tr>
     15        <td>'.l10n('charlies_content.video_time').' :</td>
     16        <td>'.bool_to_string($plugin_config['video_time']).($plugin_config['video_time']!=='rand' ? ' sec':'om').'</td>
     17      </tr>
     18    </table>';
     19    break;
     20 
     21 
     22  // Actions avant enregistrement
     23  case 'save_config':
     24    if (!is_decimal($_POST['Plugins']['charlies_content']['video_time']) AND $_POST['Plugins']['charlies_content']['video_time'] != 'rand') {
     25      $_POST['Plugins']['charlies_content']['video_time'] = 'rand';
     26      $ERRORS['conf'][] = array(l10n('charlies_content.video_time'), 'must_be_integer');
     27    }
    2828
    29                 break;
     29    break;
    3030
    31                
    32         // Formulaire d'édition
    33         case 'edit_config':
    34                 $PAGE['content'] .='
    35                 <table>
    36                         <tr>
    37                                 <td>'.l10n('charlies_content.video_time').' :</td>
    38                                 <td>
    39                                         <input type="text" name="Plugins[charlies_content][video_time]" value="'.$plugin_config['video_time'].'" size="3"/>sec
    40                                         <i>'.l10n('charlies_content.rand').'</i>
    41                                 </td>
    42                         </tr>
    43                 </table>';
    44                 break;
     31   
     32  // Formulaire d'édition
     33  case 'edit_config':
     34    $PAGE['content'] .='
     35    <table>
     36      <tr>
     37        <td>'.l10n('charlies_content.video_time').' :</td>
     38        <td>
     39          <input type="text" name="Plugins[charlies_content][video_time]" value="'.$plugin_config['video_time'].'" size="3"/>sec
     40          <i>'.l10n('charlies_content.rand').'</i>
     41        </td>
     42      </tr>
     43    </table>';
     44    break;
    4545}
    4646?>
  • extensions/PHP_Optimisateur/plugins/convert_pan/main.php

    r10337 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |                 Plugin ConvertPan 1.3                 |
     3|            PHP OPTIMISATEUR           |
     4|          Plugin ConvertPan 1.3        |
    55\***************************************/
    66
     
    88## Crée des miniatures rognées pour ne pas avoir de minuscules images
    99
    10 $CP_namepanorama = $CONF['Plugins']['convert_pan']['NAMEpanorama'];     // Suffixe des panoramas
    11 $CP_detectmode = $CONF['Plugins']['convert_pan']['DetectMode'];                 // Mode de détection
    12 $CP_dimpanorama = $CONF['Plugins']['convert_pan']['DIMpanorama'];               // Hauteur des panoramas normaux
    13 $CP_ratiopan = $CONF['Plugins']['convert_pan']['RatioPan'];                     // Ratio des panoramas
    14 $CP_ratiopanthumb = $CONF['Plugins']['convert_pan']['RatioPanThumb'];   // Ratio des miniatures
     10$CP_namepanorama = $CONF['Plugins']['convert_pan']['NAMEpanorama'];   // Suffixe des panoramas
     11$CP_detectmode = $CONF['Plugins']['convert_pan']['DetectMode'];       // Mode de détection
     12$CP_dimpanorama = $CONF['Plugins']['convert_pan']['DIMpanorama'];     // Hauteur des panoramas normaux
     13$CP_ratiopan = $CONF['Plugins']['convert_pan']['RatioPan'];           // Ratio des panoramas
     14$CP_ratiopanthumb = $CONF['Plugins']['convert_pan']['RatioPanThumb']; // Ratio des miniatures
    1515
    1616if (!isset($BlockAll)) {
    1717
    1818if (
    19         ($CP_detectmode == 'name' AND strpos($file['name'],$CP_namepanorama) !== false) OR
    20         ($CP_detectmode == 'ratio' AND $FileInfos['Width']/$FileInfos['Height'] >= $CP_ratiopan)
     19  ($CP_detectmode == 'name' AND strpos($file['name'],$CP_namepanorama) !== false) OR
     20  ($CP_detectmode == 'ratio' AND $FileInfos['Width']/$FileInfos['Height'] >= $CP_ratiopan)
    2121) {
    2222
    23         if (!isset($BlockNormal) AND $CP_dimpanorama != 0) {
    24                 nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize 0 '.$CP_dimpanorama.' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
    25                 $BlockNormal['convert_pan'] = true;
    26         }
    27        
    28         if (!isset($BlockThumbnail) AND $CP_ratiopanthumb != 0) {
    29                 $DIMthumbnailV = $CONF['DIMthumbnail']/$CP_ratiopanthumb;
    30                
    31                 // on prend la miniature au milieu du panorama
    32                 $tmp_x = $FileInfos['Width'] * $DIMthumbnailV / $FileInfos['Height'];
    33                 $offset_x = ($tmp_x - $CONF['DIMthumbnail']) / 2;
    34                
    35                 nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize 0 '.$DIMthumbnailV.' -crop '.$offset_x.' 0 '.$CONF['DIMthumbnail'].' '.$DIMthumbnailV.' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
    36                 $BlockThumbnail['convert_pan'] = true;
    37         }
     23  if (!isset($BlockNormal) AND $CP_dimpanorama != 0) {
     24    nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize 0 '.$CP_dimpanorama.' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
     25    $BlockNormal['convert_pan'] = true;
     26  }
     27 
     28  if (!isset($BlockThumbnail) AND $CP_ratiopanthumb != 0) {
     29    $DIMthumbnailV = $CONF['DIMthumbnail']/$CP_ratiopanthumb;
     30   
     31    // on prend la miniature au milieu du panorama
     32    $tmp_x = $FileInfos['Width'] * $DIMthumbnailV / $FileInfos['Height'];
     33    $offset_x = ($tmp_x - $CONF['DIMthumbnail']) / 2;
     34   
     35    nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize 0 '.$DIMthumbnailV.' -crop '.$offset_x.' 0 '.$CONF['DIMthumbnail'].' '.$DIMthumbnailV.' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     36    $BlockThumbnail['convert_pan'] = true;
     37  }
    3838}
    3939
  • extensions/PHP_Optimisateur/plugins/convert_pan/setup.php

    r10337 r12819  
    33
    44switch ($PLUGIN_ACTION) {
    5         // Affichage simple de la configuration
    6         case 'read_config':
    7                 $PAGE['content'] .= '
    8                 <table>
    9                         <tr>
    10                                 <td>'.l10n('convert_pan.DetectMode').' :</td>
    11                                 <td>'.$plugin_config['DetectMode'].'</td>
    12                         </tr>';
    13                        
    14                         if ($plugin_config['DetectMode'] == 'name') {
    15                                 $PAGE['content'] .= '
    16                                 <tr>
    17                                         <td>'.l10n('convert_pan.NAMEpanorama').' :</td>
    18                                         <td>'.$plugin_config['NAMEpanorama'].'</td>
    19                                 </tr>';
    20                         } else if ($plugin_config['DetectMode'] == 'ratio') {
    21                                 $PAGE['content'] .= '
    22                                 <tr>
    23                                         <td>'.l10n('convert_pan.RatioPan').' :</td>
    24                                         <td>'.$plugin_config['RatioPan'].'</td>
    25                                 </tr>';
    26                         }
    27                        
    28                         $PAGE['content'] .= '
    29                         <tr>
    30                                 <td>'.l10n('convert_pan.DIMpanorama').' :</td>
    31                                 <td>'.$plugin_config['DIMpanorama'].' px</td>
    32                         </tr>
    33                         <tr>
    34                                 <td>'.l10n('convert_pan.RatioPanThumb').' :</td>
    35                                 <td>'.$plugin_config['RatioPanThumb'].'</td>
    36                         </tr>
    37                 </table>';
    38                 break;
    39                
    40         // Actions avant enregistrement
    41         case 'save_config':
    42                 $_POST['Plugins']['convert_pan']['NAMEpanorama'] = delete_special_car($_POST['Plugins']['convert_pan']['NAMEpanorama']);
    43                
    44                 if (!is_decimal($_POST['Plugins']['convert_pan']['DIMpanorama'])) {
    45                         $_POST['Plugins']['convert_pan']['DIMpanorama'] = 500;
    46                         $ERRORS['conf'][] = array(l10n('convert_pan.DIMpanorama'), 'must_be_integer');
    47                 }
    48                 if (!is_decimal($_POST['Plugins']['convert_pan']['RatioPanThumb'])) {
    49                         $_POST['Plugins']['convert_pan']['RatioPanThumb'] = 1.7;
    50                         $ERRORS['conf'][] = array(l10n('convert_pan.RatioPanThumb'), 'must_be_decimal');
    51                 }
    52                 if (!is_decimal($_POST['Plugins']['convert_pan']['RatioPan'])) {
    53                         $_POST['Plugins']['convert_pan']['RatioPan'] = 2.85;
    54                         $ERRORS['conf'][] = array(l10n('convert_pan.RatioPan'), 'must_be_decimal');
    55                 }
    56                
    57                 break;
    58                
    59         // Formulaire d'édition
    60         case 'edit_config':
    61                 $PAGE['content'] .= '
    62                 <script type="text/javascript">
    63                         function ToggleConfig(sel, section){
    64                                 var obj = $("#convert_pan-tr-"+section);
    65                                 if(sel.checked){
    66                                         obj.show();
    67                                 }else{
    68                                         obj.hide();
    69                                 }
    70                         }
    71                 </script>
    72        
    73                 <table>
    74                         <tr>
    75                                 <td>'.l10n('convert_pan.DetectMode').' :</td>
    76                                 <td>
    77                                         <input type="radio" id="convert_pan-radio-name" name="Plugins[convert_pan][DetectMode]" value="name" onchange="ToggleConfig(this,\'name\');" '.(($plugin_config['DetectMode']=='name')?'checked="checked"':'').'/>
    78                                         <label for="convert_pan-radio-name">'.l10n('convert_pan.DetectMode.name').'</label>
    79                                         <input type="radio" id="convert_pan.radio.ratio" name="Plugins[convert_pan][DetectMode]" value="ratio" onchange="ToggleConfig(this,\'ratio\');" '.(($plugin_config['DetectMode']=='ratio')?'checked="checked"':'').'/>
    80                                         <label for="convert_pan-radio-ratio">'.l10n('convert_pan.DetectMode.ratio').'</label>
    81                                 </td>
    82                         </tr>
    83                         <tr id="convert_pan-tr-name">
    84                                 <td>'.l10n('convert_pan.NAMEpanorama').' :</td>
    85                                 <td><input type="text" name="Plugins[convert_pan][NAMEpanorama]" value="'.$plugin_config['NAMEpanorama'].'" size="6"/></td>
    86                         </tr>
    87                         <tr id="convert_pan-tr-ratio">
    88                                 <td>'.l10n('convert_pan.RatioPan').' :</td>
    89                                 <td><input type="text" name="Plugins[convert_pan][RatioPan]" value="'.$plugin_config['RatioPan'].'" size="3"/>px</td>
    90                         </tr>
    91                        
    92                         <tr>
    93                                 <td>'.l10n('convert_pan.DIMpanorama').' :</td>
    94                                 <td>
    95                                         <input type="text" name="Plugins[convert_pan][DIMpanorama]" value="'.$plugin_config['DIMpanorama'].'" size="3"/>px
    96                                         <i>'.l10n('convert_pan.unactive').'</i>
    97                                 </td>
    98                         </tr>
    99                         <tr>
    100                                 <td>'.l10n('convert_pan.RatioPanThumb').' :</td>
    101                                 <td>
    102                                         <input type="text" name="Plugins[convert_pan][RatioPanThumb]" value="'.$plugin_config['RatioPanThumb'].'" size="3"/>
    103                                         <i>'.l10n('convert_pan.unactive').'</i>
    104                                 </td>
    105                         </tr>
    106                 </table>
    107                
    108                 <script type="text/javascript">
    109                         ToggleConfig(document.forms[0].elements["Plugins[convert_pan][DetectMode]"][0], "name");
    110                         ToggleConfig(document.forms[0].elements["Plugins[convert_pan][DetectMode]"][1], "ratio");
    111                 </script>';
    112                 break;
     5  // Affichage simple de la configuration
     6  case 'read_config':
     7    $PAGE['content'] .= '
     8    <table>
     9      <tr>
     10        <td>'.l10n('convert_pan.DetectMode').' :</td>
     11        <td>'.$plugin_config['DetectMode'].'</td>
     12      </tr>';
     13     
     14      if ($plugin_config['DetectMode'] == 'name') {
     15        $PAGE['content'] .= '
     16        <tr>
     17          <td>'.l10n('convert_pan.NAMEpanorama').' :</td>
     18          <td>'.$plugin_config['NAMEpanorama'].'</td>
     19        </tr>';
     20      } else if ($plugin_config['DetectMode'] == 'ratio') {
     21        $PAGE['content'] .= '
     22        <tr>
     23          <td>'.l10n('convert_pan.RatioPan').' :</td>
     24          <td>'.$plugin_config['RatioPan'].'</td>
     25        </tr>';
     26      }
     27     
     28      $PAGE['content'] .= '
     29      <tr>
     30        <td>'.l10n('convert_pan.DIMpanorama').' :</td>
     31        <td>'.$plugin_config['DIMpanorama'].' px</td>
     32      </tr>
     33      <tr>
     34        <td>'.l10n('convert_pan.RatioPanThumb').' :</td>
     35        <td>'.$plugin_config['RatioPanThumb'].'</td>
     36      </tr>
     37    </table>';
     38    break;
     39   
     40  // Actions avant enregistrement
     41  case 'save_config':
     42    $_POST['Plugins']['convert_pan']['NAMEpanorama'] = delete_special_car($_POST['Plugins']['convert_pan']['NAMEpanorama']);
     43   
     44    if (!is_decimal($_POST['Plugins']['convert_pan']['DIMpanorama'])) {
     45      $_POST['Plugins']['convert_pan']['DIMpanorama'] = 500;
     46      $ERRORS['conf'][] = array(l10n('convert_pan.DIMpanorama'), 'must_be_integer');
     47    }
     48    if (!is_decimal($_POST['Plugins']['convert_pan']['RatioPanThumb'])) {
     49      $_POST['Plugins']['convert_pan']['RatioPanThumb'] = 1.7;
     50      $ERRORS['conf'][] = array(l10n('convert_pan.RatioPanThumb'), 'must_be_decimal');
     51    }
     52    if (!is_decimal($_POST['Plugins']['convert_pan']['RatioPan'])) {
     53      $_POST['Plugins']['convert_pan']['RatioPan'] = 2.85;
     54      $ERRORS['conf'][] = array(l10n('convert_pan.RatioPan'), 'must_be_decimal');
     55    }
     56   
     57    break;
     58   
     59  // Formulaire d'édition
     60  case 'edit_config':
     61    $PAGE['content'] .= '
     62    <script type="text/javascript">
     63      function ToggleConfig(sel, section){
     64        var obj = $("#convert_pan-tr-"+section);
     65        if(sel.checked){
     66          obj.show();
     67        }else{
     68          obj.hide();
     69        }
     70      }
     71    </script>
     72 
     73    <table>
     74      <tr>
     75        <td>'.l10n('convert_pan.DetectMode').' :</td>
     76        <td>
     77          <input type="radio" id="convert_pan-radio-name" name="Plugins[convert_pan][DetectMode]" value="name" onchange="ToggleConfig(this,\'name\');" '.(($plugin_config['DetectMode']=='name')?'checked="checked"':'').'/>
     78          <label for="convert_pan-radio-name">'.l10n('convert_pan.DetectMode.name').'</label>
     79          <input type="radio" id="convert_pan.radio.ratio" name="Plugins[convert_pan][DetectMode]" value="ratio" onchange="ToggleConfig(this,\'ratio\');" '.(($plugin_config['DetectMode']=='ratio')?'checked="checked"':'').'/>
     80          <label for="convert_pan-radio-ratio">'.l10n('convert_pan.DetectMode.ratio').'</label>
     81        </td>
     82      </tr>
     83      <tr id="convert_pan-tr-name">
     84        <td>'.l10n('convert_pan.NAMEpanorama').' :</td>
     85        <td><input type="text" name="Plugins[convert_pan][NAMEpanorama]" value="'.$plugin_config['NAMEpanorama'].'" size="6"/></td>
     86      </tr>
     87      <tr id="convert_pan-tr-ratio">
     88        <td>'.l10n('convert_pan.RatioPan').' :</td>
     89        <td><input type="text" name="Plugins[convert_pan][RatioPan]" value="'.$plugin_config['RatioPan'].'" size="3"/>px</td>
     90      </tr>
     91     
     92      <tr>
     93        <td>'.l10n('convert_pan.DIMpanorama').' :</td>
     94        <td>
     95          <input type="text" name="Plugins[convert_pan][DIMpanorama]" value="'.$plugin_config['DIMpanorama'].'" size="3"/>px
     96          <i>'.l10n('convert_pan.unactive').'</i>
     97        </td>
     98      </tr>
     99      <tr>
     100        <td>'.l10n('convert_pan.RatioPanThumb').' :</td>
     101        <td>
     102          <input type="text" name="Plugins[convert_pan][RatioPanThumb]" value="'.$plugin_config['RatioPanThumb'].'" size="3"/>
     103          <i>'.l10n('convert_pan.unactive').'</i>
     104        </td>
     105      </tr>
     106    </table>
     107   
     108    <script type="text/javascript">
     109      ToggleConfig(document.forms[0].elements["Plugins[convert_pan][DetectMode]"][0], "name");
     110      ToggleConfig(document.forms[0].elements["Plugins[convert_pan][DetectMode]"][1], "ratio");
     111    </script>';
     112    break;
    113113}
    114114?>
  • extensions/PHP_Optimisateur/plugins/create_custom_thumbs/main.php

    r10337 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |         Plugin CreateCustomThumbs 1.1         |
     3|            PHP OPTIMISATEUR           |
     4|      Plugin CreateCustomThumbs 1.1    |
    55\***************************************/
    66
     
    88## Dépend de la valeur de $CONF['DIMthumbnail']
    99
     10if(!isset($CCT_filesource)) $CCT_filesource = $FilesSource[$i];                // fichier de travail
     11$CCT_dimthumbnail = $CONF['Plugins']['create_custom_thumbs']['DIMthumbnailV']; // Hauteur de l'image
     12$CCT_frameparams = $CONF['Plugins']['create_custom_thumbs']['FRAMEparams'];    // Paramètres du cadre
     13
    1014if (!isset($BlockAll)) {
    1115
    1216// CreateCustomThumbs à la priorité sur ConvertPan
    1317if (isset($BlockThumbnail['convert_pan']) OR !isset($BlockThumbnail)) {
     18 
     19  // Miniature de taille personnalisée
     20  if ($CCT_dimthumbnail != 0) {
     21    $max = max($CONF['DIMthumbnail'], $CCT_dimthumbnail);
    1422
    15         if(!isset($CCT_filesource)) $CCT_filesource = $FilesSource[$i]; // fichier de travail
    16         $CCT_dimthumbnail = $CONF['Plugins']['create_custom_thumbs']['DIMthumbnailV']; // Hauteur de l'image
    17         $CCT_frameparams = $CONF['Plugins']['create_custom_thumbs']['FRAMEparams']; // Paramètres du cadre
    18        
    19         // Miniature de taille personnalisée
    20         if ($CCT_dimthumbnail != 0) {
    21                 $max = max($CONF['DIMthumbnail'], $CCT_dimthumbnail);
     23    // on prend la miniature au milieu de l'image
     24    if ($FileInfos['Height'] >= $FileInfos['Width']) {
     25      $resize_param = $max.' 0';
     26      $tmp_x = $max;
     27      $tmp_y = $max * $FileInfos['Height'] / $FileInfos['Width'];
     28    } else {
     29      $resize_param = '0 '.$max;
     30      $tmp_x = $max * $FileInfos['Width'] / $FileInfos['Height'];
     31      $tmp_y = $max;
     32    }
     33   
     34    $offset_x = ceil(($tmp_x - $CONF['DIMthumbnail']) / 2);
     35    $offset_y = ceil(($tmp_y - $CCT_dimthumbnail) / 2);
     36   
     37    nconvert('-overwrite -q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$resize_param.' -crop '.$offset_x.' '.$offset_y.' '.$CONF['DIMthumbnail'].' '.$CCT_dimthumbnail.' -rmeta -rexifthumb "'.$CCT_filesource.'"');
     38   
     39    $BlockThumbnail['create_custom_thumbs'] = true;
     40    $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
     41  }
    2242
    23                 // on prend la miniature au milieu de l'image
    24                 if ($FileInfos['Height'] >= $FileInfos['Width']) {
    25                         $resize_param = $max.' 0';
    26                         $tmp_x = $max;
    27                         $tmp_y = $max * $FileInfos['Height'] / $FileInfos['Width'];
    28                 } else {
    29                         $resize_param = '0 '.$max;
    30                         $tmp_x = $max * $FileInfos['Width'] / $FileInfos['Height'];
    31                         $tmp_y = $max;
    32                 }
    33                
    34                 $offset_x = ceil(($tmp_x - $CONF['DIMthumbnail']) / 2);
    35                 $offset_y = ceil(($tmp_y - $CCT_dimthumbnail) / 2);
    36                
    37                 nconvert('-overwrite -q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$resize_param.' -crop '.$offset_x.' '.$offset_y.' '.$CONF['DIMthumbnail'].' '.$CCT_dimthumbnail.' -rmeta -rexifthumb "'.$CCT_filesource.'"');
    38                
    39                 $BlockThumbnail['create_custom_thumbs'] = true;
    40                 $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
    41         }
     43  // Cadre autour de la miniature
     44  if ($CCT_frameparams['size1'] != 0 OR $CCT_frameparams['size2'] != 0) {
     45    // Si la miniature n'a pas encore été générée il faut le faire
     46    if ($CCT_filesource == $FilesSource[$i]) {
     47      nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     48      $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
     49    }
    4250
    43         // Cadre autour de la miniature
    44         if ($CCT_frameparams['size1'] != 0 OR $CCT_frameparams['size2'] != 0) {
    45                 // Si la miniature n'a pas encore été générée il faut le faire
    46                 if ($CCT_filesource == $FilesSource[$i]) {
    47                         nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
    48                         $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
    49                 }
     51    $img = imagecreatefromjpeg($CCT_filesource);
     52    $x = imagesx($img)-1;
     53    $y = imagesy($img)-1;
     54   
     55    $colors[0] = hex2RGB($CCT_frameparams['color1']);
     56    $colors[1] = hex2RGB($CCT_frameparams['color2']);
     57    $colors[0] = imagecolorallocate($img, $colors[0]['r'], $colors[0]['g'], $colors[0]['b']);
     58    $colors[1] = imagecolorallocate($img, $colors[1]['r'], $colors[1]['g'], $colors[1]['b']);
    5059
    51                 $img = imagecreatefromjpeg($CCT_filesource);
    52                 $x = imagesx($img)-1;
    53                 $y = imagesy($img)-1;
    54                
    55                 $colors[0] = hex2RGB($CCT_frameparams['color1']);
    56                 $colors[1] = hex2RGB($CCT_frameparams['color2']);
    57                 $colors[0] = imagecolorallocate($img, $colors[0]['r'], $colors[0]['g'], $colors[0]['b']);
    58                 $colors[1] = imagecolorallocate($img, $colors[1]['r'], $colors[1]['g'], $colors[1]['b']);
    59 
    60                 for ($m=0; $m<$CCT_frameparams['size1']; $m++) {
    61                         imagerectangle($img, $m, $m, $x-$m, $y-$m, $colors[0]);
    62                 }
    63                 for ($m=$CCT_frameparams['size1']; $m<$CCT_frameparams['size1']+$CCT_frameparams['size2']; $m++) {
    64                         imagerectangle($img, $m, $m, $x-$m, $y-$m, $colors[1]);
    65                 }
    66                
    67                 imagejpeg($img, $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg', $CONF['Qthumbnail']);
    68                 imagedestroy($img);
    69                
    70                 $BlockThumbnail['create_custom_thumbs'] = true;
    71                 $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
    72         }
     60    for ($m=0; $m<$CCT_frameparams['size1']; $m++) {
     61      imagerectangle($img, $m, $m, $x-$m, $y-$m, $colors[0]);
     62    }
     63    for ($m=$CCT_frameparams['size1']; $m<$CCT_frameparams['size1']+$CCT_frameparams['size2']; $m++) {
     64      imagerectangle($img, $m, $m, $x-$m, $y-$m, $colors[1]);
     65    }
     66   
     67    imagejpeg($img, $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg', $CONF['Qthumbnail']);
     68    imagedestroy($img);
     69   
     70    $BlockThumbnail['create_custom_thumbs'] = true;
     71    $CCT_filesource = $file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg';
     72  }
    7373}
    7474
  • extensions/PHP_Optimisateur/plugins/create_custom_thumbs/setup.php

    r10337 r12819  
    33
    44switch ($PLUGIN_ACTION) {
    5         // Affichage simple de la configuration
    6         case 'read_config':
    7                 $plugin_config['FRAMEparams']['color1'] = nice_hex_color($plugin_config['FRAMEparams']['color1']);
    8                 $plugin_config['FRAMEparams']['color2'] = nice_hex_color($plugin_config['FRAMEparams']['color2']);
    9                
    10                 $PAGE['content'] .= '
    11                 <table>
    12                         <tr>
    13                                 <td>'.l10n('create_custom_thumbs.DIMthumbnailV').' :</td>
    14                                 <td>'.bool_to_string($plugin_config['DIMthumbnailV']).' px</td>
    15                         </tr>
    16                         <tr>
    17                                 <td>'.l10n('create_custom_thumbs.FRAMEparams').' 1 :</td>
    18                                 <td>
    19                                         #'.$plugin_config['FRAMEparams']['color1'].'
    20                                         <span class="color-display" style="background-color:#'.nice_hex_color($plugin_config['FRAMEparams']['color1']).';">&nbsp;</span>
    21                                         '.$plugin_config['FRAMEparams']['size1'].'px
    22                                 </td>
    23                         </tr>
    24                         <tr>
    25                                 <td>'.l10n('create_custom_thumbs.FRAMEparams').' 2 :</td>
    26                                 <td>
    27                                         #'.$plugin_config['FRAMEparams']['color2'].'
    28                                         <span class="color-display" style="background-color:#'.nice_hex_color($plugin_config['FRAMEparams']['color2']).';">&nbsp;</span>
    29                                         '.$plugin_config['FRAMEparams']['size2'].'px
    30                                 </td>
    31                         </tr>
    32                 </table>';
    33                 break;
    34        
    35        
    36         // Actions avant enregistrement
    37         case 'save_config':
    38                 $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color1'] = str_replace('#',null, $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color1']);
    39                 $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color2'] = str_replace('#',null, $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color2']);
    40                
    41                 if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['DIMthumbnailV'])) {
    42                         $_POST['Plugins']['create_custom_thumbs']['DIMthumbnailV'] = 0;
    43                         $ERRORS['conf'][] = array(l10n('create_custom_thumbs.DIMthumbnailV'), 'must_be_integer');
    44                 }
    45                 if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size1'])) {
    46                         $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size1'] = 0;
    47                         $ERRORS['conf'][] = array(l10n('create_custom_thumbs.FRAMEparams').' 1', 'must_be_integer');
    48                 }
    49                 if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size2'])) {
    50                         $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size2'] = 0;
    51                         $ERRORS['conf'][] = array(l10n('create_custom_thumbs.FRAMEparams').' 2', 'must_be_integer');
    52                 }
    53                
    54                 break;
     5  // Affichage simple de la configuration
     6  case 'read_config':
     7    $plugin_config['FRAMEparams']['color1'] = nice_hex_color($plugin_config['FRAMEparams']['color1']);
     8    $plugin_config['FRAMEparams']['color2'] = nice_hex_color($plugin_config['FRAMEparams']['color2']);
     9   
     10    $PAGE['content'] .= '
     11    <table>
     12      <tr>
     13        <td>'.l10n('create_custom_thumbs.DIMthumbnailV').' :</td>
     14        <td>'.bool_to_string($plugin_config['DIMthumbnailV']).' px</td>
     15      </tr>
     16      <tr>
     17        <td>'.l10n('create_custom_thumbs.FRAMEparams').' 1 :</td>
     18        <td>
     19          #'.$plugin_config['FRAMEparams']['color1'].'
     20          <span class="color-display" style="background-color:#'.nice_hex_color($plugin_config['FRAMEparams']['color1']).';">&nbsp;</span>
     21          '.$plugin_config['FRAMEparams']['size1'].'px
     22        </td>
     23      </tr>
     24      <tr>
     25        <td>'.l10n('create_custom_thumbs.FRAMEparams').' 2 :</td>
     26        <td>
     27          #'.$plugin_config['FRAMEparams']['color2'].'
     28          <span class="color-display" style="background-color:#'.nice_hex_color($plugin_config['FRAMEparams']['color2']).';">&nbsp;</span>
     29          '.$plugin_config['FRAMEparams']['size2'].'px
     30        </td>
     31      </tr>
     32    </table>';
     33    break;
     34 
     35 
     36  // Actions avant enregistrement
     37  case 'save_config':
     38    $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color1'] = str_replace('#',null, $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color1']);
     39    $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color2'] = str_replace('#',null, $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['color2']);
     40   
     41    if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['DIMthumbnailV'])) {
     42      $_POST['Plugins']['create_custom_thumbs']['DIMthumbnailV'] = 0;
     43      $ERRORS['conf'][] = array(l10n('create_custom_thumbs.DIMthumbnailV'), 'must_be_integer');
     44    }
     45    if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size1'])) {
     46      $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size1'] = 0;
     47      $ERRORS['conf'][] = array(l10n('create_custom_thumbs.FRAMEparams').' 1', 'must_be_integer');
     48    }
     49    if (!is_decimal($_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size2'])) {
     50      $_POST['Plugins']['create_custom_thumbs']['FRAMEparams']['size2'] = 0;
     51      $ERRORS['conf'][] = array(l10n('create_custom_thumbs.FRAMEparams').' 2', 'must_be_integer');
     52    }
     53   
     54    break;
    5555
    56                
    57         // Formulaire d'édition
    58         case 'edit_config':
    59                 $plugin_config['FRAMEparams']['color1'] = nice_hex_color($plugin_config['FRAMEparams']['color1']);
    60                 $plugin_config['FRAMEparams']['color2'] = nice_hex_color($plugin_config['FRAMEparams']['color2']);
    61                
    62                 $PAGE['content'] .='
    63                 <table>
    64                         <tr>
    65                                 <td>'.l10n('create_custom_thumbs.DIMthumbnailV').' :</td>
    66                                 <td>
    67                                         <input type="text" name="Plugins[create_custom_thumbs][DIMthumbnailV]" value="'.$plugin_config['DIMthumbnailV'].'" size="3"/>px
    68                                         <i>'.l10n('create_custom_thumbs.unactive').'</i>
    69                                 </td>
    70                         </tr>
    71                         <tr>
    72                                 <td>'.l10n('create_custom_thumbs.FRAMEparams').' 1 :</td>
    73                                 <td>
    74                                         <input type="text" id="CCT-color1" name="Plugins[create_custom_thumbs][FRAMEparams][color1]" value="'.$plugin_config['FRAMEparams']['color1'].'" size="6"/>
    75                                         <input type="text" name="Plugins[create_custom_thumbs][FRAMEparams][size1]" value="'.$plugin_config['FRAMEparams']['size1'].'" size="1"/>px
    76                                         <i>'.l10n('create_custom_thumbs.unactive').'</i>
    77                                 </td>
    78                         </tr>
    79                         <tr>
    80                                 <td>'.l10n('create_custom_thumbs.FRAMEparams').' 2 :</td>
    81                                 <td>
    82                                         <input type="text" id="CCT-color2" name="Plugins[create_custom_thumbs][FRAMEparams][color2]" value="'.$plugin_config['FRAMEparams']['color2'].'" size="6"/>
    83                                         <input type="text" name="Plugins[create_custom_thumbs][FRAMEparams][size2]" value="'.$plugin_config['FRAMEparams']['size2'].'" size="1"/>px
    84                                         <i>'.l10n('create_custom_thumbs.unactive').'</i>
    85                                 </td>
    86                         </tr>
    87                         <script type="text/javascript">
    88                                 $("#CCT-color1").ColorPicker({
    89                                         onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); },
    90                                         onChange: function(hsb, hex, rgb, el) { $("#CCT-color1").val(hex); },
    91                                         onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
    92                                 }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
    93                                 $("#CCT-color2").ColorPicker({
    94                                         onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); (el).ColorPickerHide(); },
    95                                         onChange: function(hsb, hex, rgb, el) { $("#CCT-color2").val(hex); },
    96                                         onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
    97                                 }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
    98                         </script>
    99                 </table>';
    100                 break;
     56   
     57  // Formulaire d'édition
     58  case 'edit_config':
     59    $plugin_config['FRAMEparams']['color1'] = nice_hex_color($plugin_config['FRAMEparams']['color1']);
     60    $plugin_config['FRAMEparams']['color2'] = nice_hex_color($plugin_config['FRAMEparams']['color2']);
     61   
     62    $PAGE['content'] .='
     63    <table>
     64      <tr>
     65        <td>'.l10n('create_custom_thumbs.DIMthumbnailV').' :</td>
     66        <td>
     67          <input type="text" name="Plugins[create_custom_thumbs][DIMthumbnailV]" value="'.$plugin_config['DIMthumbnailV'].'" size="3"/>px
     68          <i>'.l10n('create_custom_thumbs.unactive').'</i>
     69        </td>
     70      </tr>
     71      <tr>
     72        <td>'.l10n('create_custom_thumbs.FRAMEparams').' 1 :</td>
     73        <td>
     74          <input type="text" id="CCT-color1" name="Plugins[create_custom_thumbs][FRAMEparams][color1]" value="'.$plugin_config['FRAMEparams']['color1'].'" size="6"/>
     75          <input type="text" name="Plugins[create_custom_thumbs][FRAMEparams][size1]" value="'.$plugin_config['FRAMEparams']['size1'].'" size="1"/>px
     76          <i>'.l10n('create_custom_thumbs.unactive').'</i>
     77        </td>
     78      </tr>
     79      <tr>
     80        <td>'.l10n('create_custom_thumbs.FRAMEparams').' 2 :</td>
     81        <td>
     82          <input type="text" id="CCT-color2" name="Plugins[create_custom_thumbs][FRAMEparams][color2]" value="'.$plugin_config['FRAMEparams']['color2'].'" size="6"/>
     83          <input type="text" name="Plugins[create_custom_thumbs][FRAMEparams][size2]" value="'.$plugin_config['FRAMEparams']['size2'].'" size="1"/>px
     84          <i>'.l10n('create_custom_thumbs.unactive').'</i>
     85        </td>
     86      </tr>
     87      <script type="text/javascript">
     88        $("#CCT-color1").ColorPicker({
     89          onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); $(el).ColorPickerHide(); },
     90          onChange: function(hsb, hex, rgb, el) { $("#CCT-color1").val(hex); },
     91          onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
     92        }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
     93        $("#CCT-color2").ColorPicker({
     94          onSubmit: function(hsb, hex, rgb, el) { $(el).val(hex); (el).ColorPickerHide(); },
     95          onChange: function(hsb, hex, rgb, el) { $("#CCT-color2").val(hex); },
     96          onBeforeShow: function () { $(this).ColorPickerSetColor(this.value); }
     97        }) .bind("keyup", function(){ $(this).ColorPickerSetColor(this.value); });
     98      </script>
     99    </table>';
     100    break;
    101101}
    102102?>
  • extensions/PHP_Optimisateur/plugins/create_folders_alpha/main.php

    r10337 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |         Plugin CreateFoldersAlpha 1.2         |
     3|            PHP OPTIMISATEUR           |
     4|      Plugin CreateFoldersAlpha 1.2    |
    55\***************************************/
    66
     
    1111
    1212while ($file = readdir($handle)) {
    13         if ($file != '.' && $file != '..' && !is_dir($CONF['DIRsource'].'/'.$file)) {
    14                 // Récupère le parties du nom servant à créer les dossiers
    15                 if (preg_match('#^(.{1})([^_.]*)_(.*)#', $file, $matches)) {
    16                         $Letter = strtoupper($matches[1]);
    17                         $FolderName = $matches[1].$matches[2];
     13  if ($file != '.' && $file != '..' && !is_dir($CONF['DIRsource'].'/'.$file)) {
     14    // Récupère le parties du nom servant à créer les dossiers
     15    if (preg_match('#^(.{1})([^_.]*)_(.*)#', $file, $matches)) {
     16      $Letter = strtoupper($matches[1]);
     17      $FolderName = $matches[1].$matches[2];
    1818
    19                         // Crée les dossier
    20                         if (!file_exists($CONF['DIRsource'].$Letter.'/'.$FolderName)) {
    21                                 mkdir_log($CONF['DIRsource'].$Letter.'/'.$FolderName);
    22                         }
    23                        
    24                         // Déplace le fichier
    25                         rename_log($CONF['DIRsource'].$file, $CONF['DIRsource'].$Letter.'/'.$FolderName.'/'.$file, true);
    26                
    27                 } else {
    28                         $LOG[] = 'The file '.$CONF['DIRsource'].$file.' doesn\'t match the patern #^(.{1})([^_.]*)_(.*)#, not moved';
    29                 }
    30                
    31                 $done = true;
    32         }
     19      // Crée les dossier
     20      if (!file_exists($CONF['DIRsource'].$Letter.'/'.$FolderName)) {
     21        mkdir_log($CONF['DIRsource'].$Letter.'/'.$FolderName);
     22      }
     23     
     24      // Déplace le fichier
     25      rename_log($CONF['DIRsource'].$file, $CONF['DIRsource'].$Letter.'/'.$FolderName.'/'.$file, true);
     26   
     27    } else {
     28      $LOG[] = 'The file '.$CONF['DIRsource'].$file.' doesn\'t match the patern #^(.{1})([^_.]*)_(.*)#, not moved';
     29    }
     30   
     31    $done = true;
     32  }
    3333}
    3434
  • extensions/PHP_Optimisateur/plugins/front2back_support/main.php

    r10337 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |         Plugin Front2Back Support 1.2         |
     3|            PHP OPTIMISATEUR           |
     4|     Plugin Front2Back Support 1.2     |
    55\***************************************/
    66
     
    1717// applique le tag au fichier normal si il existe un verso
    1818if (file_exists($file['folder_src'].$file['name'].$F2B_nameverso.'.'.$file['ext']) AND !empty($F2B_tagverso)) {
    19         nconvert('-iptc_add 25 "'.$F2B_tagverso.'" "'.$FilesSource[$i].'"');
    20         $LOG[] = 'Tag "'.$F2B_tagverso.'" added to '.$FilesSource[$i];
     19  nconvert('-iptc_add 25 "'.$F2B_tagverso.'" "'.$FilesSource[$i].'"');
     20  $LOG[] = 'Tag "'.$F2B_tagverso.'" added to '.$FilesSource[$i];
    2121}
    2222
    2323if (strpos($file['name'], $F2B_nameverso) !== false) {
    24         $file['name_clean'] = str_replace($F2B_nameverso,null,$file['name']);
    25        
    26         if (!empty($F2B_tagverso)) {
    27                 nconvert('-iptc_add 25 "'.$F2B_tagverso.'" "'.$FilesSource[$i].'"');
    28                 $LOG[] = 'Tag "'.$F2B_tagverso.'" added to '.$FilesSource[$i];
    29         }
    30        
    31         // Image normale
    32         if (!file_exists($file['folder_out'].'thumbnail/verso')) {
    33                 mkdir_log($file['folder_out'].'thumbnail/verso');
    34         }
    35         nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/verso/'.$file['name_clean'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
    36        
    37         // Image hd
    38         if ($CONF['DIRhighORNOT']) {
    39                 if (!file_exists($file['folder_out'].'pwg_high/verso')) {
    40                         mkdir($file['folder_out'].'pwg_high/verso');
    41                         $LOG[] = 'Dir '.$file['folder_out'].'pwg_high/verso/ created';
    42                 }
    43                 if ($CONF['DIMhdORNOT']) {
    44                         nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/verso/'.$file['name_clean'].'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
    45                 } else if (strtolower($file['ext']) != 'jpg') {
    46                         nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name_clean'].'.jpg" "'.$FilesSource[$i].'"');
    47                 } else {
    48                         copy_log($FilesSource[$i], $file['folder_out'].'pwg_high/verso/'.$file['name_clean'].'.jpg');
    49                 }
    50         }
    51        
    52         // Déplacement de l'image originale
    53         if ($F2B_moveverso) {
    54                 if (!file_exists($file['folder_src'].'verso')) {
    55                         mkdir_log($file['folder_src'].'verso', 0777, true);
    56                 }
    57                 rename_log($file['folder_src'].$file['name'].'.'.$file['ext'], $file['folder_src'].'verso/'.$file['name_clean'].'.'.$file['ext'], true);
    58         }
    59        
    60         // Suppression de la miniature si déjà crée (par un autre plugin)
    61         if (file_exists($file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg')) {
    62                 unlink($file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg');
    63         }
    64         // Suppression de l'image HD si déjà crée (par un autre plugin)
    65         if (file_exists($file['folder_out'].'pwg_high/'.$file['name'].'.jpg')) {
    66                 unlink($file['folder_out'].'pwg_high/'.$file['name'].'.jpg');
    67         }
    68        
    69         $BlockNormal['front2back_support'] = true;
    70         $BlockThumbnail['front2back_support'] = true;
    71         $BlockHigh['front2back_support'] = true;
     24  $file['name_clean'] = str_replace($F2B_nameverso,null,$file['name']);
     25 
     26  if (!empty($F2B_tagverso)) {
     27    nconvert('-iptc_add 25 "'.$F2B_tagverso.'" "'.$FilesSource[$i].'"');
     28    $LOG[] = 'Tag "'.$F2B_tagverso.'" added to '.$FilesSource[$i];
     29  }
     30 
     31  // Image normale
     32  if (!file_exists($file['folder_out'].'thumbnail/verso')) {
     33    mkdir_log($file['folder_out'].'thumbnail/verso');
     34  }
     35  nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/verso/'.$file['name_clean'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
     36 
     37  // Image hd
     38  if ($CONF['DIRhighORNOT']) {
     39    if (!file_exists($file['folder_out'].'pwg_high/verso')) {
     40      mkdir($file['folder_out'].'pwg_high/verso');
     41      $LOG[] = 'Dir '.$file['folder_out'].'pwg_high/verso/ created';
     42    }
     43    if ($CONF['DIMhdORNOT']) {
     44      nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/verso/'.$file['name_clean'].'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
     45    } else if (strtolower($file['ext']) != 'jpg') {
     46      nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name_clean'].'.jpg" "'.$FilesSource[$i].'"');
     47    } else {
     48      copy_log($FilesSource[$i], $file['folder_out'].'pwg_high/verso/'.$file['name_clean'].'.jpg');
     49    }
     50  }
     51 
     52  // Déplacement de l'image originale
     53  if ($F2B_moveverso) {
     54    if (!file_exists($file['folder_src'].'verso')) {
     55      mkdir_log($file['folder_src'].'verso', 0777, true);
     56    }
     57    rename_log($file['folder_src'].$file['name'].'.'.$file['ext'], $file['folder_src'].'verso/'.$file['name_clean'].'.'.$file['ext'], true);
     58  }
     59 
     60  // Suppression de la miniature si déjà crée (par un autre plugin)
     61  if (file_exists($file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg')) {
     62    unlink($file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg');
     63  }
     64  // Suppression de l'image HD si déjà crée (par un autre plugin)
     65  if (file_exists($file['folder_out'].'pwg_high/'.$file['name'].'.jpg')) {
     66    unlink($file['folder_out'].'pwg_high/'.$file['name'].'.jpg');
     67  }
     68 
     69  $BlockNormal['front2back_support'] = true;
     70  $BlockThumbnail['front2back_support'] = true;
     71  $BlockHigh['front2back_support'] = true;
    7272}
    7373
  • extensions/PHP_Optimisateur/plugins/front2back_support/setup.php

    r10337 r12819  
    33
    44switch ($PLUGIN_ACTION) {
    5         // Affichage simple de la configuration
    6         case 'read_config':
    7                 $PAGE['content'] .= '
    8                 <table>
    9                         <tr>
    10                                 <td>'.l10n('front2back_support.NAMEverso').' :</td>
    11                                 <td>'.$plugin_config['NAMEverso'].'</td>
    12                         </tr>
    13                         <tr>
    14                                 <td>'.l10n('front2back_support.MOVEverso').' :</td>
    15                                 <td>'.bool_to_string($plugin_config['MOVEverso']).'</td>
    16                         </tr>
    17                         <tr>
    18                                 <td>'.l10n('front2back_support.TAGverso').' :</td>
    19                                 <td>'.$plugin_config['TAGverso'].'</td>
    20                         </tr>
    21                 </table>';
    22                 break;
    23                
    24         // Actions avant enregistrement
    25         case 'save_config':
    26                 $_POST['Plugins']['front2back_support']['NAMEverso'] = delete_special_car($_POST['Plugins']['front2back_support']['NAMEverso']);
    27                 break;
    28                
    29         // Formulaire d'édition
    30         case 'edit_config':
    31                 $PAGE['content'] .= '
    32                 <table>
    33                         <tr>
    34                                 <td>'.l10n('front2back_support.NAMEverso').' :</td>
    35                                 <td><input type="text" name="Plugins[front2back_support][NAMEverso]" value="'.$plugin_config['NAMEverso'].'" size="6"/></td>
    36                         </tr>
    37                         <tr>
    38                                 <td>'.l10n('front2back_support.MOVEverso').' :</td>
    39                                 <td>
    40                                         <input type="radio" id="front2back_support-move1" name="Plugins[front2back_support][MOVEverso]" value="true" '.(($plugin_config['MOVEverso'])?'checked="checked"':'').'/>
    41                                         <label for="front2back_support-move1">'.l10n('yes').'</label>
    42                                         <input type="radio" id="front2back_support-move2" name="Plugins[front2back_support][MOVEverso]" value="false" '.((!$plugin_config['MOVEverso'])?'checked="checked"':'').'/>
    43                                         <label for="front2back_support-move2">'.l10n('no').'</label>
    44                                 </td>
    45                         </tr>
    46                         <tr>
    47                                 <td>'.l10n('front2back_support.TAGverso').' :</td>
    48                                 <td>
    49                                         <input type="text" name="Plugins[front2back_support][TAGverso]" value="'.$plugin_config['TAGverso'].'" size="10"/>
    50                                         <i>'.l10n('front2back_support.unactive').'</i>
    51                                 </td>
    52                         </tr>
    53                 </table>';
    54                 break;
     5  // Affichage simple de la configuration
     6  case 'read_config':
     7    $PAGE['content'] .= '
     8    <table>
     9      <tr>
     10        <td>'.l10n('front2back_support.NAMEverso').' :</td>
     11        <td>'.$plugin_config['NAMEverso'].'</td>
     12      </tr>
     13      <tr>
     14        <td>'.l10n('front2back_support.MOVEverso').' :</td>
     15        <td>'.bool_to_string($plugin_config['MOVEverso']).'</td>
     16      </tr>
     17      <tr>
     18        <td>'.l10n('front2back_support.TAGverso').' :</td>
     19        <td>'.$plugin_config['TAGverso'].'</td>
     20      </tr>
     21    </table>';
     22    break;
     23   
     24  // Actions avant enregistrement
     25  case 'save_config':
     26    $_POST['Plugins']['front2back_support']['NAMEverso'] = delete_special_car($_POST['Plugins']['front2back_support']['NAMEverso']);
     27    break;
     28   
     29  // Formulaire d'édition
     30  case 'edit_config':
     31    $PAGE['content'] .= '
     32    <table>
     33      <tr>
     34        <td>'.l10n('front2back_support.NAMEverso').' :</td>
     35        <td><input type="text" name="Plugins[front2back_support][NAMEverso]" value="'.$plugin_config['NAMEverso'].'" size="6"/></td>
     36      </tr>
     37      <tr>
     38        <td>'.l10n('front2back_support.MOVEverso').' :</td>
     39        <td>
     40          <input type="radio" id="front2back_support-move1" name="Plugins[front2back_support][MOVEverso]" value="true" '.(($plugin_config['MOVEverso'])?'checked="checked"':'').'/>
     41          <label for="front2back_support-move1">'.l10n('yes').'</label>
     42          <input type="radio" id="front2back_support-move2" name="Plugins[front2back_support][MOVEverso]" value="false" '.((!$plugin_config['MOVEverso'])?'checked="checked"':'').'/>
     43          <label for="front2back_support-move2">'.l10n('no').'</label>
     44        </td>
     45      </tr>
     46      <tr>
     47        <td>'.l10n('front2back_support.TAGverso').' :</td>
     48        <td>
     49          <input type="text" name="Plugins[front2back_support][TAGverso]" value="'.$plugin_config['TAGverso'].'" size="10"/>
     50          <i>'.l10n('front2back_support.unactive').'</i>
     51        </td>
     52      </tr>
     53    </table>';
     54    break;
    5555}
    5656?>
  • extensions/PHP_Optimisateur/plugins/watermark/main.php

    r9276 r12819  
    11<?php
    22/***************************************\
    3 |                       PHP OPTIMISATEUR                        |
    4 |                 Plugin Watermark 1.1                  |
     3|            PHP OPTIMISATEUR           |
     4|          Plugin Watermark 1.1         |
    55\***************************************/
    66
     
    88## Dépend des valeurs de $CONF['copyONhd'], $CONF['copyONnormal'] et $CONF['copyPOS']
    99
    10 $WM_waterfile = $CONF['Plugins']['watermark']['waterFILE']; // Fichier à incruster
     10$WM_waterfile = $CONF['Plugins']['watermark']['waterFILE'];   // Fichier à incruster
    1111$WM_wateralpha = $CONF['Plugins']['watermark']['waterALPHA']; // Opacité
    1212
    1313if (file_exists($WM_waterfile)) {
    14         if ($CONF['copyONhd']) {
    15                 $CONF['copyHD'] = '-wmfile "'.$WM_waterfile.'" -wmflag '.$CONF['copyPOS'].' -wmpos 0 0 -wmopacity '.$WM_wateralpha.'';
    16         }
    17        
    18         if ($CONF['copyONnormal']) {
    19                 $CONF['copyNormal'] = '-wmfile "'.$WM_waterfile.'" -wmflag '.$CONF['copyPOS'].' -wmpos 0 0 -wmopacity '.$WM_wateralpha.'';
    20         }
     14  if ($CONF['copyONhd']) {
     15    $CONF['copyHD'] = '-wmfile "'.$WM_waterfile.'" -wmflag '.$CONF['copyPOS'].' -wmpos 0 0 -wmopacity '.$WM_wateralpha.'';
     16  }
     17 
     18  if ($CONF['copyONnormal']) {
     19    $CONF['copyNormal'] = '-wmfile "'.$WM_waterfile.'" -wmflag '.$CONF['copyPOS'].' -wmpos 0 0 -wmopacity '.$WM_wateralpha.'';
     20  }
    2121}
    2222?>
  • extensions/PHP_Optimisateur/plugins/watermark/setup.php

    r10337 r12819  
    33
    44switch ($PLUGIN_ACTION) {
    5         // Affichage simple de la configuration
    6         case 'read_config':
    7                 $PAGE['content'] .= '
    8                 <table>
    9                         <tr>
    10                                 <td>'.l10n('watermark.waterFILE').' :</td>
    11                                 <td>'.$plugin_config['waterFILE'].'</td>
    12                         </tr>
    13                         <tr>
    14                                 <td>'.l10n('watermark.waterALPHA').' :</td>
    15                                 <td>'.$plugin_config['waterALPHA'].' %</td>
    16                         </tr>
    17                 </table>';
    18                 break;
    19                
    20         // Actions avant enregistrement
    21         case 'save_config':
    22                 if (!is_decimal($_POST['Plugins']['watermark']['waterALPHA'])) {
    23                         $_POST['Plugins']['watermark']['waterALPHA'] = 80;
    24                         $ERRORS['conf'][] = array(l10n('watermark.waterALPHA'), 'must_be_integer');
    25                 }
    26                
    27                 break;
    28                
    29         // Formulaire d'édition
    30         case 'edit_config':
    31                 $PAGE['content'] .= '
    32                 <table>
    33                         <tr>
    34                                 <td>'.l10n('watermark.waterFILE').' :</td>
    35                                 <td><input type="text" name="Plugins[watermark][waterFILE]" value="'.$plugin_config['waterFILE'].'" size="10"/></td>
    36                         </tr>
    37                         <tr>
    38                                 <td>'.l10n('watermark.waterALPHA').' :</td>
    39                                 <td><input type="text" name="Plugins[watermark][waterALPHA]" value="'.$plugin_config['waterALPHA'].'" size="3"/>%</td>
    40                         </tr>
    41                 </table>';
    42                 break;
     5  // Affichage simple de la configuration
     6  case 'read_config':
     7    $PAGE['content'] .= '
     8    <table>
     9      <tr>
     10        <td>'.l10n('watermark.waterFILE').' :</td>
     11        <td>'.$plugin_config['waterFILE'].'</td>
     12      </tr>
     13      <tr>
     14        <td>'.l10n('watermark.waterALPHA').' :</td>
     15        <td>'.$plugin_config['waterALPHA'].' %</td>
     16      </tr>
     17    </table>';
     18    break;
     19   
     20  // Actions avant enregistrement
     21  case 'save_config':
     22    if (!is_decimal($_POST['Plugins']['watermark']['waterALPHA'])) {
     23      $_POST['Plugins']['watermark']['waterALPHA'] = 80;
     24      $ERRORS['conf'][] = array(l10n('watermark.waterALPHA'), 'must_be_integer');
     25    }
     26   
     27    break;
     28   
     29  // Formulaire d'édition
     30  case 'edit_config':
     31    $PAGE['content'] .= '
     32    <table>
     33      <tr>
     34        <td>'.l10n('watermark.waterFILE').' :</td>
     35        <td><input type="text" name="Plugins[watermark][waterFILE]" value="'.$plugin_config['waterFILE'].'" size="10"/></td>
     36      </tr>
     37      <tr>
     38        <td>'.l10n('watermark.waterALPHA').' :</td>
     39        <td><input type="text" name="Plugins[watermark][waterALPHA]" value="'.$plugin_config['waterALPHA'].'" size="3"/>%</td>
     40      </tr>
     41    </table>';
     42    break;
    4343}
    4444?>
  • extensions/PHP_Optimisateur/template/css/colorpicker.css

    r9201 r12819  
    11.colorpicker {
    2         width: 286px;
    3         height: 176px;
    4         overflow: hidden;
    5         position: absolute;
    6         background: url(../images/colorpicker_background.png);
    7         font-family: Arial, Helvetica, sans-serif;
    8         display: none;
     2  width: 286px;
     3  height: 176px;
     4  overflow: hidden;
     5  position: absolute;
     6  background: url(../images/colorpicker_background.png);
     7  font-family: Arial, Helvetica, sans-serif;
     8  display: none;
    99}
    1010.colorpicker_color {
    11         width: 150px;
    12         height: 150px;
    13         left: 14px;
    14         top: 13px;
    15         position: absolute;
    16         background: #f00;
    17         overflow: hidden;
    18         cursor: crosshair;
     11  width: 150px;
     12  height: 150px;
     13  left: 14px;
     14  top: 13px;
     15  position: absolute;
     16  background: #f00;
     17  overflow: hidden;
     18  cursor: crosshair;
    1919}
    2020.colorpicker_color div {
    21         position: absolute;
    22         top: 0;
    23         left: 0;
    24         width: 150px;
    25         height: 150px;
    26         background: url(../images/colorpicker_overlay.png);
     21  position: absolute;
     22  top: 0;
     23  left: 0;
     24  width: 150px;
     25  height: 150px;
     26  background: url(../images/colorpicker_overlay.png);
    2727}
    2828.colorpicker_color div div {
    29         position: absolute;
    30         top: 0;
    31         left: 0;
    32         width: 11px;
    33         height: 11px;
    34         overflow: hidden;
    35         background: url(../images/colorpicker_select.gif);
    36         margin: -5px 0 0 -5px;
     29  position: absolute;
     30  top: 0;
     31  left: 0;
     32  width: 11px;
     33  height: 11px;
     34  overflow: hidden;
     35  background: url(../images/colorpicker_select.gif);
     36  margin: -5px 0 0 -5px;
    3737}
    3838.colorpicker_hue {
    39         position: absolute;
    40         top: 13px;
    41         left: 171px;
    42         width: 35px;
    43         height: 150px;
    44         cursor: n-resize;
     39  position: absolute;
     40  top: 13px;
     41  left: 171px;
     42  width: 35px;
     43  height: 150px;
     44  cursor: n-resize;
    4545}
    4646.colorpicker_hue div {
    47         position: absolute;
    48         width: 35px;
    49         height: 9px;
    50         overflow: hidden;
    51         background: url(../images/colorpicker_indic.gif) left top;
    52         margin: -4px 0 0 0;
    53         left: 0px;
     47  position: absolute;
     48  width: 35px;
     49  height: 9px;
     50  overflow: hidden;
     51  background: url(../images/colorpicker_indic.gif) left top;
     52  margin: -4px 0 0 0;
     53  left: 0px;
    5454}
    5555.colorpicker_new_color {
    56         position: absolute;
    57         width: 60px;
    58         height: 30px;
    59         left: 213px;
    60         top: 13px;
    61         background: #f00;
     56  position: absolute;
     57  width: 60px;
     58  height: 30px;
     59  left: 213px;
     60  top: 13px;
     61  background: #f00;
    6262}
    6363.colorpicker_current_color {
    64         display:none;
     64  display:none;
    6565}
    6666.colorpicker input {
    67         background-color: transparent;
    68         border: 1px solid transparent;
    69         position: absolute;
    70         font-size: 10px;
    71         font-family: Arial, Helvetica, sans-serif;
    72         color: #898989;
    73         top: 4px;
    74         right: 11px;
    75         text-align: right;
    76         margin: 0;
    77         padding: 0;
    78         height: 11px;
     67  background-color: transparent;
     68  border: 1px solid transparent;
     69  position: absolute;
     70  font-size: 10px;
     71  font-family: Arial, Helvetica, sans-serif;
     72  color: #898989;
     73  top: 4px;
     74  right: 11px;
     75  text-align: right;
     76  margin: 0;
     77  padding: 0;
     78  height: 11px;
    7979}
    8080/* annulation des styles généraux */
    8181.colorpicker input:hover, .colorpicker input:focus {
    82         border:none;
    83         background:none;
    84         -moz-box-shadow:none;
    85         -webkit-box-shadow:none;
     82  border:none;
     83  background:none;
     84  -moz-box-shadow:none;
     85  -webkit-box-shadow:none;
    8686}
    8787.colorpicker_hex {
    88         display:none;
     88  display:none;
    8989}
    9090.colorpicker_field {
    91         height: 22px;
    92         width: 62px;
    93         background-position: top;
    94         position: absolute;
     91  height: 22px;
     92  width: 62px;
     93  background-position: top;
     94  position: absolute;
    9595}
    9696.colorpicker_field span {
    97         position: absolute;
    98         width: 12px;
    99         height: 22px;
    100         overflow: hidden;
    101         top: 0;
    102         right: 0;
    103         cursor: n-resize;
     97  position: absolute;
     98  width: 12px;
     99  height: 22px;
     100  overflow: hidden;
     101  top: 0;
     102  right: 0;
     103  cursor: n-resize;
    104104}
    105105.colorpicker_rgb_r {
    106         background-image: url(../images/colorpicker_rgb_r.png);
    107         top: 52px;
    108         left: 212px;
     106  background-image: url(../images/colorpicker_rgb_r.png);
     107  top: 52px;
     108  left: 212px;
    109109}
    110110.colorpicker_rgb_g {
    111         background-image: url(../images/colorpicker_rgb_g.png);
    112         top: 82px;
    113         left: 212px;
     111  background-image: url(../images/colorpicker_rgb_g.png);
     112  top: 82px;
     113  left: 212px;
    114114}
    115115.colorpicker_rgb_b {
    116         background-image: url(../images/colorpicker_rgb_b.png);
    117         top: 112px;
    118         left: 212px;
     116  background-image: url(../images/colorpicker_rgb_b.png);
     117  top: 112px;
     118  left: 212px;
    119119}
    120120.colorpicker_hsb_h, .colorpicker_hsb_s, .colorpicker_hsb_b {
    121         display:none;
     121  display:none;
    122122}
    123123.colorpicker_submit {
    124         position: absolute;
    125         width: 22px;
    126         height: 22px;
    127         background: url(../images/colorpicker_submit.png) top;
    128         right: 6px;
    129         bottom: 6px;
    130         overflow: hidden;
     124  position: absolute;
     125  width: 22px;
     126  height: 22px;
     127  background: url(../images/colorpicker_submit.png) top;
     128  right: 6px;
     129  bottom: 6px;
     130  overflow: hidden;
    131131}
    132132.colorpicker_focus {
    133         background-position: center;
     133  background-position: center;
    134134}
    135135.colorpicker_hex.colorpicker_focus {
    136         background-position: bottom;
     136  background-position: bottom;
    137137}
    138138.colorpicker_submit.colorpicker_focus {
    139         background-position: bottom;
     139  background-position: bottom;
    140140}
    141141.colorpicker_slider {
    142         background-position: bottom;
     142  background-position: bottom;
    143143}
  • extensions/PHP_Optimisateur/template/css/jqtransform.css

    r9201 r12819  
    11form.jqtransformdone label{
    2         display:block;
    3         float:left;
     2  display:block;
     3  float:left;
    44}
    55.jqTransformRadioWrapper {
    6         display:block;
    7         float:left;
    8         margin:2px 4px -2px 4px;
     6  display:block;
     7  float:left;
     8  margin:2px 4px -2px 4px;
    99}
    1010.jqTransformRadio {
    11         background:url(../images/radio.png) no-repeat center top;
    12         vertical-align:middle;
    13         height:12px;
    14         width:12px;
    15         display:block;
     11  background:url(../images/radio.png) no-repeat center top;
     12  vertical-align:middle;
     13  height:12px;
     14  width:12px;
     15  display:block;
    1616}
    1717.jqTransformCheckboxWrapper{
    18         display:block;
    19         float:left;
    20         margin:2px 4px -2px 4px;
     18  display:block;
     19  float:left;
     20  margin:2px 4px -2px 4px;
    2121}
    2222.jqTransformCheckbox {
    23         background:url(../images/checkbox.png) no-repeat center top;
    24         vertical-align:middle;
    25         height:12px;
    26         width:12px;
    27         display:block;
     23  background:url(../images/checkbox.png) no-repeat center top;
     24  vertical-align:middle;
     25  height:12px;
     26  width:12px;
     27  display:block;
    2828}
    2929.jqTransformChecked { background-position:center bottom; }
  • extensions/PHP_Optimisateur/template/css/screen.css

    r10337 r12819  
    11* {
    2         margin:0px;
    3         padding:0px;
    4         border:0px;
     2  margin:0px;
     3  padding:0px;
     4  border:0px;
    55}
    66
    77body {
    8         font-size:13px;
    9         font-family:"Calibri",sans-serif;
    10         background:#0a0a0a;
    11         color:#777;
    12         width:990px;
    13         margin:0 auto;
     8  font-size:13px;
     9  font-family:"Calibri",sans-serif;
     10  background:#0a0a0a;
     11  color:#777;
     12  width:990px;
     13  margin:0 auto;
    1414}
    1515
    1616#overlay {
    17         position:fixed;
    18         z-index:9999;
    19         top:0;
    20         left:0;
    21         width:100%;
    22         height:100%;
    23         background:#000;
    24         opacity:0.3;
    25         filter:alpha(opacity=30);
     17  position:fixed;
     18  z-index:9999;
     19  top:0;
     20  left:0;
     21  width:100%;
     22  height:100%;
     23  background:#000;
     24  opacity:0.3;
     25  filter:alpha(opacity=30);
    2626}
    2727
    2828div.generic {
    29         width:450px;
    30         margin:10px;
    31         padding:10px;
    32         border:1px solid #333;
    33         float:left;
    34         -moz-border-radius:3px;
    35         -webkit-border-radius:3px;
    36 }
    37         div.title {
    38                 float:none;
    39                 width:942px;
    40                 text-align:center;
    41                 font-weight:bold;
    42                 font-size:1.5em;
    43                 color:#eee;
    44                 text-shadow:0 0 4px #07f;
    45                 border-color:#07F;
    46                 -moz-box-shadow:0 0 6px #07F, inset 0 0 5px #07F;
    47                 -webkit-box-shadow:0 0 6px #07F, inset 0 0 5px #07F;
    48                 background-color:#222;
    49                 background-image:-moz-linear-gradient(center bottom, #111, #333);
    50                 background-image:-webkit-gradient(linear,center bottom,center top,color-stop(0, #111),color-stop(1, #333));
    51         }
    52         div.footer {
    53                 clear:both;
    54                 width:942px;
    55                 text-align:center;
    56                 border:none;
    57         }
    58         div.files li {
    59                 margin-top:0;
    60         }
    61 
    62         div.finish  {
    63                 background:#030;
    64                 color:#eee;
    65                 text-shadow:0 0 4px #0b0;
    66                 border-color:#0b0;
    67                 -moz-box-shadow:0 0 6px #0b0, inset 0 0 5px #0b0;
    68                 -webkit-box-shadow:0 0 6px #0b0, inset 0 0 5px #0b0;
    69                 font-weight:bold;
    70                 font-size:1.2em;
    71         }
    72 
    73         div.error {
    74                 background:#300;
    75                 color:#eee;
    76                 text-shadow:0 0 4px #B00;
    77                 border-color:#B00;
    78                 -moz-box-shadow:0 0 6px #B00, inset 0 0 5px #B00;
    79                 -webkit-box-shadow:0 0 6px #B00, inset 0 0 5px #B00;
    80                 font-weight:bold;
    81                 font-size:1.2em;
    82         }
    83         div.notice {
    84                 background:#440;
    85                 color:#eee;
    86                 text-shadow:0 0 4px #ff0;
    87                 border-color:#ff0;
    88                 -moz-box-shadow:0 0 6px #ff0, inset 0 0 5px #ff0;
    89                 -webkit-box-shadow:0 0 6px #ff0, inset 0 0 5px #ff0;
    90                 font-weight:bold;
    91                 font-size:1.2em;
    92         }
    93         div.notice.conf {
    94                 font-weight:normal;
    95                 font-size:1em;
    96         }
    97         div.link {
    98                 float:right;
    99                 font-size:1.1em;
    100                 border:none;
    101                 text-align:center;
    102         }
    103        
     29  width:450px;
     30  margin:10px;
     31  padding:10px;
     32  border:1px solid #333;
     33  float:left;
     34  -moz-border-radius:3px;
     35  -webkit-border-radius:3px;
     36  overflow-x:hidden;
     37}
     38  div.title {
     39    float:none;
     40    width:942px;
     41    text-align:center;
     42    font-weight:bold;
     43    font-size:1.5em;
     44    color:#eee;
     45    text-shadow:0 0 4px #07f;
     46    border-color:#07F;
     47    -moz-box-shadow:0 0 6px #07F, inset 0 0 5px #07F;
     48    -webkit-box-shadow:0 0 6px #07F, inset 0 0 5px #07F;
     49    background-color:#222;
     50    background-image:-moz-linear-gradient(center bottom, #111, #333);
     51    background-image:-webkit-gradient(linear,center bottom,center top,color-stop(0, #111),color-stop(1, #333));
     52  }
     53  div.footer {
     54    clear:both;
     55    width:942px;
     56    text-align:center;
     57    border:none;
     58  }
     59  div.files li {
     60    margin-top:0;
     61  }
     62
     63  div.finish  {
     64    background:#030;
     65    color:#eee;
     66    text-shadow:0 0 4px #0b0;
     67    border-color:#0b0;
     68    -moz-box-shadow:0 0 6px #0b0, inset 0 0 5px #0b0;
     69    -webkit-box-shadow:0 0 6px #0b0, inset 0 0 5px #0b0;
     70    font-weight:bold;
     71    font-size:1.2em;
     72  }
     73
     74  div.error {
     75    background:#300;
     76    color:#eee;
     77    text-shadow:0 0 4px #B00;
     78    border-color:#B00;
     79    -moz-box-shadow:0 0 6px #B00, inset 0 0 5px #B00;
     80    -webkit-box-shadow:0 0 6px #B00, inset 0 0 5px #B00;
     81    font-weight:bold;
     82    font-size:1.2em;
     83  }
     84  div.notice {
     85    background:#440;
     86    color:#eee;
     87    text-shadow:0 0 4px #ff0;
     88    border-color:#ff0;
     89    -moz-box-shadow:0 0 6px #ff0, inset 0 0 5px #ff0;
     90    -webkit-box-shadow:0 0 6px #ff0, inset 0 0 5px #ff0;
     91    font-weight:bold;
     92    font-size:1.2em;
     93  }
     94  div.notice.conf {
     95    font-weight:normal;
     96    font-size:1em;
     97  }
     98  div.link {
     99    float:right;
     100    font-size:1.1em;
     101    border:none;
     102    text-align:center;
     103  }
     104 
    104105a {
    105         text-decoration:none;
    106         font-style:italic;
    107         font-family:"Consolas";
    108         color:#e80;
    109         text-shadow:0 0 4px #f70;
    110 }
    111         a:hover {
    112                 color:#07F;
    113                 text-shadow:0 0 4px #07f;
    114         }
    115         .link a {
    116                 margin:0 10px;
    117                 float:right;
    118                 margin-bottom:1px;
    119         }       
     106  text-decoration:none;
     107  font-style:italic;
     108  font-family:"Consolas";
     109  color:#e80;
     110  text-shadow:0 0 4px #f70;
     111}
     112  a:hover {
     113    color:#07F;
     114    text-shadow:0 0 4px #07f;
     115  }
     116  .link a {
     117    margin:0 10px;
     118    float:right;
     119    margin-bottom:1px;
     120  } 
    120121
    121122h2 {
    122         margin-top:-5px;
    123         color:#eee;
    124         text-shadow:0 0 5px #ddd;
     123  margin-top:-5px;
     124  color:#eee;
     125  text-shadow:0 0 5px #ddd;
    125126}
    126127
    127128ul {
    128         margin:0 0 0 20px;
    129 }
    130         li {
    131                 margin-top:5px;
    132         }
    133                 li ul li {
    134                         margin-top:0;
    135                 }
    136                
    137 input[type="submit"], input[type="reset"], input[type="text"], a.input-submit {
    138         color:#666;
    139         border:1px solid #555;
    140         -moz-border-radius:3px;
    141         -webkit-border-radius:3px;
    142         background:#111;
    143         font-family:"Calibri",sans-serif;
    144 }
    145         input[type="submit"]:hover, input[type="reset"]:hover, input[type="text"]:hover, a.input-submit:hover {
    146                 border-color:#07f;
    147                 -moz-box-shadow:0 0 3px #07f;
    148                 -webkit-box-shadow:0 0 3px #07f;
    149         }
    150         input[type="submit"]:focus, input[type="reset"]:focus, input[type="text"]:focus {
    151                 color:#999;
    152                 background:#222;
    153                 border-color:#f70;
    154                 -moz-box-shadow:0 0 3px #F70;
    155                 -webkit-box-shadow:0 0 3px #F70;
    156         }
    157         input[type="submit"], input[type="reset"], a.input-submit  {
    158                 margin:-5px 10px 0 10px;
    159                 padding:3px 8px 3px 6px;
    160                 color:#777;
    161                 font-size:1.1em;
    162                 font-style:italic;
    163                 -moz-border-radius:20px;
    164                 -webkit-border-radius:20px;
    165                 background-image:-moz-linear-gradient(center bottom, #111, #333);
    166                 background-image:-webkit-gradient(linear,center bottom,center top,color-stop(0, #111),color-stop(1, #333));
    167         }
    168         input[type="submit"]:hover, input[type="reset"]:hover, a.input-submit:hover {
    169                 color:#07f;
    170                 text-shadow:0 0 3px #07f;
    171                 background-image:-moz-linear-gradient(center top, #111, #222);
    172                 background-image:-webkit-gradient(linear,center top,center bottom,color-stop(0, #111),color-stop(1, #222));
    173         }
    174        
     129  margin:0 0 0 20px;
     130}
     131  li {
     132    margin-top:5px;
     133  }
     134    li ul li {
     135      margin-top:0;
     136    }
     137   
     138input[type="submit"], input[type="reset"], input[type="text"], a.input-submit, textarea {
     139  color:#666;
     140  border:1px solid #555;
     141  -moz-border-radius:3px;
     142  -webkit-border-radius:3px;
     143  background:#111;
     144  font-family:"Calibri",sans-serif;
     145  font-size:12px;
     146  line-height:1em;
     147}
     148  input[type="submit"]:hover, input[type="reset"]:hover, input[type="text"]:hover, a.input-submit:hover, textarea:hover {
     149    border-color:#07f;
     150    -moz-box-shadow:0 0 3px #07f;
     151    -webkit-box-shadow:0 0 3px #07f;
     152  }
     153  input[type="submit"]:focus, input[type="reset"]:focus, input[type="text"]:focus, textarea:focus {
     154    color:#999;
     155    background:#222;
     156    border-color:#f70;
     157    -moz-box-shadow:0 0 3px #F70;
     158    -webkit-box-shadow:0 0 3px #F70;
     159  }
     160  input[type="submit"], input[type="reset"], a.input-submit  {
     161    margin:-5px 10px 0 10px;
     162    padding:3px 8px 3px 6px;
     163    color:#777;
     164    font-size:1.1em;
     165    font-style:italic;
     166    -moz-border-radius:20px;
     167    -webkit-border-radius:20px;
     168    background-image:-moz-linear-gradient(center bottom, #111, #333);
     169    background-image:-webkit-gradient(linear,center bottom,center top,color-stop(0, #111),color-stop(1, #333));
     170  }
     171  input[type="submit"]:hover, input[type="reset"]:hover, a.input-submit:hover {
     172    color:#07f;
     173    text-shadow:0 0 3px #07f;
     174    background-image:-moz-linear-gradient(center top, #111, #222);
     175    background-image:-webkit-gradient(linear,center top,center bottom,color-stop(0, #111),color-stop(1, #222));
     176  }
     177 
    175178a.input-submit {
    176         float:none;
    177         display:inline-block;
    178         margin-top:1px;
    179         padding:3px 10px 5px 10px;
    180         text-shadow:none;
     179  float:none;
     180  display:inline-block;
     181  margin-top:1px;
     182  padding:3px 10px 5px 10px;
     183  text-shadow:none;
    181184}
    182185
    183186
    184187b.new {
    185         color:#0b0;
    186         font-style:italic;
     188  color:#0b0;
     189  font-style:italic;
    187190}
    188191b.miss {
    189         color:#B00;
    190         font-style:italic;
     192  color:#B00;
     193  font-style:italic;
    191194}
    192195
    193196span.title {
    194         font-weight:bold;
    195         text-decoration:underline;
    196         font-size:1.1em;
    197         color:#eee;
    198         text-shadow:0 0 3px #ddd;
     197  font-weight:bold;
     198  text-decoration:underline;
     199  font-size:1.1em;
     200  color:#eee;
     201  text-shadow:0 0 3px #ddd;
    199202}
    200203
    201204table {
    202         min-width:50%;
    203 }
    204         tr td:first-child {
    205                 text-align:right;
    206                 padding-right:5px;
    207                 font-weight:bold;
    208         }
    209         tr td.legend {
    210                 font-weight:normal;
    211                 text-align:left;
    212         }
    213                
     205  min-width:50%;
     206}
     207  tr td:first-child {
     208    text-align:right;
     209    padding-right:5px;
     210    font-weight:bold;
     211    min-width:100px;
     212  }
     213  tr td.legend {
     214    font-weight:normal;
     215    text-align:left;
     216  }
     217   
    214218#loader {
    215         float:right;
    216         margin:-8px 0 -10px 0;
     219  float:right;
     220  margin:-8px 0 -10px 0;
    217221}
    218222
    219223.plugin-title .plugin-active {
    220         float:right;
     224  float:right;
    221225}
    222226
    223227.color-display {
    224         width:30px;
    225         height:15px;
    226         margin:-10px 0;
    227         display:inline-block;
    228         vertical-align:middle;
    229         border:1px solid #888;
    230         -moz-border-radius:3px;
    231         -webkit-border-radius:3px;
    232         -moz-box-shadow: 0 0 2px #888, inset 0 0 2px #888;
    233         -webkit-box-shadow: 0 0 2px #888, inset 0 0 2px #888;
     228  width:30px;
     229  height:15px;
     230  margin:-10px 0;
     231  display:inline-block;
     232  vertical-align:middle;
     233  border:1px solid #888;
     234  -moz-border-radius:3px;
     235  -webkit-border-radius:3px;
     236  -moz-box-shadow: 0 0 2px #888, inset 0 0 2px #888;
     237  -webkit-box-shadow: 0 0 2px #888, inset 0 0 2px #888;
    234238}
    235239
    236240#languageSwitchLink {
    237         float:right;
    238         width:100px;
    239         padding:0 5px;
    240         text-align:left;
     241  float:right;
     242  width:100px;
     243  padding:0 5px;
     244  text-align:left;
    241245}
    242246
    243247#languageSwitchBox {
    244         position:absolute;
    245         top:5px;
    246         right:50%;
    247         margin-right:-470px;
    248         width:100px;
    249         z-index:99;
    250         padding:5px;
    251         background:#0a0a0a;
    252         -moz-box-shadow:0 0 5px #000;
    253         -webkit-box-shadow:0 0 5px #000;
    254         text-align:left;
    255         opacity:0.8;
    256         filter:alpha(opacity=80);
     248  position:absolute;
     249  top:5px;
     250  right:50%;
     251  margin-right:-470px;
     252  width:100px;
     253  z-index:99;
     254  padding:5px;
     255  background:#0a0a0a;
     256  -moz-box-shadow:0 0 5px #000;
     257  -webkit-box-shadow:0 0 5px #000;
     258  text-align:left;
     259  opacity:0.8;
     260  filter:alpha(opacity=80);
    257261}
    258262
    259263#languageSwitchBox *, #languageSwitchLink * {
    260         font-size:13px;
    261         text-shadow:none;
    262         font-weight:normal;
    263         color:#eee;
     264  font-size:13px;
     265  text-shadow:none;
     266  font-weight:normal;
     267  color:#eee;
    264268}
    265269
    266270#languageSwitchBox ul, #languageSwitchLink ul {
    267         list-style:none;
    268         margin:0 5px 0 5px;
    269 }
     271  list-style:none;
     272  margin:0 5px 0 5px;
     273}
Note: See TracChangeset for help on using the changeset viewer.