Changeset 12819 for extensions/PHP_Optimisateur/plugins/front2back_support
- Timestamp:
- Jan 1, 2012, 10:09:17 PM (13 years ago)
- Location:
- extensions/PHP_Optimisateur/plugins/front2back_support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/PHP_Optimisateur/plugins/front2back_support/main.php
r10337 r12819 1 1 <?php 2 2 /***************************************\ 3 | PHP OPTIMISATEUR|4 | Plugin Front2Back Support 1.2|3 | PHP OPTIMISATEUR | 4 | Plugin Front2Back Support 1.2 | 5 5 \***************************************/ 6 6 … … 17 17 // applique le tag au fichier normal si il existe un verso 18 18 if (file_exists($file['folder_src'].$file['name'].$F2B_nameverso.'.'.$file['ext']) AND !empty($F2B_tagverso)) { 19 20 19 nconvert('-iptc_add 25 "'.$F2B_tagverso.'" "'.$FilesSource[$i].'"'); 20 $LOG[] = 'Tag "'.$F2B_tagverso.'" added to '.$FilesSource[$i]; 21 21 } 22 22 23 23 if (strpos($file['name'], $F2B_nameverso) !== false) { 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 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; 72 72 } 73 73 -
extensions/PHP_Optimisateur/plugins/front2back_support/setup.php
r10337 r12819 3 3 4 4 switch ($PLUGIN_ACTION) { 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 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; 55 55 } 56 56 ?>
Note: See TracChangeset
for help on using the changeset viewer.