2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2004 by Greg Gay, Joel Kronenberg & Heidi Hazelton */
6 /* Adaptive Technology Resource Centre / University of Toronto */
9 /* This program is free software. You can redistribute it and/or */
10 /* modify it under the terms of the GNU General Public License */
11 /* as published by the Free Software Foundation. */
12 /****************************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 $_section[0][0] = _AT('tools');
19 $_section[0][1] = 'tools/';
20 $_section[1][0] = _AT('backup_manager');
21 $_section[1][1] = 'tools/';
23 authenticate(AT_PRIV_ADMIN);
25 require(AT_INCLUDE_PATH.'classes/Backup/Backup.class.php');
26 require(AT_INCLUDE_PATH.'lib/filemanager.inc.php');
28 if (isset($_POST['restore'], $_POST['backup_id'])) {
29 header('Location: restore.php?backup_id=' . $_POST['backup_id']);
31 } else if (isset($_POST['download'], $_POST['backup_id'])) {
32 $Backup =& new Backup($db, $_SESSION['course_id']);
33 $Backup->download($_POST['backup_id']);
34 exit; // never reached
35 } else if (isset($_POST['delete'], $_POST['backup_id'])) {
36 header('Location: delete.php?backup_id=' . $_POST['backup_id']);
38 } else if (isset($_POST['edit'], $_POST['backup_id'])) {
39 header('Location: edit.php?backup_id=' . $_POST['backup_id']);
41 } else if (!empty($_POST)) {
42 $msg->addError('NO_ITEM_SELECTED');
45 require(AT_INCLUDE_PATH.'header.inc.php');
47 $Backup =& new Backup($db, $_SESSION['course_id']);
48 $list = $Backup->getAvailableList();
52 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
54 <table class="data" summary="" rules="cols">
57 <th><?php echo _AT('file_name'); ?></th>
58 <th><?php echo _AT('date_created'); ?></th>
59 <th><?php echo _AT('file_size'); ?></th>
60 <th><?php echo _AT('description'); ?></th>
65 <td colspan="6"><input type="submit" name="restore" value="<?php echo _AT('restore'); ?>" />
66 <input type="submit" name="download" value="<?php echo _AT('download'); ?>" />
67 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" />
68 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" /></td>
77 <td colspan="4"><?php echo _AT('none_found'); ?></td>
81 foreach ($list as $row) {
82 echo '<tr onmousedown="document.form[\'b'.$row['backup_id'].'\'].checked = true; rowselect(this);" id="r_'.$row['backup_id'].'">';
83 echo '<td class="row1"><label><input type="radio" value="'.$row['backup_id'].'" name="backup_id" id="b'.$row['backup_id'].'" />';
84 echo $row['file_name'].'</label></td>';
85 echo '<td>'.AT_date(_AT('filemanager_date_format'), $row['date_timestamp'], AT_DATE_UNIX_TIMESTAMP).'</td>';
86 echo '<td align="right">'.get_human_size($row['file_size']).'</td>';
87 echo '<td>'.AT_Print($row['description'], 'backups.description').'</td>';
96 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>