From 098fd63f6f3db38c28f83aece1a7e7e2fb65a050 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 18 Feb 2019 17:28:38 -0500 Subject: [PATCH] LP: Indicate that exercise is hidden when addin LP item #2777 --- main/lp/learnpath.class.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 7f0adfccba..cfcb3e3562 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -10730,6 +10730,8 @@ class learnpath 'preview_view.png', get_lang('Preview') ); + $quizIcon = Display::return_icon('quiz.png', '', [], ICON_SIZE_TINY); + $moveIcon = Display::return_icon('move_everywhere.png', get_lang('Move'), [], ICON_SIZE_TINY); $exerciseUrl = api_get_path(WEB_CODE_PATH).'exercise/showinframes.php?'.api_get_cidreq(); // Display hotpotatoes @@ -10760,33 +10762,32 @@ class learnpath api_html_entity_decode($row_quiz['title']) ); + $visibility = api_get_item_visibility( + ['real_id' => $course_id], + TOOL_QUIZ, + $row_quiz['iid'], + $session_id + ); + $link = Display::url( $previewIcon, $exerciseUrl.'&exerciseId='.$row_quiz['id'], ['target' => '_blank'] ); $return .= '
  • '; - $return .= ''; - $return .= Display::return_icon( - 'move_everywhere.png', - get_lang('Move'), - [], - ICON_SIZE_TINY - ); - $return .= ' '; - $return .= Display::return_icon( - 'quiz.png', - '', - [], - ICON_SIZE_TINY - ); + $return .= Display::url($moveIcon, '#', ['class' => 'moved']); + $return .= $quizIcon; $sessionStar = api_get_session_image( $row_quiz['session_id'], $userInfo['status'] ); - $return .= ''. - Security::remove_XSS(cut($title, 80)).$link.$sessionStar. - ''; + $return .= Display::url( + Security::remove_XSS(cut($title, 80)).$link.$sessionStar, + api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_QUIZ.'&file='.$row_quiz['id'].'&lp_id='.$this->lp_id, + [ + 'class' => $visibility == 0 ? 'moved text-muted' : 'moved', + ] + ); $return .= '
  • '; }