Minor - format code, use entity attributes

pull/2629/head
Julio Montoya 7 years ago
parent 8572a22d6f
commit cc16d3103e
  1. 6
      main/session/resume_session.php
  2. 2
      src/Chamilo/CoreBundle/Entity/Session.php

@ -19,7 +19,7 @@ require_once __DIR__.'/../inc/global.inc.php';
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
$sessionId = isset($_GET['id_session']) ? intval($_GET['id_session']) : null;
$sessionId = isset($_GET['id_session']) ? (int) $_GET['id_session'] : null;
if (empty($sessionId)) {
api_not_allowed(true);
@ -113,7 +113,7 @@ switch ($action) {
}
$sessionHeader = Display::page_header(
Display::return_icon('session.png', get_lang('Session')).' '.$sessionInfo['name'],
Display::return_icon('session.png', get_lang('Session')).' '.$session->getName(),
null,
'h3'
);
@ -149,7 +149,7 @@ $courseListToShow .= '<table id="session-list-course" class="data_table">
<th width="25%">'.get_lang('Actions').'</th>
</tr>';
if ($sessionInfo['nbr_courses'] == 0) {
if ($session->getNbrCourses() === 0) {
$courseListToShow .= '<tr>
<td colspan="4">'.get_lang('NoCoursesForThisSession').'</td>
</tr>';

@ -591,7 +591,7 @@ class Session
*/
public function getNbrCourses()
{
return $this->nbrCourses;
return (int) $this->nbrCourses;
}
/**

Loading…
Cancel
Save