removed mods directory from the ATutor codebase
[atutor.git] / mods / calendar / admin_cal.php
diff --git a/mods/calendar/admin_cal.php b/mods/calendar/admin_cal.php
deleted file mode 100644 (file)
index ad1fe20..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-<?php\r
-/*\r
-This is the ATutor webcalendar module page. It allows an admin user\r
-to set or edit  the URL for the webcalendar installation for ATutor, and\r
-it includes the launcher, which opens webcalendar in a new window\r
-\r
-*/\r
-define('AT_INCLUDE_PATH', '../../include/');\r
-require (AT_INCLUDE_PATH.'vitals.inc.php');\r
-\r
-if($_REQUEST['saved_webcalendar_url'] == 1){\r
-       if($_REQUEST['webcalendar_url'] == ''){\r
-                       $msg->addError('WEBCALENDAR_URL_ADD_EMPTY');\r
-       }else{\r
-               $webcalendar_url = addslashes(stripslashes($_REQUEST['webcalendar_url']));\r
-               $sql = "INSERT INTO ".TABLE_PREFIX."config VALUES('webcalendar', '".$webcalendar_url."')";\r
-               if(!$result = mysql_query($sql)){\r
-                       $msg->addError('WEBCALENDAR_URL_ADD_FAILED');\r
-               }else{\r
-                       $msg->addFeedback('WEBCALENDAR_URL_ADD_SAVED');\r
-               }\r
-       }\r
-}\r
-\r
-if($_REQUEST['edited_webcalendar_url'] == 1){\r
-       if($_REQUEST['webcalendar_url'] == ''){\r
-                       $msg->addError('WEBCALENDAR_URL_ADD_EMPTY');\r
-                       //      $_POST['edit_webcalendar_url'] = 1;\r
-                       \r
-       }else{\r
-               $webcalendar_url = addslashes(stripslashes($_REQUEST['webcalendar_url']));\r
-               $sql = "UPDATE ".TABLE_PREFIX."config SET  value='".$webcalendar_url."' WHERE name = 'webcalendar'";\r
-               if(!$result = mysql_query($sql)){\r
-                       $msg->addError('WEBCALENDAR_URL_ADD_FAILED');\r
-               }else{\r
-                       $msg->addFeedback('WEBCALENDAR_URL_ADD_SAVED');\r
-               }\r
-       }\r
-}\r
-\r
-if($_REQUEST['webcalendar_sync'] == 1){\r
-       //populate the webcal_user table with ATutor members\r
-       $sql = "SELECT * from ".TABLE_PREFIX."members";\r
-       $result = mysql_query($sql,$db);\r
-       if(!$result3 = mysql_query($sql)){\r
-               $msg->addError('WEBCALENDAR_UPDATE_MEMBERS_FAILED');\r
-       }else{\r
-               $msg->addFeedback('WEBCALENDAR_UPDATE_MEMBERS_SAVED');\r
-       }\r
-       while ($row = mysql_fetch_array($result)){\r
-               $sql2  = "REPLACE INTO webcal_user VALUES ('$row[1]','".md5($row[2])."','$row[6]','$row[5]','N','$row[3]')";\r
-               $result1 = mysql_query($sql2, $db);\r
-       }\r
-\r
-\r
-       $sql = "SELECT * from ".TABLE_PREFIX."admins";\r
-       if(!$result3 = mysql_query($sql)){\r
-               $msg->addError('WEBCALENDAR_UPDATE_ADMINS_FAILED');\r
-       }else{\r
-               $msg->addFeedback('WEBCALENDAR_UPDATE_ADMINS_SAVED');\r
-       }\r
-       while ($row = mysql_fetch_array($result3)){\r
-               $sql3  = "REPLACE INTO webcal_user VALUES ('$row[0]','".md5($row[1])."','$row[2]','','Y','$row[3]')";\r
-               $result4 = mysql_query($sql3, $db);\r
-       }\r
-\r
-       //populate the webcal_group table with ATutor courses\r
-       $sql5 = "SELECT * FROM ".TABLE_PREFIX."courses";\r
-       $result5 = mysql_query($sql5,$db);\r
-       while ($row = mysql_fetch_array($result5)){\r
-               $sql2  = "REPLACE INTO webcal_group VALUES ('$row[0]','".$row[1]."','$row[6]','$row[5]')";\r
-               $result1 = mysql_query($sql2, $db);\r
-       }\r
-       if(!$result1 = mysql_query($sql)){\r
-               $msg->addError('WEBCALENDAR_UPDATE_GROUPS_FAILED');\r
-       }else{\r
-               $msg->addFeedback('WEBCALENDAR_UPDATE_GROUPS_SAVED');\r
-       }\r
-\r
-       //populate webcal_group_users users enrolled courses (i.e. groups) \r
-\r
-       $sql6 = "SELECT * FROM ".TABLE_PREFIX."course_enrollment WHERE approved='y'";\r
-       $result6 = mysql_query($sql6,$db);\r
-       while ($row = mysql_fetch_array($result6)){\r
-\r
-               $sql8 = "SELECT login FROM ".TABLE_PREFIX."members WHERE member_id='$row[0]'";\r
-               $result8 = mysql_query($sql8,$db);\r
-               while($row1 = mysql_fetch_array($result8)){\r
-                       $at_login_name = $row1[0];\r
-               }\r
-               $sql2  = "REPLACE INTO webcal_group_user VALUES ('$row[1]','$at_login_name')";\r
-               if(!$result7 = mysql_query($sql2)){\r
-                       $msg->addError('WEBCALENDAR_UPDATE_GROUPMEMS_FAILED');\r
-               }else{\r
-                       $msg->addFeedback('WEBCALENDAR_UPDATE_GROUPMEMS_SAVED');\r
-               }\r
-       }\r
-\r
-\r
-}\r
-\r
-//////////\r
-//Check to see if the url to webcalendar exists in the db \r
-$sql = 'SELECT * from '.TABLE_PREFIX.'config WHERE name="webcalendar"';\r
-$result = mysql_query($sql, $db);\r
-\r
-while($row = mysql_fetch_array($result)){\r
-       $webcalendar_url_db = $row[1];\r
-}\r
-\r
-require (AT_INCLUDE_PATH.'header.inc.php');\r
-\r
-if($webcalendar_url_db == '' || $_POST['edit_webcalendar_url']){ \r
-\r
-?>\r
-               <div class="input-form">\r
-               <div class="row">\r
-                       <p><?php echo _AT('webcalendar_add_url'); ?>\r
-               </p>\r
-                       <div class="row buttons">\r
-                       <form action="<?php $_SERVER['PHP_SELF']?>" method="post">\r
-\r
-                       <?php if($_POST['edit_webcalendar_url']){ ?>\r
-                               <input type="hidden" name="edited_webcalendar_url" value="1">\r
-                       <?php }else{ ?>\r
-                               <input type="hidden" name="saved_webcalendar_url" value="1">\r
-                       <?php } ?>\r
-                       <?php if($_POST['edit_webcalendar_url']){ ?>\r
-                               <input type="text" name="webcalendar_url" value="<?php echo $webcalendar_url_db; ?>" size="80" length="150" />\r
-                               <?php }else{ ?>\r
-                               <input type="text" name="webcalendar_url" value="<?php echo $webcalendar_url; ?>" size="80" length="150" />\r
-                       \r
-                       <?php } ?>      \r
-                       <input type="submit" value="<?php echo _AT('webcalendar_save'); ?>" style="botton">\r
-                       </form>\r
-                       </div>\r
-               </div>\r
-               </div>\r
-\r
-<?php }else{?>\r
-\r
-               <div class="input-form">\r
-               <div class="row">\r
-                       <p><?php echo _AT('webcalendar_sync'); ?></p>\r
-                       <p>     <strong><?php echo $webcalendar_sync; ?> </strong>                                                                      </p>\r
-                       <div class="row buttons">\r
-                       <form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">\r
-                       <input type="hidden" name="webcalendar_sync" value="1">\r
-                       <input type="submit" value="<?php echo _AT('webcalendar_sync_button'); ?>" style="botton">\r
-                       </form>\r
-                       </div>\r
-               </div>\r
-               </div>\r
-               <div class="input-form">\r
-               <div class="row">\r
-                       <p><?php echo _AT('webcalendar_location'); ?></p>\r
-                       <p>     <strong><?php echo $webcalendar_url_db; ?> </strong>                                                                    </p>\r
-                       <div class="row buttons">\r
-                       <form action="<?php  $_SERVER['PHP_SELF']; ?>" method="post">\r
-                       <input type="hidden" name="edit_webcalendar_url" value="1">\r
-                       <input type="submit" value="<?php echo _AT('webcalendar_edit'); ?>" style="botton">\r
-                       </form>\r
-                       </div>\r
-               </div>\r
-               </div>\r
-\r
-\r
-               <div class="input-form">\r
-               <div class="row">\r
-\r
-\r
-\r
-\r
-<?php } \r
-\r
-?>\r
-\r
-<?php \r
-\r
- require (AT_INCLUDE_PATH.'footer.inc.php'); ?>
\ No newline at end of file