Minor - format code

pull/3741/head
Julio Montoya 4 years ago
parent 95aea43f7c
commit 1ee0e226af
  1. 1
      src/CoreBundle/Controller/ResourceApiController.php
  2. 4
      src/CoreBundle/Repository/AssetRepository.php
  3. 2
      src/CoreBundle/Traits/ControllerTrait.php
  4. 6
      src/CourseBundle/Component/CourseCopy/CourseBuilder.php
  5. 2
      src/CourseBundle/Component/CourseCopy/CourseRestorer.php
  6. 9
      src/CourseBundle/Component/CourseCopy/Resources/CourseCopyLearnpath.php
  7. 1
      src/CourseBundle/Resources/config/services.yml

@ -16,7 +16,6 @@ use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Class ResourceApiController.

@ -5,7 +5,6 @@
namespace Chamilo\CoreBundle\Repository;
use Chamilo\CoreBundle\Entity\Asset;
use Chamilo\CoreBundle\Entity\ResourceFile;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use League\Flysystem\FilesystemInterface;
@ -58,10 +57,11 @@ class AssetRepository extends ServiceEntityRepository
}
}
public function getFolder(Asset $asset):? string
public function getFolder(Asset $asset): ? string
{
if ($asset->hasFile()) {
$file = $asset->getTitle();
return '/'.$asset->getCategory().'/'.$file.'/';
}

@ -32,7 +32,7 @@ trait ControllerTrait
{
$services = parent::getSubscribedServices();
$services['translator'] = TranslatorInterface::class;
$services['resource_factory'] = ResourceFactory::class;
//$services['resource_factory'] = ResourceFactory::class;
$services['glide'] = Glide::class;
$services['chamilo.settings.manager'] = SettingsManager::class;
$services['chamilo_settings.form_factory.settings'] = SettingsFormFactory::class;

@ -1513,7 +1513,7 @@ class CourseBuilder
$obj->debug,
$visibility,
$obj->author,
$obj->preview_image,
//$obj->preview_image,
$obj->use_max_score,
$obj->autolaunch,
$obj->created_on,
@ -1527,7 +1527,7 @@ class CourseBuilder
$this->course->add_resource($lp);
if (!empty($obj->preview_image)) {
/*if (!empty($obj->preview_image)) {
// Add LP teacher image
$asset = new Asset(
$obj->preview_image,
@ -1535,7 +1535,7 @@ class CourseBuilder
'/upload/learning_path/images/'.$obj->preview_image
);
$this->course->add_resource($asset);
}
}*/
}
}

@ -2805,7 +2805,7 @@ class CourseRestorer
'js_lib' => self::DBUTF8($lp->js_lib),
'content_license' => self::DBUTF8($lp->content_license),
'author' => self::DBUTF8($lp->author),
'preview_image' => self::DBUTF8($lp->preview_image),
//'preview_image' => self::DBUTF8($lp->preview_image),
'use_max_score' => self::DBUTF8($lp->use_max_score),
'autolaunch' => self::DBUTF8(isset($lp->autolaunch) ? $lp->autolaunch : ''),
'created_on' => empty($lp->created_on) ? api_get_utc_datetime() : self::DBUTF8($lp->created_on),

@ -85,11 +85,6 @@ class CourseCopyLearnpath extends Resource
*/
public $author;
/**
* Author's image.
*/
public $preview_image;
/**
* Create a new learnpath.
*
@ -132,7 +127,7 @@ class CourseCopyLearnpath extends Resource
$debug,
$visibility,
$author,
$preview_image,
//$preview_image,
$use_max_score,
$autolaunch,
$created_on,
@ -168,7 +163,7 @@ class CourseCopyLearnpath extends Resource
$this->expired_on = $expired_on;
$this->session_id = $session_id;
$this->author = $author;
$this->preview_image = $preview_image;
//$this->preview_image = $preview_image;
$this->categoryId = $categoryId;
$this->items = $items;
}

@ -36,4 +36,3 @@ services:
- setToolChain: ['@Chamilo\CoreBundle\ToolChain']
- setResourceNodeRepository: ['@Chamilo\CoreBundle\Repository\ResourceNodeRepository']
exclude: '../../Repository/CCourseSettingRepository.php'

Loading…
Cancel
Save