Fix redirect to tab see BT#13026

pull/2487/head
jmontoyaa 8 years ago
parent 34f1447213
commit d13374a2f2
  1. 49
      main/session/index.php

@ -13,7 +13,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
if (empty($_GET['session_id'])) {
api_not_allowed();
api_not_allowed(true);
}
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']) : null;
@ -419,16 +419,6 @@ $column_model_courses = array(
$extra_params_courses['height'] = '100%';
$extra_params_courses['autowidth'] = 'true'; //use the width of the parent
//$extra_params_courses['gridview'] = "false";
/*$extra_params_courses['rowNum'] = 9000;
$extra_params_courses['height'] = "100%";
$extra_params_courses['autowidth'] = 'false'; //use the width of the parent
$extra_params_courses['recordtext'] = '';
$extra_params_courses['pgtext'] = '';
$extra_params_courses['pgbuttons'] = false;*/
//$extra_params_courses['width'] = '50%';
//$extra_params_courses['autowidth'] = 'true';
$url = api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=session_courses_lp_default&session_id='.$session_id.'&course_id='.$course_id;
$columns = array(
get_lang('PublicationDate'),
@ -444,20 +434,6 @@ $column_model = array(
$extra_params = array();
$extra_params['sortname'] = 'date';
/*
$extra_params['sortorder'] = 'asc';
$extra_params['pgbuttons'] = false;
$extra_params['recordtext'] = '';
$extra_params['pgtext'] = '';
$extra_params['height'] = "100%";
*/
//$extra_params['autowidth'] = 'true'; //use the width of the parent
//$extra_params['width'] = '90%';
//$extra_params['autowidth'] = 'true'; //use the width of the parent
//$extra_params['forceFit'] = 'true'; //use the width of the parent
//$extra_params['altRows'] = 'true'; //zebra style
$extra_params['height'] = '100%';
$extra_params['autowidth'] = 'true'; //use the width of the parent
@ -542,8 +518,8 @@ function change_session() {
}
$(function() {
//js used when generating images on the fly see function Tracking::show_course_detail()
$(".dialog").dialog("destroy");
//js used when generating images on the fly see function Tracking::show_course_detail()
//$(".dialog").dialog("destroy");
$(".dialog").dialog({
autoOpen: false,
show: "blind",
@ -560,10 +536,19 @@ $(function() {
return false;
});
/* Binds a tab id in the url */
$("#tabs").bind('tabsselect', function(event, ui) {
window.location.href=ui.tab;
});
// Redirect to tab
var url = document.location.toString();
if (url.match('#')) {
var tabLink = url.split('#')[1];
$('.nav-tabs a[href="#' + tabLink + '"]').tab('show');
// Redirect to course part
var secondLink = url.split('#')[2];
if (secondLink) {
var aTag = $("a[href='#" + secondLink + "']");
$('html,body').animate({scrollTop: aTag.offset().top}, 'slow');
}
}
<?php
//Displays js code to use a jqgrid
echo Display::grid_js(
@ -624,7 +609,7 @@ if (!api_is_anonymous()) {
$reportingTab = Tracking::show_user_progress(
api_get_user_id(),
$session_id,
'#tabs-4',
'#tabs-5',
false,
false
);

Loading…
Cancel
Save