Fix interbreadcrumb not needed to add it in the template, is already generated inside the Template class

pull/2487/head
jmontoyaa 10 years ago
parent e7785a2ffa
commit 7c4de0d060
  1. 8
      main/inc/lib/api.lib.php
  2. 3
      main/inc/lib/template.lib.php
  3. 21
      main/lp/lp_view.php

@ -1622,14 +1622,16 @@ function api_get_cidreq_params($courseCode, $sessionId = 0, $groupId = 0)
*
* @param bool $addSessionId
* @param bool $addGroupId
* @param string $origin
*
* @return string Course & session references to add to a URL
*
*/
function api_get_cidreq($addSessionId = true, $addGroupId = true)
function api_get_cidreq($addSessionId = true, $addGroupId = true, $origin = '')
{
$courseCode = api_get_course_id();
$url = empty($courseCode) ? '' : 'cidReq='.htmlspecialchars($courseCode);
$origin = api_get_origin();
$origin = empty($origin) ? api_get_origin() : Security::remove_XSS($origin);
if ($addSessionId) {
if (!empty($url)) {
@ -7499,7 +7501,7 @@ function convert_double_quote_to_single($in_text) {
function api_get_origin()
{
if (isset($_REQUEST['origin'])) {
return $_REQUEST['origin'] == 'learnpath' ? 'learnpath' : null;
return $_REQUEST['origin'] === 'learnpath' ? 'learnpath' : '';
}
return null;

@ -406,7 +406,7 @@ class Template
if (api_get_setting('show_toolshortcuts') != 'false') {
//Course toolbar
$show_course_shortcut = CourseHome::show_navigation_tool_shortcuts();
}
}
if (api_get_setting('show_navigation_menu') != 'false') {
//Course toolbar
$show_course_navigation_menu = CourseHome::show_navigation_menu();
@ -1009,6 +1009,7 @@ class Template
$this->assign('user_notifications', $total_invitations);
// Block Breadcrumb
$breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
$this->assign('breadcrumb', $breadcrumb);

@ -407,33 +407,31 @@ if (Database::num_rows($res_media) > 0) {
$is_allowed_to_edit = api_is_allowed_to_edit(false, true, true, false);
$breadcrumb = null;
global $interbreadcrumb;
if ($is_allowed_to_edit) {
global $interbreadcrumb;
$interbreadcrumb[] = array(
'url' => 'lp_controller.php?action=list&isStudentView=false',
'url' => api_get_self().'?action=list&isStudentView=false&'.api_get_cidreq(true, true, 'course'),
'name' => get_lang('LearningPaths')
);
$interbreadcrumb[] = array(
'url' => api_get_self() . "?action=add_item&type=step&lp_id={$_SESSION['oLP']->lp_id}&isStudentView=false&".api_get_cidreq(),
'url' => api_get_self() . "?action=add_item&type=step&lp_id={$_SESSION['oLP']->lp_id}&isStudentView=false&".api_get_cidreq(true, true, 'course'),
'name' => $_SESSION['oLP']->get_name()
);
$interbreadcrumb[] = array(
'url' => '#',
'name' => get_lang('Preview')
);
$breadcrumb = return_breadcrumb($interbreadcrumb, null, null);
}
// Return to course home.
if ($is_allowed_to_edit) {
$buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([
$buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq(true, true, 'course') . '&' . http_build_query([
'isStudentView' => 'false',
'action' => 'return_to_course_homepage'
]);
} else {
$buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([
$buttonHomeUrl = 'lp_controller.php?' . api_get_cidreq(true, true, 'course') . '&' . http_build_query([
'action' => 'return_to_course_homepage'
]);
}
@ -473,10 +471,7 @@ if ($_SESSION['oLP']->current == $_SESSION['oLP']->get_last()) {
}
}
$template = new Template('title', false, false, true, true, false);
$template = new Template('', false, false, true, true, false);
$template->assign('glossary_extra_tools', api_get_setting('show_glossary_in_extra_tools'));
$fixLinkSetting = api_get_configuration_value('lp_fix_embed_content');
@ -502,7 +497,7 @@ $template->assign('jquery_ui_js_web_path', api_get_jquery_ui_js_web_path());
$template->assign('jquery_ui_css_web_path', api_get_jquery_ui_css_web_path());
$template->assign('is_allowed_to_edit', $is_allowed_to_edit);
$template->assign('gamification_mode', $gamificationMode);
$template->assign('breadcrumb', $breadcrumb);
//$template->assign('breadcrumb', $breadcrumb);
$template->assign('button_home_url', $buttonHomeUrl);
$template->assign('button_home_text', $buttonHomeText);
$template->assign('navigation_bar', $navigation_bar);

Loading…
Cancel
Save