Sfoglia il codice sorgente

[svn r22113] logic changes-allow hide and show videoconference with ajax - (FS#4403)

Isaac Flores 15 anni fa
parent
commit
0a1f627a2e
2 ha cambiato i file con 22 aggiunte e 21 eliminazioni
  1. 17 18
      main/course_home/activity.php
  2. 5 3
      main/course_home/course_home.php

+ 17 - 18
main/course_home/activity.php

@@ -291,31 +291,32 @@ function show_tools_category($course_tool_category)
 			else{
 				$toolsRow['link'] = $toolsRow['link'].$qm_or_amp.api_get_cidreq();
 			}
-				if(strpos($toolsRow['name'],'visio_')!==false)
-				{
+				if(strpos($toolsRow['name'],'visio_')!==false) {
 					
 					/*
 					$toollink = "\t" . '<a ' . $class . ' href="#" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_visio\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
 					*/
 	
-					$toollink = "\t" . '<a ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
-				}
-				else if(strpos($toolsRow['name'],'chat')!==false && api_get_course_setting('allow_open_chat_window')==true)
-				{
+					$toollink = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'"  ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
+					$my_tool_link = "\t" . '<a id="istooldesc_'.$toolsRow["id"].'"  ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_visio'.$_SESSION['_cid'].'\',config=\'height=\'+730+\', width=\'+1020+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
+				} else if(strpos($toolsRow['name'],'chat')!==false && api_get_course_setting('allow_open_chat_window')==true) {
 					/*
 					$toollink = "\t" . '<a ' . $class . ' href="#" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
 					*/
-					$toollink = "\t" . '<a ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
-				}			
-				else 
-				{
+					$toollink = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'" ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
+					$my_tool_link="\t" . '<a id="istooldesc_'.$toolsRow["id"].'" ' . $class . ' href="javascript: void(0);" onclick="window.open(\'' . htmlspecialchars($toolsRow['link']) . '\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $toolsRow['target'] . '">';
+
+				} else {
+
 					if (count(explode('type=classroom',$toolsRow['link']))==2 || count(explode('type=conference',$toolsRow['link']))==2) {					
-						$toollink = "\t" . '<a ' . $class . ' href="' . $toolsRow['link'] . '" target="_blank">';							
-						$my_tool_link = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . $toolsRow['link'] . '" target="_blank">';							
+						//$toollink = "\t" . '<a ' . $class . ' href="' . $toolsRow['link'] . '" target="_blank">';	
+						$toollink = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . $toolsRow['link'] . '" target="_blank">';													
+						$my_tool_link = "\t" . '<a id="istooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . $toolsRow['link'] . '" target="_blank">';							
 					
 					} else {					
-						$toollink = "\t" . '<a ' . $class . ' href="' . htmlspecialchars($toolsRow['link']) . '" target="' . $toolsRow['target'] . '">';	
-						$my_tool_link = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . htmlspecialchars($toolsRow['link']) . '" target="' . $toolsRow['target'] . '">';	
+						//$toollink = "\t" . '<a ' . $class . ' href="' . htmlspecialchars($toolsRow['link']) . '" target="' . $toolsRow['target'] . '">';	
+						$toollink = "\t" . '<a id="tooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . htmlspecialchars($toolsRow['link']) . '" target="' . $toolsRow['target'] . '">';							
+						$my_tool_link = "\t" . '<a id="istooldesc_'.$toolsRow["id"].'" ' . $class . ' href="' . htmlspecialchars($toolsRow['link']) . '" target="' . $toolsRow['target'] . '">';	
 					
 					}
 
@@ -331,15 +332,13 @@ function show_tools_category($course_tool_category)
 					|| $toolsRow['image'] == 'external.gif' || $toolsRow['image'] == 'external_na.gif')
 				{
 					$tool_name = stripslashes($toolsRow['name']);
-				}
-				else
-				{
+				} else {
 					$tool_name = get_lang(ucfirst($toolsRow['name']));
 				}
 				Display::display_icon($toolsRow['image'], $tool_name, array('class'=>'tool-icon','id'=>'toolimage_'.$toolsRow["id"]));
 				echo '</a> ';
 					
-				echo $toollink;	
+				echo $my_tool_link;	
 				/*	
 					echo ($toolsRow['image'] == 'file_html_na.gif' || $toolsRow['image'] == 'file_html.gif' || $toolsRow['image'] == 'scormbuilder.gif' || $toolsRow['image'] == 'scormbuilder_na.gif' || $toolsRow['image'] == 'blog.gif' || $toolsRow['image'] == 'blog_na.gif' || $toolsRow['image'] == 'external.gif' || $toolsRow['image'] == 'external_na.gif') ? '  '.stripslashes($toolsRow['name']) : '  '.get_lang(ucfirst($toolsRow['name']));
 				*/

+ 5 - 3
main/course_home/course_home.php

@@ -1,4 +1,4 @@
-<?php // $Id: course_home.php 22105 2009-07-15 11:58:05Z iflorespaz $
+<?php // $Id: course_home.php 22113 2009-07-15 16:07:21Z iflorespaz $
 
 /*
 ==============================================================================
@@ -68,7 +68,7 @@ $htmlHeadXtra[] ='<script type="text/javascript">
  $(document).ready(function() {
  
  	//$(window).load(function () { 
-      $(".make_visible_and_invisible").attr("href","javascript:void(0)");
+      $(".make_visible_and_invisible").attr("href","javascript:void(0);");
 	//});
 	
  	$("td .make_visible_and_invisible > img").click(function () { 
@@ -90,11 +90,13 @@ $htmlHeadXtra[] ='<script type="text/javascript">
 			list_image_na=image_for_replace.split("_na");
 			list_image_na=list_image_na[0]+".gif";
 			new_current_tool_image=current_tool_image.replace(image_for_replace,list_image_na);
-			$("#tooldesc_"+my_tool_id).attr("class","");		
+			$("#tooldesc_"+my_tool_id).attr("class","");
+			$("#istooldesc_"+my_tool_id).attr("class","");					
        } else {
        	    new_image_to_replace=list_new_image[0]+"_na.gif";
 			new_current_tool_image=current_tool_image.replace(image_for_replace,new_image_to_replace);	
 			$("#tooldesc_"+my_tool_id).attr("class","invisible");
+			$("#istooldesc_"+my_tool_id).attr("class","invisible");		
        	}
 		$("#toolimage_"+my_tool_id).attr("src",new_current_tool_image);