changed git call from https to git readonly
[atutor.git] / mods / cmap / index_admin.php
1 <?php\r
2 /*\r
3 This is the ATutor CMAP module page. It allows an admin user\r
4 to set or edit  the URL for the CMAP installation for ATutor.\r
5 \r
6 */\r
7 define('AT_INCLUDE_PATH', '../../include/');\r
8 require (AT_INCLUDE_PATH.'vitals.inc.php');\r
9 \r
10 \r
11 if (isset($_POST['submit'])) {\r
12         $_POST['uri'] = trim($_POST['uri']);\r
13 \r
14         if (!$_POST['uri']){\r
15                 $msg->addError('CMAPURL_ADD_EMPTY');\r
16         }\r
17                         \r
18         if (!$msg->containsErrors()) {\r
19                 $_POST['uri'] = $addslashes($_POST['uri']);\r
20                 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES ('cmap', '$_POST[uri]')";\r
21                 mysql_query($sql, $db);\r
22                 $msg->addFeedback('CMAPURL_ADD_SAVED');\r
23 \r
24                 header('Location: '.$_SERVER['PHP_SELF']);\r
25                 exit;\r
26         }\r
27 }\r
28 \r
29 require (AT_INCLUDE_PATH.'header.inc.php');\r
30 \r
31 ?>\r
32 \r
33 <?php if ($_config['cmap']): ?>\r
34         <div class="input-form">\r
35                 <div class="row">\r
36                         <p><?php  echo _AT('cmap_admin_text'); ?></p>\r
37                 </div>\r
38 \r
39         </div>\r
40 <?php else: ?>\r
41         <div class="input-form">\r
42                 <div class="row">\r
43                         <p><?php echo _AT('cmap_missing_url');  ?></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('cmap_location'); ?></label></p>\r
52         \r
53                         <input type="text" name="uri" value="<?php echo $_config['cmap']; ?>" id="uri" size="80" style="min-width: 95%;" />\r
54                 </div>\r
55 \r
56                 <div class="row buttons">\r
57                         <input type="submit" name="submit" value="<?php echo _AT('save'); ?>"  />\r
58                 </div>\r
59         </div>\r
60 </form>\r
61 <?php if ($_config['cmap']): ?>\r
62 \r
63 <div class="input-form">\r
64 | <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['cmap']; ?>','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_own_window'); ?></a> \r
65 | <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('http://cmap.ihmc.us/Support/Help/','cmapwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('cmap_help_window'); ?></a> \r
66 | <br /><br />\r
67 </div>\r
68 <iframe name="cmap" id="cmap" title="ePresence" scrolling="yes" src="<?php echo $_config['cmap']; ?>" height="800" width="90%" align="center" style="border:thin white solid; align:center;"></iframe>\r
69 <?php else: ?>\r
70                 <div class="row">\r
71                         <p><?php echo _AT('cmap_missing_url');  ?></p>\r
72                 </div>\r
73 \r
74 <?php endif; ?>\r
75 \r
76 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>