Ignore:
Timestamp:
Apr 12, 2011, 7:45:22 PM (13 years ago)
Author:
mistic100
Message:

new version 1.4, new plugin for Charlies Content, NConvert updated

Location:
extensions/PHP_Optimisateur/include
Files:
7 edited

Legend:

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

    r9276 r10337  
    55\***************************************/
    66
    7 $PAGE_CONTENT[0] .= '<div class="generic config">
     7$PAGE['content'] .= '<div class="generic config">
    88                <h2>'.l10n('Configuration').'</h2>
    99                <ul>
     
    5656                                        <tr>
    5757                                                <td><b>'.l10n('DIMhd').' :</b></td>
    58                                                 <td>'.$CONF['DIMhd'].'px</td>
     58                                                <td>'.$CONF['DIMhd'].' px</td>
    5959                                        </tr>
    6060                                        <tr>
    6161                                                <td><b>'.l10n('DIMnormal').' :</b></td>
    62                                                 <td>'.$CONF['DIMnormal'].'px</td>
     62                                                <td>'.$CONF['DIMnormal'].' px</td>
    6363                                        </tr>
    6464                                        <tr>
    6565                                                <td><b>'.l10n('DIMthumbnail').' :</b></td>
    66                                                 <td>'.$CONF['DIMthumbnail'].'px</td>
     66                                                <td>'.$CONF['DIMthumbnail'].' px</td>
    6767                                        </tr>
    6868                                        <tr>
    6969                                                <td><b>'.l10n('Qhd').' :</b></td>
    70                                                 <td>'.$CONF['Qhd'].'%</td>
     70                                                <td>'.$CONF['Qhd'].' %</td>
    7171                                        </tr>
    7272                                        <tr>
    7373                                                <td><b>'.l10n('Qnormal').' :</b></td>
    74                                                 <td>'.$CONF['Qnormal'].'%</td>
     74                                                <td>'.$CONF['Qnormal'].' %</td>
    7575                                        </tr>
    7676                                        <tr>
    7777                                                <td><b>'.l10n('Qthumbnail').' :</b></td>
    78                                                 <td>'.$CONF['Qthumbnail'].'%</td>
     78                                                <td>'.$CONF['Qthumbnail'].' %</td>
    7979                                        </tr>
    8080                                        <tr>
    8181                                                <td><b>'.l10n('DPI').' :</b></td>
    82                                                 <td>'.$CONF['DPI'].'dpi</td>
     82                                                <td>'.$CONF['DPI'].' dpi</td>
    8383                                        </tr>
    8484                                </table>
     
    128128                       
    129129                        foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    130                                 $PAGE_CONTENT[0] .= '<li>
     130                                $PAGE['content'] .= '<li>
    131131                                        <div class="plugin-title">
    132132                                                <span class="title">'.$plugin_config['name'].' :</span>
    133133                                               
    134134                                                <span class="plugin-active">';
    135                                                 // Si il est manquant on ne met que la checkbox de suppression, sinon boutons d'activation
    136135                                                if ($plugin_config['active']) {
    137                                                         $PAGE_CONTENT[0] .= '<b class="new">'.l10n('Active').'</b>';
     136                                                        $PAGE['content'] .= '<b class="new">'.l10n('Active').'</b>';
    138137                                                } else {
    139                                                         $PAGE_CONTENT[0] .= '<b class="miss">'.l10n('Inactive').'</b>';
     138                                                        $PAGE['content'] .= '<b class="miss">'.l10n('Inactive').'</b>';
    140139                                                }
    141                                                 $PAGE_CONTENT[0] .= '</span>
     140                                                $PAGE['content'] .= '</span>
    142141                                               
    143142                                        </div>';
     
    147146                                                include('plugins/'.$plugin_id.'/setup.php');
    148147                                        }
    149                                 $PAGE_CONTENT[0] .= '</li>';
     148                                $PAGE['content'] .= '</li>';
    150149                        }
    151                 $PAGE_CONTENT[0] .= '</ul>
     150                $PAGE['content'] .= '</ul>
    152151        </div>';
    153152?>
  • extensions/PHP_Optimisateur/include/functions.php

    r9265 r10337  
    11<?php
     2
    23// Affiche les textes localisés
    34function l10n($code) {
     
    2223        while ($file = readdir($dh)) {
    2324                if ($file !== '.' && $file !== '..' && is_dir('language/'.$file)) {
    24                         $name = (file_exists('language/'.$file.'/'.$file.'.txt')) ? file_get_contents('language/'.$file.'/'.$file.'.txt') : $file;
     25                        $name = (file_exists('language/'.$file.'/iso.txt')) ? file_get_contents('language/'.$file.'/iso.txt') : $file;
    2526                        $languages[$file] = $name;
    2627                }
     
    6667                return preg_replace($search, $replace, $string);
    6768        } else {
    68                 return str_replace(array('%','$'), '_', $string);
     69                return str_replace(array('%','$',' '), '_', $string);
    6970        }
    7071}
     
    121122        $content = array();
    122123        foreach ($xml as $nom => $elem) {
    123                 if (trim($elem) == '') {
     124                if (trim($elem) == '' AND $elem != '') {
    124125                        $content[$nom] = XMLParse($elem->children());
    125126                } else {
     
    165166                                $array[$key] = true;           
    166167                        } else if ($value === 'false') {
    167                                 $array[$key] = false;           
     168                                $array[$key] = false;   
     169                        } else if ($value == null) {
     170                                // rien à faire ^^
    168171                        } else if (preg_match('#^([0-9]*)$#', $value)) {
    169172                                settype($array[$key], 'int');           
     
    247250// Verifie si une chaine est un nombre décimal (plus strict que is_numeric qui fonctionne avec les hexadecimaux)
    248251function is_decimal($num) {
    249         if(is_numeric($num) === true AND (float)$num == $num) {
     252        if((is_numeric($num) === true AND (float)$num == $num) OR $num === '0') {
    250253                return true;
    251254        } else {
     
    257260function load_plugin_lang($plugin_id) {
    258261        global $CONF, $Lang;
    259         if (file_exists('plugins/'.$plugin_id.'/lang/'.$CONF['user_lang'].'.php')) {
    260                 include('plugins/'.$plugin_id.'/lang/'.$CONF['user_lang'].'.php');
    261         } else {
    262                 include('plugins/'.$plugin_id.'/lang/en_UK.php');
    263         }
    264 }
     262        if (file_exists('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php')) {
     263                include('plugins/'.$plugin_id.'/language/'.$CONF['user_lang'].'.php');
     264        } else {
     265                include('plugins/'.$plugin_id.'/language/en_UK.php');
     266        }
     267}
     268
     269// fonction nconvert avec gestion du log
     270function nconvert($param, $log=true) {
     271        global $LOG;
     272
     273        exec('include\nconvert.exe '. $param .' 2>&1', $out);
     274       
     275        if ($log) {
     276                for ($i=0; $i<=3; $i++)
     277                        unset($out[$i]);
     278                if (count($out)) $LOG[] = array_values($out);
     279                //$LOG[] = "\t" . $param;
     280        } else {
     281                return $out;
     282        }
     283}
     284
     285// fonction mkdir avec gestion du log
     286function mkdir_log($dir) {
     287        global $LOG;
     288        mkdir($dir, 0777, true);
     289        $LOG[] = 'Dir '.$dir.' created';
     290}
     291
     292// fonction copy avec gestion du log
     293function copy_log($src, $dest) {
     294        global $LOG;
     295        copy($src, $dest);
     296        $LOG[] = 'Copy '.$src.' to '.$dest;
     297}
     298
     299// fonction rename avec gestion du log
     300function rename_log($path, $new_path, $move=false) {
     301        global $LOG;
     302        rename($path, $new_path);
     303        if ($move)
     304                $LOG[] = 'Move '.$path.' to '.$new_path;
     305        else
     306                $LOG[] = 'Rename '.$path.' into '.$new_path;
     307}
     308
     309// enregistre le log dans un fichier
     310function print_log($nb, $s) {
     311        global $APPversion, $LOG;
     312       
     313        $config = file_get_contents('config.xml');
     314       
     315        $string =
     316                "PHP Optimisateur " . $APPversion . "\r\n".
     317                date('r') . "\r\n".
     318                $nb . " files in " . $s . " seconds" . "\r\n\r\n".
     319               
     320                $config . "\r\n\r\n";
     321       
     322        foreach ($LOG as $event) {
     323                if (is_array($event)) {
     324                        $string .= implode("\r\n", $event) . "\r\n";
     325                } else {
     326                        $string .= $event . "\r\n";
     327                }
     328        }
     329       
     330        if (!file_exists('logs')) {
     331                mkdir('logs', 0777, true);
     332        }
     333       
     334        $filename = 'log_' . date('Y-m-d_H-i-s') . '.txt';
     335        file_put_contents('logs/'.$filename, $string);
     336        return $filename;
     337}
     338
     339// case insentive version of in_array
     340function in_arrayi($needle, $haystack) {
     341        $needle = strtolower($needle);
     342        $haystack = array_map('strtolower', $haystack);
     343        return in_array($needle, $haystack);
     344}
     345
    265346?>
  • extensions/PHP_Optimisateur/include/header.php

    r9632 r10337  
    3535                        });
    3636                });
    37         </script>       
     37        </script>
     38       
     39        '.$PAGE['header'].'
    3840       
    3941</head>
     
    4850        <div id="languageSwitchLink" title="Change Language">
    4951                <ul>
    50                         <li><a href="#"><img src="language/'.$CONF['user_lang'].'/'.$CONF['user_lang'].'.png" alt="'.$CONF['languages'][$CONF['user_lang']].'"/> '.$CONF['languages'][$CONF['user_lang']].'</a></li>
     52                        <li><a href="#"><img src="language/'.$CONF['user_lang'].'/flag.png" alt="'.$CONF['languages'][$CONF['user_lang']].'"/> '.$CONF['languages'][$CONF['user_lang']].'</a></li>
    5153                </ul>
    5254        </div>
     
    5557                <ul>';
    5658                foreach ($CONF['languages'] as $key => $name) {
    57                         echo '<li><a class="lang" href="index.php?Lang='.$key.'" title="'.$name.'"><img src="language/'.$key.'/'.$key.'.png" alt="'.$name.'"/> '.$name.'</a></li>';
     59                        echo '<li><a class="lang" href="index.php?Lang='.$key.'" title="'.$name.'"><img src="language/'.$key.'/flag.png" alt="'.$name.'"/> '.$name.'</a></li>';
    5860                }
    5961                echo ' </ul>
  • extensions/PHP_Optimisateur/include/main.php

    r9633 r10337  
    1717                        $path = $dir.'/'.$file;
    1818                        $new_path = $dir.'/'.delete_special_car($file);
    19                         rename($path, $new_path);
     19                       
     20                        if ($path != $new_path) {
     21                                rename_log($path, $new_path);
     22                        }
    2023                       
    2124                        if (is_dir($new_path)) {
     
    4750
    4851$CONF['convOptions'] = '-ratio -rtype lanczos -rflag decr';
    49 $CONF['JPGexts'] = array('jpg', 'JPG'); // extensions admises pour le jpg
     52$CONF['allowedExt'] = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff');
    5053
    5154
     
    6871// Boucle sur tous les fichiers
    6972for ($i=0; $i<count($FilesSource); $i++) {
    70         // Découpe le nom de fichier : dossier/fichier
    71         preg_match('#(.*)/(.*).((?i)[a-z0-9]{3,4})$#', $FilesSortie[$i], $matches);
    72         $FileFolder = $matches[1].'/'; // dossier de sortie
    73         $FileName = $matches[2]; // nom final
    74         $FileExt = $matches[3]; // extension orginale
    75                
     73        // Découpe le nom de fichier : dossier/fichier/extension
     74        preg_match('#^(.*)/(.*)\.([a-z0-9]{2,4})$#', $FilesSource[$i], $matches);
     75        $file['folder_src'] = $matches[1].'/'; // dossier d'entrée
     76        $file['folder_out'] = str_replace($CONF['DIRsource'], $CONF['DIRsortie'], $file['folder_src']); // dossier de sortie
     77        $file['name'] = $matches[2]; // nom final
     78        $file['ext'] = $matches[3]; // extension orginale
     79                       
    7680        // Crée les sous-dossiers de sortie & 'pwg_high' & 'thumbnail'
    77         if (!file_exists($FileFolder.'pwg_high') AND $CONF['DIRhighORNOT']) {
    78                 mkdir($FileFolder.'pwg_high', 0777, true);
     81        if (!file_exists($file['folder_out'].'pwg_high') AND $CONF['DIRhighORNOT']) {
     82                mkdir_log($file['folder_out'].'pwg_high');
    7983        }
    80         if (!file_exists($FileFolder.'thumbnail')) {
    81                 mkdir($FileFolder.'thumbnail', 0777, true);
     84        if (!file_exists($file['folder_out'].'thumbnail')) {
     85                mkdir_log($file['folder_out'].'thumbnail');
    8286        }
    8387       
    84         // Informations sur le fichier
    85         exec('include\nconvert.exe -info "'.$FilesSource[$i].'"', $FileInfos);
    86         for ($m=0; $m<=5; $m++) {
    87                 unset($FileInfos[$m]);
     88        if (!in_arrayi($file['ext'], $CONF['allowedExt'])) {
     89                $BlockAll['main'] = true;
     90                $LOG[] = 'Not image file : '.$FilesSource[$i];
    8891        }
    89         foreach ($FileInfos as $key) {
    90                 $a = explode(':', $key);
    91                 $FileInfos[trim($a[0])] = trim($a[1]);
     92       
     93        if (!isset($BlockAll)) {
     94                // Informations sur le fichier
     95                exec('include\nconvert.exe -info "'.$FilesSource[$i].'"', $FileInfos);
     96               
     97                for ($m=0; $m<=5; $m++) {
     98                        unset($FileInfos[$m]);
     99                }
     100                foreach ($FileInfos as $key) {
     101                        if ($key != '') {
     102                                $a = explode(':', $key);
     103                                $FileInfos[trim($a[0])] = trim($a[1]);
     104                        }
     105                }
    92106        }
    93107               
     
    107121       
    108122        // Compresse les fichiers dans le dossier de sortie
    109         if (!isset($BlockNormal)) {
    110                 exec('include\nconvert.exe -q '.$CONF['Qnormal'].' -out jpeg -o "'.$FileFolder.$FileName.'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
     123        if (!isset($BlockNormal) AND !isset($BlockAll)) {
     124                nconvert('-q '.$CONF['Qnormal'].' -out jpeg -o "'.$file['folder_out'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMnormal'].' '.$CONF['DIMnormal'].' '.$CONF['copyNormal'].' "'.$FilesSource[$i].'"');
    111125        }
    112         if (!isset($BlockThumbnail)) {
    113                 exec('include\nconvert.exe -q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$FileFolder.'thumbnail/'.$CONF['prefixe_mini'].$FileName.'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
     126        if (!isset($BlockThumbnail) AND !isset($BlockAll)) {
     127                nconvert('-q '.$CONF['Qthumbnail'].' -out jpeg -o "'.$file['folder_out'].'thumbnail/'.$CONF['prefixe_mini'].$file['name'].'.jpg" -dpi 72 '.$CONF['convOptions'].' -resize '.$CONF['DIMthumbnail'].' '.$CONF['DIMthumbnail'].' -rmeta -rexifthumb "'.$FilesSource[$i].'"');
    114128        }
    115         if (!isset($BlockHigh) AND $CONF['DIRhighORNOT']) {
     129        if (!isset($BlockHigh) AND $CONF['DIRhighORNOT'] AND !isset($BlockAll)) {
    116130                if ($CONF['DIMhdORNOT']) {
    117                         exec('include\nconvert.exe -q '.$CONF['Qhd'].' -out jpeg -o "'.$FileFolder.'pwg_high/'.$FileName.'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
    118                 } else if (!in_array($FileExt, $CONF['JPGexts'])) {
    119                         exec('include\nconvert.exe -q '.$CONF['Qhd'].' -out jpeg -o "'.$FileFolder.'pwg_high/'.$FileName.'.jpg" "'.$FilesSource[$i].'"');
     131                        nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" -dpi '.$CONF['DPI'].' '.$CONF['convOptions'].' -resize '.$CONF['DIMhd'].' '.$CONF['DIMhd'].' '.$CONF['copyHD'].' "'.$FilesSource[$i].'"');
     132                } else if (strtolower($file['ext']) != 'jpg') {
     133                        nconvert('-q '.$CONF['Qhd'].' -out jpeg -o "'.$file['folder_out'].'pwg_high/'.$file['name'].'.jpg" "'.$FilesSource[$i].'"');
    120134                } else {
    121                         copy($FilesSource[$i], $FileFolder.'pwg_high/'.$FileName.'.jpg');
     135                        copy_log($FilesSource[$i], $file['folder_out'].'pwg_high/'.$file['name'].'.jpg');
    122136                }
    123137        }
    124138       
    125         // Réinitialise les bloqueurs
    126         unset($FileInfos);
    127         unset($BlockNormal);
    128         unset($BlockThumbnail);
    129         unset($BlockHigh);
     139        // Réinitialise les variables
     140        unset($file, $FileInfos, $BlockNormal, $BlockThumbnail, $BlockHigh, $BlockAll);
     141        $LOG[] = "\r\n";
    130142}
    131143
     
    139151                rmdir($dir);
    140152        } else if ($CONF['indexORNOT']) {
    141                 copy('include/index.php', $dir.'/index.php');
     153                copy_log('include/index.php', $dir.'/index.php');
    142154        }
    143155}
  • extensions/PHP_Optimisateur/include/save_config.php

    r9201 r10337  
    22// Quelques traitements
    33$_POST['copyPOS'] = implode('-', $_POST['copyPOS']);
    4 $_POST['copyCOLOR'] = str_replace('#','', $_POST['copyCOLOR']);
     4$_POST['copyCOLOR'] = str_replace('#', null, $_POST['copyCOLOR']);
    55$_POST['prefixe_mini'] = delete_special_car($_POST['prefixe_mini']);
    6 if (!preg_match('#(.*)/$#', $_POST['DIRsource'])) $_POST['DIRsource'] .= '/';
    7 if (!preg_match('#(.*)/$#', $_POST['DIRsortie'])) $_POST['DIRsortie'] .= '/';
     6$_POST['DIRsource'] = rtrim($_POST['DIRsource'], '/') . '/';
     7$_POST['DIRsortie'] = rtrim($_POST['DIRsortie'], '/') . '/';
    88
    99// Vérifications
    1010if (!is_decimal($_POST['Qhd']) OR $_POST['Qhd'] > 100) {
    1111        $_POST['Qhd'] = 100;
    12         $Errors['ErrorConfig'] = 'notice';
     12        $ERRORS['conf'][] = array(l10n('Qhd'), 'must_be_integer_100');
    1313}
    1414if (!is_decimal($_POST['Qnormal']) OR $_POST['Qnormal'] > 100) {
    1515        $_POST['Qnormal'] = 100;
    16         $Errors['ErrorConfig'] = 'notice';
     16        $ERRORS['conf'][] = array(l10n('Qnormal'), 'must_be_integer_100');
    1717}
    1818if (!is_decimal($_POST['Qthumbnail']) OR $_POST['Qthumbnail'] > 100) {
    1919        $_POST['Qthumbnail'] = 100;
    20         $Errors['ErrorConfig'] = 'notice';
     20        $ERRORS['conf'][] = array(l10n('Qthumbnail'), 'must_be_integer_100');
    2121}
    2222if (!is_decimal($_POST['DIMhd'])) {
    2323        $_POST['DIMhd'] = 2560;
    24         $Errors['ErrorConfig'] = 'notice';
     24        $ERRORS['conf'][] = array(l10n('DIMhd'), 'must_be_integer');
    2525}
    2626if (!is_decimal($_POST['DIMnormal']) OR $_POST['DIMnormal'] > $_POST['DIMhd']) {
    2727        $_POST['DIMnormal'] = 800;
    28         $Errors['ErrorConfig'] = 'notice';
     28        $ERRORS['conf'][] = array(l10n('DIMnormal'), 'must_be_integer');
    2929}
    3030if (!is_decimal($_POST['DIMthumbnail']) OR $_POST['DIMthumbnail'] > $_POST['DIMnormal']) {
    3131        $_POST['DIMthumbnail'] = 120;
    32         $Errors['ErrorConfig'] = 'notice';
     32        $ERRORS['conf'][] = array(l10n('DIMthumbnail'), 'must_be_integer');
    3333}
    3434if (!is_decimal($_POST['DPI'])) {
    3535        $_POST['DPI'] = 72;
    36         $Errors['ErrorConfig'] = 'notice';
     36        $ERRORS['conf'][] = array(l10n('DPI'), 'must_be_integer');
     37}
     38if (!is_decimal($_POST['copySIZE'])) {
     39        $_POST['copySIZE'] = 0.05;
     40        $ERRORS['conf'][] = array(l10n('copySIZE'), 'must_be_decimal');
    3741}
    3842       
     
    4953}
    5054
     55
     56// écrase la configuration
     57unset($_POST['submit']);
     58$CONF = array_merge($CONF, array_settype($_POST));
     59
    5160// Contenu du fichier
    5261$content = '<?xml version="1.0" encoding="UTF-8"?>'."\r\n".'<config>'."\r\n";
     
    5564file_put_contents('config.xml', $content);
    5665
    57 if (isset($Errors['ErrorConfig'])) {
    58         header('Location:index.php?page=setup&ErrorConfig='.$Errors['ErrorConfig']);
    59 } else {
    60         header('Location:index.php');
     66if (!isset($ERRORS['conf'])) {
     67        // header('Location:index.php');
     68        $PAGE['header'] .= '<meta http-equiv="refresh" content="3;url=index.php">';
     69        $PAGE['end'] .= '<div class="generic finish">'.l10n('Saved').'</div>';
    6170}
     71
    6272?>
  • extensions/PHP_Optimisateur/include/setup.php

    r9276 r10337  
    2727$CONF['copyCOLOR'] = nice_hex_color($CONF['copyCOLOR']);
    2828
    29 $PAGE_CONTENT[0] .= '<form action="index.php?page=setup" method="post">
     29$PAGE['content'] .= '<form action="index.php?page=setup" method="post">
    3030        <div class="generic config">
    3131                <h2>'.l10n('Configuration').'</h2>
     
    212212                       
    213213                        foreach ($CONF['Plugins'] as $plugin_id => $plugin_config) {
    214                                 $PAGE_CONTENT[0] .= '<li>
     214                                $PAGE['content'] .= '<li>
    215215                                        <div class="plugin-title">
    216216                                                <span class="title">'.$plugin_config['name'].' :</span>
     
    220220                                                // Cas spéciaux dans le titre (nouveau, manquant)
    221221                                                if (isset($NewPlugins[$plugin_id])) {
    222                                                         $PAGE_CONTENT[0] .= ' <b class="new">'.l10n('New !').'</b>';
     222                                                        $PAGE['content'] .= ' <b class="new">'.l10n('New !').'</b>';
    223223                                                } else if (isset($MissingPlugins[$plugin_id])) {
    224                                                         $PAGE_CONTENT[0] .= ' <b class="miss">'.l10n('Missing !').'</b>';
     224                                                        $PAGE['content'] .= ' <b class="miss">'.l10n('Missing !').'</b>';
    225225                                                }
    226226                                               
    227227                                                // Si il est manquant on ne met que la checkbox de suppression, sinon boutons d'activation
    228                                                 $PAGE_CONTENT[0] .= '<span class="plugin-active">';
     228                                                $PAGE['content'] .= '<span class="plugin-active">';
    229229                                                        if (isset($MissingPlugins[$plugin_id])) {
    230                                                                 $PAGE_CONTENT[0] .= '<label><input type="checkbox" name="Plugins['.$plugin_id.'][delete]" value="true" checked="checked"/> '.l10n('erase').'</label>';
     230                                                                $PAGE['content'] .= '<label><input type="checkbox" name="Plugins['.$plugin_id.'][delete]" value="true" checked="checked"/> '.l10n('erase').'</label>';
    231231                                                        } else {
    232                                                                 $PAGE_CONTENT[0] .= '<input type="radio" id="" id="active-'.$plugin_id.'" name="Plugins['.$plugin_id.'][active]" value="true" '.(($plugin_config['active'])?'checked="checked"':'').'/>
     232                                                                $PAGE['content'] .= '<input type="radio" id="" id="active-'.$plugin_id.'" name="Plugins['.$plugin_id.'][active]" value="true" '.(($plugin_config['active'])?'checked="checked"':'').'/>
    233233                                                                <label for="active-'.$plugin_id.'">'.l10n('Active').'</label>
    234234                                                                <input type="radio" id="" id="inactive-'.$plugin_id.'"name="Plugins['.$plugin_id.'][active]" value="false" '.((!$plugin_config['active'])?'checked="checked"':'').'/>
    235235                                                                <label for="inactive-'.$plugin_id.'">'.l10n('Inactive').'</label>';
    236236                                                        }
    237                                                 $PAGE_CONTENT[0] .= '</span>
     237                                                $PAGE['content'] .= '</span>
    238238                                               
    239239                                        </div>';
     
    244244                                                include('plugins/'.$plugin_id.'/setup.php');
    245245                                        }
    246                                 $PAGE_CONTENT[0] .= '</li>';
     246                                $PAGE['content'] .= '</li>';
    247247                        }
    248248                       
    249                 $PAGE_CONTENT[0] .= '</ul>
     249                $PAGE['content'] .= '</ul>
    250250        </div>';
    251251       
    252252
    253         $PAGE_CONTENT[2] .= '<div class="generic link">
    254                 <input type="submit" value="'.l10n('Valid').'"/>
     253        $PAGE['end'] .= '<div class="generic link">
     254                <input type="submit" name="submit" value="'.l10n('Valid').'"/>
    255255                <input type="reset" onclick="location.href=\'index.php\'" value="'.l10n('Back').'"/>
    256256        </div>
Note: See TracChangeset for help on using the changeset viewer.