ccf745744079db9adc74ad7610f841313cab3be8
[atutor.git] / mods / atalker / 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: index.php 5123 2005-07-12 14:59:03Z greg$
14         $_user_location = 'public';
15         
16         define('AT_INCLUDE_PATH', '../../include/');
17         require (AT_INCLUDE_PATH.'vitals.inc.php');
18
19         $_POST['textin'] = $addslashes(stripslashes($_POST['textin'])); 
20         $_POST['add'] = $addslashes(stripslashes($_POST['add']));       
21         $_POST['type'] = $addslashes(stripslashes($_POST['type']));     
22         $_POST['page'] = $addslashes(stripslashes($_POST['page']));     
23         $_POST['popup'] = $addslashes(stripslashes($_POST['popup']));   
24         $_POST['download'] = $addslashes(stripslashes($_POST['download']));     
25         $_POST['read'] = $addslashes(stripslashes($_POST['read']));     
26         $_POST['save'] = $addslashes(stripslashes($_POST['save']));     
27         $_POST['file_type'] = $addslashes(stripslashes($_POST['file_type']));   
28         $_POST['volumn'] = $addslashes(stripslashes($_POST['volumn'])); 
29         $_POST['duration'] = $addslashes(stripslashes($_POST['duration']));     
30         $_POST['filename'] = $addslashes(stripslashes($_POST['filename']));     
31
32
33         $_POST['export'] = $addslashes(stripslashes($_POST['export'])); 
34         $_POST['language'] = $addslashes(stripslashes($_POST['language']));     
35         $_POST['speaker'] = $addslashes(stripslashes($_POST['speaker']));
36         $_POST['base'] = $addslashes(stripslashes($_POST['base']));
37         $_POST['middle'] = $addslashes(stripslashes($_POST['middle']));
38         $_POST['range'] = $addslashes(stripslashes($_POST['range']));
39         $_POST['rate'] = $addslashes(stripslashes($_POST['rate']));
40
41
42         require_once(AT_INCLUDE_PATH.'../mods/atalker/atalkerlib.inc.php');
43
44         $_pages['mods/atalker/index.php']['title_var']  = _AT('atalker');
45         
46         $tabs = get_atalker_tabs();
47         $num_tabs = count($tabs);
48         if ($_REQUEST['tab']) {
49                 $tab = $_REQUEST['tab'];
50         }
51
52
53 // when ATalker reader  is submitted check to see if the require fields have content, then get the approriate reader
54 if($_POST['type'] && trim($_POST['textin']) == '' && !$_POST['create']){
55                         $error = 'TTS_NO_TEXTIN';
56                         $msg->addError($error);
57
58 }else if ($_POST['type'] == "text"){
59                 require(AT_INCLUDE_PATH.'../mods/atalker/text_reader.php');
60
61 }else if ($_POST['type'] == "sable"){
62                 require(AT_INCLUDE_PATH.'../mods/atalker/sable_reader.php');
63
64 }
65
66         
67         require (AT_INCLUDE_PATH.'header.inc.php');
68         require ('reader.html.php');
69
70         require (AT_INCLUDE_PATH.'footer.inc.php');
71 ?>