Changeset 1959:2c77682177b4 for plugins/importExport/inc
- Timestamp:
- 09/19/13 23:18:37 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/importExport/inc/lib.ie.maintenance.php
r1955 r1959 24 24 $this->name = __('Database export'); 25 25 $this->task = __('Download database of current blog'); 26 $this->step = __('Zip file ready to be downloaded.');27 26 28 27 $this->export_name = html::escapeHTML($this->core->blog->id.'-backup.txt'); … … 32 31 public function execute() 33 32 { 34 // 1) Create zip file 35 if (!isset($_SESSION['export_file']) || !file_exists($_SESSION['export_file'])) { 36 // Bad hack to skip one step 37 $_POST['file_name'] = date('Y-m-d-H-i-').$this->export_name; 38 $_POST['file_zip'] = 1; 39 33 // Create zip file 34 if (!empty($_POST['file_name'])) { 40 35 // This process make an http redirect 41 36 $ie = new maintenanceDcExportFlat($this->core); … … 43 38 $ie->process($this->export_type); 44 39 } 45 // 2) Download zip file40 // Go to step and show form 46 41 else { 42 return 1; 43 } 44 } 45 46 public function step() 47 { 48 // Download zip file 49 if (isset($_SESSION['export_file']) && file_exists($_SESSION['export_file'])) { 47 50 // Log task execution here as we sent file and stop script 48 51 $this->log(); … … 53 56 $ie->process('ok'); 54 57 } 55 56 return null; 57 } 58 59 public function step() 60 { 61 return isset($_SESSION['export_file']) && file_exists($_SESSION['export_file']) ? 62 $this->step : null; 58 else { 59 return 60 '<p><label for="file_name">'.__('File name:').'</label>'. 61 form::field('file_name', 50, 255, date('Y-m-d-H-i-').$this->export_name). 62 '</p>'. 63 '<p><label for="file_zip" class="classic">'. 64 form::checkbox('file_zip', 1).' '. 65 __('Compress file').'</label>'. 66 '</p>'; 67 } 63 68 } 64 69 } … … 76 81 $this->name = __('Database export'); 77 82 $this->task = __('Download database of all blogs'); 78 $this->step = __('Zip file ready to be downloaded.');79 83 80 84 $this->export_name = 'dotclear-backup.txt'; … … 84 88 public function execute() 85 89 { 86 // 1) Create zip file 87 if (!isset($_SESSION['export_file']) || !file_exists($_SESSION['export_file'])) { 88 // Bad hack to skip one step 89 $_POST['file_name'] = date('Y-m-d-H-i-').$this->export_name; 90 $_POST['file_zip'] = 1; 91 90 // Create zip file 91 if (!empty($_POST['file_name'])) { 92 92 // This process make an http redirect 93 93 $ie = new maintenanceDcExportFlat($this->core); … … 95 95 $ie->process($this->export_type); 96 96 } 97 // 2) Download zip file97 // Go to step and show form 98 98 else { 99 return 1; 100 } 101 } 102 103 public function step() 104 { 105 // Download zip file 106 if (isset($_SESSION['export_file']) && file_exists($_SESSION['export_file'])) { 99 107 // Log task execution here as we sent file and stop script 100 108 $this->log(); … … 105 113 $ie->process('ok'); 106 114 } 107 108 return null; 109 } 110 111 public function step() 112 { 113 return isset($_SESSION['export_file']) && file_exists($_SESSION['export_file']) ? 114 $this->step : null; 115 else { 116 return 117 '<p><label for="file_name">'.__('File name:').'</label>'. 118 form::field('file_name', 50, 255, date('Y-m-d-H-i-').$this->export_name). 119 '</p>'. 120 '<p><label for="file_zip" class="classic">'. 121 form::checkbox('file_zip', 1).' '. 122 __('Compress file').'</label>'. 123 '</p>'; 124 } 115 125 } 116 126 }
Note: See TracChangeset
for help on using the changeset viewer.