changed git call from https to git readonly
[atutor.git] / mods / atalker / reader_controls.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: reader_controls.php 5123 2005-07-12 14:59:03Z greg
14
15 // insert a require statement into a script to call this file into it to display ATalker controls
16 // e.g    require(AT_INCLUDE_PATH."../mods/atalker/reader_controls.php");
17         $_GET['atalker_on'] = intval($_GET['atalker_on']);
18                 global $_base_href, $_rel_url;
19
20         if($_GET['atalker_on'] == '1'){ 
21         
22                 $_SESSION['atalker_on'] = '1';
23                 header("Location: ".$_SERVER['PHP_SELF']);
24         
25         }else if($_GET['atalker_on'] == '2'){
26         
27                 session_unregister('atalker_on');
28                 header("Location: ".$_SERVER['PHP_SELF']);
29         
30         }
31
32         echo '<div style="text-align:right;">';
33         //global $_rel_url;
34         $_rel_url_new = ltrim($_rel_url, "/");
35         if($_REQUEST['cid']){
36
37
38         }
39
40         if($_rel_url == "/index.php"){
41         
42                 echo '(<img src="'.$_base_href.'mods/atalker/images/atalker_sm.gif" alt="" align="middle"/>';
43         
44         }else{
45         
46                 echo '(<img src="'.$_base_href.'mods/atalker/images/atalker_sm.gif" alt="" align="middle"/>';
47         }
48         
49         
50         if( $_SESSION['atalker_on'] == '1'){ 
51         
52                 echo '<small> '._AT('voice').' <strong>'._AT('on1').'</strong> / <a href="'.$_base_href.$_rel_url_new.'?atalker_on=2">'._AT('off').'</a></small> ';
53         
54         }else if(!$_SESSION['atalker_on']){
55
56                 echo '<small>( '._AT('voice').' <a href="'.$_base_href.$_rel_url_new.'?atalker_on=1">'._AT('on1').'</a> / <strong>'._AT('off').'</strong></small>';
57
58         }
59         
60         if($_GET['messages_on'] == '1'){ 
61         
62                 $_SESSION['messages_on'] = '1';
63                 header("Location: ".$_SERVER['PHP_SELF']);
64         
65         
66         }else if($_GET['messages_on'] == '2'){
67         
68                 session_unregister('messages_on');
69                 header("Location: ".$_SERVER['PHP_SELF']);
70         
71         }
72         
73         if( $_SESSION['messages_on'] == '1'){ 
74
75                 require(AT_INCLUDE_PATH."../mods/atalker/message_reader.php");
76                 echo ' <small> -- '._AT('messages').' <strong>'._AT('on1').'</strong> / <a href="'.$_base_href.$_rel_url_new.'?messages_on=2">'._AT('off').'</a> )</small> ';
77         
78         }else if(!$_SESSION['messages_on']){
79         
80                 echo ' <small>-- '._AT('messages').' <a href="'.$_base_href.$_rel_url_new.'?messages_on=1">'._AT('on1').'</a> / <strong>'._AT('off').'</strong> )</small>';
81         
82         }
83         
84         echo '</div>';
85 ?>