2 /****************************************************************/
4 /****************************************************************/
5 /* Copyright (c) 2002-2005 by Greg Gay */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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_voice_html.php 5123 2005-07-12 14:59:03Z greg
15 // Generate the HTML for the Administrator's Voice Manager
20 <table class="data" style="width:95%;" summary="" rules="cols" >
21 <tfoot><tr><td colspan="3">
22 <input type="submit" class="submit" name="create" value="<?php echo _AT('create_voice'); ?>" />
23 <input type="submit" class="submit" name="remove" value="<?php echo _AT('remove_voice'); ?>" />
30 <script type="text/javascript">
32 function Checkall(form){
33 for (var i = 0; i < form.elements.length; i++){
34 eval("form.elements[" + i + "].checked = form.checkall.checked");
37 function selectCat(catID, cat) {
38 for (var i=0;i<document.form.elements.length;i++) {
39 var e = document.form.elements[i];
40 if ((e.name == 'add_questions[' + catID + '][]') && (e.type=='checkbox'))
41 e.checked = cat.checked;
47 <!-- Note that validation will fail here when language variable names begin with something other than a letter
48 e.g _AT(404_blurb) fails
51 <h3><?php echo _AT('manage_atutor_voice'); ?></h3>
56 $sql = "SELECT * from ".TABLE_PREFIX."language_text WHERE language_code = '".$_SESSION['lang']."' AND variable = '_template'";
57 $result = mysql_query($sql, $db);
58 $num_rows = mysql_num_rows($result);
59 $num_pages = ($num_rows/20);
61 if(!$_REQUEST['page'] || $_GET['page'] == '1'){
63 }else if($_REQUEST['page'] =="all"){
66 $start_limit = ((intval($_REQUEST['page'])-2)*20);
67 $end_limit = ($start_limit +20);
68 $sql .= " LIMIT ".$end_limit.', 20';
73 <td colspan="3"><?php echo _AT('pages'); ?>:
76 // create the paginator
78 for ($i=1; $i < $num_pages; $i++){
79 if($i == $_REQUEST['page']){
82 echo '<a href="'.$_base_url.'mods/atalker/admin/admin_index.php?page='.$p.SEP.'tab='.$tab.SEP.'postdata='.urlencode($postdata).'">'.$p.'</a> |'."\n";
88 <a href="<?php echo $base_url;?>mods/atalker/admin/admin_index.php?<?php echo 'page=all'.SEP.'tab='.$tab.SEP.'postdata='.urlencode($postdata); ?>"><?php echo _AT('all'); ?></a>
93 <th><input type="checkbox" name="checkall" onclick="Checkall(form);" id="selectall" title="<?php echo _AT('select_unselect'); ?>" /> </th>
94 <th scope="col"><?php echo _AT('variable'); ?></th><th scope="col"><?php echo _AT('text'); ?></th>
99 $result = mysql_query($sql, $db);
100 while($row = mysql_fetch_array($result)){
101 if(strlen($row['text']) > 100){
102 $chars = '('._AT(characters_total).' '.strlen($row['text']).')';
105 echo '<tr><td valign="top"><input type="checkbox" id="'.$row['term'].'" name="check[]" value="'.$row['term'].'" /></td><td valign="top"><label for="'.$row['term'].'">';
107 // check if template speech file exits, and create a link to the file if it does
108 if(file_exists(AT_SPEECH_TEMPLATE_DIR.$row['term'].'.mp3')){
110 //echo '<a href="'.AT_SPEECH_TEMPLATE_URL.$row['term'].'.mp3">'.$row['term'].' (mp3)</a>';
111 echo '<a href="'.$base_url.'mods/atalker/admin/play_voice.php?play_voice='.$row['term'].'.mp3">'.$row['term'].' (mp3)</a>';
113 }else if(file_exists(AT_SPEECH_TEMPLATE_DIR.$row['term'].'.ogg')){
115 echo '<a href="'.$base_url.'mods/atalker/admin/play_voice.php?play_voice='.$row['term'].'.ogg">'.$row['term'].' (ogg)</a>';
116 //echo '<a href="'.AT_SPEECH_TEMPLATE_URL.$row['term'].'.ogg">'.$row['term'].' (ogg)</a>';
122 echo '</label></td><td>'.stripslashes(htmlspecialchars($row['text'])).'</td></tr>'."\n";