Minor - format code

pull/2539/head
jmontoyaa 8 years ago
parent 1297b3df9b
commit a8fa5a20f2
  1. 3
      main/lp/lp_content.php
  2. 1
      main/session/about.php
  3. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Course.php
  4. 44
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php
  5. 6
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Asset.php
  6. 1
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CalendarEvent.php
  7. 1
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseCopyTestCategory.php
  8. 5
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/CourseDescription.php
  9. 13
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/Resource.php
  10. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/Resources/SurveyQuestion.php

@ -56,15 +56,12 @@ if ($dir) {
case 1: case 1:
$learnPath->stop_previous_item(); $learnPath->stop_previous_item();
$prerequisiteCheck = $learnPath->prerequisites_match($lpItemId); $prerequisiteCheck = $learnPath->prerequisites_match($lpItemId);
if ($prerequisiteCheck === true) { if ($prerequisiteCheck === true) {
$src = $learnPath->get_link('http', $lpItemId); $src = $learnPath->get_link('http', $lpItemId);
$learnPath->start_current_item(); // starts time counter manually if asset $learnPath->start_current_item(); // starts time counter manually if asset
$src = $learnPath->fixBlockedLinks($src); $src = $learnPath->fixBlockedLinks($src);
break; break;
} }
$src = 'blank.php?error=prerequisites&prerequisite_message='.$learnPath->error; $src = 'blank.php?error=prerequisites&prerequisite_message='.$learnPath->error;
break; break;
case 2: case 2:

@ -49,7 +49,6 @@ $userValues = new ExtraFieldValue('user');
$sessionValues = new ExtraFieldValue('session'); $sessionValues = new ExtraFieldValue('session');
foreach ($sessionCourses as $sessionCourse) { foreach ($sessionCourses as $sessionCourse) {
$courseTags = []; $courseTags = [];
if (!is_null($tagField)) { if (!is_null($tagField)) {

@ -60,7 +60,7 @@ class Course
/** /**
* Add a resource from a given type to this course. * Add a resource from a given type to this course.
* *
* @param Resource $resource * @param $resource
*/ */
public function add_resource(&$resource) public function add_resource(&$resource)
{ {

@ -3547,6 +3547,28 @@ class CourseRestorer
return \GroupManager::get_group_properties($groupId); 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. * Check if user exist otherwise use current user.
* *
@ -3574,26 +3596,4 @@ class CourseRestorer
return $userId; 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;
}
}
} }

@ -17,9 +17,9 @@ class Asset extends Resource
/** /**
* Asset constructor. * Asset constructor.
* *
* @param int $id * @param int $id
* @param int $path * @param int $path
* @param $title * @param string $title
*/ */
public function __construct($id, $path, $title) public function __construct($id, $path, $title)
{ {

@ -73,7 +73,6 @@ class CalendarEvent extends Resource
$this->start_date = $start_date; $this->start_date = $start_date;
$this->end_date = $end_date; $this->end_date = $end_date;
$this->all_day = $all_day; $this->all_day = $all_day;
$this->attachment_path = $attachment_path; $this->attachment_path = $attachment_path;
$this->attachment_filename = $attachment_filename; $this->attachment_filename = $attachment_filename;
$this->attachment_size = $attachment_size; $this->attachment_size = $attachment_size;

@ -25,6 +25,7 @@ class CourseCopyTestCategory extends Resource
/** /**
* Create a new TestCategory. * Create a new TestCategory.
* *
* @param int $id
* @param string $title * @param string $title
* @param string $description * @param string $description
*/ */

@ -33,13 +33,14 @@ class CourseDescription extends Resource
* @param int $id * @param int $id
* @param string $title * @param string $title
* @param string $content * @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); parent::__construct($id, RESOURCE_COURSEDESCRIPTION);
$this->title = $title; $this->title = $title;
$this->content = $content; $this->content = $content;
$this->description_type = $description_type; $this->description_type = $descriptionType;
} }
/** /**

@ -119,7 +119,7 @@ class Resource
* Get the constant which defines the tool of this resource. This is * Get the constant which defines the tool of this resource. This is
* used in the item_properties table. * 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_* * 29-AUG-2009: A parameter for resolving differencies between defined TOOL_*
* constants and hardcoded strings that are stored in the database. * constants and hardcoded strings that are stored in the database.
* Example: The constant TOOL_THREAD is defined in the main_api.lib.php * Example: The constant TOOL_THREAD is defined in the main_api.lib.php
@ -145,12 +145,15 @@ class Resource
case RESOURCE_ANNOUNCEMENT: case RESOURCE_ANNOUNCEMENT:
return TOOL_ANNOUNCEMENT; return TOOL_ANNOUNCEMENT;
case RESOURCE_FORUMCATEGORY: 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: case RESOURCE_FORUM:
return TOOL_FORUM; return TOOL_FORUM;
case RESOURCE_FORUMTOPIC: case RESOURCE_FORUMTOPIC:
if ($for_item_property_table) { 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; 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() public function is_restored()
{ {

@ -64,7 +64,7 @@ class SurveyQuestion extends Resource
* @param int $sort * @param int $sort
* @param int $shared_question_id * @param int $shared_question_id
* @param int $max_value * @param int $max_value
* @param int $is_required * @param bool $is_required
*/ */
public function __construct( public function __construct(
$id, $id,

Loading…
Cancel
Save