From 9d50e028ab2e23e4f691253038f6f694844e27a8 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 29 Nov 2013 14:16:24 +0100 Subject: [PATCH] Changing UI in toc. --- main/newscorm/learnpath.class.php | 20 +++++++++++++------- main/template/default/learnpath/lp.tpl | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index e9ef9eb6de..2e9f08a9c9 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -3167,8 +3167,11 @@ class learnpath $style_item = 'scorm_item'; + $active = null; + if ($item['id'] == $this->current) { $scorm_color_background = 'scorm_item_highlight'; + $active = ' active'; } else { if ($color_counter % 2 == 0) { $scorm_color_background = 'scorm_item_1'; @@ -3180,7 +3183,11 @@ class learnpath } } - $html .= '
  • '; + $onClick = null; + if ($item['type'] != 'dokeos_chapter' && $item['type'] != 'dir' && $item['type'] != 'dokeos_module') { + $onClick = 'onclick="switch_item('.$mycurrentitemid.','.$item['id'].');'.'return false;"'; + } + $html .= ''; $imageStatus = null; @@ -3205,7 +3212,7 @@ class learnpath // The anchor will let us center the TOC on the currently viewed item &^D if ($item['type'] != 'dokeos_module' && $item['type'] != 'dokeos_chapter') { $html .= '
    '; - $html .= ''; + //$html .= ''; } else { $html .= '
    '; } @@ -3218,22 +3225,21 @@ class learnpath $title = Security::remove_XSS($title); if ($item['type'] != 'dokeos_chapter' && $item['type'] != 'dir' && $item['type'] != 'dokeos_module') { - $url = $this->get_link('http', $item['id'], $toc_list); - $html .= ''.stripslashes($title).''; + //$html .= ''.stripslashes($title).''; + $html .= $title; } elseif ($item['type'] == 'dokeos_module' || $item['type'] == 'dokeos_chapter') { $html .= Display::return_icon('lp_dokeos_module.png', $title).' '.$title; } elseif ($item['type'] == 'dir') { - $html .= stripslashes($title); + $html .= $title; } - $html .= "
    "; if ($scorm_color_background != '') { $html .= '
    '; } - $html .= '
  • '; + $html .= ''; $color_counter++; } diff --git a/main/template/default/learnpath/lp.tpl b/main/template/default/learnpath/lp.tpl index 64d50bdb5a..0968fca3f8 100644 --- a/main/template/default/learnpath/lp.tpl +++ b/main/template/default/learnpath/lp.tpl @@ -54,9 +54,9 @@ {% endif %} - +