2 /****************************************************************************/
4 /****************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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');
19 authenticate(AT_PRIV_ADMIN);
21 require(AT_INCLUDE_PATH.'../mods/_core/backups/classes/Backup.class.php');
22 require_once(AT_INCLUDE_PATH.'../mods/_core/file_manager/filemanager.inc.php');
24 if (isset($_POST['restore'], $_POST['backup_id'])) {
25 header('Location: restore.php?backup_id=' . $_POST['backup_id']);
27 } else if (isset($_POST['download'], $_POST['backup_id'])) {
28 $Backup = new Backup($db, $_SESSION['course_id']);
29 $Backup->download($_POST['backup_id']);
30 exit; // never reached
31 } else if (isset($_POST['delete'], $_POST['backup_id'])) {
32 header('Location: delete.php?backup_id=' . $_POST['backup_id']);
34 } else if (isset($_POST['edit'], $_POST['backup_id'])) {
35 header('Location: edit.php?backup_id=' . $_POST['backup_id']);
37 } else if (!empty($_POST)) {
38 $msg->addError('NO_ITEM_SELECTED');
41 require(AT_INCLUDE_PATH.'header.inc.php');
43 $Backup = new Backup($db, $_SESSION['course_id']);
44 $list = $Backup->getAvailableList();
48 <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
50 <table class="data" summary="" rules="cols">
53 <th><?php echo _AT('file_name'); ?></th>
54 <th><?php echo _AT('date_created'); ?></th>
55 <th><?php echo _AT('file_size'); ?></th>
56 <th><?php echo _AT('description'); ?></th>
61 <td colspan="6"><input type="submit" name="restore" value="<?php echo _AT('restore'); ?>" class="button"/>
62 <input type="submit" name="download" value="<?php echo _AT('download'); ?>" class="button"/>
63 <input type="submit" name="delete" value="<?php echo _AT('delete'); ?>" class="button"/>
64 <input type="submit" name="edit" value="<?php echo _AT('edit'); ?>" class="button"/></td>
73 <td colspan="4"><?php echo _AT('none_found'); ?></td>
78 foreach ($list as $row) {
79 echo '<tr onmousedown="document.form[\'b'.$row['backup_id'].'\'].checked = true; rowselect(this);" id="r_'.$row['backup_id'].'">';
80 echo '<td class="row1"><label><input type="radio" value="'.$row['backup_id'].'" name="backup_id" id="b'.$row['backup_id'].'" />';
81 echo $row['file_name'].'</label></td>';
82 echo '<td>'.AT_date(_AT('filemanager_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME).'</td>';
83 echo '<td align="right">'.get_human_size($row['file_size']).'</td>';
84 echo '<td>'.AT_Print(htmlentities_utf8($row['description']), 'backups.description').'</td>';
93 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>