Dotclear

Changeset 2100 for plugins/cleanConfig


Ignore:
Timestamp:
03/06/10 18:25:45 (14 years ago)
Author:
Moe
Message:

clean:config 1.3.3 :

  • added compatiblity with new settings of Dotclear 2.2 (closes #419)
  • switched to GPL v2
Location:
plugins/cleanConfig
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/cleanConfig/_define.php

    r1968 r2100  
    33# 
    44# This file is part of clean:config. 
    5 # Copyright 2007,2009 Moe (http://gniark.net/) 
     5# Copyright 2007,2009,2010 Moe (http://gniark.net/) 
    66# 
    77# clean:config is free software; you can redistribute it and/or modify 
     
    2828        /* Description*/                "Delete blog and global settings and plugins' versions", 
    2929        /* Author */                    "Moe (http://gniark.net/)", 
    30         /* Version */                   '1.3.2', 
     30        /* Version */                   '1.3.3', 
    3131        /* Permissions */               null 
    3232); 
  • plugins/cleanConfig/inc/lib.cleanconfig.php

    r1968 r2100  
    2525{ 
    2626 
    27      public static function delete($setting,$limit) 
     27     public static function delete($namespace,$setting,$limit) 
    2828     { 
    2929          global $core; 
     
    3131          if ($limit == 'blog') 
    3232          { 
    33                $core->blog->settings->drop($setting); 
     33               # Settings compatibility test 
     34               if (version_compare(DC_VERSION,'2.2-alpha1','>=')) { 
     35                    $core->blog->settings->{$namespace}->drop($setting); 
     36               } else { 
     37                    $core->blog->settings->drop($setting); 
     38               } 
    3439          } 
    3540          elseif ($limit == 'global') 
     
    109114                                        $echo_ns = true; 
    110115                                   } 
     116                                    
     117                                   $id = html::escapeHTML($v['ns'].'|'.$k); 
    111118                                   $table->row('class="line"'); 
    112                                    $table->cell(form::checkbox(array('settings[]',html::escapeHTML($k)),html::escapeHTML($k),false,$v['ns'])); 
    113                                    $table->cell('<label for="'.html::escapeHTML($k).'">'.$k.'</label>'); 
     119                                   $table->cell(form::checkbox(array('settings[]',$id), 
     120                                        $id,false,$v['ns'])); 
     121                                   $table->cell('<label for="'.$id.'">'.$k.'</label>'); 
    114122                                   # boolean 
    115123                                   if (($v['type']) == 'boolean') 
     
    144152               $str .= ('<p class="checkboxes-helpers"></p>'. 
    145153               '<p>'.form::hidden(array('limit',$limit),$limit). 
    146                '<input type="submit" name="delete" value="'.__('Remove selected settings').'" /></p>'."\n". 
     154               '<input type="submit" name="delete" value="'.__('Delete selected settings').'" /></p>'."\n". 
    147155               '<p>'.$core->formNonce().'</p>'); 
    148156          } 
     
    187195          $str .= $table->get(); 
    188196          $str .= ('<p class="checkboxes-helpers"></p>'. 
    189                '<input type="submit" name="delete_versions" value="'.__('Remove selected versions').'" /></p>'."\n". 
     197               '<input type="submit" name="delete_versions" value="'.__('Delete selected versions').'" /></p>'."\n". 
    190198               '<p>'.$core->formNonce().'</p>'); 
    191199          $str .= '</form>'."\n"; 
  • plugins/cleanConfig/index.php

    r1968 r2100  
    3232 
    3333# actions 
    34 $limit = isset($_POST['limit']) ? $_POST['limit'] : ''; 
     34$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : ''; 
     35 
    3536if ((isset($_POST['delete'])) AND (($limit == 'blog') OR ($limit == 'global'))) 
    3637{ 
    3738     if (count($_POST['settings']) == 0) 
    3839     { 
    39           $msg = '<p class="message">'.__('No settings deleted.').'</p>'; 
     40          $msg = __('No setting deleted.'); 
    4041          $default_tab = $limit.'_settings'; 
    4142     } 
     
    4445          foreach ($_POST['settings'] as $setting) 
    4546          { 
    46                cleanconfig::delete($setting,$limit); 
     47               $id = explode('|',$setting); 
     48               cleanconfig::delete($id[0],$id[1],$limit); 
    4749          } 
    4850          $msg = '<div class="message"><p>'. 
    49                (($limit == 'blog') ? __('Deleted blog settings:') : __('Deleted global settings:')).'</p><ul><li>'. 
    50                implode('</li><li>',$_POST['settings']).'</li></ul></div>'; 
    51           $default_tab = $limit.'_settings'; 
     51           
     52          http::redirect($p_url.'&settingsdeleted=1&limit='.$limit); 
    5253     } 
    5354} 
     
    5657     if (count($_POST['versions']) == 0) 
    5758     { 
    58           $msg = '<p class="message">'.__('No versions deleted.').'</p>'; 
     59          $msg = __('No version deleted.'); 
    5960          $default_tab = 'versions'; 
    6061     } 
     
    6566               cleanconfig::delete_version($k); 
    6667          } 
    67           $msg = '<div class="message"><p>'.__('Deleted versions:'). 
    68                '</p><ul><li>'. 
    69                implode('</li><li>',$_POST['versions']).'</li></ul></div>'; 
    70           $default_tab = 'versions'; 
     68           
     69          http::redirect($p_url.'&versionsdeleted=1'); 
    7170     } 
     71} 
     72 
     73if (isset($_GET['settingsdeleted'])) 
     74{ 
     75     $msg = __('The selected settings have been deleted.'); 
     76      
     77     $default_tab = $limit.'_settings'; 
     78} 
     79elseif (isset($_GET['versionsdeleted'])) 
     80{ 
     81     $msg = __('Versions deleted.'); 
    7282} 
    7383 
     
    108118<body> 
    109119 
    110      <h2><?php echo html::escapeHTML($core->blog->name); ?> &gt; <?php echo __('clean:config'); ?></h2> 
    111  
    112      <?php if (!empty($msg)) {echo $msg;} ?> 
    113  
     120     <h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <?php echo __('clean:config'); ?></h2> 
     121      
     122     <?php  
     123          if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} 
     124     ?> 
     125      
    114126     <div class="multi-part" id="blog_settings" title="<?php echo __('blog settings'); ?>"> 
    115127          <?php echo(cleanconfig::settings('blog')); ?> 
     
    121133 
    122134     <div class="multi-part" id="versions" title="<?php echo __('versions'); ?>"> 
    123           <p><?php echo(__('Deletting the version of a module will reinstall it if the module has an install process.')); ?></p> 
     135          <p><?php echo(__('Deletting the version of a plugin will reinstall it if the plugin has an install process.')); ?></p> 
    124136          <?php echo(cleanconfig::versions()); ?> 
    125137     </div> 
  • plugins/cleanConfig/locales/fr/main.po

    r1968 r2100  
    1 # French translation of clean:config, a plugin for dotclear 
    2 # This file is generated by LangOmatic, a plugin for Dotclear 
     1# Language: français 
     2# plugin: cleanConfig - 1.3.2 
     3# Date: 2010-03-05 21:01:49 
     4# Translated with dcTranslater - 1.2 
    35 
    46msgid "" 
    57msgstr "Content-Type: text/plain; charset=UTF-8\n" 
    68 
    7 #: _admin.php:24 
    8 #: index.php:75 
    9 #: index.php:108 
     9#: index.php:120 
    1010msgid "clean:config" 
    1111msgstr "clean:config" 
    1212 
    13 #: class.cleanconfig.php:54 
     13#: inc/lib.cleanconfig.php:59 
    1414msgid "Use carefully. Only settings related to plugins can be deleted." 
    1515msgstr "À utiliser avec précaution. Seuls les paramètres liés aux extensions peuvent être effacés." 
    1616 
    17 #: class.cleanconfig.php:56 
    18 #: class.cleanconfig.php:158 
     17#: inc/lib.cleanconfig.php:166 
    1918msgid "Settings" 
    2019msgstr "Paramètres" 
    2120 
    22 #: class.cleanconfig.php:59 
     21#: inc/lib.cleanconfig.php:64 
    2322msgid "Setting" 
    2423msgstr "Paramètre" 
    2524 
    26 #: class.cleanconfig.php:60 
    27 msgid "Value" 
    28 msgstr "Valeur" 
    29  
    30 #: class.cleanconfig.php:108 
     25#: inc/lib.cleanconfig.php:113 
    3126msgid "namespace:" 
    3227msgstr "namespace&nbsp;:" 
    3328 
    34 #: class.cleanconfig.php:137 
     29#: inc/lib.cleanconfig.php:145 
    3530msgid "No setting." 
    3631msgstr "Pas de paramètre." 
    3732 
    38 #: class.cleanconfig.php:146 
    39 msgid "Remove selected settings" 
    40 msgstr "Supprimer les paramètres sélectionnés" 
     33#: inc/lib.cleanconfig.php:154 
     34msgid "Delete selected settings" 
     35msgstr "Supprimer les paramètres sélectionnées" 
    4136 
    42 #: class.cleanconfig.php:166 
     37#: inc/lib.cleanconfig.php:174 
    4338msgid "%s is empty" 
    4439msgstr "%s est vide" 
    4540 
    46 #: class.cleanconfig.php:170 
     41#: inc/lib.cleanconfig.php:178 
    4742msgid "Versions" 
    4843msgstr "Versions" 
    4944 
    50 #: class.cleanconfig.php:173 
    51 msgid "Module" 
    52 msgstr "Modules" 
     45#: inc/lib.cleanconfig.php:181 
     46msgid "plugin" 
     47msgstr "plugins" 
    5348 
    54 #: class.cleanconfig.php:189 
    55 msgid "Remove selected versions" 
     49#: inc/lib.cleanconfig.php:197 
     50msgid "Delete selected versions" 
    5651msgstr "Supprimer les versions sélectionnées" 
    5752 
    58 #: index.php:39 
    59 msgid "No settings deleted." 
     53#: index.php:40 
     54msgid "No setting deleted." 
    6055msgstr "Aucun paramètre supprimé." 
    6156 
    62 #: index.php:48 
    63 msgid "Deleted blog settings:" 
    64 msgstr "Paramètres du blog supprimés&nbsp;:" 
    65  
    66 #: index.php:48 
    67 msgid "Deleted global settings:" 
    68 msgstr "Paramètres globaux supprimés&nbsp;:" 
    69  
    70 #: index.php:57 
    71 msgid "No versions deleted." 
     57#: index.php:59 
     58msgid "No version deleted." 
    7259msgstr "Aucune version supprimée." 
    7360 
    74 #: index.php:66 
    75 msgid "Deleted versions:" 
    76 msgstr "Versions supprimées&nbsp;:" 
     61#: index.php:75 
     62msgid "The selected settings have been deleted." 
     63msgstr "Les paramètres sélectionnés ont été supprimés." 
    7764 
    78 #: index.php:84 
     65#: index.php:81 
     66msgid "Versions deleted." 
     67msgstr "Versions supprimées." 
     68 
     69#: index.php:96 
    7970msgid "Are you sure you want to delete settings?" 
    8071msgstr "Êtes-vous certain de vouloir supprimer les paramètres ?" 
    8172 
    82 #: index.php:86 
     73#: index.php:98 
    8374msgid "Are you sure you want to delete versions?" 
    8475msgstr "Êtes-vous certain de vouloir supprimer les versions ?" 
    8576 
    86 #: index.php:112 
    87 msgid "blog settings" 
    88 msgstr "paramètres du blog" 
    89  
    90 #: index.php:116 
    91 msgid "global settings" 
    92 msgstr "paramètres globaux" 
    93  
    94 #: index.php:120 
     77#: index.php:134 
    9578msgid "versions" 
    9679msgstr "versions" 
    9780 
    98 #: index.php:121 
    99 msgid "Deletting the version of a module will reinstall it if the module has an install process." 
    100 msgstr "Effacer la version d'un module le réinstallera si le module a une procédure d'installation." 
     81#: index.php:135 
     82msgid "Deletting the version of a plugin will reinstall it if the plugin has an install process." 
     83msgstr "Effacer la version d'un plugin le réinstallera si le plugin a une procédure d'installation." 
     84 
Note: See TracChangeset for help on using the changeset viewer.

Sites map