Dotclear

Changeset 941:6f519f7bf9fc for admin


Ignore:
Timestamp:
10/30/12 13:51:52 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Split update and backup files management on two tabs, #fixes #1253

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/update.php

    r769 r941  
    4242$step = in_array($step,array('check','download','backup','unzip')) ? $step : ''; 
    4343 
     44$default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'update'; 
     45if (!empty($_POST['backup_file'])) { 
     46     $default_tab = 'files'; 
     47} 
     48 
    4449$archives = array(); 
    4550foreach (files::scanDir(DC_BACKUP_PATH) as $v) { 
     
    4853     } 
    4954} 
     55if (!empty($archives)) { 
     56     $archives = array_reverse($archives); 
     57} else { 
     58     $default_tab = 'update'; 
     59} 
    5060 
    5161# Revert or delete backup file 
     
    6171                    throw new Exception(sprintf(__('Unable to delete file %s'),html::escapeHTML($b_file))); 
    6272               } 
    63                http::redirect($p_url); 
     73               http::redirect($p_url.'?tab=files'); 
    6474          } 
    6575           
     
    6979               $zip->unzipAll(DC_BACKUP_PATH.'/'); 
    7080               @unlink(DC_BACKUP_PATH.'/'.$b_file); 
    71                http::redirect($p_url); 
     81               http::redirect($p_url.'?tab=files'); 
    7282          } 
    7383     } 
     
    157167/* DISPLAY Main page 
    158168-------------------------------------------------------- */ 
    159 dcPage::open(__('Dotclear update')); 
     169dcPage::open(__('Dotclear update'), 
     170     (!$step ? dcPage::jsPageTabs($default_tab) : '') 
     171); 
    160172 
    161173if (!$core->error->flag()) { 
     
    165177if (!$step) 
    166178{ 
     179     echo '<div class="multi-part" id="update" title="'.__('Dotclear update').'">'; 
    167180     if (empty($new_v)) 
    168181     { 
     
    183196          '</form>'; 
    184197     } 
     198     echo '</div>'; 
    185199      
    186200     if (!empty($archives)) 
    187201     { 
     202          echo '<div class="multi-part" id="files" title="'.__('Manage backup files').'">'; 
     203 
    188204          echo 
    189205          '<h3>'.__('Update backup files').'</h3>'. 
     
    208224          $core->formNonce().'</p>'. 
    209225          '</form>'; 
     226 
     227          echo '</div>'; 
    210228     } 
    211229} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map