changed git call from https to git readonly
[atutor.git] / mods / photo_album / admin_config.php
1 <?php\r
2 /*==============================================================\r
3   Photo Album\r
4  ==============================================================\r
5   Copyright (c) 2006 by Dylan Cheon & Kelvin Wong\r
6   Institute for Assistive Technology / University of Victoria\r
7   http://www.canassist.ca/                                    \r
8                                                                \r
9   This program is free software. You can redistribute it and/or\r
10   modify it under the terms of the GNU General Public License  \r
11   as published by the Free Software Foundation.                \r
12  ==============================================================\r
13  */\r
14 // $Id:\r
15 \r
16 /**\r
17  * @desc        This file generates the administrator course moderation config page\r
18  * @author      Dylan Cheon & Kelvin Wong\r
19  * @copyright   2006, Institute for Assistive Technology / University of Victoria \r
20  * @link        http://www.canassist.ca/                                    \r
21  * @license GNU\r
22  */\r
23 define('AT_INCLUDE_PATH', '../../include/');\r
24 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
25 require (AT_INCLUDE_PATH.'header.inc.php');\r
26 admin_authenticate(AT_ADMIN_PRIV_PHOTO_ALBUM);\r
27 ?>\r
28 \r
29 <?php\r
30 require_once ('define.php');\r
31 require_once ('HTML/Template/ITX.php');\r
32 require_once ('include/data_func.php');\r
33 $_SESSION['pa']['administrator_mode']=true;\r
34 \r
35 if (isset($_POST['submit']) && (isset($_POST['radiobutton']))){ //check whether the config moderation request was submitted\r
36         if ($_POST['radiobutton']=='make_enabled'){\r
37                 modify_config_mode($_SESSION['pa']['course_id'], CONFIG_ENABLED);\r
38         } else if ($_POST['radiobutton']=='make_disabled'){\r
39                 modify_config_mode($_SESSION['pa']['course_id'], CONFIG_DISABLED);\r
40         }\r
41 }\r
42 \r
43 $template=new HTML_Template_ITX("./Template");\r
44 $template->loadTemplateFile("admin_config.tpl.php");\r
45 $template->setVariable("TITLE", _AT('pa_title_instructor_config'));\r
46 $template->setVariable("CONFIG_NOTE", _AT('pa_note_instructor_config'));\r
47 \r
48 $mode=get_config_mode($_SESSION['pa']['course_id']);\r
49 $template->setVariable("CONFIG_STRING", _AT('pa_tag_config_string'));\r
50 if ($mode==CONFIG_ENABLED){\r
51         $template->setVariable("CONFIG_VALUE", _AT('pa_tag_config_enabled'));\r
52         $template->setVariable("CHECKED1", "checked=\"checked\"");\r
53 } else {\r
54         $template->setVariable("CONFIG_VALUE", _AT('pa_tag_config_disabled'));\r
55         $template->setVariable("CHECKED2", "checked=\"checked\"");\r
56 }\r
57 \r
58 $template->setVariable("FORM_NAME", "config_form");\r
59 $template->setVariable("ACTION", $_SERVER['PHP_SELF']);\r
60 $template->setVariable("RADIO_VALUE1", "make_enabled");\r
61 $template->setVariable("RADIO_STRING1", _AT('yes'));\r
62 $template->setVariable("RADIO_VALUE2", "make_disabled");\r
63 $template->setVariable("RADIO_STRING2", _AT('no'));\r
64 $template->setVariable("SUBMIT_VALUE", _AT('pa_button_config_change'));\r
65 \r
66 $template->show();\r
67 ?>\r
68 <?php require_once(AT_INCLUDE_PATH.'footer.inc.php'); ?>