Dotclear


Ignore:
Timestamp:
11/17/13 20:25:53 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Children:
2567:6c11245cbf04, 2568:61c67a7d17fa
Message:

Add some people in CREDITS, remove trailing spaces and tabs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/inc/class.dc.export.flat.php

    r1857 r2566  
    2020          $this->description = __('Exports a blog or a full Dotclear installation to flat file.'); 
    2121     } 
    22       
     22 
    2323     public function process($do) 
    2424     { 
    2525          # Export a blog 
    2626          if ($do == 'export_blog' && $this->core->auth->check('admin',$this->core->blog->id)) 
    27           {               
     27          { 
    2828               $fullname = $this->core->blog->public_path.'/.backup_'.sha1(uniqid()); 
    2929               $blog_id = $this->core->con->escape($this->core->blog->id); 
    30                 
     30 
    3131               try 
    3232               { 
    3333                    $exp = new flatExport($this->core->con,$fullname,$this->core->prefix); 
    3434                    fwrite($exp->fp,'///DOTCLEAR|'.DC_VERSION."|single\n"); 
    35                      
     35 
    3636                    $exp->export('category', 
    3737                         'SELECT * FROM '.$this->core->prefix.'category '. 
     
    7878                         "AND P.blog_id = '".$blog_id."'" 
    7979                    ); 
    80                      
     80 
    8181                    # --BEHAVIOR-- exportSingle 
    8282                    $this->core->callBehavior('exportSingle',$this->core,$exp,$blog_id); 
    83                      
     83 
    8484                    $_SESSION['export_file'] = $fullname; 
    8585                    $_SESSION['export_filename'] = $_POST['file_name']; 
     
    9393               } 
    9494          } 
    95            
     95 
    9696          # Export all content 
    9797          if ($do == 'export_all' && $this->core->auth->isSuperAdmin()) 
     
    118118                    $exp->exportTable('spamrule'); 
    119119                    $exp->exportTable('version'); 
    120                      
     120 
    121121                    # --BEHAVIOR-- exportFull 
    122122                    $this->core->callBehavior('exportFull',$this->core,$exp); 
    123                      
     123 
    124124                    $_SESSION['export_file'] = $fullname; 
    125125                    $_SESSION['export_filename'] = $_POST['file_name']; 
     
    133133               } 
    134134          } 
    135            
     135 
    136136          # Send file content 
    137137          if ($do == 'ok') 
     
    140140                    throw new Exception(__('Export file not found.')); 
    141141               } 
    142                 
     142 
    143143               ob_end_clean(); 
    144                 
     144 
    145145               if (substr($_SESSION['export_filename'],-4) == '.zip') { 
    146146                    $_SESSION['export_filename'] = substr($_SESSION['export_filename'],0,-4);//.'.txt'; 
    147147               } 
    148                 
     148 
    149149               # Flat export 
    150150               if (empty($_SESSION['export_filezip'])) { 
    151                 
     151 
    152152                    header('Content-Disposition: attachment;filename='.$_SESSION['export_filename']); 
    153153                    header('Content-Type: text/plain; charset=UTF-8'); 
    154154                    readfile($_SESSION['export_file']); 
    155                      
     155 
    156156                    unlink($_SESSION['export_file']); 
    157157                    unset($_SESSION['export_file'],$_SESSION['export_filename'],$_SESSION['export_filezip']); 
     
    163163                    { 
    164164                         $file_zipname = $_SESSION['export_filename'].'.zip'; 
    165                           
     165 
    166166                         $fp = fopen('php://output','wb'); 
    167167                         $zip = new fileZip($fp); 
    168168                         $zip->addFile($_SESSION['export_file'],$_SESSION['export_filename']); 
    169                           
     169 
    170170                         header('Content-Disposition: attachment;filename='.$file_zipname); 
    171171                         header('Content-Type: application/x-zip'); 
    172                           
     172 
    173173                         $zip->write(); 
    174                           
     174 
    175175                         unlink($_SESSION['export_file']); 
    176176                         unset($zip,$_SESSION['export_file'],$_SESSION['export_filename'],$file_zipname); 
     
    181181                         unset($zip,$_SESSION['export_file'],$_SESSION['export_filename'],$file_zipname); 
    182182                         @unlink($_SESSION['export_file']); 
    183                           
     183 
    184184                         throw new Exception(__('Failed to compress export file.')); 
    185185                    } 
     
    187187          } 
    188188     } 
    189       
     189 
    190190     public function gui() 
    191191     { 
     
    194194          '<h3>'.__('Single blog').'</h3>'. 
    195195          '<p>'.sprintf(__('This will create an export of your current blog: %s'),'<strong>'.html::escapeHTML($this->core->blog->name)).'</strong>.</p>'. 
    196            
     196 
    197197          '<p><label for="file_name">'.__('File name:').'</label>'. 
    198198          form::field(array('file_name','file_name'),50,255,date('Y-m-d-H-i-').html::escapeHTML($this->core->blog->id.'-backup.txt')). 
    199199          '</p>'. 
    200            
     200 
    201201          '<p><label for="file_zip" class="classic">'. 
    202202          form::checkbox(array('file_zip','file_zip'),1).' '. 
    203203          __('Compress file').'</label>'. 
    204204          '</p>'. 
    205            
     205 
    206206          '<p class="zip-dl"><a href="media.php?d=&amp;zipdl=1">'. 
    207207          __('You may also want to download your media directory as a zip file').'</a></p>'. 
    208            
     208 
    209209          '<p><input type="submit" value="'.__('Export').'" />'. 
    210210          form::hidden(array('do'),'export_blog'). 
    211211          $this->core->formNonce().'</p>'. 
    212            
     212 
    213213          '</form>'; 
    214            
     214 
    215215          if ($this->core->auth->isSuperAdmin()) 
    216216          { 
     
    219219               '<h3>'.__('Multiple blogs').'</h3>'. 
    220220               '<p>'.__('This will create an export of all the content of your database.').'</p>'. 
    221                 
     221 
    222222               '<p><label for="file_name2">'.__('File name:').'</label>'. 
    223223               form::field(array('file_name','file_name2'),50,255,date('Y-m-d-H-i-').'dotclear-backup.txt'). 
    224224               '</p>'. 
    225                 
     225 
    226226               '<p><label for="file_zip2" class="classic">'. 
    227227               form::checkbox(array('file_zip','file_zip2'),1).' '. 
    228228               __('Compress file').'</label>'. 
    229229               '</p>'. 
    230                 
     230 
    231231               '<p><input type="submit" value="'.__('Export').'" />'. 
    232232               form::hidden(array('do'),'export_all'). 
    233233               $this->core->formNonce().'</p>'. 
    234                 
     234 
    235235               '</form>'; 
    236236          } 
    237237     } 
    238238} 
    239 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map