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. * 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 string $settingName The name of the setting we want from the table
* @param Course|array $courseInfo * @param Course|array $courseInfo
* @param bool $force force checking the value in the database * @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. * @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(), 'id' => $course->getId(),
'title' => $course->getTitle(), 'title' => $course->getTitle(),
'code' => $course->getCode(), 'code' => $course->getCode(),
'directory' => $course->getDirectory(), //'directory' => $course->getDirectory(),
'urlPicture' => $picturePath, 'urlPicture' => $picturePath,
'teachers' => $teachers, 'teachers' => $teachers,
'isSpecial' => !empty($courseInfo['special_course']), 'isSpecial' => !empty($courseInfo['special_course']),
@ -341,7 +341,7 @@ class Rest extends WebService
'id' => $this->course->getId(), 'id' => $this->course->getId(),
'title' => $this->course->getTitle(), 'title' => $this->course->getTitle(),
'code' => $this->course->getCode(), 'code' => $this->course->getCode(),
'directory' => $this->course->getDirectory(), //'directory' => $this->course->getDirectory(),
'urlPicture' => CourseManager::getPicturePath($this->course, true), 'urlPicture' => CourseManager::getPicturePath($this->course, true),
'teachers' => $teachers, 'teachers' => $teachers,
'tools' => array_map( 'tools' => array_map(

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

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

@ -87,7 +87,7 @@ class CourseHomeController extends ToolBaseController
$isSpecialCourse = CourseManager::isSpecialCourse($courseId); $isSpecialCourse = CourseManager::isSpecialCourse($courseId);
if ($user && $isSpecialCourse && (isset($_GET['autoreg']) && 1 === (int) $_GET['autoreg']) && 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); $session->set('is_allowed_in_course', true);
} }

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

Loading…
Cancel
Save