remove old readme
[atutor.git] / docs / mods / _core / backups / admin / edit.php
1 <?php\r
2 /****************************************************************************/\r
3 /* ATutor                                                                                                                                       */\r
4 /****************************************************************************/\r
5 /* Copyright (c) 2002-2010                                                  */\r
6 /* Inclusive Design Institute                                               */\r
7 /* http://atutor.ca                                                                                                                     */\r
8 /*                                                                                                                                                      */\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
13 // $Id$\r
14 \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
18 \r
19 $page = 'backups';\r
20 $_user_location = 'admin';\r
21 \r
22 require(AT_INCLUDE_PATH.'../mods/_core/backups/classes/Backup.class.php');\r
23 \r
24 $_SESSION['done'] = 0;\r
25 \r
26 if (isset($_POST['cancel'])) {\r
27         $msg->addFeedback('CANCELLED');\r
28         header('Location: index.php');\r
29         exit;\r
30\r
31 \r
32 $Backup = new Backup($db, $_REQUEST['course']);\r
33 $backup_row = $Backup->getRow($_REQUEST['backup_id']);\r
34 \r
35 if (isset($_POST['edit'])) {\r
36         $Backup->edit($_POST['backup_id'], $_POST['new_description']);\r
37         $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');\r
38         header('Location: index.php');\r
39         exit;\r
40\r
41 \r
42 //check for errors\r
43 \r
44 require(AT_INCLUDE_PATH.'header.inc.php');\r
45 \r
46 ?>\r
47 \r
48 <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" onsubmit="">\r
49 <input type="hidden" name="backup_id" value="<?php echo $_GET['backup_id']; ?>" />\r
50 <input type="hidden" name="course" value="<?php echo $_GET['course']; ?>" />\r
51 \r
52 <div class="input-form">\r
53         <div class="row">\r
54                 <?php echo _AT('file_name'); ?><br />\r
55                 <?php echo _AT('edit_backup', $backup_row['file_name']); ?>\r
56         </div>\r
57 \r
58         <div class="row">\r
59                 <label for="desc"><?php echo _AT('description'); ?></label><br />\r
60                 <textarea cols="30" rows="2" name="new_description" id="desc"><?php echo AT_print($backup_row['description'], 'backups.description'); ?></textarea>\r
61         </div>\r
62 \r
63         <div class="row buttons">\r
64                 <input type="submit" name="edit" value="<?php echo _AT('save'); ?>" /> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />\r
65         </div>\r
66 </div>\r
67 </form>\r
68 <?php require (AT_INCLUDE_PATH.'footer.inc.php');  ?>