Fix session view - format code, fix php warnings

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 227c36526a
commit 4735112fef
  1. 4
      main/inc/lib/course.lib.php
  2. 16
      main/inc/lib/userportal.lib.php

@ -6019,9 +6019,11 @@ class CourseManager
/**
* Return tab of params to display a course title in the My Courses tab
* Check visibility, right, and notification icons, and load_dirs option
* // get html course params
* //
* @param $courseId
* @param bool $loadDirs
* @return array
* @return array with keys ['right_actions'] ['teachers'] ['notifications']
*/
public static function getCourseParamsForDisplay($courseId, $loadDirs = false)
{

@ -2020,23 +2020,25 @@ class IndexManager
$courseLink = $courseInfo['course_public_url'].'?id_session=0';
// get html course params
// ['right_actions'] ['teachers'] ['notifications']
$tabParams = CourseManager::getCourseParamsForDisplay($id, $loadDirs);
$courseParams = CourseManager::getCourseParamsForDisplay($id, $loadDirs);
$teachers = '';
$rightActions = '';
// teacher list
if (!empty($tabParams['teachers'])) {
$teachers = '<p class="'.$class2.' view-by-session-teachers">'.$tabParams['teachers'].'</p>';
if (!empty($courseParams['teachers'])) {
$teachers = '<p class="'.$class2.' view-by-session-teachers">'.$courseParams['teachers'].'</p>';
}
// notification
if (!empty($tabParams['right_actions'])) {
$rightActions = '<div class="pull-right">'.$tabParams['right_actions'].'</div>';
if (!empty($courseParams['right_actions'])) {
$rightActions = '<div class="pull-right">'.$courseParams['right_actions'].'</div>';
}
return "<div>
$button
<span class='$class'>$icon
<a class='sessionView' href='$courseLink'>$title</a>
</span>".$tabParams['notifications']."$rightActions
</span>".$courseParams['notifications']." $rightActions
</div>
$teachers";
}

Loading…
Cancel
Save