Changeset 14854 for extensions/Prune_History/admin/PH_admin.php
- Timestamp:
- May 8, 2012, 4:18:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Prune_History/admin/PH_admin.php
r14838 r14854 18 18 $page['global'] = array(); 19 19 $range = array(); 20 $dump_download = ''; 20 21 21 // +-----------------------------------------------------------------------+ 22 // | Getting plugin version | 23 // +-----------------------------------------------------------------------+ 22 23 // +-------------------------------------------------------------------+ 24 // | Get plugin version and name | 25 // +-------------------------------------------------------------------+ 24 26 $plugin = PHInfos(PH_PATH); 25 27 $version = $plugin['version']; … … 45 47 } 46 48 49 50 // +--------------------------------------------------------------------+ 51 // | Saving history tables | 52 // +--------------------------------------------------------------------+ 53 if (isset($_POST['save'])) 54 { 55 $dump_download = (isset($_POST['dump_download'])) ? 'true' : 'false'; 56 57 if(PH_dump($dump_download) and $dump_download == 'false') 58 { 59 array_push($page['infos'], l10n('PH_Dump_OK')); 60 } 61 else 62 { 63 array_push($page['errors'], l10n('PH_Dump_NOK')); 64 } 65 } 66 67 68 // +--------------------------------------------------------------------+ 69 // | Restoring backed up history tables | 70 // +--------------------------------------------------------------------+ 71 if (isset($_POST['restore'])) 72 { 73 $Backup_File = PH_PATH.'/include/backup/PH_Historybackup.sql'; 74 75 if (file_exists($Backup_File) and $file = file($Backup_File, FILE_IGNORE_NEW_LINES) and !empty($file)) 76 { 77 // Check backup file version 78 // ------------------------- 79 if ($file[0] == "-- ".$version." --") 80 { 81 $restore = PH_Restore_backup_file(); 82 if(empty($restore)) 83 { 84 array_push($page['infos'], l10n('PH_Restoration_OK')); 85 } 86 else 87 { 88 array_push($page['errors'], l10n('PH_Restoration_NOK')); 89 } 90 } 91 else array_push($page['errors'], l10n('PH_Bad_version_backup')); 92 } 93 else 94 { 95 array_push($page['errors'], l10n('PH_No_Backup_File')); 96 } 97 } 98 99 100 // +--------------------------------------------------------------------+ 101 // | Manual prune settings | 102 // +--------------------------------------------------------------------+ 47 103 $conf_PH = unserialize($conf['PruneHistory']); 48 104 … … 87 143 } 88 144 145 89 146 // +-----------------------------------------------------------------------+ 90 147 // | templates init | … … 104 161 'PH_NAME' => $name, 105 162 'PH_VERSION' => $version, 163 'PH_DUMP_DOWNLOAD' => $dump_download, 106 164 'PH_AUTOPRUNE_TRUE' => $conf_PH[1]=='true' ? 'checked="checked"' : '' , 107 165 'PH_AUTOPRUNE_FALSE' => $conf_PH[1]=='false' ? 'checked="checked"' : '' , … … 119 177 ); 120 178 179 121 180 // +-----------------------------------------------------------------------+ 122 181 // | templates display |
Note: See TracChangeset
for help on using the changeset viewer.