Juan Carlos Raña 15 years ago
parent
commit
af4b68595a

+ 179 - 179
main/course_home/activity.php

@@ -1,182 +1,182 @@
-<?php 
-/* For licensing terms, see /chamilo_license.txt */
-/**
-==============================================================================
-*         HOME PAGE FOR EACH COURSE
-*
-*	This page, included in every course's index.php is the home
-*	page. To make administration simple, the teacher edits his
-*	course from the home page. Only the login detects that the
-*	visitor is allowed to activate, deactivate home page links,
-*	access to the teachers tools (statistics, edit forums...).
-*
-*	@package dokeos.course_home
-==============================================================================
-*/
-require_once '../../main/inc/global.inc.php';
-require_once api_get_path(LIBRARY_PATH).'course_home.lib.php';
-
-//	MAIN CODE
-if(api_is_allowed_to_edit(null,true)) {
-	//HIDE
-	if(!empty($_GET['hide'])) // visibility 1 -> 0
-	{
-		/* -- session condition for visibility
-		if (!empty($session_id)) {			
-			$sql = "select session_id FROM $tool_table WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'";
-			$rs = Database::query($sql,__FILE__,__LINE__);
-			if (Database::num_rows($rs) > 0) { 
-	 			$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'";
-			} else {
-				$sql_select = "select * FROM $tool_table WHERE id='".$_GET["id"]."'";
-				$res_select = Database::query($sql_select,__FILE__,__LINE__);
-				$row_select = Database::fetch_array($res_select);					
-				$sql = "INSERT INTO $tool_table(name,link,image,visibility,admin,address,added_tool,target,category,session_id)
-						VALUES('{$row_select['name']}','{$row_select['link']}','{$row_select['image']}','0','{$row_select['admin']}','{$row_select['address']}','{$row_select['added_tool']}','{$row_select['target']}','{$row_select['category']}','$session_id')";
-			}									
-		} else {				
-			$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'";
-		}*/		
-		$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'";
-		Database::query($sql,__FILE__,__LINE__);				
-		Display::display_confirmation_message(get_lang('ToolIsNowHidden'));
-	} elseif(!empty($_GET['restore'])) {
-		// visibility 0,2 -> 1
-		//REACTIVATE
-		$sql = 	"UPDATE $tool_table SET visibility=1 WHERE id='".intval($_GET["id"])."'";			
-		Database::query($sql,__FILE__,__LINE__);
-		Display::display_confirmation_message(get_lang('ToolIsNowVisible'));
-	}
-}
+<?php 
+/* For licensing terms, see /chamilo_license.txt */
+/**
+==============================================================================
+*         HOME PAGE FOR EACH COURSE
+*
+*	This page, included in every course's index.php is the home
+*	page. To make administration simple, the teacher edits his
+*	course from the home page. Only the login detects that the
+*	visitor is allowed to activate, deactivate home page links,
+*	access to the teachers tools (statistics, edit forums...).
+*
+*	@package dokeos.course_home
+==============================================================================
+*/
+require_once '../../main/inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'course_home.lib.php';
 
-// work with data post askable by admin of course
-if (api_is_platform_admin()) {
-	// Show message to confirm that a tools must be hidden from available tools
-	// visibility 0,1->2
-	if (!empty($_GET['askDelete'])) {
-?>
-			<div id="toolhide">
-			<?php echo get_lang("DelLk")?>
-			<br />&nbsp;&nbsp;&nbsp;
-			<a href="<?php echo api_get_self()?>"><?php echo get_lang("No")?></a>&nbsp;|&nbsp;
-			<a href="<?php echo api_get_self()?>?delete=yes&id=<?php echo Security::remove_XSS($_GET['id'])?>"><?php echo get_lang("Yes")?></a>
-			</div>
-<?php
-	}
-	/*
-	 * Process hiding a tools from available tools.
-	 */
-	elseif (isset($_GET["delete"]) && $_GET["delete"]) {
-		//where $id is set?
-		$id = intval($id);
-		Database::query("DELETE FROM $tool_table WHERE id='$id' AND added_tool=1",__FILE__,__LINE__);
-	}
-}
-
-
-/*
-==============================================================================
-		COURSE ADMIN ONLY VIEW
-==============================================================================
-*/
-
-// start of tools for CourseAdmins (teachers/tutors)
-if(api_is_allowed_to_edit(null,true) && !api_is_coach()) {
-
-    $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="courseadminview" style="border:0px; margin-top: 0px;padding:5px 0px;">
-		<div class="normal-message" id="id_normal_message" style="display:none">		
-		<?php			
-			echo '<img src="'.$server_protocol.$current_host.'/'.$path_work.'main/inc/lib/javascript/indicator.gif"/>'."&nbsp;&nbsp;";
-			echo get_lang('PleaseStandBy');
-		?>
-		</div>
-		<div class="confirmation-message" id="id_confirmation_message" style="display:none"></div>
-	</div>
+//	MAIN CODE
+if(api_is_allowed_to_edit(null,true)) {
+	//HIDE
+	if(!empty($_GET['hide'])) // visibility 1 -> 0
+	{
+		/* -- session condition for visibility
+		if (!empty($session_id)) {			
+			$sql = "select session_id FROM $tool_table WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'";
+			$rs = Database::query($sql,__FILE__,__LINE__);
+			if (Database::num_rows($rs) > 0) { 
+	 			$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."' AND session_id = '".intval($session_id)."'";
+			} else {
+				$sql_select = "select * FROM $tool_table WHERE id='".$_GET["id"]."'";
+				$res_select = Database::query($sql_select,__FILE__,__LINE__);
+				$row_select = Database::fetch_array($res_select);					
+				$sql = "INSERT INTO $tool_table(name,link,image,visibility,admin,address,added_tool,target,category,session_id)
+						VALUES('{$row_select['name']}','{$row_select['link']}','{$row_select['image']}','0','{$row_select['admin']}','{$row_select['address']}','{$row_select['added_tool']}','{$row_select['target']}','{$row_select['category']}','$session_id')";
+			}									
+		} else {				
+			$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'";
+		}*/		
+		$sql="UPDATE $tool_table SET visibility=0 WHERE id='".intval($_GET["id"])."'";
+		Database::query($sql,__FILE__,__LINE__);				
+		Display::display_confirmation_message(get_lang('ToolIsNowHidden'));
+	} elseif(!empty($_GET['restore'])) {
+		// visibility 0,2 -> 1
+		//REACTIVATE
+		$sql = 	"UPDATE $tool_table SET visibility=1 WHERE id='".intval($_GET["id"])."'";			
+		Database::query($sql,__FILE__,__LINE__);
+		Display::display_confirmation_message(get_lang('ToolIsNowVisible'));
+	}
+}
+
+// work with data post askable by admin of course
+if (api_is_platform_admin()) {
+	// Show message to confirm that a tools must be hidden from available tools
+	// visibility 0,1->2
+	if (!empty($_GET['askDelete'])) {
+?>
+			<div id="toolhide">
+			<?php echo get_lang("DelLk")?>
+			<br />&nbsp;&nbsp;&nbsp;
+			<a href="<?php echo api_get_self()?>"><?php echo get_lang("No")?></a>&nbsp;|&nbsp;
+			<a href="<?php echo api_get_self()?>?delete=yes&id=<?php echo Security::remove_XSS($_GET['id'])?>"><?php echo get_lang("Yes")?></a>
+			</div>
+<?php
+	}
+	/*
+	 * Process hiding a tools from available tools.
+	 */
+	elseif (isset($_GET["delete"]) && $_GET["delete"]) {
+		//where $id is set?
+		$id = intval($id);
+		Database::query("DELETE FROM $tool_table WHERE id='$id' AND added_tool=1",__FILE__,__LINE__);
+	}
+}
+
+
+/*
+==============================================================================
+		COURSE ADMIN ONLY VIEW
+==============================================================================
+*/
+
+// start of tools for CourseAdmins (teachers/tutors)
+if(api_is_allowed_to_edit(null,true) && !api_is_coach()) {
+
+    $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="courseadminview" style="border:0px; margin-top: 0px;padding:5px 0px;">
+		<div class="normal-message" id="id_normal_message" style="display:none">		
+		<?php			
+			echo '<img src="'.$server_protocol.$current_host.'/'.$path_work.'main/inc/lib/javascript/indicator.gif"/>'."&nbsp;&nbsp;";
+			echo get_lang('PleaseStandBy');
+		?>
+		</div>
+		<div class="confirmation-message" id="id_confirmation_message" style="display:none"></div>
+	</div>
 	
-	<?php
-	if (api_get_setting('show_session_data') === 'true' && $id_session > 0) {
-	?>
-	<div class="courseadminview">
-		<span class="viewcaption"><?php echo get_lang("SessionData") ?></span>
-		<table width="100%">
-			<?php echo show_session_data($id_session);?>
-		</table>
-	</div>
-	<?php
-	}
-	?>
-	<div class="courseadminview">
-		<span class="viewcaption"><?php echo get_lang("Authoring") ?></span>
-		<table width="100%">
-			<?php 
-			$my_list = CourseHome::get_tools_category(TOOL_AUTHORING); 
-			CourseHome::show_tools_category($my_list);
-			?>
-		</table>
-	</div>
-	<div class="courseadminview">
-		<span class="viewcaption"><?php echo get_lang("Interaction") ?></span>
-		<table width="100%">
-			<?php 
-			$my_list = CourseHome::get_tools_category(TOOL_INTERACTION); 
-			CourseHome::show_tools_category($my_list);
-			?>
-		</table>
-	</div>
-	<div class="courseadminview">
-		<span class="viewcaption"><?php echo get_lang("Administration") ?></span>
-		<table width="100%">
-			<?php 
-			$my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATEFORM); 
-			CourseHome::show_tools_category($my_list);
-			?>
-		</table>
-	</div>
-
-	<?php
-} elseif (api_is_coach()) {
-
-	if (api_get_setting('show_session_data') === 'true' && $id_session > 0) {
-	?>
-		<div class="courseadminview">
-			<span class="viewcaption"><?php echo get_lang("SessionData") ?></span>
-			<table width="100%">
-				<?php echo CourseHome::show_session_data($id_session);?>
-			</table>
-		</div>
-	<?php
-	}
-	?>
-		<div class="Authoringview">
-			<table width="100%">
-				<?php $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); show_tools_category($my_list);?>
-			</table>
-		</div>
-	<?php
-//		TOOLS AUTHORING
-} else {
-    $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
-    if (count($my_list)>0) {
-?>
-	<div class="Authoringview">
-
-		<table width="100%">
-			<?php CourseHome::show_tools_category($my_list);?>
-		</table>
-	</div>
-<?php
-    }
+	<?php
+	if (api_get_setting('show_session_data') === 'true' && $id_session > 0) {
+	?>
+	<div class="courseadminview">
+		<span class="viewcaption"><?php echo get_lang("SessionData") ?></span>
+		<table width="100%">
+			<?php echo show_session_data($id_session);?>
+		</table>
+	</div>
+	<?php
+	}
+	?>
+	<div class="courseadminview">
+		<span class="viewcaption"><?php echo get_lang("Authoring") ?></span>
+		<table width="100%">
+			<?php 
+			$my_list = CourseHome::get_tools_category(TOOL_AUTHORING); 
+			CourseHome::show_tools_category($my_list);
+			?>
+		</table>
+	</div>
+	<div class="courseadminview">
+		<span class="viewcaption"><?php echo get_lang("Interaction") ?></span>
+		<table width="100%">
+			<?php 
+			$my_list = CourseHome::get_tools_category(TOOL_INTERACTION); 
+			CourseHome::show_tools_category($my_list);
+			?>
+		</table>
+	</div>
+	<div class="courseadminview">
+		<span class="viewcaption"><?php echo get_lang("Administration") ?></span>
+		<table width="100%">
+			<?php 
+			$my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATEFORM); 
+			CourseHome::show_tools_category($my_list);
+			?>
+		</table>
+	</div>
+
+	<?php
+} elseif (api_is_coach()) {
+
+	if (api_get_setting('show_session_data') === 'true' && $id_session > 0) {
+	?>
+		<div class="courseadminview">
+			<span class="viewcaption"><?php echo get_lang("SessionData") ?></span>
+			<table width="100%">
+				<?php echo CourseHome::show_session_data($id_session);?>
+			</table>
+		</div>
+	<?php
+	}
+	?>
+		<div class="Authoringview">
+			<table width="100%">
+				<?php $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); CourseHome::show_tools_category($my_list);?>
+			</table>
+		</div>
+	<?php
+//		TOOLS AUTHORING
+} else {
+    $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
+    if (count($my_list)>0) {
+?>
+	<div class="Authoringview">
+
+		<table width="100%">
+			<?php CourseHome::show_tools_category($my_list);?>
+		</table>
+	</div>
+<?php
+    }
 }

+ 1 - 1
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/class.manager.php

@@ -42,7 +42,7 @@ class manager
 			array(array("htm", "html", "php", "jsp", "asp", 'js', 'css'), "fileCode", SEARCH_TYPE_HTML, 1),
 			array(array("mov", "ram", "rm", "asx", "dcr", "wmv"), "fileVideo", SEARCH_TYPE_VIDEO, 1),
 			array(array("mpg", "avi", "asf", "mpeg"), "fileVideo", SEARCH_TYPE_MOVIE, 1),
-			array(array("aif", "aiff", "wav", "mp3", "wma"), "fileMusic", SEARCH_TYPE_MUSIC, 1),
+			array(array("aif", "aiff", "wav", "mp3", "wma", "mid"), "fileMusic", SEARCH_TYPE_MUSIC, 1),
 			array(array("swf", 'flv'), "fileFlash", SEARCH_TYPE_FLASH, 1),
 			array(array("ppt"), "filePPT", SEARCH_TYPE_PPT, 0),
 			array(array("rtf"), "fileRTF", SEARCH_TYPE_DOC, 0),

+ 2 - 2
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php

@@ -151,8 +151,8 @@
 	define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid. For Dokeos exclude original xml, js and css
 
 	define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
-	define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,bmp,tif,psd,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf, flv, mp4, aac, ppt,rtf,doc, pdf,xls,txt,flv,odt,ods,odp,odg,odc,odf,odb,odi,pps,docx,pptx,xlsx,accdb,xml');//For Dokeos updated
-	define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,jpeg, png,tif,html,htm,mp3, wav,wmv,wma,rm,rmvb,mov,swf,flv,mp4,aac,avi,mpg,mpeg,asf');//For Dokeos updated
+	define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,jpeg,png,bmp,tif,psd,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf, flv, mp4, aac, ppt,rtf,doc, pdf,xls,txt,flv,odt,ods,odp,odg,odc,odf,odb,odi,pps,docx,pptx,xlsx,accdb,xml, mid');//For Dokeos updated
+	define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,jpeg, png,tif,html,htm,mp3,wav,wmv,wma,rm,rmvb,mov,swf,flv,mp4,aac,avi,mpg,mpeg,asf, mid');//For Dokeos updated
 	define('CONFIG_UPLOAD_INVALID_EXTS', 'php,php3,php4,php5,php6,phps,phtml,asp,aspx,jsp,cfm,cfc,pl,jar,sh,cgi,js,exe,com,bat,pif,scr,msi,ws,wsc,wsf,vb,vbe,vbs,reg,dll'); //For Dokeos added.
 	//Preview
 	define('CONFIG_IMG_THUMBNAIL_MAX_X', 100);