Dotclear


Ignore:
Timestamp:
09/19/13 01:08:39 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Children:
1956:d272c079e6e5, 1964:bfde9296c3c5
Message:

Revamp plugin maintenance, step 3, add backup tasks, dynamic tabs and plugin importExport, addresses #999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/index.php

    r1940 r1955  
    7070dcPage::jsPageTabs($tab); 
    7171 
    72 if ($task) { 
     72if (0){//$task) { 
    7373     echo  
    7474     '<script type="text/javascript">'."\n". 
     
    137137     // Simple task (with only a button to start it) 
    138138 
    139      echo  
    140      '<div id="maintenance" class="multi-part" title="'.__('Maintenance').'">'. 
    141      '<h3>'.__('Maintenance').'</h3>'. 
    142      '<form action="'.$p_url.'" method="post">'; 
    143  
    144      foreach($maintenance->getGroups($core) as $g_id => $g_name) 
     139     foreach($maintenance->getTabs() as $tab_id => $tab_name) 
    145140     { 
    146           $res = ''; 
    147           foreach($maintenance->getTasks($core) as $t) 
     141          $res_group = ''; 
     142          foreach($maintenance->getGroups($core) as $group_id => $group_name) 
    148143          { 
    149                if ($t->group() != $g_id) { 
    150                     continue; 
     144               $res_task = ''; 
     145               foreach($maintenance->getTasks($core) as $t) 
     146               { 
     147                    if ($t->group() != $group_id || $t->tab() != $tab_id) { 
     148                         continue; 
     149                    } 
     150 
     151                    $res_task .=   
     152                    '<p>'.form::radio(array('task', $t->id()), $t->id()).' '. 
     153                    '<label class="classic" for="'.$t->id().'">'. 
     154                    html::escapeHTML($t->task()).'</label>'; 
     155 
     156                    if (array_key_exists($t->id(), $expired)) { 
     157                         $res_task .=  
     158                         ' <span class="clear form-note warn">'.sprintf( 
     159                              __('Last execution of this task was on %s. You should execute it again.'), 
     160                              dt::dt2str(__('%Y-%m-%d %H:%M'), $expired[$t->id()]) 
     161                         ).'</span>'; 
     162                    } 
     163 
     164                    $res_task .= '</p>'; 
    151165               } 
    152166 
    153                $res .=   
    154                '<p>'.form::radio(array('task', $t->id()), $t->id()).' '. 
    155                '<label class="classic" for="'.$t->id().'">'. 
    156                html::escapeHTML($t->task()).'</label>'; 
    157  
    158                if (array_key_exists($t->id(), $expired)) { 
    159                     $res .=  
    160                     ' <span class="clear form-note warn">'.sprintf( 
    161                          __('Last execution of this task was on %s. You should execute it again.'), 
    162                          dt::dt2str(__('%Y-%m-%d %H:%M'), $expired[$t->id()]) 
    163                     ).'</span>'; 
     167               if (!empty($res_task)) { 
     168                    $res_group .=  
     169                    '<div class="fieldset">'. 
     170                    '<h4 id="'.$group_id.'">'.$group_name.'</h4>'. 
     171                    $res_task. 
     172                    '</div>'; 
    164173               } 
    165  
    166                $res .= '</p>'; 
    167           } 
    168  
    169           if (!empty($res)) { 
    170                echo '<div class="fieldset"><h4 id="'.$g_id.'">'.$g_name.'</h4>'.$res.'</div>'; 
    171           } 
    172      } 
    173  
    174      echo  
    175      '<p><input type="submit" value="'.__('Execute task').'" /> '. 
    176      form::hidden(array('tab'), 'maintenance'). 
    177      $core->formNonce().'</p>'. 
    178      '<p class="form-note info">'.__('This may take a very long time').'.</p>'. 
    179      '</form>'. 
    180      '</div>'; 
     174          } 
     175 
     176          if (!empty($res_group)) { 
     177               echo  
     178               '<div id="'.$tab_id.'" class="multi-part" title="'.$tab_name.'">'. 
     179               '<h3>'.$tab_name.'</h3>'. 
     180               '<form action="'.$p_url.'" method="post">'. 
     181               $res_group. 
     182               '<p><input type="submit" value="'.__('Execute task').'" /> '. 
     183               form::hidden(array('tab'), $tab_id). 
     184               $core->formNonce().'</p>'. 
     185               '<p class="form-note info">'.__('This may take a very long time').'.</p>'. 
     186               '</form>'. 
     187               '</div>'; 
     188          } 
     189     } 
    181190 
    182191     // Advanced tasks (that required a tab) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map