Ver código fonte

[svn r17627] set correctly the breadcrumb in the group see FS#3443

Carlos Vargas 16 anos atrás
pai
commit
838b524ec5

+ 16 - 9
main/announcements/announcements.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.php 17620 2009-01-09 12:45:57Z derrj $
+<?php //$Id: announcements.php 17627 2009-01-09 21:50:35Z cvargas1 $
 /*
 /*
 ==============================================================================
 ==============================================================================
 	Dokeos - elearning and course management software
 	Dokeos - elearning and course management software
@@ -275,15 +275,22 @@ if($surveyid)
 	$obj=@Database::fetch_object($res_temp);
 	$obj=@Database::fetch_object($res_temp);
 	$template=$obj->template;
 	$template=$obj->template;
 }
 }
-if($surveyid)
-{
-	$interbreadcrumb[] = array ("url" => "../survey/survey_list.php?cidReq=$cidReq", "name" => get_lang('Survey'));
-	$nameTools = get_lang('PublishSurvey');
-}
-else
-$nameTools = get_lang('Announcement');
 
 
-$nameTools12 = get_lang('PublishSurvey');
+if (!empty($_SESSION['toolgroup'])){
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');	
+} else {
+	if($surveyid) {
+	
+			$interbreadcrumb[] = array ("url" => "../survey/survey_list.php?cidReq=$cidReq", "name" => get_lang('Survey'));
+			$nameTools = get_lang('PublishSurvey');
+	}else {
+		$nameTools = get_lang('Announcement');
+		$nameTools12 = get_lang('PublishSurvey');
+	}
+} 
 
 
 
 
 
 

+ 7 - 7
main/calendar/agenda.inc.php

@@ -1,4 +1,4 @@
-<?php //$Id: agenda.inc.php 17607 2009-01-08 23:04:13Z juliomontoya $
+<?php //$Id: agenda.inc.php 17627 2009-01-09 21:50:35Z cvargas1 $
 
 
 /*
 /*
 ==============================================================================
 ==============================================================================
@@ -1401,30 +1401,30 @@ function display_student_links()
 	global $show;
 	global $show;
 	if ($_SESSION['sort'] == 'DESC')
 	if ($_SESSION['sort'] == 'DESC')
 	{
 	{
-		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_up.gif',get_lang('AgendaSortChronologicallyUp')).' '.get_lang("AgendaSortChronologicallyUp")."</a> ";
+		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=asc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_up.gif',get_lang('AgendaSortChronologicallyUp')).' '.get_lang("AgendaSortChronologicallyUp")."</a> ";
 	}
 	}
 	else
 	else
 	{
 	{
-		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=desc&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_down.gif',get_lang('AgendaSortChronologicallyDown')).' '.get_lang("AgendaSortChronologicallyDown")."</a> ";
+		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;sort=desc&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".$_GET['origin']."'>".Display::return_icon('calendar_down.gif',get_lang('AgendaSortChronologicallyDown')).' '.get_lang("AgendaSortChronologicallyDown")."</a> ";
 	}
 	}
 
 
 	// showing the link to show all items or only those of the current month
 	// showing the link to show all items or only those of the current month
 	if ($_SESSION['show']=="showcurrent")
 	if ($_SESSION['show']=="showcurrent")
 	{
 	{
-		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;action=showall&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_select.gif', get_lang("ShowAll")).' '.get_lang("ShowAll")."</a> ";
+		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;action=showall&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_select.gif', get_lang("ShowAll")).' '.get_lang("ShowAll")."</a> ";
 	}
 	}
 	else
 	else
 	{
 	{
-		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;action=showcurrent&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_month.gif', get_lang("ShowCurrent")).' '.get_lang("ShowCurrent")."</a> ";
+		echo "<a href='".api_get_self()."?".api_get_cidreq()."&amp;action=showcurrent&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;origin=".Security::remove_XSS($_GET['origin'])."'>".Display::return_icon('calendar_month.gif', get_lang("ShowCurrent")).' '.get_lang("ShowCurrent")."</a> ";
 	}
 	}
 
 
 	if ($_SESSION['view'] <> 'month')
 	if ($_SESSION['view'] <> 'month')
 	{
 	{
-		echo "<a href=\"".api_get_self()."?action=view&amp;view=month\">".Display::return_icon('calendar_month.gif', get_lang('MonthView'))." ".get_lang('MonthView')."</a> ";
+		echo "<a href=\"".api_get_self()."?action=view&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=month\">".Display::return_icon('calendar_month.gif', get_lang('MonthView'))." ".get_lang('MonthView')."</a> ";
 	}
 	}
 	else
 	else
 	{
 	{
-		echo "\t<a href=\"".api_get_self()."?action=view&amp;view=list\">".Display::return_icon('calendar_select.gif', get_lang('ListView'))." ".get_lang('ListView')."</a> ";
+		echo "\t<a href=\"".api_get_self()."?action=view&amp;toolgroup=".Security::remove_XSS($_GET['toolgroup'])."&amp;view=list\">".Display::return_icon('calendar_select.gif', get_lang('ListView'))." ".get_lang('ListView')."</a> ";
 	}
 	}
 }
 }
 
 

+ 12 - 8
main/calendar/agenda.php

@@ -1,4 +1,4 @@
-<?php //$Id: agenda.php 17600 2009-01-08 15:40:20Z cfasanando $
+<?php //$Id: agenda.php 17627 2009-01-09 21:50:35Z cvargas1 $
 /*
 /*
 ==============================================================================
 ==============================================================================
 	Dokeos - elearning and course management software
 	Dokeos - elearning and course management software
@@ -27,7 +27,7 @@
 ==============================================================================
 ==============================================================================
 */
 */
 // name of the language file that needs to be included
 // name of the language file that needs to be included
-$language_file = array('agenda','resourcelinker');
+$language_file = array('agenda','resourcelinker','group');
 
 
 // use anonymous mode when accessing this course tool
 // use anonymous mode when accessing this course tool
 $use_anonymous = true;
 $use_anonymous = true;
@@ -157,8 +157,8 @@ if (!$is_courseAdmin){
 		//$_SESSION['toolgroup']=$_GET['toolgroup'];
 		//$_SESSION['toolgroup']=$_GET['toolgroup'];
 		$toolgroup=$_GET['toolgroup'];
 		$toolgroup=$_GET['toolgroup'];
 		api_session_register('toolgroup');
 		api_session_register('toolgroup');
-		}
 	}
 	}
+}
 	//It comes from the group tools. If it's define it overwrites $_SESSION['group']
 	//It comes from the group tools. If it's define it overwrites $_SESSION['group']
 if (!empty($_GET['isStudentView']) and $_GET['isStudentView']=="false")
 if (!empty($_GET['isStudentView']) and $_GET['isStudentView']=="false")
 {
 {
@@ -178,12 +178,16 @@ $nameTools = get_lang('Agenda'); // language variable in trad4all.inc.php
 // showing the header if we are not in the learning path, if we are in
 // showing the header if we are not in the learning path, if we are in
 // the learning path, we do not include the banner so we have to explicitly
 // the learning path, we do not include the banner so we have to explicitly
 // include the stylesheet, which is normally done in the header
 // include the stylesheet, which is normally done in the header
-if (empty($_GET['origin']) or $_GET['origin'] != 'learnpath')
-{
+if ($_GET['toolgroup']){
+	$_clean['toolgroup']=(int)$_GET['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');	
 	Display::display_header($nameTools,'Agenda');
 	Display::display_header($nameTools,'Agenda');
-}
-else
-{
+	
+} elseif (empty($_GET['origin']) or $_GET['origin'] != 'learnpath') {
+	Display::display_header($nameTools,'Agenda');
+} else {
 	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$clarolineRepositoryWeb."css/default.css\"/>";
 	echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".$clarolineRepositoryWeb."css/default.css\"/>";
 }
 }
 
 

+ 23 - 8
main/forum/editpost.php

@@ -61,7 +61,10 @@
 ==============================================================================
 ==============================================================================
 */
 */
 // name of the language file that needs to be included
 // name of the language file that needs to be included
-$language_file = 'forum';
+$language_file = array (
+	'forum',
+	'group'
+);
 
 
 // including the global dokeos file
 // including the global dokeos file
 require ('../inc/global.inc.php');
 require ('../inc/global.inc.php');
@@ -121,13 +124,25 @@ $current_post=get_post_information($_GET['post']);
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Header and Breadcrumbs
 	Header and Breadcrumbs
 -----------------------------------------------------------
 -----------------------------------------------------------
-*/
-$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
-$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => prepare4display($current_forum_category['cat_title']));
-$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&amp;forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title']));
-$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&amp;forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".$_GET['thread'],"name" => prepare4display($current_thread['thread_title']));
-$interbreadcrumb[]=array("url" => "reply.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => get_lang('EditPost'));
-
+*/
+
+
+if (!empty($_SESSION['toolgroup'])) {
+	
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	$interbreadcrumb[] = array("url" => "viewforum.php?origin=".$origin."&amp;gidReq=".$_SESSION['toolgroup']."&amp;forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title']));	
+	$interbreadcrumb[] = array("url" => "#","name" => get_lang('EditPost'));
+	
+} else {
+	$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
+	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => prepare4display($current_forum_category['cat_title']));
+	$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&amp;forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title']));
+	$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&amp;forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".$_GET['thread'],"name" => prepare4display($current_thread['thread_title']));
+	$interbreadcrumb[]=array("url" => "#","name" => get_lang('EditPost'));
+}
 /*
 /*
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Resource Linker
 	Resource Linker

+ 7 - 7
main/forum/forumfunction.inc.php

@@ -156,7 +156,7 @@ function show_add_forumcategory_form($inputvalues=array()) {
 	$form->addElement('header', '', get_lang('AddForumCategory'));
 	$form->addElement('header', '', get_lang('AddForumCategory'));
 	$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
 	$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
 	$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
 	$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
-	$form->addElement('submit', 'SubmitForumCategory', get_lang('OK'));
+	$form->addElement('submit', 'SubmitForumCategory', get_lang('Ok'));
 
 
 	// setting the rules
 	// setting the rules
 	$form->addRule('forum_category_title', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
 	$form->addRule('forum_category_title', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
@@ -325,7 +325,7 @@ function show_add_forum_form($inputvalues=array()) {
 	 $form->addElement('html','</div>');
 	 $form->addElement('html','</div>');
 
 
 	// The OK button
 	// The OK button
-	$form->addElement('submit', 'SubmitForum', get_lang('OK'));
+	$form->addElement('submit', 'SubmitForum', get_lang('Ok'));
 	// setting the rules
 	// setting the rules
 	$form->addRule('forum_title', get_lang('ThisFieldIsRequired'), 'required');
 	$form->addRule('forum_title', get_lang('ThisFieldIsRequired'), 'required');
 	$form->addRule('forum_category', get_lang('ThisFieldIsRequired'), 'required');
 	$form->addRule('forum_category', get_lang('ThisFieldIsRequired'), 'required');
@@ -423,7 +423,7 @@ function show_edit_forumcategory_form($inputvalues=array()) {
 	$form->addElement('hidden', 'forum_category_id');
 	$form->addElement('hidden', 'forum_category_id');
 	$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
 	$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
 	$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
 	$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
-	$form->addElement('submit', 'SubmitEditForumCategory',get_lang('OK'));
+	$form->addElement('submit', 'SubmitEditForumCategory',get_lang('Ok'));
 	global $charset;
 	global $charset;
 	// setting the default values
 	// setting the default values
 	$defaultvalues['forum_category_id']=$inputvalues['cat_id'];
 	$defaultvalues['forum_category_id']=$inputvalues['cat_id'];
@@ -1788,9 +1788,9 @@ function store_thread($values) {
 
 
 		if ($current_forum['approval_direct_post']=='1' AND !api_is_allowed_to_edit()) {
 		if ($current_forum['approval_direct_post']=='1' AND !api_is_allowed_to_edit()) {
 			$message.=get_lang('MessageHasToBeApproved').'<br />';
 			$message.=get_lang('MessageHasToBeApproved').'<br />';
-			$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&origin='.$origin.'">'.get_lang('Forum').'</a><br />';
+			$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&gidReq='.$_SESSION['toolgroup'].'&origin='.$origin.'">'.get_lang('Forum').'</a><br />';
 		} else {
 		} else {
-			$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&origin='.$origin.'">'.get_lang('Forum').'</a><br />';
+			$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&gidReq='.$_SESSION['toolgroup'].'&origin='.$origin.'">'.get_lang('Forum').'</a><br />';
 			$message.=get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&origin='.$origin.'&amp;thread='.$last_thread_id.'">'.get_lang('Message').'</a>';
 			$message.=get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&origin='.$origin.'&amp;thread='.$last_thread_id.'">'.get_lang('Message').'</a>';
 		}
 		}
 		$reply_info['new_post_id'] = $last_post_id;
 		$reply_info['new_post_id'] = $last_post_id;
@@ -2373,8 +2373,8 @@ function store_edit_post($values) {
 	//update_added_resources('forum_post',$values['post_id']);
 	//update_added_resources('forum_post',$values['post_id']);
 
 
 	$message=get_lang('EditPostStored').'<br />';
 	$message=get_lang('EditPostStored').'<br />';
-	$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;origin='.$origin.'">'.get_lang('Forum').'</a><br />';
-	$message.=get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;origin='.$origin.'&amp;thread='.$values['thread_id'].'&amp;post='.Security::remove_XSS($_GET['post']).'">'.get_lang('Message').'</a>';
+	$message.=get_lang('ReturnTo').' <a href="viewforum.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;origin='.$origin.'">'.get_lang('Forum').'</a><br />';
+	$message.=get_lang('ReturnTo').' <a href="viewthread.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;origin='.$origin.'&amp;thread='.$values['thread_id'].'&amp;post='.Security::remove_XSS($_GET['post']).'">'.get_lang('Message').'</a>';
 
 
 	session_unregister('formelements');
 	session_unregister('formelements');
 	session_unregister('origin');
 	session_unregister('origin');

+ 34 - 18
main/forum/forumqualify.php

@@ -53,7 +53,7 @@ $nameTools=get_lang('Forum');
 */
 */
 
 
 $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
 $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
-$htmlHeadXtra[] = '<script language="javascript">
+$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
 										$(document).ready(function(){ $(\'.hide-me\').slideUp() });
 										$(document).ready(function(){ $(\'.hide-me\').slideUp() });
 									function hidecontent(content){ $(content).slideToggle(\'normal\'); } 
 									function hidecontent(content){ $(content).slideToggle(\'normal\'); } 
 									</script>';
 									</script>';
@@ -80,37 +80,53 @@ $current_thread=get_thread_information($_GET['thread']); // note: this has to be
 $current_forum=get_forum_information($current_thread['forum_id']); // note: this has to be validated that it is an existing forum.
 $current_forum=get_forum_information($current_thread['forum_id']); // note: this has to be validated that it is an existing forum.
 $current_forum_category=get_forumcategory_information($current_forum['forum_category']);
 $current_forum_category=get_forumcategory_information($current_forum['forum_category']);
 $whatsnew_post_info=$_SESSION['whatsnew_post_info'];
 $whatsnew_post_info=$_SESSION['whatsnew_post_info'];
-$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => $nameTools);
-$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum_category['cat_title']));
-
 /*
 /*
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Header and Breadcrumbs
 	Header and Breadcrumbs
 -----------------------------------------------------------
 -----------------------------------------------------------
 */
 */
+
 if ($origin=='learnpath') {
 if ($origin=='learnpath') {
 	include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
 	include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
 } else {
 } else {
-	$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => $nameTools);
-	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum_category['cat_title']));
-	if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
-		$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
-		$interbreadcrumb[]=array("url" => "viewforum.php?forum=".$info_thread['forum_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title']));	
-	} else {
+	if (!empty($_SESSION['toolgroup'])) {	
+		
+		$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+		$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+		$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+		$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
 		$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title']));
 		$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title']));
-	}
-
-	if ($message<>'PostDeletedSpecial') {
+		if ($message<>'PostDeletedSpecial') {
+			$interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+		}
+		$interbreadcrumb[]=array("url" => "#","name" => get_lang('QualifyThread'));
+		// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
+		Display :: display_header('');
+		api_display_tool_title($nameTools);
+	} else {
+		$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => $nameTools);
+		$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum_category['cat_title']));
 		if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
 		if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
 			$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
 			$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
-			$interbreadcrumb[]=array("url" => "viewthread.php?forum=".$info_thread['forum_id']."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+			$interbreadcrumb[]=array("url" => "viewforum.php?forum=".$info_thread['forum_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title']));	
 		} else {
 		} else {
-			$interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+			$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title']));
 		}
 		}
+	
+		if ($message<>'PostDeletedSpecial') {
+			if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
+				$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
+				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".$info_thread['forum_id']."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+			} else {
+				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+			}
+		}
+		// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
+		$interbreadcrumb[]=array("url" => "#","name" => get_lang('QualifyThread'));
+		Display :: display_header('');
+		api_display_tool_title($nameTools);	
+		
 	}
 	}
-	// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
-	Display :: display_header('');
-	api_display_tool_title($nameTools);
 }
 }
 
 
 /*
 /*

+ 21 - 3
main/forum/forumsearch.php

@@ -46,7 +46,10 @@
 */
 */
 
 
 // name of the language file that needs to be included
 // name of the language file that needs to be included
-$language_file = 'forum';
+$language_file = array (
+	'forum',
+	'group'
+);
 
 
 // including the global dokeos file
 // including the global dokeos file
 require ('../inc/global.inc.php');
 require ('../inc/global.inc.php');
@@ -74,8 +77,23 @@ if (isset($_GET['origin'])) {
 $nameTools=get_lang('Forum');
 $nameTools=get_lang('Forum');
 
 
 // breadcrumbs
 // breadcrumbs
-$interbreadcrumb[]=array('url' => 'index.php','name' => $nameTools);
-$interbreadcrumb[]=array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
+
+if (!empty ($_GET['gidReq'])) {
+	$toolgroup = Database::escape_string($_GET['gidReq']);
+	api_session_register('toolgroup');
+}
+
+if (!empty($_SESSION['toolgroup'])) {
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url" => "../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	$interbreadcrumb[] = array ("url" => "viewforum.php?origin=".$origin."&amp;gidReq=".$_SESSION['toolgroup']."&amp;forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title']));
+	$interbreadcrumb[]=array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
+} else {
+	$interbreadcrumb[]=array('url' => 'index.php','name' => $nameTools);
+	$interbreadcrumb[]=array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
+}
 
 
 // Display the header
 // Display the header
 if ($origin=='learnpath') {
 if ($origin=='learnpath') {

+ 8 - 6
main/forum/index.php

@@ -51,11 +51,11 @@ $language_file = 'forum';
 // including the global dokeos file
 // including the global dokeos file
 require '../inc/global.inc.php';
 require '../inc/global.inc.php';
 $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
 $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
-$htmlHeadXtra[] = '<script language="javascript">
+$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
 	$(document).ready(function(){ $(\'.hide-me\').slideUp() });
 	$(document).ready(function(){ $(\'.hide-me\').slideUp() });
 	function hidecontent(content){ $(content).slideToggle(\'normal\'); } 
 	function hidecontent(content){ $(content).slideToggle(\'normal\'); } 
 	</script>';
 	</script>';
-$htmlHeadXtra[] = '<script language="javascript">
+$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
 		
 		
 		function advanced_parameters() {
 		function advanced_parameters() {
 			if(document.getElementById(\'options\').style.display == \'none\') {
 			if(document.getElementById(\'options\').style.display == \'none\') {
@@ -377,7 +377,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
 							$my_all_groups_forum_id=isset($all_groups[$forum['forum_of_group']]['id']) ? $all_groups[$forum['forum_of_group']]['id'] : null;
 							$my_all_groups_forum_id=isset($all_groups[$forum['forum_of_group']]['id']) ? $all_groups[$forum['forum_of_group']]['id'] : null;
 							$group_title=substr($my_all_groups_forum_name,0,30);
 							$group_title=substr($my_all_groups_forum_name,0,30);
 
 
-							$forum_title_group_addition=' (<a href="../group/group_space.php?'.api_get_cidreq().'&gidReq='.$my_all_groups_forum_id.'" class="forum_group_link">'.get_lang('GoTo').' '.$group_title.'</a>)';
+							$forum_title_group_addition=' (<a href="../group/group_space.php?'.api_get_cidreq().'&gidReq='.$forum['forum_of_group'].'" class="forum_group_link">'.get_lang('GoTo').' '.$group_title.'</a>)';
 
 
 						} else {
 						} else {
 							$forum_title_group_addition='';
 							$forum_title_group_addition='';
@@ -388,7 +388,9 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
 						} else {
 						} else {
 							$session_displayed = '';
 							$session_displayed = '';
 						}
 						}
-						echo "\t\t<td><a href=\"viewforum.php?".api_get_cidreq()."&gidReq=".Security::remove_XSS($my_all_groups_forum_id)."&forum=".prepare4display($forum['forum_id'])."\" ".class_visible_invisible(prepare4display($forum['visibility'])).">".prepare4display($forum['forum_title']).$session_displayed.'</a>'.$forum_title_group_addition.'<br />'.prepare4display($forum['forum_comment'])."</td>\n";
+						$forum['forum_of_group']==0?$groupid='':$groupid=$forum['forum_of_group'];
+						
+						echo "\t\t<td><a href=\"viewforum.php?".api_get_cidreq()."&gidReq=".Security::remove_XSS($groupid)."&forum=".prepare4display($forum['forum_id'])."\" ".class_visible_invisible(prepare4display($forum['visibility'])).">".prepare4display($forum['forum_title']).$session_displayed.'</a>'.$forum_title_group_addition.'<br />'.prepare4display($forum['forum_comment'])."</td>\n";
 						//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
 						//$number_forum_topics_and_posts=get_post_topics_of_forum($forum['forum_id']); // deprecated
 						// the number of topics and posts
 						// the number of topics and posts
 						$number_threads=isset($forum['number_of_threads']) ? $forum['number_of_threads'] : null;
 						$number_threads=isset($forum['number_of_threads']) ? $forum['number_of_threads'] : null;
@@ -403,13 +405,13 @@ if (isset($_GET['action']) && $_GET['action'] == 'notify' AND isset($_GET['conte
 							$name=$forum['last_poster_firstname'].' '.$forum['last_poster_lastname'];
 							$name=$forum['last_poster_firstname'].' '.$forum['last_poster_lastname'];
 							$poster_id=$forum['last_poster_id'];
 							$poster_id=$forum['last_poster_id'];
 						}
 						}
-						echo "\t\t<td NOWRAP>";
+						echo "\t\t<td nowrap=\"nowrap\">";
 						
 						
 						if (!empty($forum['last_post_id'])) {
 						if (!empty($forum['last_post_id'])) {
 							echo $forum['last_post_date']."<br /> ".get_lang('By').' '.display_user_link($poster_id, $name);
 							echo $forum['last_post_date']."<br /> ".get_lang('By').' '.display_user_link($poster_id, $name);
 						}
 						}
 						echo "</td>\n";
 						echo "</td>\n";
-						echo "\t\t<td NOWRAP align='center'>";
+						echo "\t\t<td nowrap=\"nowrap\" align=\"center\">";
 						if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval($session_id)!=0)) {
 						if (api_is_allowed_to_edit(false,true) && !($forum['session_id']==0 && intval($session_id)!=0)) {
 							echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&amp;content=forum&amp;id=".$forum['forum_id']."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
 							echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=edit&amp;content=forum&amp;id=".$forum['forum_id']."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>";
 							echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&amp;content=forum&amp;id=".$forum['forum_id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForum"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
 							echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&amp;content=forum&amp;id=".$forum['forum_id']."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteForum"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";

+ 25 - 9
main/forum/newthread.php

@@ -109,16 +109,32 @@ $current_forum_category=get_forumcategory_information($current_forum['forum_cate
 -----------------------------------------------------------
 -----------------------------------------------------------
 */
 */
 
 
-if( (isset($_GET['gradebook']) && $_GET['gradebook']=='view') || ( isset($_POST['gradebook']) && $_POST['gradebook']=='view')) {
-		$interbreadcrumb[]= array (
-			'url' => '../gradebook/index.php',
-			'name' => get_lang('Gradebook')
-		);
+
+if (!empty($_GET['gidReq'])) {
+	$toolgroup = Database::escape_string($_GET['gidReq']);
+	api_session_register('toolgroup');
+}
+
+if (!empty($_SESSION['toolgroup'])) {
+	
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&amp;gidReq=".$_SESSION['toolgroup']."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
+	$interbreadcrumb[]=array("url" => "newthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => get_lang('NewTopic'));
+} else {
+	if( (isset($_GET['gradebook']) && $_GET['gradebook']=='view') || ( isset($_POST['gradebook']) && $_POST['gradebook']=='view')) {
+			$interbreadcrumb[]= array (
+				'url' => '../gradebook/index.php',
+				'name' => get_lang('Gradebook')
+			);
+	}
+	$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
+	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => $current_forum_category['cat_title']);
+	$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
+	$interbreadcrumb[]=array("url" => "newthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => get_lang('NewTopic'));	
 }
 }
-$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
-$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => $current_forum_category['cat_title']);
-$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
-$interbreadcrumb[]=array("url" => "newthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => get_lang('NewTopic'));
 /*
 /*
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Resource Linker
 	Resource Linker

+ 16 - 5
main/forum/reply.php

@@ -109,12 +109,23 @@ $current_forum_category=get_forumcategory_information($current_forum['forum_cate
 	Breadcrumbs
 	Breadcrumbs
 -----------------------------------------------------------
 -----------------------------------------------------------
 */
 */
-$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
-$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => $current_forum_category['cat_title']);
-$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
-$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => $current_thread['thread_title']);
-$interbreadcrumb[]=array("url" => "reply.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => get_lang('Reply'));
 
 
+if (!empty($_SESSION['toolgroup'])) {
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url" => "../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
+	$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => $current_thread['thread_title']);
+	$interbreadcrumb[]=array("url" => "#","name" => get_lang('Reply'));
+	
+} else {
+	$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools);
+	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => $current_forum_category['cat_title']);
+	$interbreadcrumb[]=array("url" => "viewforum.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum']),"name" => $current_forum['forum_title']);
+	$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => $current_thread['thread_title']);
+	$interbreadcrumb[]=array("url" => "#","name" => get_lang('Reply'));
+}
 /*
 /*
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Resource Linker
 	Resource Linker

+ 35 - 12
main/forum/viewforum.php

@@ -45,7 +45,10 @@
 */
 */
 
 
 // name of the language file that needs to be included
 // name of the language file that needs to be included
-$language_file = 'forum';
+$language_file = array (
+	'forum',
+	'group'
+);
 
 
 // including the global dokeos file
 // including the global dokeos file
 require '../inc/global.inc.php';
 require '../inc/global.inc.php';
@@ -122,9 +125,29 @@ if(!empty($my_forum_group)){
 */
 */
 $my_search=isset($_GET['search'])?$_GET['search']:'';
 $my_search=isset($_GET['search'])?$_GET['search']:'';
 $my_action=isset($_GET['action'])?$_GET['action']:'';
 $my_action=isset($_GET['action'])?$_GET['action']:'';
-$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS($my_search),"name" => $nameTools);
-$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum_category['cat_title']));
-$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($my_forum)."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));
+
+
+if (!empty($_GET['gidReq'])) {
+	$toolgroup = Database::escape_string($_GET['gidReq']);
+	api_session_register('toolgroup');
+}
+
+if (!empty($_SESSION['toolgroup'])) {
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	//$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS($my_search),"name" => $nameTools);
+	//$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum_category['cat_title']));
+	$interbreadcrumb[]=array("url" => "#","name" => prepare4display($current_forum['forum_title'])); 
+	//viewforum.php?forum=".Security::remove_XSS($my_forum)."&amp;origin=".$origin."&amp;gidReq=".$_SESSION['toolgroup']."&amp;search=".Security::remove_XSS(urlencode($my_search)),
+
+} else {
+	$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS($my_search),"name" => $nameTools);
+	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum_category['cat_title']));
+	$interbreadcrumb[]=array("url" => "#","name" => prepare4display($current_forum['forum_title'])); 
+	//viewforum.php?forum=".Security::remove_XSS($my_forum)."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search))
+}
 
 
 if ($origin=='learnpath') {
 if ($origin=='learnpath') {
 	include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
 	include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
@@ -267,7 +290,7 @@ if (!empty($message)) {
 -----------------------------------------------------------
 -----------------------------------------------------------
 */
 */
 echo '<div class="actions">';
 echo '<div class="actions">';
-echo '<span style="float:right;">'.search_link().'</span>';
+//echo '<span style="float:right;">'.search_link().'</span>';
 // The link should appear when
 // The link should appear when
 // 1. the course admin is here
 // 1. the course admin is here
 // 2. the course member is here and new threads are allowed
 // 2. the course member is here and new threads are allowed
@@ -386,11 +409,11 @@ if(is_array($threads)) {
 			echo "\t\t<td>".$last_post."</td>\n";
 			echo "\t\t<td>".$last_post."</td>\n";
 			echo "\t\t<td>";	
 			echo "\t\t<td>";	
 			if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
 			if (api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) {
-				echo "<a href=\"editpost.php?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;thread=".Security::remove_XSS($row['thread_id'])."&amp;post=".$row['post_id']."&origin=".$origin."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>\n";
-				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;action=delete&amp;content=thread&amp;id=".$row['thread_id'].$origin_string."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteCompleteThread"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
-				display_visible_invisible_icon('thread', $row['thread_id'], $row['visibility'], array("forum"=>$my_forum,'origin'=>$origin));
-				display_lock_unlock_icon('thread',$row['thread_id'], $row['locked'], array("forum"=>$my_forum,'origin'=>$origin));
-				echo "<a href=\"viewforum.php?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;action=move&amp;thread=".$row['thread_id'].$origin_string."\">".icon('../img/deplacer_fichier.gif',get_lang('MoveThread'))."</a>";
+				echo "<a href=\"editpost.php?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;thread=".Security::remove_XSS($row['thread_id'])."&amp;post=".$row['post_id']."&amp;gidReq=".$_SESSION['toolgroup']."&origin=".$origin."\">".icon('../img/edit.gif',get_lang('Edit'))."</a>\n";
+				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;action=delete&amp;content=thread&amp;gidReq=".$_SESSION['toolgroup']."&amp;id=".$row['thread_id'].$origin_string."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("DeleteCompleteThread"),ENT_QUOTES,$charset))."')) return false;\">".icon('../img/delete.gif',get_lang('Delete'))."</a>";
+				display_visible_invisible_icon('thread', $row['thread_id'], $row['visibility'], array("forum"=>$my_forum,'origin'=>$origin,"gidReq"=>$_SESSION['toolgroup']));
+				display_lock_unlock_icon('thread',$row['thread_id'], $row['locked'], array("forum"=>$my_forum,'origin'=>$origin,"gidReq"=>$_SESSION['toolgroup']));
+				echo "<a href=\"viewforum.php?".api_get_cidreq()."&forum=".Security::remove_XSS($my_forum)."&amp;action=move&amp;gidReq=".$_SESSION['toolgroup']."&amp;thread=".$row['thread_id'].$origin_string."\">".icon('../img/deplacer_fichier.gif',get_lang('MoveThread'))."</a>";
 			}
 			}
 			$iconnotify = 'send_mail.gif';
 			$iconnotify = 'send_mail.gif';
 			if (is_array(isset($_SESSION['forum_notification']['thread'])?$_SESSION['forum_notification']['thread']:null)) {
 			if (is_array(isset($_SESSION['forum_notification']['thread'])?$_SESSION['forum_notification']['thread']:null)) {
@@ -399,9 +422,9 @@ if(is_array($threads)) {
 				}
 				}
 			}
 			}
 			$icon_liststd = 'group.gif';
 			$icon_liststd = 'group.gif';
-			echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;forum=".Security::remove_XSS($my_forum)."&origin=".$origin."&amp;action=notify&amp;content=thread&amp;id=".$row['thread_id']."\">".icon('../img/'.$iconnotify,get_lang('NotifyMe'))."</a>";
+			echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;forum=".Security::remove_XSS($my_forum)."&origin=".$origin."&amp;action=notify&amp;content=thread&amp;gidReq=".$_SESSION['toolgroup']."&amp;id=".$row['thread_id']."\">".icon('../img/'.$iconnotify,get_lang('NotifyMe'))."</a>";
 			if ($userinf['status']=='1') {
 			if ($userinf['status']=='1') {
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).'&origin='.$origin.'&amp;action=liststd&amp;content=thread&amp;id='.$row['thread_id'].'">'.icon('../img/'.$icon_liststd,get_lang('StudentList')).'</a>';			
+				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).'&origin='.$origin.'&amp;action=liststd&amp;content=thread&amp;gidReq='.$_SESSION['toolgroup'].'&amp;id='.$row['thread_id'].'">'.icon('../img/'.$icon_liststd,get_lang('StudentList')).'</a>';			
 			}
 			}
 			echo "</td>\n";
 			echo "</td>\n";
 			echo "\t</tr>\n";
 			echo "\t</tr>\n";

+ 22 - 1
main/forum/viewforumcategory.php

@@ -47,6 +47,26 @@
 
 
 // name of the language file that needs to be included
 // name of the language file that needs to be included
 $language_file = 'forum';
 $language_file = 'forum';
+// including the global dokeos init file
+require '../inc/global.inc.php';
+$htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/jquery.js" ></script>';
+$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
+	$(document).ready(function(){ $(\'.hide-me\').slideUp() });
+	function hidecontent(content){ $(content).slideToggle(\'normal\'); } 
+	</script>';
+$htmlHeadXtra[] = '<script type="text/javascript" language="javascript">
+		
+		function advanced_parameters() {
+			if(document.getElementById(\'options\').style.display == \'none\') {
+					document.getElementById(\'options\').style.display = \'block\';
+					document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;<img src="../img/nolines_minus.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
+			} else {
+					document.getElementById(\'options\').style.display = \'none\';
+					document.getElementById(\'plus_minus\').innerHTML=\'&nbsp;<img src="../img/nolines_plus.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
+			}		
+		}
+	</script>';	
+
 
 
 // including the global dokeos file
 // including the global dokeos file
 require '../inc/global.inc.php';
 require '../inc/global.inc.php';
@@ -200,7 +220,8 @@ if ($action_forums!='add') {
 	echo '<span style="float:right;">'.search_link().'</span>';
 	echo '<span style="float:right;">'.search_link().'</span>';
 	if (api_is_allowed_to_edit(false,true)) {
 	if (api_is_allowed_to_edit(false,true)) {
 		//echo '<a href="'.api_get_self().'?forumcategory='.$_GET['forumcategory'].'&amp;action=add&amp;content=forumcategory">'.get_lang('AddForumCategory').'</a> | ';
 		//echo '<a href="'.api_get_self().'?forumcategory='.$_GET['forumcategory'].'&amp;action=add&amp;content=forumcategory">'.get_lang('AddForumCategory').'</a> | ';
-		echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='.Security::remove_XSS($_GET['forumcategory']).'&amp;action=add&amp;content=forum">'.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
+		echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&amp;content=forum"> '.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
+		//echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='.Security::remove_XSS($_GET['forumcategory']).'&amp;action=add&amp;content=forum">'.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
 	}
 	}
 	echo '</div>';
 	echo '</div>';
 	
 	

+ 46 - 26
main/forum/viewthread.php

@@ -32,7 +32,10 @@
 * 	@package dokeos.forum
 * 	@package dokeos.forum
 */
 */
 // name of the language file that needs to be included
 // name of the language file that needs to be included
-$language_file = 'forum';
+$language_file = array (
+'forum',
+'group'
+);
 
 
 // including the global dokeos file
 // including the global dokeos file
 require '../inc/global.inc.php';
 require '../inc/global.inc.php';
@@ -88,41 +91,58 @@ $whatsnew_post_info=$_SESSION['whatsnew_post_info'];
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Header and Breadcrumbs
 	Header and Breadcrumbs
 -----------------------------------------------------------
 -----------------------------------------------------------
-*/
-if (!empty($_GET['gradebook'])) {
-		$interbreadcrumb[]= array (
-			'url' => '../gradebook/index.php',
-			'name' => get_lang('Gradebook')
-		);
-}
-$my_search=isset($_GET['search']) ? $_GET['search'] : '';
-
-
-if ($origin=='learnpath') {
-	include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
-} else {
+*/
 
 
-	$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS(urlencode($my_search)),"name" => $nameTools);
-	$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum_category['cat_title']));
-	if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
-		$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
-		$interbreadcrumb[]=array("url" => "viewforum.php?forum=".$info_thread['forum_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));	
-	} else {
-		$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));
+if (!empty($_SESSION['toolgroup'])) {
+	
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	$interbreadcrumb[] = array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;gidReq=".$_SESSION['toolgroup']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));
+	$interbreadcrumb[] = array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
+	
+	Display :: display_header('');
+	api_display_tool_title($nameTools);
+	
+} else {
+	if (!empty($_GET['gradebook'])) {
+			$interbreadcrumb[]= array (
+				'url' => '../gradebook/index.php',
+				'name' => get_lang('Gradebook')
+			);
 	}
 	}
-	if (isset($message) && $message<>'PostDeletedSpecial') {
+	$my_search=isset($_GET['search']) ? $_GET['search'] : '';
+	
+	
+	if ($origin=='learnpath') {
+		include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
+	} else {
+	
+		$interbreadcrumb[]=array("url" => "index.php?search=".Security::remove_XSS(urlencode($my_search)),"name" => $nameTools);
+		$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum_category['cat_title']));
+		if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
+			$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
+			$interbreadcrumb[]=array("url" => "viewforum.php?forum=".$info_thread['forum_id']."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));	
+		} else {
+			$interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;origin=".$origin."&amp;search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title']));
+		}
+		$message = isset($message) ? $message : '';
+		//
+		if (isset($message) && $message<>'PostDeletedSpecial') {
+		//this prevents show the link to the page
 			if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
 			if (isset($_GET['gradebook']) and $_GET['gradebook']=='view') {
 				$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
 				$info_thread=get_thread_information(Security::remove_XSS($_GET['thread']));
 				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".$info_thread['forum_id']."&amp;gradebook=".Security::remove_XSS($_GET['gradebook'])."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
 				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".$info_thread['forum_id']."&amp;gradebook=".Security::remove_XSS($_GET['gradebook'])."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
 			} else {
 			} else {
 				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
 				$interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&amp;thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title']));
 			}
 			}
+		}
+		// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
+		Display :: display_header('');
+		api_display_tool_title($nameTools);
 	}
 	}
-	// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
-	Display :: display_header('');
-	api_display_tool_title($nameTools);
 }
 }
-
 /*
 /*
 -----------------------------------------------------------
 -----------------------------------------------------------
 	Is the user allowed here?
 	Is the user allowed here?

+ 96 - 42
main/work/work.php

@@ -27,7 +27,7 @@
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
 * 	@author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
 * 	@author Roan Embrechts, code refactoring and virtual course support
 * 	@author Roan Embrechts, code refactoring and virtual course support
 * 	@author Frederic Vauthier, directories management
 * 	@author Frederic Vauthier, directories management
-*  	@version $Id: work.php 17575 2009-01-07 21:51:12Z cvargas1 $
+*  	@version $Id: work.php 17627 2009-01-09 21:50:35Z cvargas1 $
 *
 *
 * 	@todo refactor more code into functions, use quickforms, coding standards, ...
 * 	@todo refactor more code into functions, use quickforms, coding standards, ...
 */
 */
@@ -108,6 +108,7 @@ require_once (api_get_path(LIBRARY_PATH) . 'events.lib.inc.php');
 require_once (api_get_path(LIBRARY_PATH) . 'security.lib.php');
 require_once (api_get_path(LIBRARY_PATH) . 'security.lib.php');
 require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
 require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
 require_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
 require_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
+require_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
 // Section (for the tabs)
 // Section (for the tabs)
 $this_section = SECTION_COURSES;
 $this_section = SECTION_COURSES;
 $ctok = $_SESSION['sec_token'];
 $ctok = $_SESSION['sec_token'];
@@ -260,53 +261,106 @@ if(isset($_GET['action']) && $_GET['action']=="downloadfolder")
 	Header
 	Header
 -----------------------------------------------------------
 -----------------------------------------------------------
 */
 */
-
-if (isset($origin) && $origin != 'learnpath') {
+	
+if (!empty($_SESSION['toolgroup'])){
+	$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
+	$group_properties  = GroupManager :: get_group_properties($_clean['toolgroup']);
+	$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
+	$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
+	
 	$url_dir ='';
 	$url_dir ='';
-	$interbreadcrumb[] = array ('url' => $url_dir,'name' => get_lang('StudentPublications'));
-
-	//if (!$display_tool_options  && !$display_upload_form)
-	//{
-	//------interbreadcrumb for the current directory root path
-	$dir_array = explode("/", $cur_dir_path);
-	$array_len = count($dir_array);
-
-	if ($array_len > 0) {
-		$url_dir = 'work.php?&curdirpath=/';
-		$interbreadcrumb[] = array (
-			'url' => $url_dir,
-			'name' => get_lang('HomeDirectory'));
-	}
-
-	$dir_acum = '';
-	for ($i = 0; $i < $array_len; $i++) {
-		$url_dir = 'work.php?&curdirpath=' . $dir_acum . $dir_array[$i];
-		$interbreadcrumb[] = array (
-			'url' => $url_dir,
-			'name' => $dir_array[$i]
-		);
-		$dir_acum .= $dir_array[$i] . '/';
-	}
-	//	}
+		$interbreadcrumb[] = array ('url' => $url_dir,'name' => get_lang('StudentPublications'));
+	
+		//if (!$display_tool_options  && !$display_upload_form)
+		//{
+		//------interbreadcrumb for the current directory root path
+		$dir_array = explode("/", $cur_dir_path);
+		$array_len = count($dir_array);
+	
+		if ($array_len > 0) {
+			$url_dir = 'work.php?&curdirpath=/';
+			$interbreadcrumb[] = array (
+				'url' => $url_dir,
+				'name' => get_lang('HomeDirectory'));
+		}
+	
+		$dir_acum = '';
+		for ($i = 0; $i < $array_len; $i++) {
+			$url_dir = 'work.php?&curdirpath=' . $dir_acum . $dir_array[$i];
+			$interbreadcrumb[] = array (
+				'url' => $url_dir,
+				'name' => $dir_array[$i]
+			);
+			$dir_acum .= $dir_array[$i] . '/';
+		}
+		//	}
+	
+		if ($display_upload_form) {
+			$interbreadcrumb[] = array (
+				"url" => "work.php",
+				"name" => get_lang('UploadADocument'));
+		}
+	
+		if ($display_tool_options) {		
+			$interbreadcrumb[] = array (
+				"url" => "work.php",
+				"name" => get_lang('EditToolOptions'));
+		}
+	
+	Display :: display_header(null);
+	
+	
+} else {
 
 
-	if ($display_upload_form) {
-		$interbreadcrumb[] = array (
-			"url" => "work.php",
-			"name" => get_lang('UploadADocument'));
-	}
 
 
-	if ($display_tool_options) {		
-		$interbreadcrumb[] = array (
-			"url" => "work.php",
-			"name" => get_lang('EditToolOptions'));
+	if (isset($origin) && $origin != 'learnpath') {
+		$url_dir ='';
+		$interbreadcrumb[] = array ('url' => $url_dir,'name' => get_lang('StudentPublications'));
+	
+		//if (!$display_tool_options  && !$display_upload_form)
+		//{
+		//------interbreadcrumb for the current directory root path
+		$dir_array = explode("/", $cur_dir_path);
+		$array_len = count($dir_array);
+	
+		if ($array_len > 0) {
+			$url_dir = 'work.php?&curdirpath=/';
+			$interbreadcrumb[] = array (
+				'url' => $url_dir,
+				'name' => get_lang('HomeDirectory'));
+		}
+	
+		$dir_acum = '';
+		for ($i = 0; $i < $array_len; $i++) {
+			$url_dir = 'work.php?&curdirpath=' . $dir_acum . $dir_array[$i];
+			$interbreadcrumb[] = array (
+				'url' => $url_dir,
+				'name' => $dir_array[$i]
+			);
+			$dir_acum .= $dir_array[$i] . '/';
+		}
+		//	}
+	
+		if ($display_upload_form) {
+			$interbreadcrumb[] = array (
+				"url" => "work.php",
+				"name" => get_lang('UploadADocument'));
+		}
+	
+		if ($display_tool_options) {		
+			$interbreadcrumb[] = array (
+				"url" => "work.php",
+				"name" => get_lang('EditToolOptions'));
+		}
+		//--------------------------------------------------
+		Display :: display_header(null);
+	} else {
+		//we are in the learnpath tool
+		include api_get_path(INCLUDE_PATH) . 'reduced_header.inc.php';
 	}
 	}
-	//--------------------------------------------------
-	Display :: display_header(null);
-} else {
-	//we are in the learnpath tool
-	include api_get_path(INCLUDE_PATH) . 'reduced_header.inc.php';
 }
 }
 
 
+
 //stats
 //stats
 event_access_tool(TOOL_STUDENTPUBLICATION);
 event_access_tool(TOOL_STUDENTPUBLICATION);