Dotclear

Changeset 2199


Ignore:
Timestamp:
04/16/10 16:51:19 (13 years ago)
Author:
JcDenis
Message:

dcAdvancedCleaner 0.4:

  • Fixed list of tables (closes #440)
  • Fixed direct uninstaller
  • Added readable errors return
  • Added DC 2.2 compatibility (new settings)
  • Changed admin design
Location:
plugins/dcAdvancedCleaner
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcAdvancedCleaner/_admin.php

    r1567 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1313if (!defined('DC_CONTEXT_ADMIN')){return;} 
    1414 
    15 if (!$core->auth->isSuperAdmin()){return;} 
    16  
    1715$_menu['Plugins']->addItem( 
    1816     __('Advanced cleaner'), 
  • plugins/dcAdvancedCleaner/_define.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1717     /* Description*/         "Make a huge cleaning of dotclear", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.3', 
     19     /* Version */            '0.4', 
    2020     /* Permissions */        null 
    2121); 
    22      /* date */          #20091213 
     22     /* date */          #20100416 
    2323?> 
  • plugins/dcAdvancedCleaner/_install.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    2424{ 
    2525     # Check DC version (dev on) 
    26      if (!version_compare(DC_VERSION,'2.1.6','>=')) 
     26     if (version_compare(DC_VERSION,'2.1.6','<')) 
    2727     { 
    2828          throw new Exception('Plugin called dcAdvancedCleaner requires Dotclear 2.1.6 or higher.'); 
    2929     } 
    30      # Check DC version (new settings) 
    31      if (version_compare(DC_VERSION,'2.2','>=')) 
    32      { 
    33           throw new Exception('Plugin called dcAdvancedCleaner requires Dotclear up to 2.2.'); 
    34      } 
    3530 
    3631     # Settings 
    37      $s = null; 
    38      $s =& $core->blog->settings; 
    39      $s->setNameSpace('dcAdvancedCleaner'); 
    40      $s->put('dcadvancedcleaner_behavior_active',true,'boolean','',false,true); 
    41      $s->put('dcadvancedcleaner_dcproperty_hide',true,'boolean','',false,true); 
    42      $s->setNameSpace('system'); 
     32     $s = dcAdvancedCleanerSettings($core); 
     33     $s->put('dcAdvancedCleaner_behavior_active',true,'boolean','',false,true); 
     34     $s->put('dcAdvancedCleaner_dcproperty_hide',true,'boolean','',false,true); 
    4335 
    4436     # Version 
  • plugins/dcAdvancedCleaner/_prepend.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1515global $__autoload, $core; 
    1616 
    17 # dcac class 
     17# Main class 
    1818$__autoload['dcAdvancedCleaner'] =  
    1919     dirname(__FILE__).'/inc/class.dc.advanced.cleaner.php'; 
     
    2323     dirname(__FILE__).'/inc/lib.dc.advanced.cleaner.behaviors.php'; 
    2424 
    25 # Generic class 
     25# Unsintaller class 
    2626$__autoload['dcUninstaller'] =  
    2727     dirname(__FILE__).'/inc/class.dc.uninstaller.php'; 
     
    4848     require_once dirname(__FILE__).'/inc/lib.dc.advanced.cleaner.activityreport.php'; 
    4949} 
     50 
     51# DC 2.1.6 vs 2.2 settings 
     52function dcAdvancedCleanerSettings($core,$namespace='dcAdvancedCleaner') 
     53{ 
     54     if (!version_compare(DC_VERSION,'2.1.6','<=')) {  
     55          $core->blog->settings->addNamespace($namespace);  
     56          return $core->blog->settings->{$namespace};  
     57     } else {  
     58          $core->blog->settings->setNamespace($namespace);  
     59          return $core->blog->settings;  
     60     } 
     61} 
    5062?> 
  • plugins/dcAdvancedCleaner/inc/class.dc.advanced.cleaner.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1515class dcAdvancedCleaner 
    1616{ 
     17     protected static $errors = array( 
     18          'settings' => array( 
     19               'delete_global' => 'Failed to delete global settings', 
     20               'delete_local' => 'Failed to delete local settings', 
     21               'delete_all' => 'Failed to delete all settings' 
     22          ), 
     23          'tables' => array( 
     24               'empty' => 'Failed to empty table', 
     25               'delete' => 'Failed to delete table' 
     26          ), 
     27          'plugins' => array( 
     28               'empty' => 'Failed to empty plugin folder', 
     29               'delete' => 'Failed to delete plugin folder' 
     30          ), 
     31          'themes' => array( 
     32               'empty' => 'Failed to empty themes folder', 
     33               'delete' => 'Failed to delete themes folder' 
     34          ), 
     35          'caches' => array( 
     36               'empty' => 'Failed to empty cache folder', 
     37               'delete' => 'Failed to delete cache folder' 
     38          ), 
     39          'versions' => array( 
     40               'delete' => 'Failed to delete version' 
     41          ) 
     42     ); 
     43 
    1744     public static $dotclear = array( 
    1845          'settings' => array( 
     
    7097     protected static function deleteGlobalSettings($core,$entry) 
    7198     { 
    72           return $core->con->execute( 
     99          $core->con->execute( 
    73100               'DELETE FROM '.$core->prefix.'setting '. 
    74101               'WHERE blog_id IS NULL '. 
    75                "AND setting_ns = '".$core->con->escape($entry)."' "); 
     102               "AND setting_ns = '".$core->con->escape($entry)."' " 
     103          ); 
    76104     } 
    77105 
    78106     protected static function deleteLocalSettings($core,$entry) 
    79107     { 
    80           return $core->con->execute( 
     108          $core->con->execute( 
    81109               'DELETE FROM '.$core->prefix.'setting '. 
    82110               "WHERE blog_id = '".$core->con->escape($core->blog->id)."' ". 
    83                "AND setting_ns = '".$core->con->escape($entry)."' "); 
     111               "AND setting_ns = '".$core->con->escape($entry)."' " 
     112          ); 
    84113     } 
    85114 
    86115     protected static function deleteAllSettings($core,$entry) 
    87116     { 
    88           return $core->con->execute( 
     117          $core->con->execute( 
    89118               'DELETE FROM '.$core->prefix.'setting '. 
    90119               "WHERE setting_ns = '".$core->con->escape($entry)."' ". 
    91                "AND (blog_id IS NULL OR blog_id != '') "); 
     120               "AND (blog_id IS NULL OR blog_id != '') " 
     121          ); 
    92122     } 
    93123 
     
    99129          $rs = array(); 
    100130          $i = 0; 
    101           foreach($res as $v) { 
    102  
    103                $rs[$i]['key'] = substr($v,strlen($core->prefix)); 
    104                $rs[$i]['value'] = $core->con->select('SELECT count(*) FROM '.$v)->f(0); 
     131          foreach($res as $k => $v) 
     132          { 
     133               if ('' != $core->prefix) 
     134               { 
     135                    if (!preg_match('/^'.$core->prefix.'/',$v)) continue; 
     136                    $v = substr($v,strlen($core->prefix)); 
     137               } 
     138               $rs[$i]['key'] = $v; 
     139               $rs[$i]['value'] = $core->con->select('SELECT count(*) FROM '.$res[$k])->f(0); 
    105140               $i++; 
    106141          } 
     
    110145     protected static function emptyTable($core,$entry) 
    111146     { 
    112           return (boolean) $core->con->execute( 
    113                'DELETE FROM '.$core->con->escapeSystem($core->prefix.$entry)); 
     147          $core->con->execute( 
     148               'DELETE FROM '.$core->con->escapeSystem($core->prefix.$entry) 
     149          ); 
    114150     } 
    115151 
    116152     protected static function deleteTable($core,$entry) 
    117153     { 
    118           if (self::emptyTable($core,$entry)) { 
    119                return (boolean) $core->con->execute( 
    120                     'DROP TABLE '.$core->con->escapeSystem($core->prefix.$entry)); 
    121           } 
    122           return false; 
     154          self::emptyTable($core,$entry); 
     155 
     156          $core->con->execute( 
     157               'DROP TABLE '.$core->con->escapeSystem($core->prefix.$entry) 
     158          ); 
    123159     } 
    124160 
     
    140176     protected static function deleteVersion($core,$entry) 
    141177     { 
    142           return (boolean) $core->con->execute( 
     178          $core->con->execute( 
    143179               'DELETE FROM '.$core->prefix.'version '. 
    144                "WHERE module = '".$core->con->escape($entry)."' "); 
     180               "WHERE module = '".$core->con->escape($entry)."' " 
     181          ); 
    145182     } 
    146183 
     
    154191     { 
    155192          $res = explode(PATH_SEPARATOR,DC_PLUGINS_ROOT); 
    156           return self::delDir($res,$entry,false); 
     193          self::delDir($res,$entry,false); 
    157194     } 
    158195 
     
    160197     { 
    161198          $res = explode(PATH_SEPARATOR,DC_PLUGINS_ROOT); 
    162           return self::delDir($res,$entry,true); 
     199          self::delDir($res,$entry,true); 
    163200     } 
    164201 
     
    170207     protected static function emptyTheme($core,$entry) 
    171208     { 
    172           return self::delDir($core->blog->themes_path,$entry,false); 
     209          self::delDir($core->blog->themes_path,$entry,false); 
    173210     } 
    174211 
    175212     protected static function deleteTheme($core,$entry) 
    176213     { 
    177           return self::delDir($core->blog->themes_path,$entry,true); 
     214          self::delDir($core->blog->themes_path,$entry,true); 
    178215     } 
    179216 
     
    185222     protected static function emptyCache($core,$entry) 
    186223     { 
    187           return self::delDir(DC_TPL_CACHE,$entry,false); 
     224          self::delDir(DC_TPL_CACHE,$entry,false); 
    188225     } 
    189226 
    190227     protected static function deleteCache($core,$entry) 
    191228     { 
    192           return self::delDir(DC_TPL_CACHE,$entry,true); 
     229          self::delDir(DC_TPL_CACHE,$entry,true); 
    193230     } 
    194231 
     
    201238          $core->callBehavior('dcAdvancedCleanerBeforeAction',$type,$action,$ns); 
    202239 
    203           # Delete global settings 
    204           if ($type == 'settings' && $action == 'delete_global') 
    205                self::deleteGlobalSettings($core,$ns); 
    206  
    207           # Delete local settings 
    208           if ($type == 'settings' && $action == 'delete_local') 
    209                self::deleteLocalSettings($core,$ns); 
    210  
    211           # Delete all settings 
    212           if ($type == 'settings' && $action == 'delete_all') 
    213                self::deleteAllSettings($core,$ns); 
    214  
    215           # Empty tables 
    216           if ($type == 'tables' && $action == 'empty') 
    217                self::emptyTable($core,$ns); 
    218  
    219           # Delete tables 
    220           if ($type == 'tables' && $action == 'delete') 
    221                self::deleteTable($core,$ns); 
    222  
    223           # Delete versions 
    224           if ($type == 'versions' && $action == 'delete') 
    225                self::deleteVersion($core,$ns); 
    226  
    227           # Empty plugins 
    228           if ($type == 'plugins' && $action == 'empty') 
    229                self::emptyPlugin($core,$ns); 
    230  
    231           # Delete plugins 
    232           if ($type == 'plugins' && $action == 'delete') 
    233                self::deletePlugin($core,$ns); 
    234  
    235           # Empty themes 
    236           if ($type == 'themes' && $action == 'empty') 
    237                self::emptyTheme($core,$ns); 
    238  
    239           # Delete themes 
    240           if ($type == 'themes' && $action == 'delete') 
    241                self::deleteTheme($core,$ns); 
    242  
    243           # Empty caches 
    244           if ($type == 'caches' && $action == 'empty') 
    245                self::emptyCache($core,$ns); 
    246  
    247           # Delete caches 
    248           if ($type == 'caches' && $action == 'delete') 
    249                self::deleteCache($core,$ns); 
     240          try { 
     241               # Delete global settings 
     242               if ($type == 'settings' && $action == 'delete_global') 
     243                    self::deleteGlobalSettings($core,$ns); 
     244 
     245               # Delete local settings 
     246               if ($type == 'settings' && $action == 'delete_local') 
     247                    self::deleteLocalSettings($core,$ns); 
     248 
     249               # Delete all settings 
     250               if ($type == 'settings' && $action == 'delete_all') 
     251                    self::deleteAllSettings($core,$ns); 
     252 
     253               # Empty tables 
     254               if ($type == 'tables' && $action == 'empty') 
     255                    self::emptyTable($core,$ns); 
     256 
     257               # Delete tables 
     258               if ($type == 'tables' && $action == 'delete') 
     259                    self::deleteTable($core,$ns); 
     260 
     261               # Delete versions 
     262               if ($type == 'versions' && $action == 'delete') 
     263                    self::deleteVersion($core,$ns); 
     264 
     265               # Empty plugins 
     266               if ($type == 'plugins' && $action == 'empty') 
     267                    self::emptyPlugin($core,$ns); 
     268 
     269               # Delete plugins 
     270               if ($type == 'plugins' && $action == 'delete') 
     271                    self::deletePlugin($core,$ns); 
     272 
     273               # Empty themes 
     274               if ($type == 'themes' && $action == 'empty') 
     275                    self::emptyTheme($core,$ns); 
     276 
     277               # Delete themes 
     278               if ($type == 'themes' && $action == 'delete') 
     279                    self::deleteTheme($core,$ns); 
     280 
     281               # Empty caches 
     282               if ($type == 'caches' && $action == 'empty') 
     283                    self::emptyCache($core,$ns); 
     284 
     285               # Delete caches 
     286               if ($type == 'caches' && $action == 'delete') 
     287                    self::deleteCache($core,$ns); 
     288 
     289               return true; 
     290          } 
     291          catch(Exception $e) { 
     292               $errors = self::$errors; 
     293               if (isset($errors[$type][$action])) { 
     294                    throw new Exception(__($errors[$type][$action])); 
     295               } 
     296               else { 
     297                    throw new Exception(sprintf(__('Cannot execute "%s" of type "%s"'),$action,$type)); 
     298               } 
     299               return false; 
     300          } 
    250301     } 
    251302 
     
    314365     protected static function delTree($dir,$delroot=true) 
    315366     { 
    316           $current_dir = opendir($dir); 
    317           while($entryname = readdir($current_dir)) { 
    318  
    319                if (is_dir($dir.'/'.$entryname) && ($entryname != '.' && $entryname!='..')) { 
    320  
    321                     if (!self::delTree($dir.'/'.$entryname)) return false; 
    322                } 
    323                elseif ($entryname != '.' && $entryname!='..') { 
    324  
    325                     if (!@unlink($dir.'/'.$entryname)) return false; 
    326                } 
    327           } 
    328           closedir($current_dir); 
     367          if (!is_dir($dir) || !is_readable($dir)) return false; 
     368 
     369          if (substr($dir,-1) != '/') $dir .= '/'; 
     370 
     371          if (($d = @dir($dir)) === false) return false; 
     372 
     373          while (($entryname = $d->read()) !== false) 
     374          { 
     375               if ($entryname != '.' && $entryname != '..') 
     376               { 
     377                    if (is_dir($dir.'/'.$entryname)) 
     378                    { 
     379                         if (!self::delTree($dir.'/'.$entryname)) return false; 
     380                    } 
     381                    else 
     382                    { 
     383                         if (!@unlink($dir.'/'.$entryname)) return false; 
     384                    } 
     385               } 
     386          } 
     387          $d->close(); 
    329388 
    330389          if ($delroot) 
  • plugins/dcAdvancedCleaner/inc/class.dc.uninstaller.php

    r1567 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    4141     */ 
    4242     protected static $allowed_properties = array( 
     43          'versions' => array( 
     44               'delete' => 'delete version in dc' 
     45          ), 
    4346          'settings' => array( 
    4447               'delete_global' => 'delete global settings', 
     
    6164               'empty' => 'empty cache folder', 
    6265               'delete' => 'delete cache folder' 
    63           ), 
    64           'versions' => array( 
    65                'delete' => 'delete version in dc' 
    6666          ) 
     67     ); 
     68 
     69     protected static $priority_properties = array( 
     70          'versions','settings','tables','themes','plugins','caches' 
    6771     ); 
    6872 
     
    96100          $this->path = explode(PATH_SEPARATOR,$path); 
    97101 
    98           foreach ($this->path as $root) { 
    99                $this->loadModule($root); 
     102          foreach ($this->path as $root) 
     103          { 
     104               if (!is_dir($root) || !is_readable($root)) continue; 
     105 
     106               if (substr($root,-1) != '/') $root .= '/'; 
     107 
     108               if (($d = @dir($root)) === false) continue; 
     109 
     110               while (($entry = $d->read()) !== false) 
     111               { 
     112                    $full_entry = $root.'/'.$entry; 
     113 
     114                    if ($entry != '.' && $entry != '..' && is_dir($full_entry)) 
     115                    { 
     116                         $this->loadModule($full_entry); 
     117                    } 
     118               } 
     119               $d->close(); 
    100120          } 
    101121 
     
    113133     public function loadModule($root) 
    114134     { 
    115           if (!is_dir($root) || !is_readable($root)) return;; 
    116  
    117           if (substr($root,-1) != '/') $root .= '/'; 
    118  
    119           if (($d = @dir($root)) === false) return; 
    120  
    121           while (($entry = $d->read()) !== false) 
    122           { 
    123                $full_entry = $root.'/'.$entry; 
    124  
    125                if ($entry != '.' && $entry != '..' && is_dir($full_entry) 
    126                 && file_exists($full_entry.'/_define.php') 
    127                 && file_exists($full_entry.'/_uninstall.php')) { 
    128  
    129                     $this->id = $entry; 
    130                     $this->mroot = $full_entry; 
    131  
    132                     require $full_entry.'/_define.php'; 
    133                     require $full_entry.'/_uninstall.php'; 
    134  
    135                     $this->id = null; 
    136                     $this->mroot = null; 
    137                } 
    138           } 
    139           $d->close(); 
     135          if (file_exists($root.'/_define.php') 
     136           && file_exists($root.'/_uninstall.php')) { 
     137 
     138               $this->id = basename($root); 
     139               $this->mroot = $root; 
     140 
     141               require $root.'/_define.php'; 
     142               require $root.'/_uninstall.php'; 
     143 
     144               $this->id = null; 
     145               $this->mroot = null; 
     146          } 
    140147     } 
    141148      
     
    208215     } 
    209216 
    210      private function addAction($group,$type,$action,$ns,$desc='') 
     217     private function addAction($group,$type,$action,$ns,$desc) 
    211218     { 
    212219          $group = self::group($group); 
     
    229236     /** 
    230237     Returns modules <var>$id</var> predefined actions associative array 
     238     ordered by priority 
    231239      
    232240     @param    id        <b>string</b>       Optionnal module ID 
     
    249257          if (!isset($this->actions[$group][$id])) return array(); 
    250258 
    251           return $this->actions[$group][$id]; 
     259          $res = array(); 
     260          foreach(self::$priority_properties as $k => $v) 
     261          { 
     262               if (!isset($this->actions[$group][$id][$v])) continue; 
     263               $res[$v] = $this->actions[$group][$id][$v]; 
     264          } 
     265 
     266          return $res; 
    252267     } 
    253268 
  • plugins/dcAdvancedCleaner/inc/lib.dc.advanced.cleaner.activityreport.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1616$core->activityReport->addGroup('dcadvancedcleaner',__('Plugin dcAdvancedCleaner')); 
    1717 
    18 # from BEHAVIOR dcAdvancedCleanerBeforeAction in dcAdvancedCleaner/inc/lib.kutrl.srv.php 
     18# from BEHAVIOR dcAdvancedCleanerBeforeAction  
     19# in dcAdvancedCleaner/inc/class.dc.advanced.cleaner.php 
    1920$core->activityReport->addAction( 
    2021     'dcadvancedcleaner', 
  • plugins/dcAdvancedCleaner/inc/lib.dc.advanced.cleaner.behaviors.php

    r1567 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    3131          $done = false; 
    3232 
    33           if (!$core->blog->settings->dcadvancedcleaner_behavior_active) return; 
     33          $s = dcAdvancedCleanerSettings($core); 
     34          if (!$s->dcAdvancedCleaner_behavior_active) return; 
    3435 
    3536          $uninstaller = new dcUninstaller($core); 
     
    3940          $m_actions = $uninstaller->getDirectActions($module['id']); 
    4041 
    41           foreach($m_callbacks as $callback) { 
    42  
    43                $f = unserialize(base64_decode($callback['func'])); 
    44                if (!is_callable($f)) continue; 
    45  
    46                call_user_func($f,$module); 
     42          foreach($m_callbacks as $k => $callback) 
     43          { 
     44               if (!isset($callback['func']) || !is_callable($callback['func'])) continue; 
     45 
     46               call_user_func($callback['func'],$module); 
    4747               $done = true; 
    4848          } 
    4949 
    50           foreach($m_actions as $type => $actions) { 
    51  
    52                foreach($actions as $v) { 
    53  
     50          foreach($m_actions as $type => $actions) 
     51          { 
     52               foreach($actions as $v) 
     53               { 
    5454                    $uninstaller->execute($type,$v['action'],$v['ns']); 
    5555                    $done = true; 
     
    6464     public static function dcAdvancedCleanerAdminTabs($core,$p_url) 
    6565     { 
    66           self::modulesTabs($core,DC_PLUGINS_ROOT,$p_url.'&amp;t=uninstaller'); 
     66          self::modulesTabs($core,DC_PLUGINS_ROOT,$p_url.'&tab=uninstaller'); 
    6767     } 
    6868 
     
    7373 
    7474     # Generic module tabs 
    75      public static function modulesTabs($core,$path,$redir,$title='Uninstall extensions') 
    76      { 
    77           if (!$core->blog->settings->dcadvancedcleaner_behavior_active) return; 
     75     public static function modulesTabs($core,$path,$redir,$title='') 
     76     { 
     77          $s = dcAdvancedCleanerSettings($core); 
     78          if (!$s->dcadvancedcleaner_behavior_active) return; 
    7879 
    7980          $err = ''; 
     81          $title = empty($title) ? __('Advanced uninstall') : $title; 
    8082 
    8183          $uninstaller = new dcUninstaller($core); 
     
    8486          $props = $uninstaller->getAllowedProperties(); 
    8587 
    86           # Execute actions 
    87           if (isset($_POST['action']) && $_POST['action'] == 'uninstall' && !empty($_POST['id'])) { 
    88  
    89                foreach($_POST['id'] as $k => $id) { 
    90  
    91                     # Settings 
    92                     if (!isset($_POST['actions'][$k])) continue; 
    93  
    94                     try { 
    95                          foreach($_POST['actions'][$k] as $ks => $sentence) { 
    96  
    97                               $s = unserialize(base64_decode($sentence)); 
    98  
    99                               if (!isset($s['type'])  
    100                                || !isset($s['action'])  
    101                                || !isset($s['ns'])) continue; 
    102  
    103                               $uninstaller->execute($s['type'],$s['action'],$s['ns']); 
    104  
    105                               http::redirect($_POST['redir'].'&removed=1'); 
     88          # Execute 
     89          if (isset($_POST['action']) && $_POST['action'] == 'uninstall' 
     90          && (!empty($_POST['extras']) || !empty($_POST['actions']))) { 
     91 
     92               try { 
     93                    # Extras 
     94                    if (!empty($_POST['extras'])) { 
     95                         foreach($_POST['extras'] as $module_id => $extras) 
     96                         { 
     97                              foreach($extras as $k => $sentence) 
     98                              { 
     99                                   $extra = @unserialize(@base64_decode($sentence)); 
     100 
     101                                   if (!$extra || !is_callable($extra)) continue; 
     102 
     103                                   call_user_func($extra,$modul_id); 
     104                              } 
    106105                         } 
    107106                    } 
    108                     catch(Exception $e) { 
    109                          $err = $e->getMessage(); 
    110                     } 
     107                    # Actions 
     108                    if (!empty($_POST['actions'])) { 
     109                         foreach($_POST['actions'] as $module_id => $actions) 
     110                         { 
     111                              foreach($actions as $k => $sentence) 
     112                              { 
     113                                   $action = @unserialize(@base64_decode($sentence)); 
     114 
     115                                   if (!$action  
     116                                    || !isset($action['type'])  
     117                                    || !isset($action['action'])  
     118                                    || !isset($action['ns'])) continue; 
     119 
     120                                   $uninstaller->execute($action['type'],$action['action'],$action['ns']); 
     121                              } 
     122                         } 
     123                    } 
     124                    http::redirect($redir.'&msg=1'); 
     125               } 
     126               catch(Exception $e) { 
     127                    $err = $e->getMessage(); 
    111128               } 
    112129          } 
    113130 
    114131          echo  
    115           '<div class="multi-part" id="uninstaller" title="'. 
    116                __($title).'">'; 
     132          '<div class="multi-part" id="uninstaller" title="'.__($title).'">'; 
    117133 
    118134          if($err) 
     
    128144          '<form method="post" action="'.$redir.'">'. 
    129145          '<table class="clear"><tr>'. 
    130           '<th>&nbsp;</th>'. 
     146          '<th>'.__('Id').'</th>'. 
    131147          '<th>'.__('Module').'</th>'; 
    132148           
     
    144160               echo 
    145161               '<tr class="line">'. 
    146                '<td class="nowrap"><label class="classic">'. 
    147                form::checkbox(array('id['.$i.']'),$module_id).' '.$module_id. 
    148                '</label></td>'. 
     162               '<td class="nowrap">'.$module_id.'</td>'. 
    149163               '<td class="maximal nowrap">'.$module['name'].' '.$module['version'].'</td>'; 
    150164 
     
    171185 
    172186                         echo '<label class="classic">'. 
    173                          form::checkbox(array('actions['.$i.']['.$j.']'),$ret). 
     187                         form::checkbox(array('actions['.$module_id.']['.$j.']'),$ret). 
    174188                         ' '.$action['desc'].'</label><br />'; 
    175189 
     
    193207 
    194208                    echo '<label class="classic">'. 
    195                     form::checkbox(array('extras['.$i.']['.$k.']'),$ret). 
     209                    form::checkbox(array('extras['.$module_id.']['.$k.']'),$ret). 
    196210                    ' '.$callback['desc'].'</label><br />'; 
    197211               } 
    198212 
    199213               echo '</td></tr>'; 
    200                $i++; 
    201214          } 
    202215          echo  
     
    204217          '<p>'. 
    205218          $core->formNonce(). 
     219          form::hidden(array('redir'),$redir). 
    206220          form::hidden(array('action'),'uninstall'). 
    207221          '<input type="submit" name="submit" value="'.__('Perform selected actions').'" /> '. 
  • plugins/dcAdvancedCleaner/index.php

    r1980 r2199  
    33# This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1414 
    1515if (!$core->auth->isSuperAdmin()){return;} 
     16 
     17# Lists 
     18function drawDcAdvancedCleanerLists($core,$type) 
     19{ 
     20     $combo_funcs = array( 
     21          'settings' => array('dcAdvancedCleaner','getSettings'), 
     22          'tables' => array('dcAdvancedCleaner','getTables'), 
     23          'plugins' => array('dcAdvancedCleaner','getPlugins'), 
     24          'themes' => array('dcAdvancedCleaner','getThemes'), 
     25          'caches' => array('dcAdvancedCleaner','getCaches'), 
     26          'versions' => array('dcAdvancedCleaner','getVersions') 
     27     ); 
     28     $combo_actions = array( 
     29          'settings' => array( 
     30               __('delete global settings') => 'delete_global', 
     31               __('delete blog settings') => 'delete_local', 
     32               __('delete all settings') =>'delete_all' 
     33          ), 
     34          'tables' => array( 
     35               __('delete') => 'delete', 
     36               __('empty') => 'empty' 
     37          ), 
     38          'plugins' => array( 
     39               __('delete') => 'delete', 
     40               __('empty') => 'empty' 
     41          ), 
     42          'themes' => array( 
     43               __('delete') => 'delete', 
     44               __('empty') => 'empty' 
     45          ), 
     46          'caches' => array( 
     47               __('delete') => 'delete', 
     48               __('empty') => 'empty' 
     49          ), 
     50          'versions' => array( 
     51               __('delete') => 'delete' 
     52          ) 
     53     ); 
     54     $combo_help = array( 
     55          'settings' => __('Namespaces registered in dcSettings'), 
     56          'tables' => __('All database tables of Dotclear'), 
     57          'plugins' => __('Folders from plugins directories'), 
     58          'themes' => __('Folders from blog themes directory'), 
     59          'caches' => __('Folders from cache directory'), 
     60          'versions' => __('Versions registered in table "version" of Dotclear') 
     61     ); 
     62 
     63     if (!isset($combo_funcs[$type])) return ''; 
     64 
     65     $s = dcAdvancedCleanerSettings($core); 
     66     $rs = call_user_func($combo_funcs[$type],$core); 
     67 
     68     echo  
     69     '<div class="listDcAdvancedCleaner">'. 
     70     '<p class="form-note">'.$combo_help[$type].'</p>'; 
     71      
     72     if (empty($rs)) { 
     73          echo  
     74          '<p>'.sprintf(__('There is no %s'),__(substr($type,0,-1))).'</p>'; 
     75     } else { 
     76 
     77          echo 
     78          '<p>'.sprintf(__('There are %s %s'),count($rs),__($type)).'</p>'. 
     79          '<form method="post" action="plugin.php?p=dcAdvancedCleaner&amp;tab=lists&amp;part='.$type.'">'. 
     80          '<table><thead><tr>'. 
     81          '<th>'.__('Name').'</th><th>'.__('Objects').'</th>'. 
     82          '</tr></thead><tbody>'; 
     83 
     84          foreach($rs as $k => $v) 
     85          { 
     86               $offline = in_array($v['key'],dcAdvancedCleaner::$dotclear[$type]); 
     87 
     88               if ($s->dcAdvancedCleaner_dcproperty_hide && $offline) continue; 
     89 
     90               echo  
     91               '<tr class="line'. 
     92               ($offline ? ' offline' : ''). 
     93               '">'. 
     94               '<td class="nowrap"><label class="classic">'. 
     95               form::checkbox(array('entries['.$k.']'),html::escapeHTML($v['key'])).' '.$v['key'].'</label></td>'. 
     96               '<td class="nowrap">'.$v['value'].'</td>'. 
     97               '</tr>'; 
     98          } 
     99 
     100          echo 
     101          '</tbody></table>'. 
     102          '<p>'.__('Action on selected rows:').'<br />'. 
     103          form::combo(array('action'),$combo_actions[$type]). 
     104          '<input type="submit" value="'.__('ok').'" />'. 
     105          form::hidden(array('p'),'dcAdvancedCleaner'). 
     106          form::hidden(array('tab'),'lists'). 
     107          form::hidden(array('part'),$type). 
     108          form::hidden(array('type'),$type). 
     109          $core->formNonce().'</p>'. 
     110          '</form>'; 
     111     } 
     112     echo  
     113     '<div>'; 
     114} 
    16115 
    17116# Localized l10n 
     
    38137 
    39138# vars 
    40 $p_url = 'plugin.php?p=dcAdvancedCleaner'; 
    41139$msg = isset($_GET['msg']) ? true : false; 
    42 $for = isset($_GET['for']) ? $_GET['for'] : ''; 
    43 $tab = isset($_REQUEST['t']) ? $_REQUEST['t'] : 'records'; 
     140$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'dcac'; 
     141$part = isset($_REQUEST['part']) ? $_REQUEST['part'] : 'caches'; 
    44142$entries = isset($_POST['entries']) ? $_POST['entries'] : ''; 
    45143$action = isset($_POST['action']) ? $_POST['action'] : ''; 
    46144$type = isset($_POST['type']) ? $_POST['type'] : ''; 
     145$s = dcAdvancedCleanerSettings($core); 
    47146 
    48147# Combos 
    49 $combo_settings = array( 
    50      __('delete global settings') => 'delete_global', 
    51      __('delete blog settings') => 'delete_local', 
    52      __('delete all settings') =>'delete_all' 
     148$combo_title = array( 
     149     'settings' => __('Settings'), 
     150     'tables' => __('Tables'), 
     151     'plugins' => __('Extensions'), 
     152     'themes' => __('Themes'), 
     153     'caches' => __('Cache'), 
     154     'versions' => __('Versions') 
    53155); 
    54 $combo_bi = array( 
    55      __('delete') => 'delete', 
    56      __('empty') => 'empty' 
    57 ); 
    58 $combo_delete = array( 
    59      __('delete') => 'delete' 
    60 ); 
     156      
    61157$combo_type = array( 
    62158     'settings' => array('delete_global','delete_local','delete_all'), 
     
    67163     'versions' => array('delete') 
    68164); 
    69 $combo_help = array( 
    70      'settings' => __('Namespaces registered in dcSettings'), 
    71      'tables' => __('All database tables of Dotclear'), 
    72      'plugins' => __('Folders from plugins directories'), 
    73      'themes' => __('Folders from blog themes directory'), 
    74      'caches' => __('Folders from cache directory'), 
    75      'versions' => __('Versions registered in table "version" of Dotclear') 
    76 ); 
    77165 
    78166# This plugin settings 
    79 if ($action == 'dcadvancedcleaner_settings') { 
    80  
    81      $core->blog->settings->setNameSpace('dcAdvancedCleaner'); 
    82      $core->blog->settings->put('dcadvancedcleaner_behavior_active', 
    83           isset($_POST['dcadvancedcleaner_behavior_active']),'boolean'); 
    84      $core->blog->settings->put('dcadvancedcleaner_dcproperty_hide', 
    85           isset($_POST['dcadvancedcleaner_dcproperty_hide']),'boolean'); 
    86      $core->blog->settings->setNameSpace('system'); 
    87  
    88      http::redirect($p_url.'&t=dcb&msg=1'); 
     167if ($tab == 'dcac' && $action == 'dcadvancedcleaner_settings') 
     168{ 
     169     try { 
     170          $s->put('dcAdvancedCleaner_behavior_active',isset($_POST['dcadvancedcleaner_behavior_active']),'boolean'); 
     171          $s->put('dcAdvancedCleaner_dcproperty_hide',isset($_POST['dcadvancedcleaner_dcproperty_hide']),'boolean'); 
     172 
     173          http::redirect($p_url.'&tab=dcac&part=dcac&part=&msg=done'); 
     174     } 
     175     catch(Exception $e) { 
     176          $core->error->add($e->getMessage()); 
     177     } 
    89178} 
    90179 
    91180# Actions 
    92 if (!empty($entries)  
     181if ($tab == 'lists' && !empty($entries)  
    93182 && isset($combo_type[$type])  
    94183 && in_array($action,$combo_type[$type])) { 
     
    99188          } 
    100189 
    101           # Redirection on success 
    102           http::redirect($p_url.'&t='.$tab.'&msg=done'); 
     190          http::redirect($p_url.'&tab=lists&part='.$part.'&msg=done'); 
    103191     } 
    104192     catch(Exception $e) { 
     
    107195} 
    108196 
    109 # Lists 
    110 $settings = dcAdvancedCleaner::getSettings($core); 
    111 $tables = dcAdvancedCleaner::getTables($core); 
    112 $plugins = dcAdvancedCleaner::getPlugins($core); 
    113 $themes = dcAdvancedCleaner::getThemes($core); 
    114 $caches = dcAdvancedCleaner::getCaches($core); 
    115 $versions = dcAdvancedCleaner::getVersions($core); 
    116  
    117 ?> 
    118 <html> 
    119  <head> 
    120   <title><?php echo __('Advanced cleaner'); ?></title> 
    121   <style type="text/css"> 
    122   .listDcAdvancedCleaner { 
    123      float:left; 
    124      padding:10px; 
    125      margin:10px 10px 0 0; 
    126      border:1px solid #CCCCCC; 
    127      background-color: #FCFCFC; 
    128   } 
    129   .bombDcAdvancedCleaner { 
    130      padding:14px 0 2px 36px; 
    131      background:url(index.php?pf=dcAdvancedCleaner/icon-b.png) no-repeat; 
    132   } 
    133   </style> 
    134   <?php echo dcPage::jsToolBar().dcPage::jsPageTabs($tab); ?> 
    135  
    136 <?php  
     197echo ' 
     198<html><head> 
     199<title>'.__('Advanced cleaner').'</title> 
     200<link rel="stylesheet" type="text/css" href="index.php?pf=dcAdvancedCleaner/style.css" />'. 
     201dcPage::jsToolBar(). 
     202dcPage::jsPageTabs($tab).' 
     203</style>'; 
    137204 
    138205# --BEHAVIOR-- dcAdvancedCleanerAdminHeader 
    139206$core->callBehavior('dcAdvancedCleanerAdminHeader',$core,$p_url,$tab); 
    140207 
    141 ?> 
    142  </head> 
    143  <body> 
    144   <h2 class="bombDcAdvancedCleaner"><?php echo html::escapeHTML($core->blog->name).' &rsaquo; '.__('Advanced cleaner'); ?></h2> 
    145   <p class="static-msg"><?php echo __('Beware: All actions done here are irreversible and are directly applied'); ?></p> 
    146   <?php if (!empty($msg)) { echo '<p class="message">'.__('Action successfully done').'</p>'; } ?> 
    147  
    148   <div class="multi-part" id="records" title="<?php echo __('Records'); ?>"> 
    149 <?php 
    150 drawDcAdvancedCleanerLists('settings',$settings,$combo_settings,$combo_help['settings'],'records'); 
    151 drawDcAdvancedCleanerLists('tables',$tables,$combo_bi,$combo_help['tables'],'records'); 
    152 drawDcAdvancedCleanerLists('versions',$versions,$combo_delete,$combo_help['versions'],'records'); 
    153 ?> 
    154   </div> 
    155  
    156   <div class="multi-part" id="folders" title="<?php echo __('Folders'); ?>"> 
    157 <?php 
    158 drawDcAdvancedCleanerLists('plugins',$plugins,$combo_bi,$combo_help['plugins'],'foldlers'); 
    159 drawDcAdvancedCleanerLists('themes',$themes,$combo_bi,$combo_help['themes'],'folders'); 
    160 drawDcAdvancedCleanerLists('caches',$caches,$combo_bi,$combo_help['caches'],'folders'); 
    161 ?> 
    162   </div> 
    163  
    164 <?php  
     208echo ' 
     209</head><body> 
     210<h2 class="bombDcAdvancedCleaner">'.html::escapeHTML($core->blog->name). 
     211' &rsaquo; '.__('Advanced cleaner').'</h2> 
     212<p class="static-msg">'.__('Beware: All actions done here are irreversible and are directly applied').'</p>'; 
     213 
     214if (!empty($msg)) { echo '<p class="message">'.__('Action successfully done').'</p>'; } 
     215 
     216echo '<div class="multi-part" id="lists" title="'.__('Records and folders').'">'. 
     217'<p>'; 
     218foreach($combo_title as $k => $v) 
     219{ 
     220     echo '<a class="button" href="'.$p_url.'&amp;tab=lists&part='.$k.'">'.$v.'</a> '; 
     221} 
     222echo '</p>'; 
     223      
     224# Load "part" page 
     225if (isset($combo_title[$part])) 
     226{ 
     227     echo '<fieldset><legend>'.$combo_title[$part].'</legend>'; 
     228     drawDcAdvancedCleanerLists($core,$part); 
     229     echo '</fieldset>'; 
     230} 
     231echo '</div>'; 
    165232 
    166233# --BEHAVIOR-- dcAdvancedCleanerAdminTabs 
    167234$core->callBehavior('dcAdvancedCleanerAdminTabs',$core,$p_url); 
    168235 
     236echo ' 
     237<div class="multi-part" id="dcac" title="'.__('This plugin settings').'"> 
     238<fieldset><legend>'.__('This plugin settings').'</legend> 
     239<form method="post" action="'.$p_url.'&amp;tab=dcac&part="> 
     240<p class="field"><label>'. 
     241form::checkbox(array('dcadvancedcleaner_behavior_active'),'1', 
     242$s->dcAdvancedCleaner_behavior_active). 
     243__('Activate behaviors').'</label></p> 
     244<p class="form-note">'.__('Enable actions set in _uninstall.php files.').'</p> 
     245<p class="field"><label>'. 
     246form::checkbox(array('dcadvancedcleaner_dcproperty_hide'),'1', 
     247$s->dcAdvancedCleaner_dcproperty_hide). 
     248__('Hide Dotclear default properties in actions tabs').' 
     249</label></p> 
     250<p class="form-note">'.__('Prevent from deleting Dotclear important properties.').'</p> 
     251<p><input type="submit" name="submit" value="'.__('Save').'" />'. 
     252form::hidden(array('p'),'dcAdvancedCleaner'). 
     253form::hidden(array('tab'),'dcac'). 
     254form::hidden(array('part'),''). 
     255form::hidden(array('action'),'dcadvancedcleaner_settings'). 
     256$core->formNonce().'</p> 
     257</form> 
     258</fieldset> 
     259</div>'; 
     260 
     261dcPage::helpBlock('dcAdvancedCleaner'); 
     262echo ' 
     263<hr class="clear"/> 
     264<p class="right"> 
     265<a class="button" href="'.$p_url.'&amp;part=dcac">'.__('settings').'</a> -  
     266dcAdvancedCleaner - '.$core->plugins->moduleInfo('dcAdvancedCleaner','version').'&nbsp; 
     267<img alt="dcMiniUrl" src="index.php?pf=dcAdvancedCleaner/icon.png" /> 
     268</p> 
     269</body></html>'; 
    169270?> 
    170  
    171   <div class="multi-part" id="dcb" title="<?php echo __('Settings'); ?>"> 
    172    <form method="post" action="plugin.php"> 
    173     <p> 
    174       <label class="classic"><?php echo 
    175        form::checkbox(array('dcadvancedcleaner_behavior_active'),'1', 
    176         $core->blog->settings->dcadvancedcleaner_behavior_active).' '. 
    177       __('Activate behaviors'); ?> 
    178       </label> 
    179      </p> 
    180      <p class="form-note"><?php echo __('Enable actions set in _uninstall.php files.'); ?></p> 
    181     <p> 
    182       <label class="classic"><?php echo 
    183        form::checkbox(array('dcadvancedcleaner_dcproperty_hide'),'1', 
    184         $core->blog->settings->dcadvancedcleaner_dcproperty_hide).' '. 
    185       __('Hide Dotclear default properties in actions tabs'); ?> 
    186       </label> 
    187      </p> 
    188      <p class="form-note"><?php echo __('Prevent from deleting Dotclear important properties.'); ?></p> 
    189      <p> 
    190      <input type="submit" name="submit" value="<?php echo __('Save'); ?>" /> 
    191       <?php echo  
    192        form::hidden(array('p'),'dcAdvancedCleaner'). 
    193        form::hidden(array('t'),'dcb'). 
    194         form::hidden(array('action'),'dcadvancedcleaner_settings'). 
    195        $core->formNonce(); 
    196       ?> 
    197       </p> 
    198      </form> 
    199   </div> 
    200    
    201   <?php echo dcPage::helpBlock('dcAdvancedCleaner'); ?> 
    202  
    203   <p class="clear">&nbsp;</p> 
    204   <hr class="clear"/> 
    205   <p class="right"> 
    206    dcAdvancedCleaner - <?php echo $core->plugins->moduleInfo('dcAdvancedCleaner','version'); ?>&nbsp; 
    207    <img alt="dcMiniUrl" src="index.php?pf=dcAdvancedCleaner/icon.png" /> 
    208   </p> 
    209  </body> 
    210 </html> 
    211 <?php 
    212  
    213 function drawDcAdvancedCleanerLists($type,$rs,$actions,$help='',$tab='records') 
    214 { 
    215      echo  
    216      '<div class="listDcAdvancedCleaner">'. 
    217      '<h2>'.__(ucfirst($type)).'</h2>'. 
    218      '<p class="form-note">'.$help.'</p>'; 
    219       
    220      if (empty($rs)) { 
    221           echo  
    222           '<p>'.sprintf(__('There is no %s'),__(substr($type,0,-1))).'</p>'; 
    223      } else { 
    224  
    225           echo 
    226           '<p>'.sprintf(__('There are %s %s'),count($rs),__($type)).'</p>'. 
    227           '<form method="post" action="plugin.php">'. 
    228           '<table><thead><tr>'. 
    229           '<th>'.__('Name').'</th><th>'.__('Objects').'</th>'. 
    230           '</tr></thead><tbody>'; 
    231  
    232           foreach($rs as $k => $v) { 
    233  
    234                $offline = in_array($v['key'],dcAdvancedCleaner::$dotclear[$type]); 
    235  
    236                if ($GLOBALS['core']->blog->settings->dcadvancedcleaner_dcproperty_hide && $offline) 
    237                     continue; 
    238  
    239                echo  
    240                '<tr class="line'. 
    241                ($offline ? ' offline' : ''). 
    242                '">'. 
    243                '<td class="nowrap"><label class="classic">'. 
    244                form::checkbox(array('entries['.$k.']'),html::escapeHTML($v['key'])).' '.$v['key'].'</label></td>'. 
    245                '<td class="nowrap">'.$v['value'].'</td>'. 
    246                '</tr>'; 
    247           } 
    248  
    249           echo 
    250           '</tbody></table>'. 
    251           '<p>'.__('Action on selected rows:').'<br />'. 
    252           form::combo(array('action'),$actions). 
    253           '<input type="submit" value="'.__('ok').'" />'. 
    254           form::hidden(array('p'),'dcAdvancedCleaner'). 
    255           form::hidden(array('t'),$tab). 
    256           form::hidden(array('type'),$type). 
    257           $GLOBALS['core']->formNonce().'</p>'. 
    258           '</form>'; 
    259      } 
    260      echo  
    261      '</div>'; 
    262 } 
    263 ?> 
  • plugins/dcAdvancedCleaner/locales/fr/main.lang.php

    r1980 r2199  
    11<?php 
    22// Language: français  
    3 // Module: dcAdvancedCleaner - 0.3 
    4 // Date: 2009-12-13 18:24:15  
     3// Module: dcAdvancedCleaner - 0.4.RC.1 
     4// Date: 2010-04-16 13:41:24  
    55// Translated with dcTranslater - 1.3  
    66 
    7 #_admin.php:18 
    8 #index.php:120 
    9 #index.php:144 
     7#_admin.php:16 
     8#index.php:200 
     9#index.php:212 
    1010$GLOBALS['__l10n']['Advanced cleaner'] = 'Nettoyeur avancé'; 
    1111 
    12 #inc/class.dc.uninstaller.php:277 
     12#inc/class.dc.uninstaller.php:292 
    1313$GLOBALS['__l10n']['extra action'] = 'Action additionelle'; 
    1414 
     
    1616$GLOBALS['__l10n']['Plugin dcAdvancedCleaner'] = 'Extension dcAdvancedCleaner'; 
    1717 
    18 #inc/lib.dc.advanced.cleaner.activityreport.php:23 
     18#inc/lib.dc.advanced.cleaner.activityreport.php:24 
    1919$GLOBALS['__l10n']['New action from dcAdvancedCleaner has been made with type="%s", action="%s", ns="%s".'] = 'Une nouvelle action depuis dcAdvancedCleaner a été effectuée avec:  type="%s", action="%s", ns="%s"'; 
    2020 
    21 #inc/lib.dc.advanced.cleaner.behaviors.php:122 
     21#inc/lib.dc.advanced.cleaner.behaviors.php:81 
     22$GLOBALS['__l10n']['Advanced uninstall'] = 'Désinstallation avancé'; 
     23 
     24#inc/lib.dc.advanced.cleaner.behaviors.php:138 
    2225$GLOBALS['__l10n']['There is no module with uninstall features'] = 'Il n\'y a pas de module avec des fonctions de désinstallation avancée'; 
    2326 
    24 #inc/lib.dc.advanced.cleaner.behaviors.php:127 
     27#inc/lib.dc.advanced.cleaner.behaviors.php:143 
    2528$GLOBALS['__l10n']['List of modules with advanced uninstall features'] = 'Liste des modules avec des fonctions de désinstallation avancée'; 
    2629 
    27 #inc/lib.dc.advanced.cleaner.behaviors.php:131 
     30#inc/lib.dc.advanced.cleaner.behaviors.php:147 
    2831$GLOBALS['__l10n']['Module'] = 'Module'; 
    2932 
    30 #inc/lib.dc.advanced.cleaner.behaviors.php:207 
     33#inc/lib.dc.advanced.cleaner.behaviors.php:221 
    3134$GLOBALS['__l10n']['Perform selected actions'] = 'Effectuer les actions sélectionnées'; 
    3235 
    33 #index.php:18 
    34 #index.php:171 
     36#index.php:30 
     37$GLOBALS['__l10n']['delete global settings'] = 'effacer les paramètres globaux'; 
     38 
     39#index.php:31 
     40$GLOBALS['__l10n']['delete blog settings'] = 'effacer les paramètres du blog'; 
     41 
     42#index.php:32 
     43$GLOBALS['__l10n']['delete all settings'] = 'effacer tous les paramètres'; 
     44 
     45#index.php:36 
     46#index.php:40 
     47#index.php:44 
     48#index.php:48 
     49$GLOBALS['__l10n']['empty'] = 'vider'; 
     50 
     51#index.php:55 
     52$GLOBALS['__l10n']['Namespaces registered in dcSettings'] = 'Espaces de nom enregistrés dans dcSettings'; 
     53 
     54#index.php:56 
     55$GLOBALS['__l10n']['All database tables of Dotclear'] = 'Toutes les tables Dotclear de la base de données'; 
     56 
     57#index.php:57 
     58$GLOBALS['__l10n']['Folders from plugins directories'] = 'Dossiers des répertoires de plugins'; 
     59 
     60#index.php:58 
     61$GLOBALS['__l10n']['Folders from blog themes directory'] = 'Dossiers du répertoire des thèmes du blog'; 
     62 
     63#index.php:59 
     64$GLOBALS['__l10n']['Folders from cache directory'] = 'Dossiers du répertoire de cache'; 
     65 
     66#index.php:60 
     67$GLOBALS['__l10n']['Versions registered in table "version" of Dotclear'] = 'Versions enregistrées dans la table "version" de Dotclear'; 
     68 
     69#index.php:74 
     70$GLOBALS['__l10n']['There is no %s'] = 'Il n\'y a pas de %s'; 
     71 
     72#index.php:78 
     73$GLOBALS['__l10n']['There are %s %s'] = 'Il y a %s %s'; 
     74 
     75#index.php:81 
     76$GLOBALS['__l10n']['Name'] = 'Nom'; 
     77 
     78#index.php:81 
     79$GLOBALS['__l10n']['Objects'] = 'Objets'; 
     80 
     81#index.php:103 
     82$GLOBALS['__l10n']['Action on selected rows:'] = 'Action sur les lignes selectionnées :'; 
     83 
     84#index.php:118 
     85#index.php:150 
    3586$GLOBALS['__l10n']['Settings'] = 'Paramètres'; 
    3687 
    37 #index.php:18 
     88#index.php:118 
     89#index.php:266 
    3890$GLOBALS['__l10n']['settings'] = 'paramètres'; 
    3991 
    40 #index.php:18 
     92#index.php:118 
    4193$GLOBALS['__l10n']['setting'] = 'paramètre'; 
    4294 
    43 #index.php:20 
     95#index.php:120 
    4496$GLOBALS['__l10n']['plugins'] = 'extensions'; 
    4597 
    46 #index.php:20 
     98#index.php:120 
    4799$GLOBALS['__l10n']['plugin'] = 'extension'; 
    48100 
    49 #index.php:21 
     101#index.php:121 
    50102$GLOBALS['__l10n']['themes'] = 'thèmes'; 
    51103 
    52 #index.php:21 
     104#index.php:121 
    53105$GLOBALS['__l10n']['theme'] = 'thème'; 
    54106 
    55 #index.php:24 
     107#index.php:124 
    56108$GLOBALS['__l10n']['delete table'] = 'effacer la table'; 
    57109 
    58 #index.php:25 
     110#index.php:125 
    59111$GLOBALS['__l10n']['delete cache files'] = 'effacer les fichiers de cache'; 
    60112 
    61 #index.php:26 
     113#index.php:126 
    62114$GLOBALS['__l10n']['delete plugin files'] = 'effacer les fichiers du plugin'; 
    63115 
    64 #index.php:27 
     116#index.php:127 
    65117$GLOBALS['__l10n']['delete theme files'] = 'effacer les fichiers du thème'; 
    66118 
    67 #index.php:28 
     119#index.php:128 
    68120$GLOBALS['__l10n']['delete the version number'] = 'effacer le numéro de version'; 
    69121 
    70 #index.php:29 
     122#index.php:129 
    71123$GLOBALS['__l10n']['Uninstall extensions'] = 'Désinstaller des extensions'; 
    72124 
    73 #index.php:30 
     125#index.php:130 
    74126$GLOBALS['__l10n']['delete %s blog settings'] = 'effacer les paramètres de %s pour ce blog'; 
    75127 
    76 #index.php:31 
     128#index.php:131 
    77129$GLOBALS['__l10n']['delete %s global settings'] = 'effacer les paramètres globaux de %s'; 
    78130 
    79 #index.php:32 
     131#index.php:132 
    80132$GLOBALS['__l10n']['delete all %s settings'] = 'effacer tous les paramètres de %s'; 
    81133 
    82 #index.php:33 
     134#index.php:133 
    83135$GLOBALS['__l10n']['delete %s table'] = 'effacer la table %s'; 
    84136 
    85 #index.php:34 
     137#index.php:134 
    86138$GLOBALS['__l10n']['delete %s version number'] = 'effacer la version de %s'; 
    87139 
    88 #index.php:35 
     140#index.php:135 
    89141$GLOBALS['__l10n']['delete %s plugin files'] = 'effacer les fichiers de l\'extension %s'; 
    90142 
    91 #index.php:36 
     143#index.php:136 
    92144$GLOBALS['__l10n']['delete %s theme file'] = 'effacer les fichiers de thème de %s'; 
    93145 
    94 #index.php:37 
     146#index.php:137 
    95147$GLOBALS['__l10n']['delete %s cache files'] = 'effacer le cache de %s'; 
    96148 
    97 #index.php:50 
    98 $GLOBALS['__l10n']['delete global settings'] = 'effacer les paramètres globaux'; 
    99  
    100 #index.php:51 
    101 $GLOBALS['__l10n']['delete blog settings'] = 'effacer les paramètres du blog'; 
    102  
    103 #index.php:52 
    104 $GLOBALS['__l10n']['delete all settings'] = 'effacer tous les paramètres'; 
    105  
    106 #index.php:56 
    107 $GLOBALS['__l10n']['empty'] = 'vider'; 
    108  
    109 #index.php:70 
    110 $GLOBALS['__l10n']['Namespaces registered in dcSettings'] = 'Espaces de nom enregistrés dans dcSettings'; 
    111  
    112 #index.php:71 
    113 $GLOBALS['__l10n']['All database tables of Dotclear'] = 'Toutes les tables Dotclear de la base de données'; 
    114  
    115 #index.php:72 
    116 $GLOBALS['__l10n']['Folders from plugins directories'] = 'Dossiers des répertoires de plugins'; 
    117  
    118 #index.php:73 
    119 $GLOBALS['__l10n']['Folders from blog themes directory'] = 'Dossiers du répertoire des thèmes du blog'; 
    120  
    121 #index.php:74 
    122 $GLOBALS['__l10n']['Folders from cache directory'] = 'Dossiers du répertoire de cache'; 
    123  
    124 #index.php:75 
    125 $GLOBALS['__l10n']['Versions registered in table "version" of Dotclear'] = 'Versions enregistrées dans la table "version" de Dotclear'; 
    126  
    127 #index.php:145 
     149#index.php:213 
    128150$GLOBALS['__l10n']['Beware: All actions done here are irreversible and are directly applied'] = 'Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées'; 
    129151 
    130 #index.php:146 
     152#index.php:215 
    131153$GLOBALS['__l10n']['Action successfully done'] = 'Action effectuée avec succès'; 
    132154 
    133 #index.php:148 
    134 $GLOBALS['__l10n']['Records'] = 'Enregistrements'; 
     155#index.php:217 
     156$GLOBALS['__l10n']['Records and folders'] = 'Enregistrements et dossiers'; 
    135157 
    136 #index.php:156 
    137 $GLOBALS['__l10n']['Folders'] = 'Dossiers'; 
     158#index.php:238 
     159#index.php:239 
     160$GLOBALS['__l10n']['This plugin settings'] = 'Paramètres de cette extension'; 
    138161 
    139 #index.php:177 
     162#index.php:244 
    140163$GLOBALS['__l10n']['Activate behaviors'] = 'Activer les behaviors'; 
    141164 
    142 #index.php:180 
     165#index.php:245 
    143166$GLOBALS['__l10n']['Enable actions set in _uninstall.php files.'] = 'Lit les actions demandées dans les fichiers _uninstall.php.'; 
    144167 
    145 #index.php:185 
     168#index.php:249 
    146169$GLOBALS['__l10n']['Hide Dotclear default properties in actions tabs'] = 'Cacher les propriétés par défaut dans les onglets d\'action'; 
    147170 
    148 #index.php:188 
     171#index.php:251 
    149172$GLOBALS['__l10n']['Prevent from deleting Dotclear important properties.'] = 'Évite de supprimer des propiétés importantes de Dotclear.'; 
    150173 
    151 #index.php:222 
    152 $GLOBALS['__l10n']['There is no %s'] = 'Il n\'y a pas de %s'; 
    153  
    154 #index.php:226 
    155 $GLOBALS['__l10n']['There are %s %s'] = 'Il y a %s %s'; 
    156  
    157 #index.php:229 
    158 $GLOBALS['__l10n']['Name'] = 'Nom'; 
    159  
    160 #index.php:229 
    161 $GLOBALS['__l10n']['Objects'] = 'Objets'; 
    162  
    163 #index.php:251 
    164 $GLOBALS['__l10n']['Action on selected rows:'] = 'Action sur les lignes selectionnées :'; 
    165  
    166174?> 
  • plugins/dcAdvancedCleaner/locales/fr/main.po

    r1980 r2199  
    11# Language: français 
    2 # Module: dcAdvancedCleaner - 0.3 
    3 # Date: 2009-12-13 18:24:15 
     2# Module: dcAdvancedCleaner - 0.4.RC.1 
     3# Date: 2010-04-16 13:41:24 
    44# Translated with translater 1.3 
    55 
     
    77msgstr "" 
    88"Content-Type: text/plain; charset=UTF-8\n" 
    9 "Project-Id-Version: dcAdvancedCleaner 0.3\n" 
     9"Project-Id-Version: dcAdvancedCleaner 0.4.RC.1\n" 
    1010"POT-Creation-Date: \n" 
    11 "PO-Revision-Date: 2009-12-13T18:24:15+00:00\n" 
     11"PO-Revision-Date: 2010-04-16T13:41:24+00:00\n" 
    1212"Last-Translator: JC Denis\n" 
    1313"Language-Team: \n" 
     
    1515"Content-Transfer-Encoding: 8bit\n" 
    1616 
    17 #: _admin.php:18 
    18 #: index.php:120 
    19 #: index.php:144 
     17#: _admin.php:16 
     18#: index.php:200 
     19#: index.php:212 
    2020msgid "Advanced cleaner" 
    2121msgstr "Nettoyeur avancé" 
    2222 
    23 #: inc/class.dc.uninstaller.php:277 
     23#: inc/class.dc.uninstaller.php:292 
    2424msgid "extra action" 
    2525msgstr "Action additionelle" 
     
    2929msgstr "Extension dcAdvancedCleaner" 
    3030 
    31 #: inc/lib.dc.advanced.cleaner.activityreport.php:23 
     31#: inc/lib.dc.advanced.cleaner.activityreport.php:24 
    3232msgid "New action from dcAdvancedCleaner has been made with type=\"%s\", action=\"%s\", ns=\"%s\"." 
    3333msgstr "Une nouvelle action depuis dcAdvancedCleaner a été effectuée avec:  type=\"%s\", action=\"%s\", ns=\"%s\"" 
    3434 
    35 #: inc/lib.dc.advanced.cleaner.behaviors.php:122 
     35#: inc/lib.dc.advanced.cleaner.behaviors.php:81 
     36msgid "Advanced uninstall" 
     37msgstr "Désinstallation avancé" 
     38 
     39#: inc/lib.dc.advanced.cleaner.behaviors.php:138 
    3640msgid "There is no module with uninstall features" 
    3741msgstr "Il n'y a pas de module avec des fonctions de désinstallation avancée" 
    3842 
    39 #: inc/lib.dc.advanced.cleaner.behaviors.php:127 
     43#: inc/lib.dc.advanced.cleaner.behaviors.php:143 
    4044msgid "List of modules with advanced uninstall features" 
    4145msgstr "Liste des modules avec des fonctions de désinstallation avancée" 
    4246 
    43 #: inc/lib.dc.advanced.cleaner.behaviors.php:131 
     47#: inc/lib.dc.advanced.cleaner.behaviors.php:147 
    4448msgid "Module" 
    4549msgstr "Module" 
    4650 
    47 #: inc/lib.dc.advanced.cleaner.behaviors.php:207 
     51#: inc/lib.dc.advanced.cleaner.behaviors.php:221 
    4852msgid "Perform selected actions" 
    4953msgstr "Effectuer les actions sélectionnées" 
    5054 
    51 #: index.php:18 
    52 #: index.php:171 
     55#: index.php:30 
     56msgid "delete global settings" 
     57msgstr "effacer les paramètres globaux" 
     58 
     59#: index.php:31 
     60msgid "delete blog settings" 
     61msgstr "effacer les paramètres du blog" 
     62 
     63#: index.php:32 
     64msgid "delete all settings" 
     65msgstr "effacer tous les paramètres" 
     66 
     67#: index.php:36 
     68#: index.php:40 
     69#: index.php:44 
     70#: index.php:48 
     71msgid "empty" 
     72msgstr "vider" 
     73 
     74#: index.php:55 
     75msgid "Namespaces registered in dcSettings" 
     76msgstr "Espaces de nom enregistrés dans dcSettings" 
     77 
     78#: index.php:56 
     79msgid "All database tables of Dotclear" 
     80msgstr "Toutes les tables Dotclear de la base de données" 
     81 
     82#: index.php:57 
     83msgid "Folders from plugins directories" 
     84msgstr "Dossiers des répertoires de plugins" 
     85 
     86#: index.php:58 
     87msgid "Folders from blog themes directory" 
     88msgstr "Dossiers du répertoire des thèmes du blog" 
     89 
     90#: index.php:59 
     91msgid "Folders from cache directory" 
     92msgstr "Dossiers du répertoire de cache" 
     93 
     94#: index.php:60 
     95msgid "Versions registered in table \"version\" of Dotclear" 
     96msgstr "Versions enregistrées dans la table \"version\" de Dotclear" 
     97 
     98#: index.php:74 
     99msgid "There is no %s" 
     100msgstr "Il n'y a pas de %s" 
     101 
     102#: index.php:78 
     103msgid "There are %s %s" 
     104msgstr "Il y a %s %s" 
     105 
     106#: index.php:81 
     107msgid "Name" 
     108msgstr "Nom" 
     109 
     110#: index.php:81 
     111msgid "Objects" 
     112msgstr "Objets" 
     113 
     114#: index.php:103 
     115msgid "Action on selected rows:" 
     116msgstr "Action sur les lignes selectionnées :" 
     117 
     118#: index.php:118 
     119#: index.php:150 
    53120msgid "Settings" 
    54121msgstr "Paramètres" 
    55122 
    56 #: index.php:18 
     123#: index.php:118 
     124#: index.php:266 
    57125msgid "settings" 
    58126msgstr "paramètres" 
    59127 
    60 #: index.php:18 
     128#: index.php:118 
    61129msgid "setting" 
    62130msgstr "paramètre" 
    63131 
    64 #: index.php:20 
     132#: index.php:120 
    65133msgid "plugins" 
    66134msgstr "extensions" 
    67135 
    68 #: index.php:20 
     136#: index.php:120 
    69137msgid "plugin" 
    70138msgstr "extension" 
    71139 
    72 #: index.php:21 
     140#: index.php:121 
    73141msgid "themes" 
    74142msgstr "thèmes" 
    75143 
    76 #: index.php:21 
     144#: index.php:121 
    77145msgid "theme" 
    78146msgstr "thème" 
    79147 
    80 #: index.php:24 
     148#: index.php:124 
    81149msgid "delete table" 
    82150msgstr "effacer la table" 
    83151 
    84 #: index.php:25 
     152#: index.php:125 
    85153msgid "delete cache files" 
    86154msgstr "effacer les fichiers de cache" 
    87155 
    88 #: index.php:26 
     156#: index.php:126 
    89157msgid "delete plugin files" 
    90158msgstr "effacer les fichiers du plugin" 
    91159 
    92 #: index.php:27 
     160#: index.php:127 
    93161msgid "delete theme files" 
    94162msgstr "effacer les fichiers du thème" 
    95163 
    96 #: index.php:28 
     164#: index.php:128 
    97165msgid "delete the version number" 
    98166msgstr "effacer le numéro de version" 
    99167 
    100 #: index.php:29 
     168#: index.php:129 
    101169msgid "Uninstall extensions" 
    102170msgstr "Désinstaller des extensions" 
    103171 
    104 #: index.php:30 
     172#: index.php:130 
    105173msgid "delete %s blog settings" 
    106174msgstr "effacer les paramètres de %s pour ce blog" 
    107175 
    108 #: index.php:31 
     176#: index.php:131 
    109177msgid "delete %s global settings" 
    110178msgstr "effacer les paramètres globaux de %s" 
    111179 
    112 #: index.php:32 
     180#: index.php:132 
    113181msgid "delete all %s settings" 
    114182msgstr "effacer tous les paramètres de %s" 
    115183 
    116 #: index.php:33 
     184#: index.php:133 
    117185msgid "delete %s table" 
    118186msgstr "effacer la table %s" 
    119187 
    120 #: index.php:34 
     188#: index.php:134 
    121189msgid "delete %s version number" 
    122190msgstr "effacer la version de %s" 
    123191 
    124 #: index.php:35 
     192#: index.php:135 
    125193msgid "delete %s plugin files" 
    126194msgstr "effacer les fichiers de l'extension %s" 
    127195 
    128 #: index.php:36 
     196#: index.php:136 
    129197msgid "delete %s theme file" 
    130198msgstr "effacer les fichiers de thème de %s" 
    131199 
    132 #: index.php:37 
     200#: index.php:137 
    133201msgid "delete %s cache files" 
    134202msgstr "effacer le cache de %s" 
    135203 
    136 #: index.php:50 
    137 msgid "delete global settings" 
    138 msgstr "effacer les paramètres globaux" 
    139  
    140 #: index.php:51 
    141 msgid "delete blog settings" 
    142 msgstr "effacer les paramètres du blog" 
    143  
    144 #: index.php:52 
    145 msgid "delete all settings" 
    146 msgstr "effacer tous les paramètres" 
    147  
    148 #: index.php:56 
    149 msgid "empty" 
    150 msgstr "vider" 
    151  
    152 #: index.php:70 
    153 msgid "Namespaces registered in dcSettings" 
    154 msgstr "Espaces de nom enregistrés dans dcSettings" 
    155  
    156 #: index.php:71 
    157 msgid "All database tables of Dotclear" 
    158 msgstr "Toutes les tables Dotclear de la base de données" 
    159  
    160 #: index.php:72 
    161 msgid "Folders from plugins directories" 
    162 msgstr "Dossiers des répertoires de plugins" 
    163  
    164 #: index.php:73 
    165 msgid "Folders from blog themes directory" 
    166 msgstr "Dossiers du répertoire des thèmes du blog" 
    167  
    168 #: index.php:74 
    169 msgid "Folders from cache directory" 
    170 msgstr "Dossiers du répertoire de cache" 
    171  
    172 #: index.php:75 
    173 msgid "Versions registered in table \"version\" of Dotclear" 
    174 msgstr "Versions enregistrées dans la table \"version\" de Dotclear" 
    175  
    176 #: index.php:145 
     204#: index.php:213 
    177205msgid "Beware: All actions done here are irreversible and are directly applied" 
    178206msgstr "Attention : toutes les actions menées ici sont irréversibles et sont directement appliquées" 
    179207 
    180 #: index.php:146 
     208#: index.php:215 
    181209msgid "Action successfully done" 
    182210msgstr "Action effectuée avec succès" 
    183211 
    184 #: index.php:148 
    185 msgid "Records" 
    186 msgstr "Enregistrements" 
    187  
    188 #: index.php:156 
    189 msgid "Folders" 
    190 msgstr "Dossiers" 
    191  
    192 #: index.php:177 
     212#: index.php:217 
     213msgid "Records and folders" 
     214msgstr "Enregistrements et dossiers" 
     215 
     216#: index.php:238 
     217#: index.php:239 
     218msgid "This plugin settings" 
     219msgstr "Paramètres de cette extension" 
     220 
     221#: index.php:244 
    193222msgid "Activate behaviors" 
    194223msgstr "Activer les behaviors" 
    195224 
    196 #: index.php:180 
     225#: index.php:245 
    197226msgid "Enable actions set in _uninstall.php files." 
    198227msgstr "Lit les actions demandées dans les fichiers _uninstall.php." 
    199228 
    200 #: index.php:185 
     229#: index.php:249 
    201230msgid "Hide Dotclear default properties in actions tabs" 
    202231msgstr "Cacher les propriétés par défaut dans les onglets d'action" 
    203232 
    204 #: index.php:188 
     233#: index.php:251 
    205234msgid "Prevent from deleting Dotclear important properties." 
    206235msgstr "Évite de supprimer des propiétés importantes de Dotclear." 
    207236 
    208 #: index.php:222 
    209 msgid "There is no %s" 
    210 msgstr "Il n'y a pas de %s" 
    211  
    212 #: index.php:226 
    213 msgid "There are %s %s" 
    214 msgstr "Il y a %s %s" 
    215  
    216 #: index.php:229 
    217 msgid "Name" 
    218 msgstr "Nom" 
    219  
    220 #: index.php:229 
    221 msgid "Objects" 
    222 msgstr "Objets" 
    223  
    224 #: index.php:251 
    225 msgid "Action on selected rows:" 
    226 msgstr "Action sur les lignes selectionnées :" 
    227  
  • plugins/dcAdvancedCleaner/release.txt

    r1980 r2199  
     1x.x xxxxxxxx 
     2 * Added orphan media cleaner 
     3 
     40.4 20100416 
     5 * Fixed list of tables (closes #440) 
     6 * Fixed direct uninstaller 
     7 * Added readable errors return 
     8 * Added DC 2.2 compatibility (new settings) 
     9 * Changed admin design 
     10 
    1110.3 20091212 
    212 * Fixed localized strings 
Note: See TracChangeset for help on using the changeset viewer.

Sites map