From 838b524ec547953baf9ac6c96b8d36b43a127e70 Mon Sep 17 00:00:00 2001 From: Carlos Vargas Date: Fri, 9 Jan 2009 22:50:35 +0100 Subject: [PATCH] [svn r17627] set correctly the breadcrumb in the group see FS#3443 --- main/announcements/announcements.php | 25 +++-- main/calendar/agenda.inc.php | 14 +-- main/calendar/agenda.php | 20 ++-- main/forum/editpost.php | 31 ++++-- main/forum/forumfunction.inc.php | 14 +-- main/forum/forumqualify.php | 52 ++++++---- main/forum/forumsearch.php | 24 ++++- main/forum/index.php | 14 +-- main/forum/newthread.php | 34 +++++-- main/forum/reply.php | 21 +++- main/forum/viewforum.php | 47 ++++++--- main/forum/viewforumcategory.php | 23 ++++- main/forum/viewthread.php | 72 +++++++++----- main/work/work.php | 138 +++++++++++++++++++-------- 14 files changed, 368 insertions(+), 161 deletions(-) diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index 7f028ff1b9..037bb7a042 100644 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -1,4 +1,4 @@ -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'); + } +} diff --git a/main/calendar/agenda.inc.php b/main/calendar/agenda.inc.php index a51703a8e3..6dce8d5d09 100644 --- a/main/calendar/agenda.inc.php +++ b/main/calendar/agenda.inc.php @@ -1,4 +1,4 @@ -".Display::return_icon('calendar_up.gif',get_lang('AgendaSortChronologicallyUp')).' '.get_lang("AgendaSortChronologicallyUp")." "; + echo "".Display::return_icon('calendar_up.gif',get_lang('AgendaSortChronologicallyUp')).' '.get_lang("AgendaSortChronologicallyUp")." "; } else { - echo "".Display::return_icon('calendar_down.gif',get_lang('AgendaSortChronologicallyDown')).' '.get_lang("AgendaSortChronologicallyDown")." "; + echo "".Display::return_icon('calendar_down.gif',get_lang('AgendaSortChronologicallyDown')).' '.get_lang("AgendaSortChronologicallyDown")." "; } // showing the link to show all items or only those of the current month if ($_SESSION['show']=="showcurrent") { - echo "".Display::return_icon('calendar_select.gif', get_lang("ShowAll")).' '.get_lang("ShowAll")." "; + echo "".Display::return_icon('calendar_select.gif', get_lang("ShowAll")).' '.get_lang("ShowAll")." "; } else { - echo "".Display::return_icon('calendar_month.gif', get_lang("ShowCurrent")).' '.get_lang("ShowCurrent")." "; + echo "".Display::return_icon('calendar_month.gif', get_lang("ShowCurrent")).' '.get_lang("ShowCurrent")." "; } if ($_SESSION['view'] <> 'month') { - echo "".Display::return_icon('calendar_month.gif', get_lang('MonthView'))." ".get_lang('MonthView')." "; + echo "".Display::return_icon('calendar_month.gif', get_lang('MonthView'))." ".get_lang('MonthView')." "; } else { - echo "\t".Display::return_icon('calendar_select.gif', get_lang('ListView'))." ".get_lang('ListView')." "; + echo "\t".Display::return_icon('calendar_select.gif', get_lang('ListView'))." ".get_lang('ListView')." "; } } diff --git a/main/calendar/agenda.php b/main/calendar/agenda.php index a2edc66d7c..2de0b36e5f 100644 --- a/main/calendar/agenda.php +++ b/main/calendar/agenda.php @@ -1,4 +1,4 @@ - "../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'); -} -else -{ + +} elseif (empty($_GET['origin']) or $_GET['origin'] != 'learnpath') { + Display::display_header($nameTools,'Agenda'); +} else { echo ""; } diff --git a/main/forum/editpost.php b/main/forum/editpost.php index 3bf02a7619..5effe99a51 100644 --- a/main/forum/editpost.php +++ b/main/forum/editpost.php @@ -61,7 +61,10 @@ ============================================================================== */ // name of the language file that needs to be included -$language_file = 'forum'; +$language_file = array ( + 'forum', + 'group' +); // including the global dokeos file require ('../inc/global.inc.php'); @@ -121,13 +124,25 @@ $current_post=get_post_information($_GET['post']); ----------------------------------------------------------- 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."&forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title'])); -$interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum'])."&thread=".$_GET['thread'],"name" => prepare4display($current_thread['thread_title'])); -$interbreadcrumb[]=array("url" => "reply.php?forum=".Security::remove_XSS($_GET['forum'])."&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."&gidReq=".$_SESSION['toolgroup']."&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."&forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title'])); + $interbreadcrumb[]=array("url" => "viewthread.php?origin=".$origin."&forum=".Security::remove_XSS($_GET['forum'])."&thread=".$_GET['thread'],"name" => prepare4display($current_thread['thread_title'])); + $interbreadcrumb[]=array("url" => "#","name" => get_lang('EditPost')); +} /* ----------------------------------------------------------- Resource Linker diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index df2409abb3..c9007abf75 100644 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -156,7 +156,7 @@ function show_add_forumcategory_form($inputvalues=array()) { $form->addElement('header', '', get_lang('AddForumCategory')); $form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"'); $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 $form->addRule('forum_category_title', '
'.get_lang('ThisFieldIsRequired'), 'required'); @@ -325,7 +325,7 @@ function show_add_forum_form($inputvalues=array()) { $form->addElement('html','
'); // The OK button - $form->addElement('submit', 'SubmitForum', get_lang('OK')); + $form->addElement('submit', 'SubmitForum', get_lang('Ok')); // setting the rules $form->addRule('forum_title', 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('text', 'forum_category_title', get_lang('Title'),'class="input_titles"'); $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; // setting the default values $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()) { $message.=get_lang('MessageHasToBeApproved').'
'; - $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; + $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; } else { - $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; + $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; $message.=get_lang('ReturnTo').' '.get_lang('Message').''; } $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']); $message=get_lang('EditPostStored').'
'; - $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; - $message.=get_lang('ReturnTo').' '.get_lang('Message').''; + $message.=get_lang('ReturnTo').' '.get_lang('Forum').'
'; + $message.=get_lang('ReturnTo').' '.get_lang('Message').''; session_unregister('formelements'); session_unregister('origin'); diff --git a/main/forum/forumqualify.php b/main/forum/forumqualify.php index c55f432f59..733fb7ddb5 100644 --- a/main/forum/forumqualify.php +++ b/main/forum/forumqualify.php @@ -53,7 +53,7 @@ $nameTools=get_lang('Forum'); */ $htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; @@ -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_category=get_forumcategory_information($current_forum['forum_category']); $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']."&search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum_category['cat_title'])); - /* ----------------------------------------------------------- Header and Breadcrumbs ----------------------------------------------------------- */ + if ($origin=='learnpath') { include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php'); } 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']."&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']."&origin=".$origin."&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'])."&origin=".$origin."&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'])."&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']."&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" => "viewthread.php?forum=".$info_thread['forum_id']."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title'])); + $interbreadcrumb[]=array("url" => "viewforum.php?forum=".$info_thread['forum_id']."&origin=".$origin."&search=".Security::remove_XSS(urlencode($_GET['search'])),"name" => prepare4display($current_forum['forum_title'])); } else { - $interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title'])); + $interbreadcrumb[]=array("url" => "viewforum.php?forum=".Security::remove_XSS($_GET['forum'])."&origin=".$origin."&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']."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title'])); + } else { + $interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&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); } /* diff --git a/main/forum/forumsearch.php b/main/forum/forumsearch.php index 4d85048576..22de2653d9 100644 --- a/main/forum/forumsearch.php +++ b/main/forum/forumsearch.php @@ -46,7 +46,10 @@ */ // name of the language file that needs to be included -$language_file = 'forum'; +$language_file = array ( + 'forum', + 'group' +); // including the global dokeos file require ('../inc/global.inc.php'); @@ -74,8 +77,23 @@ if (isset($_GET['origin'])) { $nameTools=get_lang('Forum'); // 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."&gidReq=".$_SESSION['toolgroup']."&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 if ($origin=='learnpath') { diff --git a/main/forum/index.php b/main/forum/index.php index 4eab60810c..d20af58c13 100644 --- a/main/forum/index.php +++ b/main/forum/index.php @@ -51,11 +51,11 @@ $language_file = 'forum'; // including the global dokeos file require '../inc/global.inc.php'; $htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; -$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; +$htmlHeadXtra[] = ''; + // including the global dokeos file require '../inc/global.inc.php'; @@ -200,7 +220,8 @@ if ($action_forums!='add') { echo ''.search_link().''; if (api_is_allowed_to_edit(false,true)) { //echo ''.get_lang('AddForumCategory').' | '; - echo ''.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').''; + echo ' '.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').''; + //echo ''.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').''; } echo ''; diff --git a/main/forum/viewthread.php b/main/forum/viewthread.php index e2277dc1ad..e65c0c3fd2 100644 --- a/main/forum/viewthread.php +++ b/main/forum/viewthread.php @@ -32,7 +32,10 @@ * @package dokeos.forum */ // name of the language file that needs to be included -$language_file = 'forum'; +$language_file = array ( +'forum', +'group' +); // including the global dokeos file require '../inc/global.inc.php'; @@ -88,41 +91,58 @@ $whatsnew_post_info=$_SESSION['whatsnew_post_info']; ----------------------------------------------------------- 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']."&origin=".$origin."&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']."&origin=".$origin."&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'])."&origin=".$origin."&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'])."&gidReq=".$_SESSION['toolgroup']."&origin=".$origin."&search=".Security::remove_XSS(urlencode($my_search)),"name" => prepare4display($current_forum['forum_title'])); + $interbreadcrumb[] = array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&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']."&origin=".$origin."&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']."&origin=".$origin."&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'])."&origin=".$origin."&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') { $info_thread=get_thread_information(Security::remove_XSS($_GET['thread'])); $interbreadcrumb[]=array("url" => "viewthread.php?forum=".$info_thread['forum_id']."&gradebook=".Security::remove_XSS($_GET['gradebook'])."&thread=".Security::remove_XSS($_GET['thread']),"name" => prepare4display($current_thread['thread_title'])); } else { $interbreadcrumb[]=array("url" => "viewthread.php?forum=".Security::remove_XSS($_GET['forum'])."&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? diff --git a/main/work/work.php b/main/work/work.php index bb4d6e9f95..228748fb68 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -27,7 +27,7 @@ * @author Patrick Cool , 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 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, ... */ @@ -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) . 'formvalidator/FormValidator.class.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) $this_section = SECTION_COURSES; $ctok = $_SESSION['sec_token']; @@ -260,53 +261,106 @@ if(isset($_GET['action']) && $_GET['action']=="downloadfolder") 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 =''; - $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 event_access_tool(TOOL_STUDENTPUBLICATION);