d9a548b62d7b8cdea51def4dde54430c2fbc2e81
[atutor.git] / mods / atalker / admin / admin_index.php
1 <?php
2 /****************************************************************/
3 /* ATalker                                                                                                              */
4 /****************************************************************/
5 /* Copyright (c) 2002-2005 by Greg Gay        */
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: admin_index.php 5123 2005-07-12 14:59:03Z greg $
14
15 // This file intiates the  Text Reader, SABLE reader, and Voice Manager 
16 // for the ATutor administrator
17
18         define('AT_INCLUDE_PATH', '../../../include/');
19         require (AT_INCLUDE_PATH.'vitals.inc.php');
20         $_POST['textin'] = $addslashes(stripslashes($_POST['textin'])); 
21         $_POST['add'] = $addslashes(stripslashes($_POST['add']));       
22         $_POST['type'] = $addslashes(stripslashes($_POST['type']));     
23         $_POST['page'] = $addslashes(stripslashes($_POST['page']));     
24         $_POST['popup'] = $addslashes(stripslashes($_POST['popup']));   
25         $_POST['download'] = $addslashes(stripslashes($_POST['download']));     
26         $_POST['read'] = $addslashes(stripslashes($_POST['read']));     
27         $_POST['save'] = $addslashes(stripslashes($_POST['save']));     
28         $_POST['file_type'] = $addslashes(stripslashes($_POST['file_type']));   
29         $_POST['volumn'] = $addslashes(stripslashes($_POST['volumn'])); 
30         $_POST['duration'] = $addslashes(stripslashes($_POST['duration']));     
31         $_POST['filename'] = $addslashes(stripslashes($_POST['filename']));     
32
33
34         $_POST['export'] = $addslashes(stripslashes($_POST['export'])); 
35         $_POST['language'] = $addslashes(stripslashes($_POST['language']));     
36         $_POST['speaker'] = $addslashes(stripslashes($_POST['speaker']));
37         $_POST['base'] = $addslashes(stripslashes($_POST['base']));
38         $_POST['middle'] = $addslashes(stripslashes($_POST['middle']));
39         $_POST['range'] = $addslashes(stripslashes($_POST['range']));
40         $_POST['rate'] = $addslashes(stripslashes($_POST['rate']));
41 // with the following line, only administrators can access this page
42 admin_authenticate(AT_ADMIN_PRIV_COURSES);
43
44 // when ATalker reader  is submitted check to see if the required fields have content, then get the approriate reader
45 require_once(AT_INCLUDE_PATH.'../mods/atalker/atalkerlib.inc.php');
46
47 if($_POST['type'] && trim($_POST['textin']) == '' && !$_POST['create'] && !$_POST['remove']){
48
49                         $error = 'TTS_NO_TEXTIN';
50                         $msg->addError($error);
51
52 }else if ($_POST['type'] == "text"){
53
54                 require(AT_INCLUDE_PATH.'../mods/atalker/text_reader.php');
55
56  }else if ($_POST['type'] == "sable"){
57
58                 require(AT_INCLUDE_PATH.'../mods/atalker/sable_reader.php');
59  }
60                 
61 require_once(AT_INCLUDE_PATH.'../mods/atalker/admin/admin_voice.php');
62
63         
64 require (AT_INCLUDE_PATH.'header.inc.php');
65
66 ?>
67
68 <?php
69
70         $tabs = get_atalker_tabs();
71         $num_tabs = count($tabs);
72         if ($_REQUEST['tab']) {
73                 $tab = $_REQUEST['tab'];
74         }
75  
76  
77         if ((isset($_REQUEST['popup']))  &&  ($_REQUEST['popup'] == TRUE)) {
78                 $popup = TRUE;
79                 $popup_win = "popup=1";
80         } 
81
82 require ('../reader.html.php');
83 require (AT_INCLUDE_PATH.'footer.inc.php');
84
85 ?>