Fix variable non déclarée

This commit is contained in:
Fred Tempez 2024-01-14 19:37:25 +01:00
parent eb581b3fa5
commit b948f9baac

View File

@ -92,7 +92,9 @@ class course extends common
: ''; : '';
$categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId; $categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId;
$info = sprintf('<strong>%s<br /></strong>Auteur : %s<br />Id : <a href="%s" target="_blank">%s<br />', $this->getData(['course', $courseId, 'title']), $author, $categorieUrl, $courseId); $info = sprintf('<strong>%s<br /></strong>Auteur : %s<br />Id : <a href="%s" target="_blank">%s<br />', $this->getData(['course', $courseId, 'title']), $author, $categorieUrl, $courseId);
$enrolment = sprintf('Accès : %s<br />Inscription : %s<br />', self::$courseAccess[$this->getData(['course', $courseId, 'access'])], self::$courseEnrolment[$this->getData(['course', $courseId, 'enrolment'])]); $enrolment = sprintf('Accès : %s<br />Inscription : %s<br />',
self::$courseAccess[$this->getData(['course', $courseId, 'access'])],
self::$courseEnrolment[$this->getData(['course', $courseId, 'enrolment'])]);
self::$courses[] = [ self::$courses[] = [
$info, $info,
$this->getData(['course', $courseId, 'description']), $this->getData(['course', $courseId, 'description']),
@ -1030,8 +1032,8 @@ class course extends common
html_entity_decode($pages[$pageId]['title']), html_entity_decode($pages[$pageId]['title']),
helper::dateUTF8('%d %B %Y %H:%M', $time) helper::dateUTF8('%d %B %Y %H:%M', $time)
]; ];
$floorTime = $floorTime < $time ? $floorTime : $time; $floorTime = isset($floorTime) && $floorTime < $time ? $floorTime : $time;
$TopTime = $TopTime > $time ? $TopTime : $time; $topTime = isset($topTime) && $topTime > $time ? $topTime : $time;
} }
} else { } else {
self::$userHistory[] = [ self::$userHistory[] = [
@ -1039,8 +1041,8 @@ class course extends common
html_entity_decode($pages[$pageId]['title']), html_entity_decode($pages[$pageId]['title']),
helper::dateUTF8('%d %B %Y %H:%M', $times) helper::dateUTF8('%d %B %Y %H:%M', $times)
]; ];
$floorTime = $floorTime < $times ? $floorTime : $times; $floorTime = isset($floorTime) && $floorTime < $times ? $floorTime : $times;
$topTime = $topTime > $times ? $topTime : $times; $topTime = isset($topTime) && $topTime > $times ? $topTime : $times;
} }
} }