@ -409,7 +409,6 @@ function return_menu() {
}
function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
$session_id = api_get_session_id();
$session_name = api_get_session_name($session_id);
$_course = api_get_course_info();
@ -463,6 +462,9 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
// part 2: Interbreadcrumbs. If there is an array $interbreadcrumb defined then these have to appear before the last breadcrumb (which is the tool itself)
if (isset($interbreadcrumb) & & is_array($interbreadcrumb)) {
foreach ($interbreadcrumb as $breadcrumb_step) {
if (isset($breadcrumb_step['type']) & & $breadcrumb_step['type'] == 'right') {
continue;
}
if ($breadcrumb_step['url'] != '#') {
$sep = (strrchr($breadcrumb_step['url'], '?') ? '& ' : '?');
$navigation_item['url'] = $breadcrumb_step['url'].$sep.api_get_cidreq();
@ -499,6 +501,24 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
}
}
$navigation_right = array();
if (isset($interbreadcrumb) & & is_array($interbreadcrumb)) {
foreach ($interbreadcrumb as $breadcrumb_step) {
if (isset($breadcrumb_step['type']) & & $breadcrumb_step['type'] == 'right') {
if ($breadcrumb_step['url'] != '#') {
$sep = (strrchr($breadcrumb_step['url'], '?') ? '& ' : '?');
$navigation_item['url'] = $breadcrumb_step['url'].$sep.api_get_cidreq();
} else {
$navigation_item['url'] = '#';
}
$breadcrumb_step['title'] = cut($navigation_item['title'], MAX_LENGTH_BREADCRUMB);
$breadcrumb_step['title'] = Security::remove_XSS($navigation_item['title']);
$navigation_right[] = $breadcrumb_step;
}
}
}
// part 3: The tool itself. If we are on the course homepage we do not want to display the title of the course because this
// is the same as the first part of the breadcrumbs (see part 1)
@ -513,7 +533,6 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
foreach ($navigation as $index => $navigation_info) {
if (!empty($navigation_info['title'])) {
if ($navigation_info['url'] == '#') {
$final_navigation[$index] = $navigation_info['title'];
} else {
@ -568,6 +587,13 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
$lis.= Display::tag('li', $view_as_student_link, array('id' => 'view_as_link','class' => 'pull-right'));
}
if (!empty($navigation_right)) {
foreach($navigation_right as $item){
$extra_class = isset($item['class']) ? $item['class'] : null;
$lis.= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right'));
}
}
if (!empty($lis)) {
$html .= Display::tag('ul', $lis, array('class'=>'breadcrumb'));
}