Minor - Format code, remove unused code

pull/3890/head
Julio Montoya 5 years ago
parent 9763d82a5d
commit 24ab3c0ee6
  1. 6
      public/main/inc/lib/api.lib.php
  2. 4
      public/main/inc/lib/webservices/Rest.php
  3. 7
      public/main/session/index.php
  4. 1
      src/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  5. 2
      src/CoreBundle/Controller/CourseHomeController.php
  6. 12
      src/CoreBundle/Entity/CourseRelUserCatalogue.php

@ -2052,9 +2052,9 @@ function api_get_course_int_id($code = null)
/**
* Gets a course setting from the current course_setting table. Try always using integer values.
*
* @param string $settingName The name of the setting we want from the table
* @param Course|array $courseInfo
* @param bool $force force checking the value in the database
* @param string $settingName The name of the setting we want from the table
* @param Course|array $courseInfo
* @param bool $force force checking the value in the database
*
* @return mixed The value of that setting in that table. Return -1 if not found.
*/

@ -313,7 +313,7 @@ class Rest extends WebService
'id' => $course->getId(),
'title' => $course->getTitle(),
'code' => $course->getCode(),
'directory' => $course->getDirectory(),
//'directory' => $course->getDirectory(),
'urlPicture' => $picturePath,
'teachers' => $teachers,
'isSpecial' => !empty($courseInfo['special_course']),
@ -341,7 +341,7 @@ class Rest extends WebService
'id' => $this->course->getId(),
'title' => $this->course->getTitle(),
'code' => $this->course->getCode(),
'directory' => $this->course->getDirectory(),
//'directory' => $this->course->getDirectory(),
'urlPicture' => CourseManager::getPicturePath($this->course, true),
'teachers' => $teachers,
'tools' => array_map(

@ -196,12 +196,9 @@ $sessionTitleLink = api_get_configuration_value('courses_list_session_title_link
if (2 == $sessionTitleLink && 1 === $session->getNbrCourses()) {
$sessionCourses = $session->getCourses();
$sessionCourse = $sessionCourses[0]->getCourse();
$courseUrl = $sessionCourse->getDirectory().'/index.php?';
$courseUrl .= http_build_query([
'id_session' => $session->getId(),
]);
$url = api_get_course_url($sessionCourse->getId(), $session->getId());
header('Location: '.api_get_path(WEB_COURSE_PATH).$courseUrl);
header('Location: '.$url);
exit;
}

@ -239,7 +239,6 @@ class CkEditor extends Editor
foreach ($courseTemplates as $templateData) {
$template = $templateData[0];
$courseDirectory = $course->getDirectory();
$templateItem = [];
$templateItem['title'] = $template->getTitle();

@ -87,7 +87,7 @@ class CourseHomeController extends ToolBaseController
$isSpecialCourse = CourseManager::isSpecialCourse($courseId);
if ($user && $isSpecialCourse && (isset($_GET['autoreg']) && 1 === (int) $_GET['autoreg']) &&
CourseManager::subscribeUser($userId, $courseCode, STUDENT)
CourseManager::subscribeUser($userId, $courseId, STUDENT)
) {
$session->set('is_allowed_in_course', true);
}

@ -54,12 +54,9 @@ class CourseRelUserCatalogue
{
}
/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return (string) $this->getCourse()->getCode();
return $this->getCourse()->getCode();
}
/**
@ -70,10 +67,7 @@ class CourseRelUserCatalogue
return $this->id;
}
/**
* @return $this
*/
public function setCourse(Course $course)
public function setCourse(Course $course): self
{
$this->course = $course;

Loading…
Cancel
Save