From a8fa5a20f2ae7f540a47c3fd9af68e9da8cb53b7 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 23 Apr 2018 08:44:18 +0200 Subject: [PATCH] Minor - format code --- main/lp/lp_content.php | 3 -- main/session/about.php | 1 - .../Component/CourseCopy/Course.php | 2 +- .../Component/CourseCopy/CourseRestorer.php | 44 +++++++++---------- .../Component/CourseCopy/Resources/Asset.php | 6 +-- .../CourseCopy/Resources/CalendarEvent.php | 1 - .../Resources/CourseCopyTestCategory.php | 1 + .../Resources/CourseDescription.php | 5 ++- .../CourseCopy/Resources/Resource.php | 13 +++--- .../CourseCopy/Resources/SurveyQuestion.php | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/main/lp/lp_content.php b/main/lp/lp_content.php index 47d0ee6feb..737b03be61 100755 --- a/main/lp/lp_content.php +++ b/main/lp/lp_content.php @@ -56,15 +56,12 @@ if ($dir) { case 1: $learnPath->stop_previous_item(); $prerequisiteCheck = $learnPath->prerequisites_match($lpItemId); - if ($prerequisiteCheck === true) { $src = $learnPath->get_link('http', $lpItemId); $learnPath->start_current_item(); // starts time counter manually if asset $src = $learnPath->fixBlockedLinks($src); - break; } - $src = 'blank.php?error=prerequisites&prerequisite_message='.$learnPath->error; break; case 2: diff --git a/main/session/about.php b/main/session/about.php index 1af58f0d68..57c8a4c3de 100644 --- a/main/session/about.php +++ b/main/session/about.php @@ -49,7 +49,6 @@ $userValues = new ExtraFieldValue('user'); $sessionValues = new ExtraFieldValue('session'); foreach ($sessionCourses as $sessionCourse) { - $courseTags = []; if (!is_null($tagField)) { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Course.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Course.php index 8e794a3b3a..b987d4806a 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Course.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Course.php @@ -60,7 +60,7 @@ class Course /** * Add a resource from a given type to this course. * - * @param Resource $resource + * @param $resource */ public function add_resource(&$resource) { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php index a0263aea6e..a81e3bec99 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php @@ -3547,6 +3547,28 @@ class CourseRestorer return \GroupManager::get_group_properties($groupId); } + /** + * @param string $documentPath + * @param string $webEditorCss + */ + public function fixEditorHtmlContent($documentPath, $webEditorCss = '') + { + $extension = pathinfo(basename($documentPath), PATHINFO_EXTENSION); + + switch ($extension) { + case 'html': + case 'htm': + $contents = file_get_contents($documentPath); + $contents = str_replace( + '{{css_editor}}', + $webEditorCss, + $contents + ); + file_put_contents($documentPath, $contents); + break; + } + } + /** * Check if user exist otherwise use current user. * @@ -3574,26 +3596,4 @@ class CourseRestorer return $userId; } - - /** - * @param string $documentPath - * @param string $webEditorCss - */ - public function fixEditorHtmlContent($documentPath, $webEditorCss = '') - { - $extension = pathinfo(basename($documentPath), PATHINFO_EXTENSION); - - switch ($extension) { - case 'html': - case 'htm': - $contents = file_get_contents($documentPath); - $contents = str_replace( - '{{css_editor}}', - $webEditorCss, - $contents - ); - file_put_contents($documentPath, $contents); - break; - } - } } diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Asset.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Asset.php index 405774905f..b2d85f38c1 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Asset.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Asset.php @@ -17,9 +17,9 @@ class Asset extends Resource /** * Asset constructor. * - * @param int $id - * @param int $path - * @param $title + * @param int $id + * @param int $path + * @param string $title */ public function __construct($id, $path, $title) { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php index 01ec274baf..b7b902db6f 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php @@ -73,7 +73,6 @@ class CalendarEvent extends Resource $this->start_date = $start_date; $this->end_date = $end_date; $this->all_day = $all_day; - $this->attachment_path = $attachment_path; $this->attachment_filename = $attachment_filename; $this->attachment_size = $attachment_size; diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyTestCategory.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyTestCategory.php index 4c1858c0ee..2bd90e2891 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyTestCategory.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyTestCategory.php @@ -25,6 +25,7 @@ class CourseCopyTestCategory extends Resource /** * Create a new TestCategory. * + * @param int $id * @param string $title * @param string $description */ diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseDescription.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseDescription.php index 1c64f316bc..0515386065 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseDescription.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseDescription.php @@ -33,13 +33,14 @@ class CourseDescription extends Resource * @param int $id * @param string $title * @param string $content + * @param string $descriptionType */ - public function __construct($id, $title, $content, $description_type) + public function __construct($id, $title, $content, $descriptionType) { parent::__construct($id, RESOURCE_COURSEDESCRIPTION); $this->title = $title; $this->content = $content; - $this->description_type = $description_type; + $this->description_type = $descriptionType; } /** diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Resource.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Resource.php index 27a7f4538f..beae6d9b02 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Resource.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Resource.php @@ -119,7 +119,7 @@ class Resource * Get the constant which defines the tool of this resource. This is * used in the item_properties table. * - * @param bool $for_item_property_table (optional) Added by Ivan, + * @param bool $for_item_property_table (optional) Added by Ivan, * 29-AUG-2009: A parameter for resolving differencies between defined TOOL_* * constants and hardcoded strings that are stored in the database. * Example: The constant TOOL_THREAD is defined in the main_api.lib.php @@ -145,12 +145,15 @@ class Resource case RESOURCE_ANNOUNCEMENT: return TOOL_ANNOUNCEMENT; case RESOURCE_FORUMCATEGORY: - return 'forum_category'; // Ivan, 29-AUG-2009: A constant like TOOL_FORUM_CATEGORY is missing in main_api.lib.php. Such a constant has been defined in the forum tool for local needs. + // Ivan, 29-AUG-2009: A constant like TOOL_FORUM_CATEGORY is missing in main_api.lib.php. + // Such a constant has been defined in the forum tool for local needs. + return 'forum_category'; case RESOURCE_FORUM: return TOOL_FORUM; case RESOURCE_FORUMTOPIC: if ($for_item_property_table) { - return 'forum_thread'; // Ivan, 29-AUG-2009: A hardcoded value that the "Forums" tool stores in the item property table. + // Ivan, 29-AUG-2009: A hardcoded value that the "Forums" tool stores in the item property table. + return 'forum_thread'; } return TOOL_THREAD; @@ -200,9 +203,9 @@ class Resource } /** - * Check if this resource is allready restored in the destination course. + * Check if this resource is already restored in the destination course. * - * @return bool true if allready restored (i.e. destination_id is set). + * @return bool true if already restored (i.e. destination_id is set). */ public function is_restored() { diff --git a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php index 887833aab7..acbe003365 100644 --- a/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php +++ b/src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php @@ -64,7 +64,7 @@ class SurveyQuestion extends Resource * @param int $sort * @param int $shared_question_id * @param int $max_value - * @param int $is_required + * @param bool $is_required */ public function __construct( $id,