2 /****************************************************************************/
\r
4 /****************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************************/
\r
15 define('AT_INCLUDE_PATH', '../../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 admin_authenticate(AT_ADMIN_PRIV_BACKUPS);
\r
20 $_user_location = 'admin';
\r
22 $course = $_POST['course'];
\r
23 require(AT_INCLUDE_PATH.'../mods/_core/backups/classes/Backup.class.php');
\r
25 $Backup = new Backup($db);
\r
27 if (isset($_POST['cancel'])) {
\r
28 $msg->addFeedback('CANCELLED');
\r
29 header('Location: index.php');
\r
31 } else if (isset($_POST['submit'])) {
\r
33 $Backup->setCourseID($_POST['course']);
\r
34 $error = $Backup->create($_POST['description']);
\r
35 if ($error !== FALSE) {
\r
36 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
\r
37 header('Location: index.php');
\r
42 require(AT_INCLUDE_PATH.'header.inc.php');
\r
47 <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
\r
49 <div class="input-form">
\r
51 <p><?php echo _AT('create_backup_about', AT_COURSE_BACKUPS); ?></p>
\r
54 <?php if ($system_courses): ?>
\r
55 <?php if (isset($_POST['submit']) && ($Backup->getNumAvailable() >= AT_COURSE_BACKUPS)): ?>
\r
57 <p><strong><?php echo _AT('max_backups_reached'); ?></strong></p>
\r
61 <span class="required" title="<?php echo _AT('required_field'); ?>">*</span><label for="courses"><?php echo _AT('course'); ?></label><br />
\r
62 <select name="course" id="courses"><?php
\r
63 foreach ($system_courses as $id => $course) {
\r
64 echo '<option value="'.$id.'">'.$course['title'].'</option>';
\r
70 <label for="desc"><?php echo _AT('optional_description'); ?></label><br />
\r
71 <textarea cols="35" rows="2" id="desc" name="description" scroll="no"></textarea>
\r
73 <div class="row buttons">
\r
74 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" /> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
\r
79 <p><?php echo _AT('no_courses_found'); ?></p>
\r
85 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>