From ce2cf5b459b5ecaf23281f96d1d6b6c123caea52 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Fri, 1 Jun 2007 01:42:59 +0200 Subject: [PATCH] [svn r12517] Hide learnpaths from student view in the list if they are hidden --- main/newscorm/lp_list.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php index 1159d3e384..873e4b7fbb 100644 --- a/main/newscorm/lp_list.php +++ b/main/newscorm/lp_list.php @@ -162,13 +162,19 @@ echo "\n"; --------------------------------------*/ $list = new LearnpathList(api_get_user_id()); $flat_list = $list->get_flat_list(); +$is_allowed_to_edit = api_is_allowed_to_edit(); //var_dump($flat_list); if (is_array($flat_list)) { $counter = 0; foreach ($flat_list as $id => $details) { - $counter++; + if(!$is_allowed_to_edit && $details['lp_visibility'] == "i") + { + // This is a student and this path is invisible, skip + continue; + } + $counter++; if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; } $url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id; @@ -194,7 +200,7 @@ if (is_array($flat_list)) { $dsp_progress = ''.learnpath::get_db_progress($id,api_get_user_id(),'both').''; } - if(api_is_allowed_to_edit()) + if($is_allowed_to_edit) { $dsp_desc = ''.$details['lp_maker'].'    '.$details['lp_proximity'].'    '.$details['lp_encoding'].'  '."\n"; $fileExtension=explode('.',$dspFileName);