made a copy
[atutor.git] / admin / create_course.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
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 /************************************************************************/
13 // $Id$
14
15 define('AT_INCLUDE_PATH', '../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate(AT_ADMIN_PRIV_COURSES);
18         
19 require(AT_INCLUDE_PATH.'classes/Backup/Backup.class.php');
20 require(AT_INCLUDE_PATH.'lib/course.inc.php');
21
22 if (isset($_POST['cancel'])) {
23         $msg->addFeedback('CANCELLED');
24         header('Location: '.AT_BASE_HREF.'admin/courses.php');
25         exit;
26 } else if (isset($_POST['form_course']) && !isset($_POST['setvisual'])) {
27         $errors = add_update_course($_POST, TRUE);
28
29         if ($errors !== FALSE) {
30                 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
31                 header('Location: '.AT_BASE_HREF.'admin/courses.php');
32                 exit;   
33         }
34 }
35
36 require(AT_INCLUDE_PATH.'header.inc.php'); 
37
38 $msg->printAll();
39
40 $course = 0;
41 $isadmin   = TRUE;
42
43 require(AT_INCLUDE_PATH.'html/course_properties.inc.php');
44
45 require(AT_INCLUDE_PATH.'footer.inc.php');
46
47 ?>