Dotclear


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

Plugin maintenance, small fixes and boss requests, addresses #999

Location:
plugins/maintenance
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/_services.php

    r1925 r1959  
    4646          $task->code((integer) $post['code']); 
    4747          if (($code = $task->execute()) === true) { 
     48               $maintenance->setLog($task->id()); 
    4849               $code = 0; 
    4950          } 
  • plugins/maintenance/inc/class.dc.maintenance.task.php

    r1955 r1959  
    2525     protected $code; 
    2626     protected $ts = 604800; // one week 
     27     protected $ajax = false; 
    2728 
    2829     protected $id; 
     
    139140 
    140141     /** 
     142      * Use ajax 
     143      * 
     144      * Is task use maintenance ajax script  
     145      * for steps process. 
     146      * 
     147      * @return     <b>boolean</b> Use ajax 
     148      */ 
     149     public function ajax() 
     150     { 
     151          return (boolean) $this->ajax; 
     152     } 
     153 
     154     /** 
    141155      * Get task message. 
    142156      * 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexcomments.php

    r1925 r1959  
    1414class dcMaintenanceIndexcomments extends dcMaintenanceTask 
    1515{ 
     16     protected $ajax = true; 
    1617     protected $group = 'index'; 
    1718     protected $limit = 500; 
  • plugins/maintenance/inc/tasks/class.dc.maintenance.indexposts.php

    r1925 r1959  
    1414class dcMaintenanceIndexposts extends dcMaintenanceTask 
    1515{ 
     16     protected $ajax = true; 
    1617     protected $group = 'index'; 
    1718     protected $limit = 500; 
  • plugins/maintenance/index.php

    r1955 r1959  
    7070dcPage::jsPageTabs($tab); 
    7171 
    72 if (0){//$task) { 
     72if ($task && $task->ajax()) { 
    7373     echo  
    7474     '<script type="text/javascript">'."\n". 
    75      "//<![CDATA\n". 
     75     "//<![CDATA[\n". 
    7676     dcPage::jsVar('dotclear.msg.wait', __('Please wait...')). 
    7777     "//]]>\n". 
     
    8787// Success message 
    8888 
    89 if ($task && !empty($_GET['done'])) { 
    90      dcPage::success($task->success()); 
    91 } 
     89$msg = $task && !empty($_GET['done']) ? dcPage::success($task->success(),true,true,false) : ''; 
    9290 
    9391if ($task && ($res = $task->step()) !== null) { 
     
    102100          ) 
    103101     ); 
     102 
     103     echo $msg; 
    104104 
    105105     // Intermediate task (task required several steps) 
     
    135135     ); 
    136136 
     137     echo $msg; 
     138 
    137139     // Simple task (with only a button to start it) 
    138140 
  • plugins/maintenance/js/dc.maintenance.js

    r1925 r1959  
    3535                              dcMaintenanceStep(box,code); 
    3636                         } else { 
    37                               $('.step-msg',box).addClass('success'); 
     37                              $('#content h2').after($('<div/>').addClass('success').append($('.step-msg',box))); 
    3838                              $('.step-wait',box).remove(); 
    3939                              $('.step-back',box).show(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map