Browse Source

fixed bug with in windows

Isaac Flores 15 years ago
parent
commit
d811533599
2 changed files with 29 additions and 5 deletions
  1. 16 3
      main/course_home/activity.php
  2. 13 2
      main/course_home/course_home.php

+ 16 - 3
main/course_home/activity.php

@@ -389,7 +389,7 @@ if (isset($_GET['sent_http_request']) && $_GET['sent_http_request']==1) {
 		$requested_clase   = ($tool_visibility == 0 ) ? 'visible' : 'invisible';
 		$requested_message = ($tool_visibility == 0 ) ? 'is_active' : 'is_inactive';
     $requested_view    = ($tool_visibility == 0 ) ? 'visible.gif' : 'invisible.gif'; 
-    $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;           		
+    $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;        		
 	 	/*
 		-----------------------------------------------------------
 			HIDE AND REACTIVATE
@@ -476,8 +476,21 @@ if(api_is_platform_admin())
 // start of tools for CourseAdmins (teachers/tutors)
 if(api_is_allowed_to_edit())
 {
-	?>
-	<div class="normal-message" id="id_normal_message" style="display:none"><?php echo get_lang("PleaseStandBy")."<br/>".'<img src="/main/inc/lib/javascript/indicator.gif"/>'; ?></div>
+    $current_protocol  = $_SERVER['SERVER_PROTOCOL'];
+    $current_host      = $_SERVER['HTTP_HOST'];
+    $server_protocol = substr($current_protocol,0,strrpos($current_protocol,'/'));
+    $server_protocol = $server_protocol.'://';
+    if ($current_host == 'localhost') {
+      //Get information of path
+      $info = explode('courses',api_get_self());
+      $path_work = substr($info[0], 0, strlen($info[0]));
+    } else {
+      $path_work = "";
+    }
+
+   
+?>
+	<div class="normal-message" id="id_normal_message" style="display:none"><?php echo get_lang("PleaseStandBy")."<br/>".'<img src="'.$server_protocol.$current_host.'/'.$path_work.'main/inc/lib/javascript/indicator.gif"/>'; ?></div>
 	<div class="confirmation-message" id="id_confirmation_message" style="display:none"></div>		
 	<div class="courseadminview">
 		<span class="viewcaption"><?php echo get_lang("Authoring") ?></span>

+ 13 - 2
main/course_home/course_home.php

@@ -64,6 +64,14 @@ $use_anonymous = true;
 // inlcuding the global file
 include '../../main/inc/global.inc.php';
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
+if ($_SERVER['HTTP_HOST'] == 'localhost') {
+    //Get information of path
+    api_self();
+    $info = explode('courses',api_get_self());
+    $path_work = substr($info[0],0,strlen($info[0])-1);
+} else {
+    $path_work = "";
+} 
 $htmlHeadXtra[] ='<script type="text/javascript">
  $(document).ready(function() {
   $(".make_visible_and_invisible").attr("href","javascript:void(0);");
@@ -80,7 +88,10 @@ $htmlHeadXtra[] ='<script type="text/javascript">
 		//Delete last item
     	list_path_name[list_path_name.length-1]=null;
     	real_path = list_path_name.join("/");
-    
+      my_protocol = location.protocol;
+      my_host = location.host;
+      my_real_path = my_protocol+"//"+my_host;
+            
 		$.ajax({
 			contentType: "application/x-www-form-urlencoded",
 			beforeSend: function(objeto) {
@@ -88,7 +99,7 @@ $htmlHeadXtra[] ='<script type="text/javascript">
 				$("#id_confirmation_message").hide();
 			},
 			type: "GET",
-			url: "/main/course_home/activity.php",
+			url: my_real_path+"'.$path_work.'/main/course_home/activity.php",
 			data: "id="+my_tool_id+"&sent_http_request=1",
 			success: function(datos) {
 				eval("var info="+datos);