Dotclear

Changeset 2044:4a3330bc8bd5


Ignore:
Timestamp:
09/23/13 20:34:42 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Message:

Revamp plugin maintenance, final setp (perhaps still some typo), addresses #1484, fixes #1208, fixes #999

Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • locales/en/plugins.po

    r1989 r2044  
    959959msgstr "" 
    960960 
     961msgid "Tools to maintain the performance of your blogs." 
     962msgstr "" 
     963 
    961964msgid "Backup" 
    962965msgstr "" 
    963966 
     967msgid "Tools to back up your content." 
     968msgstr "" 
     969 
     970msgid "Development" 
     971msgstr "" 
     972 
     973msgid "Tools to assist in development of plugins, themes and core." 
     974msgstr "" 
     975 
    964976msgid "Optimize" 
    965977msgstr "" 
     
    980992msgstr "" 
    981993 
    982 msgid "One task to execute" 
     994msgid "Compressed file for all blogs" 
     995msgstr "" 
     996 
     997msgid "Translations" 
     998msgstr "" 
     999 
     1000msgid "Maintain translations" 
    9831001msgstr "" 
    9841002 
     
    9911009 
    9921010#, php-format 
    993 msgid_plural "There are %s tasks to execute." 
     1011msgid "There are %s tasks to execute." 
    9941012msgstr "" 
    9951013 
     
    10241042msgstr "" 
    10251043 
     1044msgid "It may be useful to empty this cache when modifying a theme's .html or .css files (or when updating a theme or plugin). Notice : with some hosters, the templates cache cannot be emptied with this plugin. You may then have to delete the directory <strong>/cbtpl/</strong> directly on the server with your FTP software." 
     1045msgstr "" 
     1046 
    10261047msgid "Count again comments and trackbacks" 
    10271048msgstr "" 
     
    10331054msgstr "" 
    10341055 
     1056msgid "Count again comments and trackbacks allows to check their exact numbers. This operation can be useful when importing from another blog platform (or when migrating from dotclear 1 to dotclear 2)." 
     1057msgstr "" 
     1058 
    10351059msgid "Search engine index" 
    10361060msgstr "" 
     
    10521076msgstr "" 
    10531077 
     1078msgid "Index all comments and trackbacks in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages." 
     1079msgstr "" 
     1080 
    10541081msgid "Index all entries for search engine" 
    10551082msgstr "" 
     
    10641091msgstr "" 
    10651092 
     1093msgid "Index all entries in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages." 
     1094msgstr "" 
     1095 
     1096msgid "Entries metadata" 
     1097msgstr "" 
     1098 
     1099msgid "Synchronize entries metadata" 
     1100msgstr "" 
     1101 
     1102msgid "Synchronize entry %d to %d." 
     1103msgstr "" 
     1104 
     1105msgid "Entries metadata synchronize done." 
     1106msgstr "" 
     1107 
     1108msgid "Failed to synchronize entries metadata." 
     1109msgstr "" 
     1110 
     1111msgid "Synchronize all entries metadata could be useful after importing content in your blog or do bad operation on database tables." 
     1112msgstr "" 
     1113 
    10661114msgid "Delete all logs" 
    10671115msgstr "" 
     
    10731121msgstr "" 
    10741122 
     1123msgid "Logs record all activity and connection to your blog history. Unless you need to keep this history, consider deleting these logs from time to time." 
     1124msgstr "" 
     1125 
    10751126msgid "optimize tables" 
    10761127msgstr "" 
     
    10821133msgstr "" 
    10831134 
     1135msgid "After numerous delete or update operations on Dotclear's database, it gets fragmented. Optimizing will allow to defragment it. It has no incidence on your data's integrity. It is recommended to optimize before any blog export." 
     1136msgstr "" 
     1137 
    10841138msgid "Download media folder of current blog" 
    10851139msgstr "" 
    10861140 
     1141msgid "It may be useful to backup your media folder. This compress all content of media folder into a single zip file. Notice : with some hosters, the media folder cannot be compressed with this plugin if it is too big." 
     1142msgstr "" 
     1143 
    10871144msgid "Download active theme of current blog" 
    10881145msgstr "" 
    10891146 
     1147msgid "It may be useful to backup the active theme before any change or update. This compress theme folder into a single zip file." 
     1148msgstr "" 
     1149 
    10901150msgid "Every week" 
    10911151msgstr "" 
     
    11241184msgstr "" 
    11251185 
     1186msgid "Activation" 
     1187msgstr "" 
     1188 
    11261189msgid "Display alert messages on late tasks" 
    11271190msgstr "" 
    11281191 
     1192msgid "You can place list of late tasks on your %s." 
     1193msgstr "" 
     1194 
     1195msgid "Frequency" 
     1196msgstr "Périodicité" 
     1197 
     1198msgid "Use one recall time for all tasks" 
     1199msgstr "" 
     1200 
    11291201msgid "Recall time for all tasks:" 
    11301202msgstr "" 
    11311203 
     1204msgid "Use one recall time per task" 
     1205msgstr "" 
     1206 
    11321207msgid "Recall time per task:" 
    11331208msgstr "" 
    11341209 
    1135 msgid "You can place list of late tasks on your %s." 
     1210msgid "Save this settings" 
    11361211msgstr "" 
    11371212 
  • locales/fr/plugins.po

    r2022 r2044  
    11841184msgstr "Entretien" 
    11851185 
     1186msgid "Tools to maintain the performance of your blogs." 
     1187msgstr "Outils pour maintenir les performances de vos blogs." 
     1188 
    11861189msgid "Backup" 
    11871190msgstr "Sauvegarde" 
    11881191 
     1192msgid "Tools to back up your content." 
     1193msgstr "Outils de sauvegarde du contenu" 
     1194 
     1195msgid "Development" 
     1196msgstr "Développement" 
     1197 
     1198msgid "Tools to assist in development of plugins, themes and core." 
     1199msgstr "Outils pour aider au developpement de plugins, thèmes et au core." 
     1200 
    11891201msgid "Optimize" 
    11901202msgstr "Optimiser" 
     
    12041216msgid "Compressed file for all blogs" 
    12051217msgstr "Fichier compressé pour tous les blogs (zip)" 
     1218 
     1219msgid "Translations" 
     1220msgstr "Traductions" 
     1221 
     1222msgid "Maintain translations" 
     1223msgstr "Maintenir les traductions" 
    12061224 
    12071225#, php-format 
     
    12481266msgstr "Impossible de vider le répertoire de cache des « templates »." 
    12491267 
     1268msgid "It may be useful to empty this cache when modifying a theme's .html or .css files (or when updating a theme or plugin). Notice : with some hosters, the templates cache cannot be emptied with this plugin. You may then have to delete the directory <strong>/cbtpl/</strong> directly on the server with your FTP software." 
     1269msgstr "La suppression du répertoire du cache des templates peut se révéler nécessaire lors de modifications dans les fichiers .html ou .css d'un thème (voire lors d'un changement de thème ou de mise à jour de plugin). Attention : chez certains hébergeurs (Free par exemple), le cache du répertoire des templates ne peut pas être vidé grâce à l'extension Maintenance, il faut supprimer le répertoire <strong>cbtpl</strong> situé dans le répertoire cache (dotclear/cache par défaut) avec un logiciel FTP." 
     1270 
    12501271msgid "Count again comments and trackbacks" 
    12511272msgstr "Recompter les commentaires et rétroliens" 
     
    12571278msgstr "Impossible de recompter les commentaires et rétroliens." 
    12581279 
     1280msgid "Count again comments and trackbacks allows to check their exact numbers. This operation can be useful when importing from another blog platform (or when migrating from dotclear 1 to dotclear 2)." 
     1281msgstr "Recompter commentaires et des rétroliens a pour effet de donner le nombre exact de ceux-ci pour chaque billet. Cette opération peut se révéler utile lors de l'import d'un blog d'une autre plateforme (ou d'une migration de Dotclear 1 vers Dotclear 2)." 
     1282 
    12591283msgid "Search engine index" 
    12601284msgstr "Index du moteur de recherche" 
     
    12761300msgstr "Impossible d'indexer les commentaires." 
    12771301 
     1302msgid "Index all comments and trackbacks in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages." 
     1303msgstr "Indexer tous les commentaires et rétroliens dans le moteur de recherche. Cette opération s'effectue généralement suite à un import afin d'obtenir des résultats lors des recherches, aussi bien depuis l'administration du blog qu'en partie publique." 
     1304 
    12781305msgid "Index all entries for search engine" 
    12791306msgstr "Indexer tous les billets pour le moteur de recherche" 
     
    12891316msgstr "Impossible d'indexer les billets." 
    12901317 
     1318msgid "Index all entries in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages." 
     1319msgstr "Indexer tous les billets dans le moteur de recherche. Cette opération s'effectue généralement suite à un import afin d'obtenir des résultats lors des recherches, aussi bien depuis l'administration du blog qu'en partie publique." 
     1320 
     1321msgid "Entries metadata" 
     1322msgstr "Métadonnées des billets" 
     1323 
     1324msgid "Synchronize entries metadata" 
     1325msgstr "Synchroniser les métadonnées des billets" 
     1326 
     1327msgid "Synchronize entry %d to %d." 
     1328msgstr "Synchronisation des billets %d à %d." 
     1329 
     1330msgid "Entries metadata synchronize done." 
     1331msgstr "La synchronisation des métadonnées des billets a été effectuée." 
     1332 
     1333msgid "Failed to synchronize entries metadata." 
     1334msgstr "Impossible de synchroniser les métadonnées des billets." 
     1335 
     1336msgid "Synchronize all entries metadata could be useful after importing content in your blog or do bad operation on database tables." 
     1337msgstr "La synchronisation des métadonnées des billets peut être utile après l'import de contenu dans votre blog ou après une mauvaise opération sur la base de données." 
     1338 
    12911339msgid "Delete all logs" 
    12921340msgstr "Supprimer tous les journaux (logs)" 
     
    12981346msgstr "Impossible de supprimer les journaux." 
    12991347 
     1348msgid "Logs record all activity and connection to your blog history. Unless you need to keep this history, consider deleting these logs from time to time." 
     1349msgstr "Sauf si vous avez un besoin précis de conservation des activités de connexion sur votre blog, pensez à vider régulièrement la table des journaux : elle contient l'enregistrement de chaque connexion à l'administration et des opérations qui s'y sont déroulées." 
     1350 
    13001351msgid "optimize tables" 
    13011352msgstr "Optimiser les tables" 
     
    13071358msgstr "Impossible d'optimiser les tables." 
    13081359 
     1360msgid "After numerous delete or update operations on Dotclear's database, it gets fragmented. Optimizing will allow to defragment it. It has no incidence on your data's integrity. It is recommended to optimize before any blog export." 
     1361msgstr "Au fur at à mesure des suppressions ou modifications dans vos billets, les tables de la base de données se fragmentent. L'opération d'optimisation permet de compacter celles-ci. Cette opération n'a aucun impact sur l'intégrité de vos données. Il est fortement conseillé d'optimiser la base de données avant tout export de blog." 
     1362 
    13091363msgid "Download media folder of current blog" 
    13101364msgstr "Télécharger la médiathèque du blog courant" 
    13111365 
     1366msgid "It may be useful to backup your media folder. This compress all content of media folder into a single zip file. Notice : with some hosters, the media folder cannot be compressed with this plugin if it is too big." 
     1367msgstr "Il peut être utile de sauvegarder votre médiathèque. Ceci comprime tout le contenu du répertoire de média dans un seul fichier Zip. Remarque : chez certains hébergeurs, la médiathèque ne peut pas être compressée avec ce plugin si elle est trop grande." 
     1368 
    13121369msgid "Download active theme of current blog" 
    13131370msgstr "Télécharger le theme actif du blog courant" 
    13141371 
     1372msgid "It may be useful to backup the active theme before any change or update. This compress theme folder into a single zip file." 
     1373msgstr "Il peut être utile de sauvegarder le thème courant avant tout changement ou mise à jour. Ceci comprime tout le contenu du répertoire du thème dans un seul fichier Zip." 
     1374 
    13151375msgid "Every week" 
    13161376msgstr "Chaque semaine" 
     
    13651425msgstr "Périodicité" 
    13661426 
     1427msgid "Use one recall time for all tasks" 
     1428msgstr "Utiliser le même délai de rappel pour toutes les tâches" 
     1429 
    13671430msgid "Recall time for all tasks:" 
    13681431msgstr "Délai de rappel pour toutes les tâches :" 
    13691432 
     1433msgid "Use one recall time per task" 
     1434msgstr "Utiliser un délai de rappel différent pour chaque tâche" 
     1435 
    13701436msgid "Recall time per task:" 
    13711437msgstr "Délai de rappel par tâche :" 
  • plugins/buildtools/_admin.php

    r1977 r2044  
    1111# -- END LICENSE BLOCK ----------------------------------------- 
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    13 $core->addBehavior('dcMaintenanceRegister', array('dcBuildTools', 'maintenanceAdmin')); 
     13$core->addBehavior('dcMaintenanceInit', array('dcBuildTools', 'maintenanceAdmin')); 
    1414 
    1515class dcBuildTools 
    1616{ 
    17      public static function maintenanceAdmin($core, $tasks, $groups, $tabs) { 
    18           $tasks[] = 'dcMaintenanceBuildtools'; 
     17     public static function maintenanceAdmin($maintenance) { 
     18          $maintenance->addTask('dcMaintenanceBuildtools'); 
    1919     } 
    2020} 
  • plugins/buildtools/class.dc.maintenance.buildtools.php

    r1978 r2044  
    44class dcMaintenanceBuildtools extends dcMaintenanceTask 
    55{ 
    6      protected $group = 'other'; 
     6     protected $tab = 'dev'; 
     7     protected $group = 'l10n'; 
    78 
    89     protected function init() 
     
    1112          $this->success           = __('fake l10n file generated.'); 
    1213          $this->error        = __('Failed to generate fake l10n file.'); 
     14          $this->description  = __('Generate a php file that contents strings to translate that are not be done with core tools.'); 
    1315     } 
    1416 
  • plugins/importExport/_admin.php

    r840 r2044  
    3333     )); 
    3434} 
    35 ?> 
     35 
     36$core->addBehavior('dcMaintenanceInit', 'ieMaintenanceInit'); 
     37 
     38function ieMaintenanceInit($maintenance) 
     39{ 
     40     $maintenance 
     41     ->addTask('ieMaintenanceExportblog') 
     42     ->addTask('ieMaintenanceExportfull') 
     43     ; 
     44} 
  • plugins/importExport/_prepend.php

    r1955 r2044  
    4545$__autoload['ieMaintenanceExportblog'] = dirname(__FILE__).'/inc/lib.ie.maintenance.php'; 
    4646$__autoload['ieMaintenanceExportfull'] = dirname(__FILE__).'/inc/lib.ie.maintenance.php'; 
    47  
    48 $this->core->addBehavior('dcMaintenanceRegister', 'ieMaintenanceRegister'); 
    49  
    50 function ieMaintenanceRegister($core, $tasks, $groups, $tabs) 
    51 { 
    52      $tasks[] = 'ieMaintenanceExportblog'; 
    53      $tasks[] = 'ieMaintenanceExportfull'; 
    54 } 
    55 ?> 
  • plugins/maintenance/_admin.php

    r1989 r2044  
    2222 
    2323// Admin behaviors 
    24 $core->addBehavior('dcMaintenanceRegister', array('dcMaintenanceAdmin', 'dcMaintenanceRegister')); 
     24$core->addBehavior('dcMaintenanceInit', array('dcMaintenanceAdmin', 'dcMaintenanceInit')); 
    2525$core->addBehavior('adminDashboardFavs', array('dcMaintenanceAdmin', 'adminDashboardFavs')); 
    2626$core->addBehavior('adminDashboardFavsIcon', array('dcMaintenanceAdmin', 'adminDashboardFavsIcon')); 
     
    2828$core->addBehavior('adminDashboardOptionsForm',   array('dcMaintenanceAdmin',   'adminDashboardOptionsForm')); 
    2929$core->addBehavior('adminAfterDashboardOptionsUpdate', array('dcMaintenanceAdmin',   'adminAfterDashboardOptionsUpdate')); 
     30$core->addBehavior('adminPageHelpBlock',     array('dcMaintenanceAdmin',   'adminPageHelpBlock')); 
    3031 
    3132/** 
     
    4142      * Register default tasks. 
    4243      * 
    43       * @param $core     <b>dcCore</b>  dcCore instance 
    44       * @param $tasks    <b>arrayObject</b>  Array of tasks to register 
    45       * @param $groups   <b>arrayObject</b>  Array of groups to register 
    46       * @param $tabs     <b>arrayObject</b>  Array of tabs to register 
    47       */ 
    48       public static function dcMaintenanceRegister($core, $tasks, $groups, $tabs) 
    49      { 
    50           $tabs['maintenance'] = __('Servicing'); 
    51           $tabs['backup'] = __('Backup'); 
    52  
    53           $groups['optimize'] = __('Optimize'); 
    54           $groups['index'] = __('Count and index'); 
    55           $groups['purge'] = __('Purge'); 
    56           $groups['other'] = __('Other'); 
    57           $groups['zipblog'] = __('Compressed file for current blog'); 
    58           $groups['zipfull'] = __('Compressed file for all blogs'); 
    59  
    60           $tasks[] = 'dcMaintenanceCache'; 
    61           $tasks[] = 'dcMaintenanceIndexposts'; 
    62           $tasks[] = 'dcMaintenanceIndexcomments'; 
    63           $tasks[] = 'dcMaintenanceCountcomments'; 
    64           $tasks[] = 'dcMaintenanceLogs'; 
    65           $tasks[] = 'dcMaintenanceVacuum'; 
    66           $tasks[] = 'dcMaintenanceZipmedia'; 
    67           $tasks[] = 'dcMaintenanceZiptheme'; 
     44      * @param $maintenance   <b>dcMaintenance</b>     dcMaintenance instance 
     45      */ 
     46      public static function dcMaintenanceInit($maintenance) 
     47     { 
     48          $maintenance 
     49          ->addTab('maintenance', __('Servicing'), array('summary' => __('Tools to maintain the performance of your blogs.'))) 
     50          ->addTab('backup', __('Backup'), array('summary' => __('Tools to back up your content.'))) 
     51          ->addTab('dev', __('Development'), array('summary' => __('Tools to assist in development of plugins, themes and core.'))) 
     52 
     53          ->addGroup('optimize', __('Optimize')) 
     54          ->addGroup('index', __('Count and index')) 
     55          ->addGroup('purge', __('Purge')) 
     56          ->addGroup('other', __('Other')) 
     57          ->addGroup('zipblog', __('Compressed file for current blog')) 
     58          ->addGroup('zipfull', __('Compressed file for all blogs')) 
     59 
     60          ->addGroup('l10n', __('Translations'), array('summary' => __('Maintain translations'))) 
     61 
     62          ->addTask('dcMaintenanceCache') 
     63          ->addTask('dcMaintenanceIndexposts') 
     64          ->addTask('dcMaintenanceIndexcomments') 
     65          ->addTask('dcMaintenanceCountcomments') 
     66          ->addTask('dcMaintenanceSynchpostsmeta') 
     67          ->addTask('dcMaintenanceLogs') 
     68          ->addTask('dcMaintenanceVacuum') 
     69          ->addTask('dcMaintenanceZipmedia') 
     70          ->addTask('dcMaintenanceZiptheme') 
     71          ; 
    6872     } 
    6973 
     
    218222          $core->auth->user_prefs->maintenance->put('dashboard_item', !empty($_POST['maintenance_dashboard_item']), 'boolean'); 
    219223     } 
     224 
     225 
     226     /** 
     227      * Build a well sorted help for tasks. 
     228      * 
     229      * This method is not so good if used with lot of tranlsations  
     230      * as it grows memory usage and translations files size,  
     231      * it is better to use help ressource files  
     232      * but keep it for exemple of how to use behavior adminPageHelpBlock. 
     233      * Cheers, JC 
     234      * 
     235      * @param $block    <b>arrayObject</b>  Called helpblocks 
     236      */ 
     237     public static function adminPageHelpBlock($blocks) 
     238     { 
     239          $found = false; 
     240          foreach($blocks as $block) { 
     241               if ($block == 'maintenancetasks') { 
     242                    $found = true; 
     243                    break; 
     244               } 
     245          } 
     246          if (!$found) { 
     247               return null; 
     248          } 
     249 
     250          $maintenance = new dcMaintenance($GLOBALS['core']); 
     251 
     252          $res_tab = ''; 
     253          foreach($maintenance->getTabs() as $tab_obj) 
     254          { 
     255               $res_group = ''; 
     256               foreach($maintenance->getGroups() as $group_obj) 
     257               { 
     258                    $res_task = ''; 
     259                    foreach($maintenance->getTasks() as $t) 
     260                    { 
     261                         if ($t->group() != $group_obj->id()  
     262                          || $t->tab() != $tab_obj->id()) { 
     263                              continue; 
     264                         } 
     265                         if (($desc = $t->description()) != '') { 
     266                              $res_task .=  
     267                              '<dt>'.$t->task().'</dt>'. 
     268                              '<dd>'.$desc.'</dd>'; 
     269                         } 
     270                    } 
     271                    if (!empty($res_task)) { 
     272                         $desc = $group_obj->description ? $group_obj->description : $group_obj->summary; 
     273 
     274                         $res_group .=  
     275                         '<h5>'.$group_obj->name().'</h5>'. 
     276                         ($desc ? '<p>'.$desc.'</p>' : ''). 
     277                         '<dl>'.$res_task.'</dl>'; 
     278                    } 
     279               } 
     280               if (!empty($res_group)) { 
     281                    $desc = $tab_obj->description ? $tab_obj->description : $tab_obj->summary; 
     282 
     283                    $res_tab .=  
     284                    '<h4>'.$tab_obj->name().'</h4>'. 
     285                    ($desc ? '<p>'.$desc.'</p>' : ''). 
     286                    $res_group; 
     287               } 
     288          } 
     289          if (!empty($res_tab)) { 
     290               $res = new ArrayObject(); 
     291               $res->content = $res_tab; 
     292               $blocks[] = $res; 
     293          } 
     294     } 
    220295} 
  • plugins/maintenance/_prepend.php

    r1955 r2044  
    1515 
    1616$__autoload['dcMaintenance'] = dirname(__FILE__).'/inc/class.dc.maintenance.php'; 
     17$__autoload['dcMaintenanceDescriptor'] = dirname(__FILE__).'/inc/class.dc.maintenance.descriptor.php'; 
    1718$__autoload['dcMaintenanceTask'] = dirname(__FILE__).'/inc/class.dc.maintenance.task.php'; 
    1819$__autoload['dcMaintenanceRest'] = dirname(__FILE__).'/_services.php'; 
     20 
    1921 
    2022$__autoload['dcMaintenanceCache'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.cache.php'; 
     
    2224$__autoload['dcMaintenanceIndexcomments'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.indexcomments.php'; 
    2325$__autoload['dcMaintenanceIndexposts'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.indexposts.php'; 
     26$__autoload['dcMaintenanceSynchpostsmeta'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.synchpostsmeta.php'; 
    2427$__autoload['dcMaintenanceLogs'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.logs.php'; 
    2528$__autoload['dcMaintenanceVacuum'] = dirname(__FILE__).'/inc/tasks/class.dc.maintenance.vacuum.php'; 
  • plugins/maintenance/inc/class.dc.maintenance.php

    r1989 r2044  
    2626{ 
    2727     public $core; 
     28     public $p_url = 'plugin.php?p=maintenance'; 
     29 
    2830     private $tasks = array(); 
    2931     private $tabs = array(); 
     
    3436      * Constructor. 
    3537      * 
    36       * Here you register tasks and groups for tasks. 
    37       * 
    3838      * @param core <b>dcCore</b>  dcCore instance 
    3939      */ 
     
    4141     { 
    4242          $this->core = $core; 
    43  
    44           $tasks = new ArrayObject(); 
    45           $tabs = new ArrayObject(); 
    46           $groups = new ArrayObject(); 
    4743          $logs = $this->getLogs(); 
    48  
    49           # --BEHAVIOR-- dcMaintenanceRegister 
    50           $core->callBehavior('dcMaintenanceRegister', $core, $tasks, $groups, $tabs); 
    51  
    52           $this->init($tasks, $groups, $tabs); 
    53      } 
    54  
    55      /** 
    56       * Initialize list of groups and tasks. 
    57       * 
    58       * @param tasks     <b>arrayObject</b>  Array of task to register 
    59       * @param groups    <b>arrayObject</b>  Array of groups to add 
    60       * @param tabs <b>arrayObject</b>  Array of tabs to add 
    61       */ 
    62      public function init($tasks, $groups, $tabs) 
    63      { 
    64           $this->tasks = $this->groups = array(); 
    65  
    66           foreach($tasks as $task) 
    67           { 
    68                if (!class_exists($task)) { 
    69                     continue; 
    70                } 
    71  
    72                $r = new ReflectionClass($task); 
    73                $p = $r->getParentClass(); 
    74  
    75                if (!$p || $p->name != 'dcMaintenanceTask') { 
    76                     continue; 
    77                } 
    78  
    79                if (($t = new $task($this, 'plugin.php?p=maintenance')) === null 
    80                || $t->perm() === null && !$this->core->auth->isSuperAdmin() 
    81                || !$this->core->auth->check($t->perm(), $this->core->blog->id)) { 
    82                     continue; 
    83                } 
    84  
    85                $this->tasks[$task] = $t; 
    86           } 
    87  
    88           foreach($groups as $id => $name) 
    89           { 
    90                $this->groups[(string) $id] = (string) $name; 
    91           } 
    92  
    93           foreach($tabs as $id => $name) 
    94           { 
    95                $this->tabs[(string) $id] = (string) $name; 
    96           } 
    97      } 
    98  
    99      /** 
    100       * Get a tab name. 
     44          $this->init(); 
     45     } 
     46 
     47     /** 
     48      * Initialize list of tabs and groups and tasks. 
     49      * 
     50      * To register a tab or group or task,  
     51      * use behavior dcMaintenanceInit then a method of 
     52      * dcMaintenance like addTab('myTab', ...). 
     53      */ 
     54     protected function init() 
     55     { 
     56          # --BEHAVIOR-- dcMaintenanceInit 
     57          $this->core->callBehavior('dcMaintenanceInit', $this); 
     58     } 
     59 
     60     /// @name Tab methods 
     61     //@{ 
     62     /** 
     63      * Add a tab. 
     64      * 
     65      * @param id        <b>string<b> Tab ID 
     66      * @param name <b>string<b> Tab name 
     67      * @param options   <b>string<b> Options 
     68      * @return <b>dcMaintenance</b>    Self 
     69      */ 
     70     public function addTab($id, $name, $options=array()) 
     71     { 
     72          $this->tabs[$id] = new dcMaintenanceDescriptor($id, $name, $options); 
     73 
     74          return $this; 
     75     } 
     76 
     77     /** 
     78      * Get a tab. 
    10179      * 
    10280      * @param id   <b>string</b> Tab ID 
    103       * @return     <b>mixed</b> tab name or null if not exists 
     81      * @return     <b>object</b> dcMaintenanceDescriptor of a tab 
    10482      */ 
    10583     public function getTab($id) 
     
    11795          return $this->tabs; 
    11896     } 
    119  
    120      /** 
    121       * Get a group name. 
     97     //@} 
     98 
     99 
     100     /// @name Group methods 
     101     //@{ 
     102     /** 
     103      * Add a group. 
     104      * 
     105      * @param id        <b>string<b> Group ID 
     106      * @param name <b>string<b> Group name 
     107      * @param options   <b>string<b> Options 
     108      * @return <b>dcMaintenance</b>    Self 
     109      */ 
     110     public function addGroup($id, $name, $options=array()) 
     111     { 
     112          $this->groups[$id] = new dcMaintenanceDescriptor($id, $name, $options); 
     113 
     114          return $this; 
     115     } 
     116 
     117     /** 
     118      * Get a group. 
    122119      * 
    123120      * @param id   <b>string</b> Group ID 
    124       * @return     <b>mixed</b> Group name or null if not exists 
     121      * @return     <b>object</b> dcMaintenanceDescriptor of a group 
    125122      */ 
    126123     public function getGroup($id) 
     
    132129      * Get groups. 
    133130      * 
    134       * @return     <b>array</b> Array of groups ID and name 
     131      * @return     <b>array</b> Array of groups ID and descriptor 
    135132      */ 
    136133     public function getGroups() 
    137134     { 
    138135          return $this->groups; 
     136     } 
     137     //@} 
     138 
     139 
     140     /// @name Task methods 
     141     //@{ 
     142     /** 
     143      * Add a task. 
     144      * 
     145      * @param task <b>mixed<b> Class name or object 
     146      * @return     <b>boolean</b> True if it is added 
     147      * @return <b>dcMaintenance</b>    Self 
     148      */ 
     149     public function addTask($task) 
     150     { 
     151          if (class_exists($task) && is_subclass_of($task, 'dcMaintenanceTask')) { 
     152               $this->tasks[$task] = new $task($this); 
     153          } 
     154 
     155          return $this; 
    139156     } 
    140157 
     
    174191          return $res; 
    175192     } 
    176  
     193     //@} 
     194 
     195 
     196     /// @name Log methods 
     197     //@{ 
    177198     /** 
    178199      * Set log for a task. 
     
    268289          return $this->logs; 
    269290     } 
     291     //@} 
    270292} 
  • plugins/maintenance/inc/class.dc.maintenance.task.php

    r1989 r2044  
    3333     protected $id; 
    3434     protected $name; 
     35     protected $description; 
    3536     protected $tab = 'maintenance'; 
    3637     protected $group = 'other'; 
     
    5051      * @param p_url     <b>string</b>  Maintenance plugin url 
    5152      */ 
    52      public function __construct($maintenance, $p_url) 
     53     public function __construct($maintenance) 
    5354     { 
    5455          $this->maintenance = $maintenance; 
     
    6162          } 
    6263 
    63           $this->p_url = $p_url; 
     64          $this->p_url = $maintenance->p_url; 
    6465          $this->id = get_class($this); 
    6566 
     
    191192 
    192193     /** 
     194      * Get task description. 
     195      * 
     196      * @return     <b>string</b>  Description 
     197      */ 
     198     public function description() 
     199     { 
     200          return $this->description; 
     201     } 
     202 
     203     /** 
    193204      * Get task tab. 
    194205      * 
     
    322333          $this->maintenance->setLog($this->id); 
    323334     } 
     335 
     336     public function help() 
     337     { 
     338          return null; 
     339     } 
    324340} 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.cache.php

    r1925 r2044  
    2121          $this->success           = __('Templates cache directory emptied.'); 
    2222          $this->error        = __('Failed to empty templates cache directory.'); 
     23 
     24          $this->description = __("It may be useful to empty this cache when modifying a theme's .html or .css files (or when updating a theme or plugin). Notice : with some hosters, the templates cache cannot be emptied with this plugin. You may then have to delete the directory <strong>/cbtpl/</strong> directly on the server with your FTP software."); 
    2325     } 
    2426 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.countcomments.php

    r1984 r2044  
    2121          $this->success           = __('Comments and trackback counted.'); 
    2222          $this->error        = __('Failed to count comments and trackbacks.'); 
     23 
     24          $this->description = __('Count again comments and trackbacks allows to check their exact numbers. This operation can be useful when importing from another blog platform (or when migrating from dotclear 1 to dotclear 2).'); 
    2325     } 
    2426 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexcomments.php

    r1989 r2044  
    2727          $this->success           = __('Comments index done.'); 
    2828          $this->error        = __('Failed to index comments.'); 
     29 
     30          $this->description = __('Index all comments and trackbacks in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages.'); 
    2931     } 
    3032 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexposts.php

    r1989 r2044  
    2727          $this->success           = __('Entries index done.'); 
    2828          $this->error        = __('Failed to index entries.'); 
     29 
     30          $this->description = __('Index all entries in search engine index. This operation is necessary, after importing content in your blog, to use internal search engine, on public and private pages.'); 
    2931     } 
    3032 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.logs.php

    r1925 r2044  
    2121          $this->success           = __('Logs deleted.'); 
    2222          $this->error        = __('Failed to delete logs.'); 
     23 
     24          $this->description = __('Logs record all activity and connection to your blog history. Unless you need to keep this history, consider deleting these logs from time to time.'); 
    2325     } 
    2426 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.vacuum.php

    r1984 r2044  
    1818     protected function init() 
    1919     { 
     20          $this->name              = __('Optimise database'); 
    2021          $this->task         = __('optimize tables'); 
    2122          $this->success           = __('Optimization successful.'); 
    2223          $this->error        = __('Failed to optimize tables.'); 
     24 
     25          $this->description = __("After numerous delete or update operations on Dotclear's database, it gets fragmented. Optimizing will allow to defragment it. It has no incidence on your data's integrity. It is recommended to optimize before any blog export."); 
    2326     } 
    2427 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.zipmedia.php

    r1989 r2044  
    2222     { 
    2323          $this->task = __('Download media folder of current blog'); 
     24 
     25          $this->description = __('It may be useful to backup your media folder. This compress all content of media folder into a single zip file. Notice : with some hosters, the media folder cannot be compressed with this plugin if it is too big.'); 
    2426     } 
    2527 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.ziptheme.php

    r1989 r2044  
    2222     { 
    2323          $this->task = __('Download active theme of current blog'); 
     24 
     25          $this->description = __('It may be useful to backup the active theme before any change or update. This compress theme folder into a single zip file.'); 
    2426     } 
    2527 
  • plugins/maintenance/index.php

    r2032 r2044  
    4343 
    4444          foreach($tasks as $t) { 
    45                if (!empty($_POST['settings_recall_time']) && $_POST['settings_recall_time'] == 'seperate') { 
    46                     $ts = empty($_POST['settings_ts_'.$t->id()]) ? 0 : $_POST['settings_ts_'.$t->id()]; 
     45               if (!empty($_POST['settings_recall_all'])) { 
     46                    $ts = $_POST['settings_recall_time']; 
    4747               } 
    4848               else { 
    49                     $ts = $_POST['settings_recall_time']; 
     49                    $ts = empty($_POST['settings_ts_'.$t->id()]) ? 0 : $_POST['settings_ts_'.$t->id()]; 
    5050               } 
    5151               $core->blog->settings->maintenance->put( 
     
    9999 
    100100$combo_ts = array( 
     101     __('Never')              => 0, 
    101102     __('Every week')         => 604800, 
    102103     __('Every two weeks')    => 1209600, 
     
    105106); 
    106107 
    107 $full_combo_ts = array_merge(array( 
    108      __('Use different periods for each task') => 'seperate'),  
    109      $combo_ts 
    110 ); 
    111  
    112 $task_combo_ts = array_merge(array( 
    113      __('Never') => 0),  
    114      $combo_ts 
    115 ); 
    116  
    117108// Display page 
    118109 
     
    120111<title>'.__('Maintenance').'</title>'. 
    121112dcPage::jsPageTabs($tab). 
    122 dcPage::jsLoad('index.php?pf=maintenance/js/settings.js');; 
     113dcPage::jsLoad('index.php?pf=maintenance/js/settings.js'); 
    123114 
    124115if ($task && $task->ajax()) { 
     
    142133          array( 
    143134               __('Plugins') => '', 
    144                '<a href="'.$p_url.'">'.__('Maintenance').'</a>' => '', 
    145                '<span class="page-title">'.html::escapeHTML($task->name()).'</span>' => '' 
     135               '<span class="page-title">'.__('Maintenance').'</span>' => '' 
    146136          ) 
    147137     ). 
     
    211201     // Simple task (with only a button to start it) 
    212202 
    213      foreach($maintenance->getTabs() as $tab_id => $tab_name) 
     203     foreach($maintenance->getTabs() as $tab_obj) 
    214204     { 
    215205          $res_group = ''; 
    216           foreach($maintenance->getGroups() as $group_id => $group_name) 
     206          foreach($maintenance->getGroups() as $group_obj) 
    217207          { 
    218208               $res_task = ''; 
    219209               foreach($tasks as $t) 
    220210               { 
    221                     if ($t->group() != $group_id || $t->tab() != $tab_id) { 
     211                    if ($t->group() != $group_obj->id()  
     212                     || $t->tab() != $tab_obj->id()) { 
    222213                         continue; 
    223214                    } 
    224215 
    225                     $res_task .=   
     216                    $res_task .=  
    226217                    '<p>'.form::radio(array('task', $t->id()), $t->id()).' '. 
    227218                    '<label class="classic" for="'.$t->id().'">'. 
     
    254245                    $res_group .=  
    255246                    '<div class="fieldset">'. 
    256                     '<h4 id="'.$group_id.'">'.$group_name.'</h4>'. 
     247                    '<h4 id="'.$group_obj->id().'">'.$group_obj->name().'</h4>'. 
    257248                    $res_task. 
    258249                    '</div>'; 
     
    262253          if (!empty($res_group)) { 
    263254               echo  
    264                '<div id="'.$tab_id.'" class="multi-part" title="'.$tab_name.'">'. 
    265                '<h3>'.$tab_name.'</h3>'. 
     255               '<div id="'.$tab_obj->id().'" class="multi-part" title="'.$tab_obj->name().'">'. 
     256               '<h3>'.$tab_obj->name().'</h3>'. 
     257               // ($tab_obj->option('summary') ? '<p>'.$tab_obj->option('summary').'</p>' : ''). 
    266258               '<form action="'.$p_url.'" method="post">'. 
    267259               $res_group. 
    268260               '<p><input type="submit" value="'.__('Execute task').'" /> '. 
    269                form::hidden(array('tab'), $tab_id). 
     261               form::hidden(array('tab'), $tab_obj->id()). 
    270262               $core->formNonce().'</p>'. 
    271263               '<p class="form-note info">'.__('This may take a very long time.').'</p>'. 
     
    315307     '<h4 class="pretty-title">'.__('Frequency').'</h4>'. 
    316308 
     309     '<p>'.form::radio(array('settings_recall_type', 'settings_recall_all'), 'all').' '. 
     310     '<label class="classic" for="settings_recall_all">'. 
     311     __('Use one recall time for all tasks').'</label>'. 
     312 
    317313     '<p><label for="settings_recall_time">'.__('Recall time for all tasks:').'</label>'. 
    318      form::combo('settings_recall_time', $full_combo_ts, 'seperate', 'recall-for-all'). 
     314     form::combo('settings_recall_time', $combo_ts, 'seperate', 'recall-for-all'). 
    319315     '</p>'. 
    320316 
    321      '<h5 class="vertical-separator">'.__('Recall time per task:').'</h5>'; 
     317     '<p>'.form::radio(array('settings_recall_type', 'settings_recall_separate'), 'separate', 1).' '. 
     318     '<label class="classic" for="settings_recall_separate">'. 
     319     __('Use one recall time per task').'</label>'; 
    322320 
    323321     foreach($tasks as $t) 
     
    327325 
    328326          '<p><label for="settings_ts_'.$t->id().'">'.$t->task().'</label>'. 
    329           form::combo('settings_ts_'.$t->id(), $task_combo_ts, $t->ts(), 'recall-per-task'). 
     327          form::combo('settings_ts_'.$t->id(), $combo_ts, $t->ts(), 'recall-per-task'). 
    330328          '</p>'. 
    331329 
     
    342340} 
    343341 
    344 dcPage::helpBlock('maintenance'); 
     342dcPage::helpBlock('maintenance', 'maintenancetasks'); 
    345343 
    346344echo '</body></html>'; 
  • plugins/maintenance/js/settings.js

    r1984 r2044  
    11$(function(){ 
    2  
    3      $('.recall-for-all').change(function(){ 
    4           var v=$(this).val(); 
    5           if(v=='seperate'){ 
     2$('.recall-for-all').attr('disabled','disabled'); 
     3     $('#settings_recall_all').change(function(){ 
     4          if($(this).attr('selected')!='selected'){ 
     5               $('.recall-per-task').attr('disabled','disabled'); 
     6               $('.recall-for-all').removeAttr('disabled'); 
     7          } 
     8     }); 
     9     $('#settings_recall_separate').change(function(){ 
     10          if($(this).attr('selected')!='selected'){ 
    611               $('.recall-per-task').removeAttr('disabled'); 
    7           }else{ 
    8                $('.recall-per-task').attr('disabled','disabled'); 
     12               $('.recall-for-all').attr('disabled','disabled'); 
    913          } 
    1014     }); 
  • plugins/maintenance/locales/en/help/maintenance.html

    r1802 r2044  
    66<body> 
    77 
     8<h4>Settings</h4> 
     9 
    810<dl> 
    9   <dt>Optimize database room</dt> 
    10   <dd>After numerous delete or update operations on Dotclear's database, it gets fragmented. 
    11   Optimizing will allow to defragment it.<br /> 
    12   It has no incidence on your data's integrity.<br /> 
    13   It is recommended to optimize before any blog export.</dd> 
     11  <dt>Activation</dt> 
     12  <dd>If this options is active, on tabs of plugin maintenance,  
     13  when a task has expired or has been nerver executed, a alert message is show below this task.<br /> 
     14  Options to display maintenance related tasks on dashboard are available in user preferences.</dd> 
    1415   
    15   <dt>Counters</dt> 
    16   <dd>Initializing comments and trackbacks counters allows to check their exact numbers.  
    17   This operation can be useful when importing from another blog platform 
    18   (or when migrating from dotclear 1 to dotclear 2).</dd> 
    19    
    20   <dt>Search engine index</dt> 
    21   <dd>These operations are necessary, after importing content in your blog, to use internal search engine, on public and private pages. 
    22     <ul> 
    23       <li><strong>Index all posts:</strong> allows to index all posts</li> 
    24       <li><strong>Index all comments:</strong> allows to index all comments and trackbacks</li> 
    25     </ul> 
    26   </dd> 
    27    
    28   <dt>Vacuum logs</dt> 
    29   <dd>Logs record all activity and connection to your blog history. Unless you need to keep this history,  
    30   consider deleting these logs from time to time.</dd> 
    31    
    32   <dt>Empty templates cache directory</dt> 
    33   <dd>It may be useful to empty this cache when modifying a theme's .html or .css files (or when updating  
    34   a theme or plugin).<br /> 
    35   Notice : with some hosters, the templates cache cannot be emptied with this plugin.  
    36   You may then have to delete the directory <strong>/cbtpl/</strong> directly on the server with your FTP software.</dd> 
     16  <dt>Frequency</dt> 
     17  <dd>It is possible to set same recall time for all tasks at one time. <br/> 
     18  Otherwise this setting can be done per task and so on for exemple deactivate some of them.</dd> 
    3719</dl> 
    3820</body> 
  • plugins/maintenance/locales/fr/help/maintenance.html

    r1956 r2044  
    66<body> 
    77 
    8 <h4>Entretien</h4> 
     8<h4>Paramètres</h4> 
    99 
    1010<dl> 
    11   <dt>Optimiser l'espace de la base de données</dt> 
    12   <dd>Au fur at à mesure des suppressions ou modifications dans vos billets, 
    13   les tables de la base de données se fragmentent. L'opération d'optimisation 
    14   permet de compacter celles-ci.<br /> 
    15   Cette opération n'a aucun impact sur l'intégrité de vos données.<br /> 
    16   Il est fortement conseillé d'optimiser la base de données avant tout export 
    17   de blog.</dd> 
     11  <dt>Activation</dt> 
     12  <dd>Si l'option est activé, dans les onglets du plugin maintenance,  
     13  lorsqu'une tâche est en retard ou n'a jamais été exécutée, un message s'affiche sous cette tâche.<br /> 
     14  Des options pour permettre l'affichage d'informations relatives à la maintenance sur le tableau de bord  
     15  sous disponible dans les préférences de l'utilisateur.</dd> 
    1816   
    19   <dt>Compteurs</dt> 
    20   <dd>Réinitialiser les compteurs des commentaires et des rétroliens a pour effet 
    21   de donner le nombre exact de ceux-ci pour chaque billet. Cette opération peut se 
    22   révéler utile lors de l'import d'un blog d'une autre plateforme (ou d'une migration 
    23   de Dotclear 1 vers Dotclear 2).</dd> 
    24    
    25   <dt>Index du moteur de recherche</dt> 
    26   <dd>Ces opérations s'effectuent généralement suite à un import afin d'obtenir 
    27   des résultats lors des recherches, aussi bien depuis l'administration du blog 
    28   qu'en partie publique. 
    29     <ul> 
    30       <li><strong>Indexer tous les billets&nbsp;:</strong> permet d'indexer les billets.</li> 
    31       <li><strong>Indexer tous les commentaires&nbsp;:</strong> permet d'indexer les commentaires.</li> 
    32     </ul> 
    33   </dd> 
    34    
    35   <dt>Vider les journaux</dt> 
    36   <dd>Sauf si vous avez un besoin précis de conservation des activités de 
    37   connexion sur votre blog, pensez à vider régulièrement la table des journaux&nbsp;: 
    38   elle contient l'enregistrement de chaque connexion à l'administration et des 
    39   opérations qui s'y sont déroulées.</dd> 
    40    
    41   <dt>Vider le répertoire du cache des templates</dt> 
    42   <dd>La suppression du répertoire du cache des templates peut se révéler 
    43   nécessaire lors de modifications dans les fichiers .html ou .css d'un thème 
    44   (voire lors d'un changement de thème ou de mise à jour de plugin).<br /> 
    45   Attention : chez certains hébergeurs (Free par exemple), le cache du répertoire 
    46   des templates ne peut pas être vidé grâce à l'extension Maintenance, il faut 
    47   supprimer le répertoire <strong>cbtpl</strong> situé dans le répertoire cache 
    48   (dotclear/cache par défaut) avec un logiciel FTP.</dd> 
     17  <dt>Périodicité</dt> 
     18  <dd>Il est possible de règler le délai de rappel des tâche à exécuter à l'identique pour toutes les tâches. <br/> 
     19  Sinon ce réglage peut se faire tâche par tâche et ainsi permettre par exemple de n'en désactiver que certaines.</dd> 
    4920</dl> 
    5021</body> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map