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

fix detection regex and watermark position

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PHP_Optimisateur/include/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?>
Note: See TracChangeset for help on using the changeset viewer.