remove old readme
[atutor.git] / docs / themes / simplified-desktop / users / preferences.tmpl.php
1
2 <?php 
3
4 $tabs = get_tabs();     
5 $num_tabs = count($tabs);
6
7 $current_tab = 0;  // set default tab
8 $switch_tab = false;
9
10 for ($i=0; $i < $num_tabs; $i++) 
11 {
12         if (isset($_POST['button_'.$i]) && ($_POST['button_'.$i] != -1)) 
13         { 
14                 $current_tab = $i;
15                 $switch_tab = true;
16                 break;
17         }
18 }
19
20 if (!$switch_tab && isset($_POST['current_tab'])) {
21         $current_tab = intval($_POST['current_tab']);
22 }
23
24 if ($current_tab == 1)
25 {
26         global $_custom_head, $onload;
27         
28         $_custom_head = "<script language=\"JavaScript\" src=\"jscripts/lib/TILE.js\" type=\"text/javascript\"></script>";
29         $onload = "setPreviewFace(); setPreviewSize(); setPreviewColours();";
30 }
31
32 require(AT_INCLUDE_PATH.'header.inc.php'); 
33
34 if($_SESSION['course_id'] == "-1"){
35 echo '<div id="container"><br />';
36 }
37
38 ?>
39
40 <form action="<?php echo $_SERVER['PHP_SELF']; ?>"  method="post" name="form" enctype="multipart/form-data">
41
42
43                 <?php output_tabs($current_tab, $changes_made); ?>
44
45
46         <div class="input-form">
47                 <input type="hidden" name="current_tab" value="<?php echo $current_tab; ?>" />
48 <?php
49         if ($current_tab != 0) 
50         {
51                 // save selected options on tab 0 (ATutor settings)
52                 if (isset($_POST['theme']))
53                         echo '  <input type="hidden" name="theme" value="'.$_POST['theme'].'" />'."\n\r";
54                 else if (isset($_SESSION['prefs']['PREF_THEME']))
55                         echo '  <input type="hidden" name="theme" value="'.$_SESSION['prefs']['PREF_THEME'].'" />'."\n\r";
56                 
57                 if (isset($_POST['mnot']))
58                         echo '  <input type="hidden" name="mnot" value="'.$_POST['mnot'].'" />'."\n\r";
59                 else if (isset($this->notify))
60                         echo '  <input type="hidden" name="mnot" value="'.$this->notify.'" />'."\n\r";
61
62                 if (isset($_POST['time_zone']))
63                         echo '  <input type="hidden" name="time_zone" value="'.$_POST['time_zone'].'" />'."\n\r";
64                 else if (isset($_SESSION['prefs']['PREF_TIMEZONE']))
65                         echo '  <input type="hidden" name="time_zone" value="'.$_SESSION['prefs']['PREF_TIMEZONE'].'" />'."\n\r";
66                 
67                 if (isset($_POST['numbering']))
68                         echo '  <input type="hidden" name="numbering" value="'.$_POST['numbering'].'" />'."\n\r";
69                 else if (isset($_SESSION['prefs']['PREF_NUMBERING']))
70                         echo '  <input type="hidden" name="numbering" value="'.$_SESSION['prefs']['PREF_NUMBERING'].'" />'."\n\r";
71                 
72                 if (isset($_POST['use_jump_redirect']))
73                         echo '  <input type="hidden" name="use_jump_redirect" value="'.$_POST['use_jump_redirect'].'" />'."\n\r";
74                 else if (isset($_SESSION['prefs']['PREF_JUMP_REDIRECT']))
75                         echo '  <input type="hidden" name="use_jump_redirect" value="'.$_SESSION['prefs']['PREF_JUMP_REDIRECT'].'" />'."\n\r";
76                 
77                 if (isset($_POST['auto']))
78                         echo '  <input type="hidden" name="auto" value="'.$_POST['auto'].'" />'."\n\r";
79                 else if (isset($this->is_auto_login))
80                         echo '  <input type="hidden" name="auto" value="'.$this->is_auto_login.'" />'."\n\r";
81                 
82                 if (isset($_POST['form_focus']))
83                         echo '  <input type="hidden" name="form_focus" value="'.$_POST['form_focus'].'" />'."\n\r";
84                 else if (isset($_SESSION['prefs']['PREF_FORM_FOCUS']))
85                         echo '  <input type="hidden" name="form_focus" value="'.$_SESSION['prefs']['PREF_FORM_FOCUS'].'" />'."\n\r";
86                 
87                 if (isset($_POST['show_guide']))
88                         echo '  <input type="hidden" name="show_guide" value="'.$_POST['show_guide'].'" />'."\n\r";
89                 else if (isset($_SESSION['prefs']['PREF_SHOW_GUIDE']))
90                         echo '  <input type="hidden" name="show_guide" value="'.$_SESSION['prefs']['PREF_SHOW_GUIDE'].'" />'."\n\r";
91                 
92                 if (isset($_POST['content_editor']))
93                         echo '  <input type="hidden" name="content_editor" value="'.$_POST['content_editor'].'" />'."\n\r";
94                 else if (isset($_SESSION['prefs']['PREF_CONTENT_EDITOR']))
95                         echo '  <input type="hidden" name="content_editor" value="'.$_SESSION['prefs']['PREF_CONTENT_EDITOR'].'" />'."\n\r";
96         }
97
98         if ($current_tab != 1) 
99         {
100                 // save selected options on tab 1 (display settings)
101                 if (isset($_POST['fontface']))
102                         echo '  <input type="hidden" name="fontface" value="'.$_POST['fontface'].'" />'."\n\r";
103                 else if (isset($_SESSION['prefs']['PREF_FONT_FACE']))
104                         echo '  <input type="hidden" name="fontface" value="'.$_SESSION['prefs']['PREF_FONT_FACE'].'" />'."\n\r";
105
106                 if (isset($_POST['font_times']))
107                         echo '  <input type="hidden" name="font_times" value="'.$_POST['font_times'].'" />'."\n\r";
108                 else if (isset($_SESSION['prefs']['PREF_FONT_TIMES']))
109                         echo '  <input type="hidden" name="font_times" value="'.$_SESSION['prefs']['PREF_FONT_TIMES'].'" />'."\n\r";
110
111                 if (isset($_POST['fg']))
112                         echo '  <input type="hidden" name="fg" value="'.$_POST['fg'].'" />'."\n\r";
113                 else if (isset($_SESSION['prefs']['PREF_FG_COLOUR']))
114                         echo '  <input type="hidden" name="fg" value="'.$_SESSION['prefs']['PREF_FG_COLOUR'].'" />'."\n\r";
115
116                 if (isset($_POST['bg']))
117                         echo '  <input type="hidden" name="bg" value="'.$_POST['bg'].'" />'."\n\r";
118                 else if (isset($_SESSION['prefs']['PREF_BG_COLOUR']))
119                         echo '  <input type="hidden" name="bg" value="'.$_SESSION['prefs']['PREF_BG_COLOUR'].'" />'."\n\r";
120
121                 if (isset($_POST['hl']))
122                         echo '  <input type="hidden" name="hl" value="'.$_POST['hl'].'" />'."\n\r";
123                 else if (isset($_SESSION['prefs']['PREF_HL_COLOUR']))
124                         echo '  <input type="hidden" name="hl" value="'.$_SESSION['prefs']['PREF_HL_COLOUR'].'" />'."\n\r";
125         }
126                 
127         if ($current_tab != 2) 
128         {
129                 // save selected options on tab 2 (content settings)
130                 if (isset($_POST['use_alternative_to_text']))
131                         echo '  <input type="hidden" name="use_alternative_to_text" value="'.$_POST['use_alternative_to_text'].'" />'."\n\r";
132                 else if (isset($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_TEXT']))
133                         echo '  <input type="hidden" name="use_alternative_to_text" value="'.$_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_TEXT'].'" />'."\n\r";
134
135                 if (isset($_POST['preferred_alt_to_text']))
136                         echo '  <input type="hidden" name="preferred_alt_to_text" value="'.$_POST['preferred_alt_to_text'].'" />'."\n\r";
137                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_TEXT']))
138                         echo '  <input type="hidden" name="preferred_alt_to_text" value="'.$_SESSION['prefs']['PREF_ALT_TO_TEXT'].'" />'."\n\r";
139                 
140                 if (isset($_POST['alt_to_text_append_or_replace']))
141                 echo '  <input type="hidden" name="alt_to_text_append_or_replace" value="'.$_POST['alt_to_text_append_or_replace'].'" />'."\n\r";
142                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_TEXT_APPEND_OR_REPLACE']))
143                 echo '  <input type="hidden" name="alt_to_text_append_or_replace" value="'.$_SESSION['prefs']['PREF_ALT_TO_TEXT_APPEND_OR_REPLACE'].'" />'."\n\r";
144                 
145                 if (isset($_POST['alt_text_prefer_lang']))
146                 echo '  <input type="hidden" name="alt_text_prefer_lang" value="'.$_POST['alt_text_prefer_lang'].'" />'."\n\r";
147                 else if (isset($_SESSION['prefs']['PREF_ALT_TEXT_PREFER_LANG']))
148                 echo '  <input type="hidden" name="alt_text_prefer_lang" value="'.$_SESSION['prefs']['PREF_ALT_TEXT_PREFER_LANG'].'" />'."\n\r";
149                 
150                 if (isset($_POST['use_alternative_to_audio']))
151                 echo '  <input type="hidden" name="use_alternative_to_audio" value="'.$_POST['use_alternative_to_audio'].'" />'."\n\r";
152                 else if (isset($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_AUDIO']))
153                 echo '  <input type="hidden" name="use_alternative_to_audio" value="'.$_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_AUDIO'].'" />'."\n\r";
154                 
155                 if (isset($_POST['preferred_alt_to_audio']))
156                 echo '  <input type="hidden" name="preferred_alt_to_audio" value="'.$_POST['preferred_alt_to_audio'].'" />'."\n\r";
157                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_AUDIO']))
158                 echo '  <input type="hidden" name="preferred_alt_to_audio" value="'.$_SESSION['prefs']['PREF_ALT_TO_AUDIO'].'" />'."\n\r";
159                 
160                 if (isset($_POST['alt_to_audio_append_or_replace']))
161                 echo '  <input type="hidden" name="alt_to_audio_append_or_replace" value="'.$_POST['alt_to_audio_append_or_replace'].'" />'."\n\r";
162                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_AUDIO_APPEND_OR_REPLACE']))
163                 echo '  <input type="hidden" name="alt_to_audio_append_or_replace" value="'.$_SESSION['prefs']['PREF_ALT_TO_AUDIO_APPEND_OR_REPLACE'].'" />'."\n\r";
164                 
165                 if (isset($_POST['alt_audio_prefer_lang']))
166                 echo '  <input type="hidden" name="alt_audio_prefer_lang" value="'.$_POST['alt_audio_prefer_lang'].'" />'."\n\r";
167                 else if (isset($_SESSION['prefs']['PREF_ALT_AUDIO_PREFER_LANG']))
168                 echo '  <input type="hidden" name="alt_audio_prefer_lang" value="'.$_SESSION['prefs']['PREF_ALT_AUDIO_PREFER_LANG'].'" />'."\n\r";
169                 
170                 if (isset($_POST['use_alternative_to_visual']))
171                 echo '  <input type="hidden" name="use_alternative_to_visual" value="'.$_POST['use_alternative_to_visual'].'" />'."\n\r";
172                 else if (isset($_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_VISUAL']))
173                 echo '  <input type="hidden" name="use_alternative_to_visual" value="'.$_SESSION['prefs']['PREF_USE_ALTERNATIVE_TO_VISUAL'].'" />'."\n\r";
174                 
175                 if (isset($_POST['preferred_alt_to_visual']))
176                 echo '  <input type="hidden" name="preferred_alt_to_visual" value="'.$_POST['preferred_alt_to_visual'].'" />'."\n\r";
177                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_VISUAL']))
178                 echo '  <input type="hidden" name="preferred_alt_to_visual" value="'.$_SESSION['prefs']['PREF_ALT_TO_VISUAL'].'" />'."\n\r";
179                 
180                 if (isset($_POST['alt_to_visual_append_or_replace']))
181                 echo '  <input type="hidden" name="alt_to_visual_append_or_replace" value="'.$_POST['alt_to_visual_append_or_replace'].'" />'."\n\r";
182                 else if (isset($_SESSION['prefs']['PREF_ALT_TO_VISUAL_APPEND_OR_REPLACE']))
183                 echo '  <input type="hidden" name="alt_to_visual_append_or_replace" value="'.$_SESSION['prefs']['PREF_ALT_TO_VISUAL_APPEND_OR_REPLACE'].'" />'."\n\r";
184                 
185                 if (isset($_POST['alt_visual_prefer_lang']))
186                 echo '  <input type="hidden" name="alt_visual_prefer_lang" value="'.$_POST['alt_visual_prefer_lang'].'" />'."\n\r";
187                 else if (isset($_SESSION['prefs']['PREF_ALT_VISUAL_PREFER_LANG']))
188                 echo '  <input type="hidden" name="alt_visual_prefer_lang" value="'.$_SESSION['prefs']['PREF_ALT_VISUAL_PREFER_LANG'].'" />'."\n\r";
189         }
190
191         if ($current_tab != 3) 
192         {
193                 // save selected options on tab 3 (tool settings)
194                 if (isset($_POST['dictionary_val']))
195                         echo '  <input type="hidden" name="dictionary_val" value="'.$_POST['dictionary_val'].'" />'."\n\r";
196                 else if (isset($_SESSION['prefs']['PREF_DICTIONARY']))
197                         echo '  <input type="hidden" name="dictionary_val" value="'.$_SESSION['prefs']['PREF_DICTIONARY'].'" />'."\n\r";
198
199                 if (isset($_POST['thesaurus_val']))
200                         echo '  <input type="hidden" name="thesaurus_val" value="'.$_POST['thesaurus_val'].'" />'."\n\r";
201                 else if (isset($_SESSION['prefs']['PREF_THESAURUS']))
202                         echo '  <input type="hidden" name="thesaurus_val" value="'.$_SESSION['prefs']['PREF_THESAURUS'].'" />'."\n\r";
203
204                 if (isset($_POST['encyclopedia_val']))
205                         echo '  <input type="hidden" name="encyclopedia_val" value="'.$_POST['encyclopedia_val'].'" />'."\n\r";
206                 else if (isset($_SESSION['prefs']['PREF_ENCYCLOPEDIA']))
207                         echo '  <input type="hidden" name="encyclopedia_val" value="'.$_SESSION['prefs']['PREF_ENCYCLOPEDIA'].'" />'."\n\r";
208
209                 if (isset($_POST['atlas_val']))
210                         echo '  <input type="hidden" name="atlas_val" value="'.$_POST['atlas_val'].'" />'."\n\r";
211                 else if (isset($_SESSION['prefs']['PREF_ATLAS']))
212                         echo '  <input type="hidden" name="atlas_val" value="'.$_SESSION['prefs']['PREF_ATLAS'].'" />'."\n\r";
213
214                 if (isset($_POST['note_taking_val']))
215                         echo '  <input type="hidden" name="note_taking_val" value="'.$_POST['note_taking_val'].'" />'."\n\r";
216                 else if (isset($_SESSION['prefs']['PREF_NOTE_TAKING']))
217                         echo '  <input type="hidden" name="note_taking_val" value="'.$_SESSION['prefs']['PREF_NOTE_TAKING'].'" />'."\n\r";
218
219                 if (isset($_POST['calculator_val']))
220                         echo '  <input type="hidden" name="calculator_val" value="'.$_POST['calculator_val'].'" />'."\n\r";
221                 else if (isset($_SESSION['prefs']['PREF_CALCULATOR']))
222                         echo '  <input type="hidden" name="calculator_val" value="'.$_SESSION['prefs']['PREF_CALCULATOR'].'" />'."\n\r";
223
224                 if (isset($_POST['abacus_val']))
225                         echo '  <input type="hidden" name="abacus_val" value="'.$_POST['abacus_val'].'" />'."\n\r";
226                 else if (isset($_SESSION['prefs']['PREF_ABACUS']))
227                         echo '  <input type="hidden" name="abacus_val" value="'.$_SESSION['prefs']['PREF_ABACUS'].'" />'."\n\r";
228         }
229         
230         if ($current_tab != 4) 
231         {
232                 // save selected options on tab 4 (control settings)
233                 if (isset($_POST['show_contents']))
234                         echo '  <input type="hidden" name="show_contents" value="'.$_POST['show_contents'].'" />'."\n\r";
235                 else if (isset($_SESSION['prefs']['PREF_SHOW_CONTENTS']))
236                         echo '  <input type="hidden" name="show_contents" value="'.$_SESSION['prefs']['PREF_SHOW_CONTENTS'].'" />'."\n\r";
237
238                 if (isset($_POST['show_next_previous_buttons']))
239                         echo '  <input type="hidden" name="show_next_previous_buttons" value="'.$_POST['show_next_previous_buttons'].'" />'."\n\r";
240                 else if (isset($_SESSION['prefs']['PREF_SHOW_NEXT_PREVIOUS_BUTTONS']))
241                         echo '  <input type="hidden" name="show_next_previous_buttons" value="'.$_SESSION['prefs']['PREF_SHOW_NEXT_PREVIOUS_BUTTONS'].'" />'."\n\r";
242
243                 if (isset($_POST['show_bread_crumbs']))
244                         echo '  <input type="hidden" name="show_bread_crumbs" value="'.$_POST['show_bread_crumbs'].'" />'."\n\r";
245                 else if (isset($_SESSION['prefs']['PREF_SHOW_BREAD_CRUMBS']))
246                         echo '  <input type="hidden" name="show_bread_crumbs" value="'.$_SESSION['prefs']['PREF_SHOW_BREAD_CRUMBS'].'" />'."\n\r";
247         }
248
249         echo '<fieldset>';
250         include(AT_INCLUDE_PATH .'../users/'.$tabs[$current_tab][1]);
251         echo '</fieldset>';
252 //      include(getcwd().'/'.$tabs[$current_tab][1]);
253
254 ?>
255         <div class="row buttons">
256 <?php 
257 if ($_SESSION['course_id'] == -1) // admin login 
258 {
259 ?>
260                 <input type="submit" name="set_default" value="<?php echo _AT('factory_default'); ?>" accesskey="d" />
261 <?php 
262 }
263 else  // user login 
264 {
265 ?>
266                 <input type="submit" name="set_default" value="<?php echo _AT('reapply_default'); ?>" accesskey="d" title="<?php echo _AT('reapply_default'); ?> - Alt-d"/>
267 <?php 
268 }
269 ?>
270                 <input type="submit" name="submit" value="<?php echo _AT('apply'); ?>" accesskey="s" />
271                 <input type="reset" name="reset" value="<?php echo _AT('reset'); ?>" />
272         </div>
273 </div>
274 </form> 
275 <?php
276 if($_SESSION['course_id'] == "-1"){
277 echo '</div>';
278 }
279
280 require(AT_INCLUDE_PATH.'footer.inc.php'); ?>