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: template_reader.php 5123 2005-07-12 14:59:03Z greg $
15 // This file is called into the _AT() function used to generate language (see include/lib/output.inc.php), to wrap a
16 // SPAN element with a mouseover/onfocus around it
18 // global $_base_path;
19 // /////wrap a speech mouseover if audio file exists
20 // require($_SERVER['DOCUMENT_ROOT'].$_base_path.'mods/atalker/template_reader.php');
22 // This script accommodatesinterface sound for MSIE and Mozilla browsers.
23 // See the ATalker theme header.html.php file for the evalSound and playSound javascripts
27 if($_SESSION['atalker_on'] == '1'){
29 global $_base_path, $_base_href, $_SESSION;
30 define('AT_SPEECH_TEMPLATE_DIR', $_SERVER['DOCUMENT_ROOT'].$_base_path.'content/template/'.$_SESSION['lang'].'/');
31 define('AT_SPEECH_TEMPLATE_URL', $_base_href.'content/template/'.$_SESSION['lang'].'/');
34 // If the browser is MSIE, handle interface sound a little differently
35 if(stristr( $_SERVER['HTTP_USER_AGENT'], "MSIE")){
37 if(file_exists(AT_SPEECH_TEMPLATE_DIR.$format.'.ogg')){
39 $outString =$outString ='<span onmouseover="playSound(\''.AT_SPEECH_TEMPLATE_URL.$format.'.ogg\')" onfocus="playSound(\''.AT_SPEECH_TEMPLATE_URL.$format.'.ogg\')"> '.$outString.'</span>';
41 }else if(file_exists(AT_SPEECH_TEMPLATE_DIR.$format.'.mp3')){
43 $outString ='<span onmouseover="playSound(\''.AT_SPEECH_TEMPLATE_URL.$format.'.mp3\')" onfocus="playSound(\''.AT_SPEECH_TEMPLATE_URL.$format.'.mp3\')"> '.$outString.'</span>';
49 if(file_exists(AT_SPEECH_TEMPLATE_DIR.$format.'.ogg')){
50 /* Modified by Eura Ercolani: mimetype support - BEGIN */
52 //$outString ='<span onmouseover="javascript:evalSound(\''.$format.'\')" onfocus="javascript:evalSound(\''.$format.'\')"> '.$outString.'</span>';
53 $outString ='<span onMouseOver="evalSound(\''.$format.'\');" onMouseOut="stopSound(\''.$format.'\');"> '.$outString.'</span>';
54 /* Modified by Eura Ercolani: mimetype support - END */
58 /* Modified by Eura Ercolani: mimetype support - BEGIN */
59 //$embed[$format] ='<embed src="'.AT_SPEECH_TEMPLATE_URL.$format.'.ogg" autostart="false" hidden="true" volumn="8" id="'.$format.'" name="'.$format.'" enablejavascript="true"></embed>'."\n";
61 $embed[$format] ='<embed src="'.AT_SPEECH_TEMPLATE_URL.$format.'.ogg" autostart="false" hidden="true" volumn="8" id="'.$format.'" name="'.$format.'" enablejavascript="true" type="'.$_SESSION['mp3HiddenMimeType'].'"></embed>'."\n";
62 /* Modified by Eura Ercolani: mimetype support - BEGIN */
64 $outString .= $embed[$format];
67 }else if(file_exists(AT_SPEECH_TEMPLATE_DIR.$format.'.mp3')){
70 /* Modified by Eura Ercolani: mimetype support - BEGIN */
71 //$outString ='<span onmouseover="javascript:evalSound(\''.$format.'\')" onfocus="javascript:evalSound(\''.$format.'\')"> '.$outString.'</span>';
72 $outString ='<span onMouseOver="evalSound(\''.$format.'\');" onMouseOut="stopSound(\''.$format.'\')"> '.$outString.'</span>';
73 /* Modified by Eura Ercolani: mimetype support - END */
76 /* Modified by Eura Ercolani: mimetype support - BEGIN */
77 //$embed[$format] ='<embed src="'.AT_SPEECH_TEMPLATE_URL.$format.'.mp3" autostart="false" hidden="true" volumn="8" id="'.$format.'" name="'.$format.'" enablejavascript="true"></embed>'."\n";
78 $embed[$format] ='<embed src="'.AT_SPEECH_TEMPLATE_URL.$format.'.mp3" autostart="false" hidden="true" volumn="8" id="'.$format.'" name="'.$format.'" enablejavascript="true" type="'.$_SESSION['mp3HiddenMimeType'].'"></embed>'."\n";
79 /* Modified by Eura Ercolani: mimetype support - END */
80 $outString .= $embed[$format];