Changeset 8195


Ignore:
Timestamp:
Dec 19, 2010, 11:31:52 AM (13 years ago)
Author:
mistic100
Message:
  • Nouveau plugin : CreateCustomThumbs permet de créer des miniatures de taille fixe
  • On peut maintenant désinstaller un plugin facilement
  • Ajout d’une option pour gérer le dossier de sortie non vide (effacer, continuer, bloquer)
Location:
extensions/PHP_Optimisateur
Files:
4 added
1 deleted
13 edited

Legend:

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

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
     
    2424                                <span class="title">'.l10n('Options').'</span>
    2525                                <table>
     26                                        <tr>
     27                                                <td><b>'.l10n('silentORNOT').' :</b></td>
     28                                                <td>'.l10n($silentORNOT).'</td>
     29                                        </tr>
     30
    2631                                        <tr>
    2732                                                <td><b>'.l10n('DIRhighORNOT').' :</b></td>
     
    111116                                        </tr>
    112117                                </table>
    113                         </li>
    114                         <li>
    115                                 <span class="title">'.l10n('PluginsBefore').'</span>
    116                                 <ul>';
    117                                         foreach ($PluginsBefore as $name => $config) {
    118                                                 echo '<li>
    119                                                         <b>'.$name.' :</b>
    120                                                         <table>';
    121                                                                 foreach ($config as $key => $value) {
    122                                                                         echo '<tr>
    123                                                                                 <td>'.$key.' :</td>
    124                                                                                 <td>'.bool_to_string($value).'</td>
    125                                                                         </tr>';
    126                                                                 }
    127                                                         echo '</table>
    128                                                 </li>';
    129                                         }
    130                                 echo '</ul>
    131                         </li>
    132                         <li>
    133                                 <span class="title">'.l10n('PluginsProcess').'</span>
    134                                 <ul>';
    135                                         foreach ($PluginsProcess as $name => $config) {
    136                                                 echo '<li>
    137                                                         <b>'.$name.' :</b>
    138                                                         <table>';
    139                                                                 foreach ($config as $key => $value) {
    140                                                                         echo '<tr>
    141                                                                                 <td>'.$key.' :</td>
    142                                                                                 <td>'.bool_to_string($value).'</td>
    143                                                                         </tr>';
    144                                                                 }
    145                                                         echo '</table>
    146                                                 </li>';
    147                                         }
    148                                 echo '</ul>
    149                         </li>
    150                         <li>
    151                                 <span class="title">'.l10n('PluginsAfter').'</span>
    152                                 <ul>';
    153                                         foreach ($PluginsAfter as $name => $config) {
    154                                                 echo '<li>
    155                                                         <b>'.$name.' :</b>
    156                                                         <table>';
    157                                                                 foreach ($config as $key => $value) {
    158                                                                         echo '<tr>
    159                                                                                 <td>'.$key.' :</td>
    160                                                                                 <td>'.bool_to_string($value).'</td>
    161                                                                         </tr>';
    162                                                                 }
    163                                                         echo '</table>
    164                                                 </li>';
    165                                         }
    166                                 echo '</ul>
    167                         </li>
    168                 </ul>
     118                        </li>';
     119                       
     120                        // Affichage des plugins, un bloc par mode
     121                        foreach (array('PluginsBefore','PluginsProcess','PluginsAfter') as $mode) {
     122                                echo '<li>
     123                                        <span class="title">'.l10n($mode).'</span>
     124                                        <ul>';
     125                                                // Un bloc par plugin
     126                                                foreach (${$mode} as $name => $config) {
     127                                                        echo '<li>';
     128                                                                echo '<b>'.$name.' :</b>
     129                                                                <table>';
     130                                                                        foreach ($config as $key => $value) {
     131                                                                                echo '<tr>
     132                                                                                        <td>'.$key.' :</td>
     133                                                                                        <td>'.bool_to_string($value).'</td>
     134                                                                                </tr>';
     135                                                                        }
     136                                                                echo '</table>
     137                                                        </li>';
     138                                                }
     139                                        echo '</ul>
     140                                </li>';
     141                        }
     142                       
     143                echo '</ul>
    169144        </div>';
    170145?>
  • extensions/PHP_Optimisateur/files/functions.php

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
  • extensions/PHP_Optimisateur/files/header.php

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
    77session_start();
    8 $APPversion = '1.1';
     8$APPversion = '1.2';
    99$user_lang = GetLanguage();
    1010include('language/'.$user_lang['Lang'].'/'.$user_lang['Lang'].'.php');
     
    2121<body>
    2222<div class="title">
    23         PHP Optimisateur '.$APPversion;
     23        PHP Optimisateur '.$APPversion.'
    2424       
     25        <span class="lang">';
    2526        foreach ($user_lang['languages'] as $key) {
    26                 echo '<a class="lang" href="index.php?Lang='.$key.'"><img src="language/'.$key.'/'.$key.'.png"/></a>';
     27                echo '<a class="lang" href="index.php?Lang='.$key.'" title="'.$key.'"><img src="language/'.$key.'/'.$key.'.png"/></a>';
    2728        }
     29        echo '</span>
    2830       
    29 echo '</div>';
     31</div>';
    3032?>
  • extensions/PHP_Optimisateur/files/style.css

    r7993 r8195  
    3131                border-color:#eee;
    3232        }
     33        div.footer {
     34                clear:both;
     35                width:942px;
     36                text-align:center;
     37                font-size:0.9em;
     38                border:none;
     39        }
    3340        div.files li {
    3441                margin-top:0;
     
    4653                font-size:1.2em;
    4754        }
    48 
     55        div.link {
     56                border:none;
     57        }
     58       
    4959a {
    50         color:#EF9700;
     60        color:#EF8100;
    5161        text-decoration:none;
    52         padding:0 10px;
    53         float:right;
    54         margin-bottom:1px;
     62        font-size:1.2em;
     63        font-style:italic;
    5564}
    5665        a:hover {
     
    5867                border-bottom:1px dotted #555;
    5968                margin-bottom:0;
     69        }
     70        div.link a {
     71                margin:0 10px;
     72                float:right;
     73                margin-bottom:1px;
     74        }
     75        span.lang a {
     76                margin:-4px 10px;
     77                float:right;
    6078        }
    6179
     
    8098        -moz-border-radius:3px;
    8199}
     100        input[type="submit"], input[type="reset"] {
     101                padding:2px 5px;
     102        }
    82103
    83 b.new:after {
    84         content:' New !';
     104b.new {
    85105        color:#0ABF00;
     106        font-style:italic;
     107}
     108b.miss {
     109        color:#BF0008;
    86110        font-style:italic;
    87111}
     
    93117}
    94118
    95 td {
    96         width:50%;
     119table {
     120        min-width:50%;
    97121}
    98         tr td:first-child {
    99                 text-align:right;
    100                 padding-right:5px;
     122        td {
     123                width:50%;
    101124        }
     125                tr td:first-child {
     126                        text-align:right;
     127                        padding-right:5px;
     128                }
  • extensions/PHP_Optimisateur/index.php

    r7994 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
     
    2323
    2424        // Afficher la configuration
    25         if (!$silentORNOT) {
    26                 include('files/display_config.php');
    27         }
     25        include('files/display_config.php');
    2826
    2927        // Dossiers
     
    3735                $Errors['ErrorFolderIn'] = true;
    3836        }
    39         if ($silentORNOT) {
    40                 rrmdir($DIRsortie); // Si mode silencieux
    41                 mkdir($DIRsortie); // vidage automatique du dossier de sortie
    42         } else if (!is_dir_empty($DIRsortie)) {
     37        if (!is_dir_empty($DIRsortie) AND $silentORNOT == 'block') {
    4338                $Errors['ErrorFolderOut'] = true;
    4439        }
     40        if (!file_exists('files\nconvert.exe')) {
     41                $Errors['ErrorNconvert'] = true;
     42        }
    4543}
     44
    4645
    4746
    4847### ERREURS ###
    4948if (isset($Errors)) {
    50         $i=0;
    5149        foreach ($Errors as $key => $null) {
    52                 // Dégueulasse les ternaires à la suite ! mais j'aime ça
    53                 echo '<div class="error">'.l10n($key).' '.(($i==0)?'<a href="index.php">'.l10n('Back').'</a> '.(($key!='ErrorFile')?'<a href="setup.php">'.l10n('Config').'</a></div>':'</div>'):'</div>');
    54                 $i++;
    55         }
     50                echo '<div class="error">'.l10n($key).'</div>';
     51        }
     52        echo '<div class="link"><a href="index.php">&raquo; '.l10n('Back').'</a> <a href="setup.php">&raquo; '.l10n('Config').'</a></div>';
    5653}
    5754
     
    6057### EXECUTION ###
    6158if (isset($_GET['Process']) AND !isset($Errors)) {
    62 
     59        // Si mode silencieux vidage automatique du dossier de sortie
     60        if ($silentORNOT == 'erase') {
     61                rrmdir($DIRsortie);
     62                mkdir($DIRsortie);
     63        }
     64
     65       
    6366        ### Supprimer les caractères spéciaux - dossiers & fichiers ###
    6467        // Les caractères '%' et '$' sont systématiquement échappés, ca génère des bugs dans les noms de fichiers
     
    8487
    8588
    86         ### Copyright ###
     89        ### Copyright & Options générales des conversion ###
    8790        $copyright = utf8_decode($copyright);
    8891       
     
    98101                $copyNormal = null;
    99102        }
     103       
     104        $convOptions = '-ratio -rtype lanczos -rflag decr';
    100105
    101106
     
    109114
    110115        ### Processus principal ###
    111 
    112116        // Tableau avec les fichiers source
    113117        $FilesSource = array();
    114118        recursive_readdir($DIRsource, 'FilesSource');
     119       
    115120        // Tableau avec les fichiers de sortie
    116121        $FilesSortie = str_replace($DIRsource, $DIRsortie, $FilesSource);
    117122
     123        // Boucle sur tous les fichiers
    118124        for ($i=0; $i<count($FilesSource); $i++) {
    119125                // Découpe le nom de fichier : dossier/fichier
    120126                preg_match('#(.*)/(.*)$#', $FilesSortie[$i], $matches);
    121                 # matches[1] = dossier sortie
    122                 # matches[2] = fichier.ext
     127                $FileFolder = $matches[1];
     128                $FileName = $matches[2];
    123129                       
    124130                // Crée les sous-dossiers de sortie & 'pwg_high' & 'thumbnail'
    125                 if (!file_exists($matches[1].'/pwg_high') AND $DIRhighORNOT) {
    126                         mkdir($matches[1].'/pwg_high', 0777, true);
    127                 }
    128                 if (!file_exists($matches[1].'/thumbnail')) {
    129                         mkdir($matches[1].'/thumbnail', 0777, true);
     131                if (!file_exists($FileFolder.'/pwg_high') AND $DIRhighORNOT) {
     132                        mkdir($FileFolder.'/pwg_high', 0777, true);
     133                }
     134                if (!file_exists($FileFolder.'/thumbnail')) {
     135                        mkdir($FileFolder.'/thumbnail', 0777, true);
     136                }
     137               
     138                // Informations sur le fichier
     139                exec('files\nconvert.exe -info "'.$FilesSource[$i].'"', $FileInfos);
     140                for ($m=0; $m<=5; $m++) {
     141                        unset($FileInfos[$m]);
     142                }
     143                foreach ($FileInfos as $key) {
     144                        $a = explode(':', $key);
     145                        $FileInfos[trim($a[0])] = trim($a[1]);
    130146                }
    131147                       
     
    139155                // Compresse les fichiers dans le dossier de sortie
    140156                if (!isset($BlockNormal)) {
    141                         exec('nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$matches[1].'/'.$matches[2].'" -dpi 72 -ratio -rtype lanczos -resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"');
     157                        exec('files\nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$FileFolder.'/'.$FileName.'" -dpi 72 '.$convOptions.' -resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"');
    142158                }
    143159                if (!isset($BlockThumbnail)) {
    144                         exec('nconvert.exe -q '.$Qthumbnail.' -out jpeg -o "'.$matches[1].'/thumbnail/'.$prefixe_mini.$matches[2].'" -dpi 72 -ratio -rtype lanczos -rflag decr -resize '.$DIMthumbnail.' '.$DIMthumbnail.' -rmeta -rexifthumb   "'.$FilesSource[$i].'"');
    145                 }
    146                 if ($DIRhighORNOT AND !isset($BlockHigh)) {
     160                        exec('files\nconvert.exe -q '.$Qthumbnail.' -out jpeg -o "'.$FileFolder.'/thumbnail/'.$prefixe_mini.$FileName.'" -dpi 72 '.$convOptions.'-resize '.$DIMthumbnail.' '.$DIMthumbnail.' -rmeta -rexifthumb         "'.$FilesSource[$i].'"');
     161                }
     162                if (!isset($BlockHigh) AND $DIRhighORNOT) {
    147163                        if ($DIMhdORNOT) {
    148                                 exec('nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$matches[1].'/pwg_high/'.$matches[2].'" -dpi '.$DPI.' -ratio -rtype lanczos -rflag decr -resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"');
     164                                exec('files\nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$FileFolder.'/pwg_high/'.$FileName.'" -dpi '.$DPI.' '.$convOptions.' -resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"');
    149165                        } else {
    150                                 copy($FilesSource[$i], $matches[1].'/pwg_high/'.$matches[2]);
     166                                copy($FilesSource[$i], $FileFolder.'/pwg_high/'.$FileName);
    151167                        }
    152168                }
    153169               
    154170                // Réinitialise les bloqueurs
     171                unset($FileInfos);
    155172                unset($BlockNormal);
    156173                unset($BlockThumbnail);
    157174                unset($BlockHigh);
    158 
    159         }
    160 
    161         if (!$silentORNOT) {
    162                 echo '<div class="files">
    163                         <h2>'.l10n('Source files').'</h2>
    164                         <ul>';
    165                                 foreach ($FilesSource as $value) {
    166                                         echo '<li>'.$value.'</li>';
    167                                 }
    168                         echo '</ul>
    169                         <i>'.l10n('%d files', count($FilesSource)).'</i>
    170                 </div>';
    171         }
     175        }
     176
     177       
     178        ### Affichage des fichiers traités ###
     179        echo '<div class="files">
     180                <h2>'.l10n('Source files').'</h2>
     181                <ul>';
     182                        foreach ($FilesSource as $value) {
     183                                echo '<li>'.$value.'</li>';
     184                        }
     185                echo '</ul>
     186                <i>'.l10n('%d files', count($FilesSource)).'</i>
     187        </div>';
    172188
    173189        unset($FilesSource);
     
    176192
    177193        ### Supprime les dossiers vides et copie les fichiers index.php ###
    178         // Tableau avec les dossiers de sortie
    179194        $DirsSortie = array();
    180195        recursive_readdir($DIRsortie, 'DirsSortie', true);
     
    199214
    200215
    201         echo '<div class="finish">'.l10n('Finish %d seconds', intval((microtime(true)-$TIME_START))).' <a href="index.php">'.l10n('Back').'</a> <a href="setup.php">'.l10n('Config').'</a></div>';
    202 
    203        
    204        
     216        ### Message final ###
     217        echo '<div class="finish">'.l10n('Finish %d seconds', intval((microtime(true)-$TIME_START))).'</div>
     218        <div class="link"><a href="index.php">&raquo; '.l10n('Back').'</a> <a href="setup.php">&raquo; '.l10n('Config').'</a></div>';
     219
     220       
     221       
     222### READY ###
    205223} else if (!isset($Errors)) {
    206         echo '<div class="finish">'.l10n('Ready').' <a href="index.php?Process=true">'.l10n('Launch').'</a> <a href="setup.php">'.l10n('Config').'</a></div>';
     224        echo '<div class="finish">'.l10n('Ready').' <span id="loader" style="display:none;float:right;margin:-8px 0 -10px 0;"><img src="files/loader.gif" /></span></div>
     225        <div class="link"><a href="index.php?Process=true" onClick="document.getElementById(\'loader\').style.display=\'block\';">&raquo; '.l10n('Launch').'</a> <a href="setup.php">&raquo; '.l10n('Config').'</a></div>';
    207226}
    208227
    209 echo '</body>
     228
     229
     230### FIN ###
     231echo '<div class="footer">
     232        2010 - <a href="http://www.strangeplanet.fr">Damien Sorel</a> - <a href="http://fr.piwigo.org/forum/viewtopic.php?id=19117">Forum</a>
     233</div>
     234
     235</body>
    210236</html>';
    211237?>
  • extensions/PHP_Optimisateur/language/en/en.php

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
    77$Lang['ErrorFile'] = "Fatal error : Configuration file missing.";
    88$Lang['ErrorFolderIn'] = "Fatal error : Source folder empty.";
    9 $Lang['ErrorFolderOut'] = "Fatal error : Exite folder not empty.";
     9$Lang['ErrorFolderOut'] = "Fatal error : Exit folder not empty.";
     10$Lang['ErrorNconvert'] = "The program nconvert.exe is unavailable.";
    1011$Lang['Source files'] = "Files";
    1112$Lang['%d files'] = "%d files";
     
    2021$Lang['FolderOut'] = "Exit folder";
    2122$Lang['Options'] = "Options";
    22 $Lang['silentORNOT'] = "Silent mode";
     23$Lang['silentORNOT'] = "If exit folder not empty";
    2324$Lang['DIRhighORNOT'] = "Create high-definition folders";
    2425$Lang['DIMhdORNOT'] = "Resize HD pictures";
     
    5556$Lang['left'] = "left";
    5657$Lang['right'] = "right";
    57 $Lang[''] = "";
     58$Lang['erase'] = "Erase";
     59$Lang['pass'] = "Continue";
     60$Lang['block'] = "Block";
     61$Lang['New !'] = " New !";
     62$Lang['Missing !'] = " Missing !";
     63$Lang['Reset'] = "Reset";
     64$Lang['Valid'] = "Valid";
    5865?>
  • extensions/PHP_Optimisateur/language/fr/fr.php

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
     
    88$Lang['ErrorFolderIn'] = "Erreur fatale : Dossier source vide.";
    99$Lang['ErrorFolderOut'] = "Erreur fatale : Dossier de sortie non vide.";
     10$Lang['ErrorNconvert'] = "Le programme nconvert.exe est introuvable.";
    1011$Lang['Source files'] = "Fichiers";
    1112$Lang['%d files'] = "%d fichiers";
     
    2021$Lang['FolderOut'] = "Répertoire de sortie";
    2122$Lang['Options'] = "Options";
    22 $Lang['silentORNOT'] = "Mode silencieux";
     23$Lang['silentORNOT'] = "Si dossier de sortie non vide";
    2324$Lang['DIRhighORNOT'] = "Créer le dossier haute définition";
    2425$Lang['DIMhdORNOT'] = "Redimensionner les images HD";
     
    5556$Lang['left'] = "gauche";
    5657$Lang['right'] = "droite";
    57 $Lang[''] = "";
     58$Lang['erase'] = "Effacer";
     59$Lang['pass'] = "Continuer";
     60$Lang['block'] = "Bloquer";
     61$Lang['New !'] = " Nouveau !";
     62$Lang['Missing !'] = " Manquant !";
     63$Lang['Reset'] = "Réinitialiser";
     64$Lang['Valid'] = "Valider";
    5865?>
  • extensions/PHP_Optimisateur/plugins/convert_pan.php

    r7991 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                       Plugin ConvertPan                       |
     4|                 Plugin ConvertPan 1.1                 |
    55\***************************************/
    66
     
    1212$DIMthumbnailV = $DIMthumbnail/$PluginsProcess['convert_pan']['RatioPanThumb']; // Taille verticale des miniatures
    1313
    14 if (strpos($matches[2], $NAMEpanorama) !== false) {
    15         exec('nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$matches[1].'/'.$matches[2].'" -dpi 72 -ratio -rtype lanczos -resize 0 '.$DIMpanorama.' '.$copyNormal.' "'.$FilesSource[$i].'"');
    16         exec('nconvert.exe -q '.$Qthumbnail.' -out jpeg -o "'.$matches[1].'/thumbnail/'.$prefixe_mini.$matches[2].'" -dpi 72 -ratio -rtype lanczos -rflag decr -resize 0 '.$DIMthumbnailV.' -crop 0 0 '.$DIMthumbnail.' '.$DIMthumbnailV.' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     14if (strpos($FileName, $NAMEpanorama) !== false) {
    1715
    18         $BlockNormal = true;
    19         $BlockThumbnail = true;
     16        // on prend la miniature au milieu du panorama
     17        $tmp_x = $FileInfos['Width'] * $DIMthumbnailV / $FileInfos['Height'];
     18        $offset_x = ($tmp_x - $DIMthumbnail) / 2;
     19
     20        if (!isset($BlockNormal)) {
     21                exec('files\nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$FileFolder.'/'.$FileName.'" -dpi 72 '.$convOptions.' -resize 0 '.$DIMpanorama.' '.$copyNormal.' "'.$FilesSource[$i].'"');
     22                $BlockNormal = true;
     23        }
     24       
     25        if (!isset($BlockThumbnail)) {
     26                exec('files\nconvert.exe -q '.$Qthumbnail.' -out jpeg -o "'.$FileFolder.'/thumbnail/'.$prefixe_mini.$FileName.'" -dpi 72 '.$convOptions.' -resize 0 '.$DIMthumbnailV.' -crop '.$offset_x.' 0 '.$DIMthumbnail.' '.$DIMthumbnailV.' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     27                $BlockThumbnail = true;
     28        }
    2029}
    2130?>
  • extensions/PHP_Optimisateur/plugins/create_folders_alpha.php

    r7994 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |               Plugin CretaFoldersAlpha                |
     4|         Plugin CreateFoldersAlpha 1.0         |
    55\***************************************/
    66
  • extensions/PHP_Optimisateur/plugins/front2back_support.php

    r7991 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |               Plugin Front2Back Support               |
     4|         Plugin Front2Back Support 1.1         |
    55\***************************************/
    66
     
    1212$MOVEverso = $PluginsProcess['front2back_support']['MOVEverso']; // Déplacer les images originales dans un sous dosssier 'verso'
    1313
    14 if (strpos($matches[2], $NAMEverso) !== false) {
    15         $matches[3] = str_replace($NAMEverso, '', $matches[2]);
    16         # matches[3] = fichier sans verso
     14if (strpos($FileName, $NAMEverso) !== false) {
     15        $FileNameClean = str_replace($NAMEverso, '', $FileName);
    1716       
    1817        // Image normale
    19         if (!file_exists($matches[1].'/thumbnail/verso')) {
    20                 mkdir($matches[1].'/thumbnail/verso');
     18        if (!file_exists($FileFolder.'/thumbnail/verso')) {
     19                mkdir($FileFolder.'/thumbnail/verso');
    2120        }
    22         exec('nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$matches[1].'/thumbnail/verso/'.$matches[3].'" -dpi 72 -ratio -rtype lanczos -resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"');
     21        exec('files\nconvert.exe -q '.$Qnormal.' -out jpeg -o "'.$FileFolder.'/thumbnail/verso/'.$FileNameClean.'" -dpi 72 '.$convOptions.' -resize '.$DIMnormal.' '.$DIMnormal.' '.$copyNormal.' "'.$FilesSource[$i].'"');
    2322       
    2423        // Image hd
    2524        if ($DIRhighORNOT) {
    26                 if (!file_exists($matches[1].'/pwg_high/verso')) {
    27                         mkdir($matches[1].'/pwg_high/verso');
     25                if (!file_exists($FileFolder.'/pwg_high/verso')) {
     26                        mkdir($FileFolder.'/pwg_high/verso');
    2827                }
    2928                if ($DIMhdORNOT) {
    30                         exec('nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$matches[1].'/pwg_high/verso/'.$matches[3].'" -dpi '.$DPI.' -ratio -rtype lanczos -rflag decr -resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"');
     29                        exec('files\nconvert.exe -q '.$Qhd.' -out jpeg -o "'.$FileFolder.'/pwg_high/verso/'.$FileNameClean.'" -dpi '.$DPI.' '.$convOptions.' -resize '.$DIMhd.' '.$DIMhd.' '.$copyHD.' "'.$FilesSource[$i].'"');
    3130                } else {
    32                         copy($FilesSource[$i], $matches[1].'/pwg_high/verso/'.$matches[3]);
     31                        copy($FilesSource[$i], $FileFolder.'/pwg_high/verso/'.$FileNameClean);
    3332                }
    3433        }
     
    3635        // Déplacement de l'image originale
    3736        if ($MOVEverso) {
    38                 $matches[4] = str_replace(substr($DIRsortie,0,-1), substr($DIRsource,0,-1), $matches[1]);
    39                 # matches[4] = dossier source
    40                 if (!file_exists($matches[4].'/verso')) {
    41                         mkdir($matches[4].'/verso', 0777, true);
     37                $FileFolderSource = str_replace(substr($DIRsortie,0,-1), substr($DIRsource,0,-1), $FileFolder);
     38                if (!file_exists($FileFolderSource.'/verso')) {
     39                        mkdir($FileFolderSource.'/verso', 0777, true);
    4240                }
    43                 rename($matches[4].'/'.$matches[2], $matches[4].'/verso/'.$matches[3]);
     41                rename($FileFolderSource.'/'.$FileName, $FileFolderSource.'/verso/'.$FileNameClean);
    4442        }
    4543       
  • extensions/PHP_Optimisateur/plugins/watermark.php

    r7991 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                       Plugin Watermark                        |
     4|                 Plugin Watermark 1.1                  |
    55\***************************************/
    66
  • extensions/PHP_Optimisateur/setup.php

    r7993 r8195  
    22/***************************************\
    33|                       PHP OPTIMISATEUR                        |
    4 |                          Version 1.1                          |
     4|                          Version 1.2                          |
    55\***************************************/
    66
    77include('files/functions.php');
    88
    9 ### Création de nouveau fichier de configuration ###
     9
     10### NOUVELLE CONFIGURATION ###
    1011if (isset($_POST['DIRsource'])) {
    11         // Quelques traitements avant d'enregistrer
     12        // Quelques traitements
    1213        $_POST['copyCOLOR'] = implode(' ', $_POST['copyCOLOR']);
    1314        $_POST['copyPOS'] = implode('-', $_POST['copyPOS']);
    14         if(!isset($_POST['PluginsBefore'])) $_POST['PluginsBefore'] = null;
    15         if(!isset($_POST['PluginsProcess'])) $_POST['PluginsProcess'] = null;
    16         if(!isset($_POST['PluginsAfter'])) $_POST['PluginsAfter'] = null;
     15       
     16        // Plugins : ensembles existants même si vides & supprime les plugins manquants
     17        foreach (array('PluginsBefore','PluginsProcess','PluginsAfter') as $mode) {
     18                if (!isset($_POST[$mode])) {
     19                        $_POST[$mode] = null;
     20                } else {
     21                        foreach ($_POST[$mode] as $name => $config) {
     22                                if (isset($config['delete'])) unset($_POST[$mode][$name]);
     23                        }
     24                }
     25        }
     26       
     27        // Ajoute les / en fin d'URI
    1728        if (!preg_match('#(.*)/$#', $_POST['DIRsource'])) $_POST['DIRsource'] .= '/';
    1829        if (!preg_match('#(.*)/$#', $_POST['DIRsortie'])) $_POST['DIRsortie'] .= '/';
     
    3041include('files/header.php');
    3142
    32 // Fichier de configuration
     43
     44### CONFIGURATION ###
    3345if (!file_exists('config.xml')) {
    3446        $Errors['ErrorFile'] = true;
     47} else {
     48        extract(load_config());
    3549}
    3650
     
    3953### ERREURS ###
    4054if (isset($Errors)) {
    41         $i=0;
    4255        foreach ($Errors as $key => $null) {
    43                 // Dégueulasse les ternaires à la suite ! mais j'aime ça
    44                 echo '<div class="error">'.l10n($key).' '.(($i==0)?'<a href="setup.php">'.l10n('Back').'</a></div>':'</div>');
    45                 $i++;
     56                echo '<div class="error">'.l10n($key).'</div>';
    4657        }
     58        echo '<div class="link"><a href="index.php">'.l10n('Back').'</a> <a href="setup.php">'.l10n('Config').'</a></div>';
    4759}
    4860
     
    5163### EXECUTION ###
    5264if (!isset($Errors)) {
    53         // Configuration
    54         extract(load_config());
    55 
    56         $copyCOLOR = explode(' ', $copyCOLOR);
    57         $copyPOS = explode('-', $copyPOS);
    58 
    59 
    6065        ### Gestion des nouveaux plugins ###
    6166        // Ajoute la configuration des plugins non-installés aux tableaux, il faut valider le formulaire pour les installer
    6267        $Plugins = glob('plugins/*.xml');
    63         $NewPlugins = array();
    6468
    6569        foreach ($Plugins as $plugin) {
     
    7680                        ${$plugin_mode}[$plugin_name] = $plugin;
    7781                        $NewPlugins[$plugin_name] = true;
     82                } else if (!file_exists('plugins/'.$plugin_name.'.php')) {
     83                        $MissingPlugins[$plugin_name] = true;
    7884                }
    7985        }
     86       
     87       
     88        ### Gestion des plugins manquants ###
     89        foreach (array('PluginsBefore','PluginsProcess','PluginsAfter') as $mode) {
     90                foreach (${$mode} as $plugin_name => $config) {
     91                        if (!file_exists('plugins/'.$plugin_name.'.php')) {
     92                                $MissingPlugins[$plugin_name] = true;
     93                        }
     94                }
     95        }
    8096
    8197
    8298        ### Formulaire ###
     99        $copyCOLOR = explode(' ', $copyCOLOR);
     100        $copyPOS = explode('-', $copyPOS);
     101       
    83102        echo '
    84103        <script type="text/javascript">
     
    91110               
    92111        <form action="setup.php" method="post">
    93         <div class="config">
    94                 <h2>'.l10n('Configuration').'</h2>
    95                 <ul>
    96                         <li>
    97                                 <span class="title">'.l10n('Folders').'</span>
    98                                 <table>
    99                                         <tr>
    100                                                 <td><b>'.l10n('FolderIn').' :</b></td>
    101                                                 <td><input type="text" name="DIRsource" value="'.$DIRsource.'"/></td>
    102                                         </tr>
    103                                         <tr>
    104                                                 <td><b>'.l10n('FolderOut').' :</b></td>
    105                                                 <td><input type="text" name="DIRsortie" value="'.$DIRsortie.'"/></td>
    106                                         </tr>
    107                                 </table>
    108                         </li>
    109                         <li>
    110                                 <span class="title">'.l10n('Options').'</span>
    111                                 <table>
    112                                         <tr>
    113                                                 <td><b>'.l10n('silentORNOT').' :</b></td>
    114                                                 <td><input type="radio" name="silentORNOT" value="true" '.(($silentORNOT)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="silentORNOT" value="false" '.((!$silentORNOT)?'checked':'').'/> '.l10n('no').'</td>
    115                                         </tr>
    116                                         <tr>
    117                                                 <td><b>'.l10n('DIRhighORNOT').' :</b></td>
    118                                                 <td><input type="radio" name="DIRhighORNOT" value="true" '.(($DIRhighORNOT)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="DIRhighORNOT" value="false" '.((!$DIRhighORNOT)?'checked':'').'/> '.l10n('no').'</td>
    119                                         </tr>
    120                                         <tr>
    121                                                 <td><b>'.l10n('DIMhdORNOT').' :</b></td>
    122                                                 <td><input type="radio" name="DIMhdORNOT" value="true" '.(($DIMhdORNOT)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="DIMhdORNOT" value="false" '.((!$DIMhdORNOT)?'checked':'').'/> '.l10n('no').'</td>
    123                                         </tr>
    124                                         <tr>
    125                                                 <td><b>'.l10n('renameORNOT').' :</b></td>
    126                                                 <td><input type="radio" name="renameORNOT" value="true" '.(($renameORNOT)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="renameORNOT" value="false" '.((!$renameORNOT)?'checked':'').'/> '.l10n('no').'</td>
    127                                         </tr>
    128                                         <tr>
    129                                                 <td><b>'.l10n('indexORNOT').' :</b></td>
    130                                                 <td><input type="radio" name="indexORNOT" value="true" '.(($indexORNOT)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="indexORNOT" value="false" '.((!$indexORNOT)?'checked':'').'/> '.l10n('no').'</td>
    131                                         </tr>
    132                                         <tr>
    133                                                 <td><b>'.l10n('prefixe_mini').' :</b></td>
    134                                                 <td><input type="text" name="prefixe_mini" value="'.$prefixe_mini.'" size="8"/></td>
    135                                         </tr>
    136                                 </table>
    137                         </li>
    138                         <li>
    139                                 <span class="title">'.l10n('Sizes and quality').'</span>
    140                                 <table>
    141                                         <tr>
    142                                                 <td><b>'.l10n('DIMhd').' :</b></td>
    143                                                 <td><input type="text" name="DIMhd" value="'.$DIMhd.'" size="4"/></td>
    144                                         </tr>
    145                                         <tr>
    146                                                 <td><b>'.l10n('DIMnormal').' :</b></td>
    147                                                 <td><input type="text" name="DIMnormal" value="'.$DIMnormal.'" size="3"/></td>
    148                                         </tr>
    149                                         <tr>
    150                                                 <td><b>'.l10n('DIMthumbnail').' :</b></td>
    151                                                 <td><input type="text" name="DIMthumbnail" value="'.$DIMthumbnail.'" size="3"/></td>
    152                                         </tr>
    153                                         <tr>
    154                                                 <td><b>'.l10n('Qhd').' :</b></td>
    155                                                 <td><input type="text" name="Qhd" value="'.$Qhd.'" size="3"/></td>
    156                                         </tr>
    157                                         <tr>
    158                                                 <td><b>'.l10n('Qnormal').' :</b></td>
    159                                                 <td><input type="text" name="Qnormal" value="'.$Qnormal.'" size="3"/></td>
    160                                         </tr>
    161                                         <tr>
    162                                                 <td><b>'.l10n('Qthumbnail').' :</b></td>
    163                                                 <td><input type="text" name="Qthumbnail" value="'.$Qthumbnail.'" size="3"/></td>
    164                                         </tr>
    165                                         <tr>
    166                                                 <td><b>'.l10n('DPI').' :</b></td>
    167                                                 <td><input type="text" name="DPI" value="'.$DPI.'" size="3"/></td>
    168                                         </tr>
    169                                 </table>
    170                         </li>
    171                         <li>
    172                                 <span class="title">'.l10n('Copyright').'</span>
    173                                 <table>
    174                                         <tr>
    175                                                 <td><b>'.l10n('Content').' :</b></td>
    176                                                 <td><input type="text" name="copyright" value="'.$copyright.'"/></td>
    177                                         </tr>
    178                                         <tr>
    179                                                 <td><b>'.l10n('copyONhd').' :</b></td>
    180                                                 <td><input type="radio" name="copyONhd" value="true" '.(($copyONhd)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="copyONhd" value="false" '.((!$copyONhd)?'checked':'').'/> '.l10n('no').'</td>
    181                                         </tr>
    182                                         <tr>
    183                                                 <td><b>'.l10n('copyONnormal').' :</b></td>
    184                                                 <td><input type="radio" name="copyONnormal" value="true" '.(($copyONnormal)?'checked':'').'/> '.l10n('yes').' <input type="radio" name="copyONnormal" value="false" '.((!$copyONnormal)?'checked':'').'/> '.l10n('no').'</td>
    185                                         </tr>
    186                                         <tr>
    187                                                 <td><b>'.l10n('copyPOS%s', l10n('copyPOSv')).' :</b></td>
    188                                                 <td><input type="radio" name="copyPOS[0]" value="top" '.(($copyPOS[0]=='top')?'checked':'').'/> '.l10n('top').' <input type="radio" name="copyPOS[0]" value="center" '.(($copyPOS[0]=='center')?'checked':'').'/> '.l10n('center').' <input type="radio" name="copyPOS[0]" value="bottom" '.(($copyPOS[0]=='bottom')?'checked':'').'/> '.l10n('bottom').'</td>
    189                                         </tr>
    190                                         <tr>
    191                                                 <td><b>'.l10n('copyPOS%s', l10n('copyPOSh')).' :</b></td>
    192                                                 <td><input type="radio" name="copyPOS[1]" value="left" '.(($copyPOS[1]=='left')?'checked':'').'/> '.l10n('left').' <input type="radio" name="copyPOS[1]" value="center" '.(($copyPOS[1]=='center')?'checked':'').'/> '.l10n('center').' <input type="radio" name="copyPOS[1]" value="right" '.(($copyPOS[1]=='right')?'checked':'').'/> '.l10n('right').'</td>
    193                                         </tr>
    194                                         <tr>
    195                                                 <td><b>'.l10n('copySIZE').' :</b></td>
    196                                                 <td><input type="text" name="copySIZE" value="'.$copySIZE.'" size="5"/></td>
    197                                         </tr>
    198                                         <tr>
    199                                                 <td><b>'.l10n('copyCOLOR').' :</b></td>
    200                                                 <td>
    201                                                         <input type="text" name="copyCOLOR[0]" value="'.$copyCOLOR[0].'" size="3" onFocus="this.select();" onKeyUp="suivant(this,\'copyCOLOR[1]\', 3)"/>
    202                                                         <input type="text" name="copyCOLOR[1]" value="'.$copyCOLOR[1].'" size="3" onFocus="this.select();" onKeyUp="suivant(this,\'copyCOLOR[2]\', 3)"/>
    203                                                         <input type="text" name="copyCOLOR[2]" value="'.$copyCOLOR[2].'" size="3" onFocus="this.select();" />
    204                                                 </td>
    205                                         </tr>
    206                                         <tr>
    207                                                 <td><b>'.l10n('copyFONT').' :</b></td>
    208                                                 <td><input type="text" name="copyFONT" value="'.$copyFONT.'"/></td>
    209                                         </tr>
    210                                 </table>
    211                         </li>
    212                 </ul>
    213         </div>
    214 
    215         <div class="config">
    216                 <h2>'.l10n('Plugins').'</h2>
    217                 <ul>
    218                         <li>
    219                                 <span class="title">'.l10n('PluginsBefore').'</span>
    220                                 <ul>';
    221                                         foreach ($PluginsBefore as $name => $config) {
    222                                                 echo '<li>
    223                                                         <b class="'.((isset($NewPlugins[$name]))?'new':'').'">'.$name.' :</b>
    224                                                         <table>';
    225                                                                 foreach ($config as $key => $value) {
    226                                                                         echo '<tr>
    227                                                                                 <td>'.$key.' :</td>
    228                                                                                 <td><input type="text" name="PluginsBefore['.$name.']['.$key.']" value="'.bool_to_string($value,1).'" size="7"/></td>
    229                                                                         </tr>';
    230                                                                 }
    231                                                         echo '</table>
    232                                                 </li>';
    233                                         }
    234                                 echo '</ul>
    235                         </li>
    236                         <li>
    237                                 <span class="title">'.l10n('PluginsProcess').'</span>
    238                                 <ul>';
    239                                         foreach ($PluginsProcess as $name => $config) {
    240                                                 echo '<li>
    241                                                         <b class="'.((isset($NewPlugins[$name]))?'new':'').'">'.$name.' :</b>
    242                                                         <table>';
    243                                                                 foreach ($config as $key => $value) {
    244                                                                         echo '<tr>
    245                                                                                 <td>'.$key.' :</td>
    246                                                                                 <td><input type="text" name="PluginsProcess['.$name.']['.$key.']" value="'.bool_to_string($value,1).'" size="7"/></td>
    247                                                                         </tr>';
    248                                                                 }
    249                                                         echo '</table>
    250                                                 </li>';
    251                                         }
    252                                 echo '</ul>
    253                         </li>
    254                         <li>
    255                                 <span class="title">'.l10n('PluginsAfter').'</span>
    256                                 <ul>';
    257                                         foreach ($PluginsAfter as $name => $config) {
    258                                                 echo '<li>
    259                                                         <b class="'.((isset($NewPlugins[$name]))?'new':'').'">'.$name.' :</b>
    260                                                         <table>';
    261                                                                 foreach ($config as $key => $value) {
    262                                                                         echo '<tr>
    263                                                                                 <td>'.$key.' :</td>
    264                                                                                 <td><input type="text" name="PluginsAfter['.$name.']['.$key.']" value="'.bool_to_string($value,1).'" size="7"/></td>
    265                                                                         </tr>';
    266                                                                 }
    267                                                         echo '</table>
    268                                                 </li>';
    269                                         }
    270                                 echo '</ul>
    271                         </li>
    272                 </ul>
    273         </div>
    274 
    275         <div class="finish">   
    276                 <input type="submit"/> <input type="reset"/> <a href="index.php">'.l10n('Back').'</a>
    277         </div>
     112                <div class="config">
     113                        <h2>'.l10n('Configuration').'</h2>
     114                        <ul>
     115                                <li>
     116                                        <span class="title">'.l10n('Folders').'</span>
     117                                        <table>
     118                                                <tr>
     119                                                        <td><b>'.l10n('FolderIn').' :</b></td>
     120                                                        <td><input type="text" name="DIRsource" value="'.$DIRsource.'"/></td>
     121                                                </tr>
     122                                                <tr>
     123                                                        <td><b>'.l10n('FolderOut').' :</b></td>
     124                                                        <td><input type="text" name="DIRsortie" value="'.$DIRsortie.'"/></td>
     125                                                </tr>
     126                                        </table>
     127                                </li>
     128                                <li>
     129                                        <span class="title">'.l10n('Options').'</span>
     130                                        <table>
     131                                                <tr>
     132                                                        <td><b>'.l10n('silentORNOT').' :</b></td>
     133                                                        <td>
     134                                                                <input type="radio" name="silentORNOT" value="erase" '.(($silentORNOT=='erase')?'checked':'').'/> '.l10n('erase').'
     135                                                                <input type="radio" name="silentORNOT" value="block" '.(($silentORNOT=='block')?'checked':'').'/> '.l10n('block').'
     136                                                                <input type="radio" name="silentORNOT" value="pass" '.(($silentORNOT=='pass')?'checked':'').'/> '.l10n('pass').'
     137                                                        </td>
     138                                                </tr>
     139                                                <tr>
     140                                                        <td><b>'.l10n('DIRhighORNOT').' :</b></td>
     141                                                        <td>
     142                                                                <input type="radio" name="DIRhighORNOT" value="true" '.(($DIRhighORNOT)?'checked':'').'/> '.l10n('yes').'
     143                                                                <input type="radio" name="DIRhighORNOT" value="false" '.((!$DIRhighORNOT)?'checked':'').'/> '.l10n('no').'
     144                                                        </td>
     145                                                </tr>
     146                                                <tr>
     147                                                        <td><b>'.l10n('DIMhdORNOT').' :</b></td>
     148                                                        <td>
     149                                                                <input type="radio" name="DIMhdORNOT" value="true" '.(($DIMhdORNOT)?'checked':'').'/> '.l10n('yes').'
     150                                                                <input type="radio" name="DIMhdORNOT" value="false" '.((!$DIMhdORNOT)?'checked':'').'/> '.l10n('no').'
     151                                                        </td>
     152                                                </tr>
     153                                                <tr>
     154                                                        <td><b>'.l10n('renameORNOT').' :</b></td>
     155                                                        <td>
     156                                                                <input type="radio" name="renameORNOT" value="true" '.(($renameORNOT)?'checked':'').'/> '.l10n('yes').'
     157                                                                <input type="radio" name="renameORNOT" value="false" '.((!$renameORNOT)?'checked':'').'/> '.l10n('no').'
     158                                                        </td>
     159                                                </tr>
     160                                                <tr>
     161                                                        <td><b>'.l10n('indexORNOT').' :</b></td>
     162                                                        <td>
     163                                                                <input type="radio" name="indexORNOT" value="true" '.(($indexORNOT)?'checked':'').'/> '.l10n('yes').'
     164                                                                <input type="radio" name="indexORNOT" value="false" '.((!$indexORNOT)?'checked':'').'/> '.l10n('no').'
     165                                                        </td>
     166                                                </tr>
     167                                                <tr>
     168                                                        <td><b>'.l10n('prefixe_mini').' :</b></td>
     169                                                        <td><input type="text" name="prefixe_mini" value="'.$prefixe_mini.'" size="8"/></td>
     170                                                </tr>
     171                                        </table>
     172                                </li>
     173                                <li>
     174                                        <span class="title">'.l10n('Sizes and quality').'</span>
     175                                        <table>
     176                                                <tr>
     177                                                        <td><b>'.l10n('DIMhd').' :</b></td>
     178                                                        <td><input type="text" name="DIMhd" value="'.$DIMhd.'" size="4"/></td>
     179                                                </tr>
     180                                                <tr>
     181                                                        <td><b>'.l10n('DIMnormal').' :</b></td>
     182                                                        <td><input type="text" name="DIMnormal" value="'.$DIMnormal.'" size="3"/></td>
     183                                                </tr>
     184                                                <tr>
     185                                                        <td><b>'.l10n('DIMthumbnail').' :</b></td>
     186                                                        <td><input type="text" name="DIMthumbnail" value="'.$DIMthumbnail.'" size="3"/></td>
     187                                                </tr>
     188                                                <tr>
     189                                                        <td><b>'.l10n('Qhd').' :</b></td>
     190                                                        <td><input type="text" name="Qhd" value="'.$Qhd.'" size="3"/></td>
     191                                                </tr>
     192                                                <tr>
     193                                                        <td><b>'.l10n('Qnormal').' :</b></td>
     194                                                        <td><input type="text" name="Qnormal" value="'.$Qnormal.'" size="3"/></td>
     195                                                </tr>
     196                                                <tr>
     197                                                        <td><b>'.l10n('Qthumbnail').' :</b></td>
     198                                                        <td><input type="text" name="Qthumbnail" value="'.$Qthumbnail.'" size="3"/></td>
     199                                                </tr>
     200                                                <tr>
     201                                                        <td><b>'.l10n('DPI').' :</b></td>
     202                                                        <td><input type="text" name="DPI" value="'.$DPI.'" size="3"/></td>
     203                                                </tr>
     204                                        </table>
     205                                </li>
     206                                <li>
     207                                        <span class="title">'.l10n('Copyright').'</span>
     208                                        <table>
     209                                                <tr>
     210                                                        <td><b>'.l10n('Content').' :</b></td>
     211                                                        <td><input type="text" name="copyright" value="'.$copyright.'"/></td>
     212                                                </tr>
     213                                                <tr>
     214                                                        <td><b>'.l10n('copyONhd').' :</b></td>
     215                                                        <td>
     216                                                                <input type="radio" name="copyONhd" value="true" '.(($copyONhd)?'checked':'').'/> '.l10n('yes').'
     217                                                                <input type="radio" name="copyONhd" value="false" '.((!$copyONhd)?'checked':'').'/> '.l10n('no').'
     218                                                        </td>
     219                                                </tr>
     220                                                <tr>
     221                                                        <td><b>'.l10n('copyONnormal').' :</b></td>
     222                                                        <td>
     223                                                                <input type="radio" name="copyONnormal" value="true" '.(($copyONnormal)?'checked':'').'/> '.l10n('yes').'
     224                                                                <input type="radio" name="copyONnormal" value="false" '.((!$copyONnormal)?'checked':'').'/> '.l10n('no').'
     225                                                        </td>
     226                                                </tr>
     227                                                <tr>
     228                                                        <td><b>'.l10n('copyPOS%s', l10n('copyPOSv')).' :</b></td>
     229                                                        <td>
     230                                                                <input type="radio" name="copyPOS[0]" value="top" '.(($copyPOS[0]=='top')?'checked':'').'/> '.l10n('top').'
     231                                                                <input type="radio" name="copyPOS[0]" value="center" '.(($copyPOS[0]=='center')?'checked':'').'/> '.l10n('center').'
     232                                                                <input type="radio" name="copyPOS[0]" value="bottom" '.(($copyPOS[0]=='bottom')?'checked':'').'/> '.l10n('bottom').'
     233                                                        </td>
     234                                                </tr>
     235                                                <tr>
     236                                                        <td><b>'.l10n('copyPOS%s', l10n('copyPOSh')).' :</b></td>
     237                                                        <td>
     238                                                                <input type="radio" name="copyPOS[1]" value="left" '.(($copyPOS[1]=='left')?'checked':'').'/> '.l10n('left').'
     239                                                                <input type="radio" name="copyPOS[1]" value="center" '.(($copyPOS[1]=='center')?'checked':'').'/> '.l10n('center').'
     240                                                                <input type="radio" name="copyPOS[1]" value="right" '.(($copyPOS[1]=='right')?'checked':'').'/> '.l10n('right').'
     241                                                        </td>
     242                                                </tr>
     243                                                <tr>
     244                                                        <td><b>'.l10n('copySIZE').' :</b></td>
     245                                                        <td><input type="text" name="copySIZE" value="'.$copySIZE.'" size="5"/></td>
     246                                                </tr>
     247                                                <tr>
     248                                                        <td><b>'.l10n('copyCOLOR').' :</b></td>
     249                                                        <td>
     250                                                                <input type="text" name="copyCOLOR[0]" value="'.$copyCOLOR[0].'" size="3" onFocus="this.select();" onKeyUp="suivant(this,\'copyCOLOR[1]\', 3)"/>
     251                                                                <input type="text" name="copyCOLOR[1]" value="'.$copyCOLOR[1].'" size="3" onFocus="this.select();" onKeyUp="suivant(this,\'copyCOLOR[2]\', 3)"/>
     252                                                                <input type="text" name="copyCOLOR[2]" value="'.$copyCOLOR[2].'" size="3" onFocus="this.select();" />
     253                                                        </td>
     254                                                </tr>
     255                                                <tr>
     256                                                        <td><b>'.l10n('copyFONT').' :</b></td>
     257                                                        <td><input type="text" name="copyFONT" value="'.$copyFONT.'"/></td>
     258                                                </tr>
     259                                        </table>
     260                                </li>
     261                        </ul>
     262                </div>
     263
     264                <div class="config">
     265                        <h2>'.l10n('Plugins').'</h2>
     266                        <ul>';
     267                                // Affichage des plugins, un bloc par mode
     268                                foreach (array('PluginsBefore','PluginsProcess','PluginsAfter') as $mode) {
     269                                        echo '<li>
     270                                                <span class="title">'.l10n($mode).'</span>
     271                                                <ul>';
     272                                                        // Un bloc par plugin
     273                                                        foreach (${$mode} as $name => $config) {
     274                                                                echo '<li>';
     275                                                                        echo '<b>'.$name.' :</b>';
     276                                                                       
     277                                                                        // Cas spéciaux dans le titre(nouveau, manquant)
     278                                                                        if (isset($NewPlugins[$name])) {
     279                                                                                echo '<b class="new">'.l10n('New !').'</b>';
     280                                                                        } else if (isset($MissingPlugins[$name])) {
     281                                                                                echo '<b class="miss">'.l10n('Missing !').'</b>';
     282                                                                        }
     283                                                                       
     284                                                                        echo '<table>';
     285                                                                                // Si il est manquant on ne met que la checkbox de suppression
     286                                                                                if (isset($MissingPlugins[$name])) {
     287                                                                                        echo '<tr>
     288                                                                                                <td>'.l10n('erase').' :</td>
     289                                                                                                <td><input type="checkbox" name="'.$mode.'['.$name.'][delete]" value="true" checked="checked"/></td>
     290                                                                                        </tr>';
     291                                                                                // sinon on affiche sa configuration
     292                                                                                } else {
     293                                                                                        foreach ($config as $key => $value) {
     294                                                                                                echo '<tr>
     295                                                                                                        <td>'.$key.' :</td>
     296                                                                                                        <td><input type="text" name="'.$mode.'['.$name.']['.$key.']" value="'.bool_to_string($value,1).'" size="'.strlen(bool_to_string($value,1)).'"/></td>
     297                                                                                                </tr>';
     298                                                                                        }
     299                                                                                }
     300                                                                        echo '</table>
     301                                                                </li>';
     302                                                        }
     303                                                echo '</ul>
     304                                        </li>';
     305                                }
     306                               
     307                        echo '</ul>
     308                </div>
     309
     310                <div class="finish"><input type="submit" value="'.l10n('Valid').'"/> <input type="reset" value="'.l10n('Reset').'"/></div>
     311                <div class="link"><a href="index.php">&raquo; '.l10n('Back').'</a></div>
    278312        </form>';
    279313}
    280314
    281 echo '</body>
     315
     316
     317### FIN ###
     318echo '<div class="footer">
     319        2010 - <a href="http://www.strangeplanet.fr">Damien Sorel</a> - <a href="http://fr.piwigo.org/forum/viewtopic.php?id=19117">Forum</a>
     320</div>
     321
     322</body>
    282323</html>';
    283324?>
Note: See TracChangeset for help on using the changeset viewer.