From ffe76dc3537d80965f322bea5cdadf346b352791 Mon Sep 17 00:00:00 2001 From: floppyears Date: Mon, 4 Jan 2010 01:48:27 -0800 Subject: [PATCH] timeline: if a section is set to hidden and the user is not capable of editing a course or sections within a course, we do not display the section --- course/format/timeline/lib.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/course/format/timeline/lib.php b/course/format/timeline/lib.php index 668c4217bb..e3cac62dc2 100644 --- a/course/format/timeline/lib.php +++ b/course/format/timeline/lib.php @@ -301,13 +301,13 @@ function timeline_print_main_col($course, $sections, $context, $editing, $showal $sectionstyle = ''; } - echo ''; - echo ''.$currenttext.$section.''; - - echo ''; - if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students - echo get_string('notavailable'); + if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { + // Hidden for students } else { + echo ''; + echo ''.$currenttext.$section.''; + + echo ''; echo '
'; $summaryformatoptions->noclean = true; echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); @@ -341,7 +341,6 @@ function timeline_print_main_col($course, $sections, $context, $editing, $showal if (isediting($course->id)) { print_section_add_menus($course, $section, $modnames); } - } echo ''; echo ''; @@ -385,6 +384,7 @@ function timeline_print_main_col($course, $sections, $context, $editing, $showal echo ''; echo ''; + } } } -- 2.11.4.GIT