changed git call from https to git readonly
[atutor.git] / mods / userplane / index_admin.php
1 <?php\r
2 /*\r
3 This is the ATutor Userplane module page. It allows an admin user\r
4 to set or edit  the Userplane  for ATutor, and\r
5 it includes the launcher, which opens Userplane in a new window\r
6 \r
7 */\r
8 define('AT_INCLUDE_PATH', '../../include/');\r
9 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
10 $_custom_css = $_base_path . 'mods/userplane/module.css'; // use a custom stylesheet\r
11 \r
12 if (isset($_POST['submit'])) {\r
13         $_POST['uri'] = trim($_POST['uri']);\r
14 \r
15         if (!$_POST['uri']){\r
16                 $msg->addError('USERPLANE_ID_ADD_EMPTY');\r
17         }\r
18                         \r
19         if (!$msg->containsErrors()) {\r
20                 $_POST['uri'] = $addslashes($_POST['uri']);\r
21                 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('userplane', '$_POST[uri]')";\r
22                 mysql_query($sql, $db);\r
23                 $msg->addFeedback('USERPLANE_ID_SAVED');\r
24 \r
25                 header('Location: '.$_SERVER['PHP_SELF']);\r
26                 exit;\r
27         }\r
28 }\r
29 \r
30 require (AT_INCLUDE_PATH.'header.inc.php');\r
31 \r
32 ?>\r
33 \r
34 <?php if ($_config['userplane']): ?>\r
35         <div class="input-form">\r
36                 <div class="row">\r
37                         <p><?php echo _AT('userplane_text'); ?></p>\r
38                 </div>\r
39         </div>\r
40 <?php else: ?>\r
41         <div class="input-form">\r
42                 <div class="row">\r
43                         <p><?php echo _AT('userplane_missing_id');  ?></p>\r
44                 </div>\r
45         </div>\r
46 <?php endif; ?>\r
47 \r
48 <form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">\r
49         <div class="input-form">\r
50                 <div class="row">\r
51                         <p><label for="uri"><?php echo _AT('userplane_id'); ?></label></p>\r
52         \r
53                         <input type="text" name="uri" value="<?php echo $_config['userplane']; ?>" id="uri" size="60" style="min-width: 65%;" />\r
54                 </div>\r
55                 <div class="row buttons">\r
56                         <input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />\r
57                 </div>\r
58         </div>\r
59 </form>\r
60 <?php\r
61 if($_config['userplane'] !=''){ ?>\r
62         <div id="userplane">\r
63         <script language="javascript" type="text/javascript" src="http://www.userplane.com/chatlite/medallion/chatlite.cfm?DomainID=<?php  echo $_config['userplane'];?>"></script><noscript>You must have JavaScript enabled to use <a href="http://www.userplane.com" title="Userplane" target="_blank">Userplane Chat</a></noscript>\r
64         </div>\r
65 \r
66 <?php }?>\r
67 <?php  require (AT_INCLUDE_PATH.'footer.inc.php'); ?>