Use FOS\CKEditorBundle instead of deprecated Ivory\CKEditorBundle

Update sonata lib
pull/2715/head
Julio Montoya 7 years ago
parent dd20a596e6
commit 3ea4f7c2a3
  1. 13
      composer.json
  2. 4
      config/bundles.php
  3. 82
      config/packages/fos_ck_editor.yaml
  4. 43
      config/packages/ivory_ck_editor.yaml
  5. 22
      config/packages/oneup_flysystem.yaml
  6. 4
      config/packages/oneup_uploader.yaml
  7. 13
      config/packages/sonata_admin.yaml
  8. 35
      config/packages/sonata_media.yaml
  9. 2
      config/routes/sonata_media.yaml
  10. 24
      config/services.yaml
  11. 2
      public/upload/media/.gitignore
  12. 33
      src/CoreBundle/Resources/config/admin.yml
  13. 61
      src/CourseBundle/Admin/CDocumentAdmin.php
  14. 11
      src/CourseBundle/Resources/config/admin.yml
  15. 3
      src/PageBundle/Controller/PageController.php

@ -57,15 +57,15 @@
"symfony/asset": "^4.0",
"symfony/expression-language": "^4.0",
"symfony/flex": "^1.0",
"symfony/form": "^3.0|^4.0",
"symfony/framework-bundle": "^3.0|^4.0",
"symfony/form": "^4.0",
"symfony/framework-bundle": "^4.0",
"symfony/monolog-bundle": "^3.1",
"symfony/polyfill-apcu": "^1.9",
"symfony/security-bundle": "^4.0",
"symfony/swiftmailer-bundle": "^3.2",
"symfony/translation": "^4.0",
"symfony/twig-bundle": "^4.0",
"symfony/validator": "3.4.*",
"symfony/validator": "^4.0",
"symfony/yaml": "^4.0",
"symfony/annotations-pack": "^1.0",
"symfony/webpack-encore-pack": "^1.0",
@ -78,7 +78,6 @@
"chamilo/settings-bundle": "dev-master",
"sonata-project/admin-bundle": "~3.0",
"sonata-project/block-bundle": "~3.0",
"sonata-project/cache": "~1.0",
"sonata-project/cache-bundle": "~2.0",
"sonata-project/classification-bundle": "~3.0",
"sonata-project/timeline-bundle" : "~3.0",
@ -88,13 +87,13 @@
"sonata-project/doctrine-orm-admin-bundle": "~3.0",
"sonata-project/easy-extends-bundle": "~2.5",
"sonata-project/exporter": "~1",
"sonata-project/intl-bundle": "~2.4.0",
"sonata-project/media-bundle": "~3.0",
"sonata-project/intl-bundle": "~2.5",
"sonata-project/media-bundle": "3.x-dev",
"sonata-project/notification-bundle": "~3.0",
"sonata-project/page-bundle": "~3.0",
"sonata-project/seo-bundle": "~2.0",
"sonata-project/user-bundle": "~4.0",
"sonata-project/formatter-bundle": "~3.0",
"sonata-project/formatter-bundle": "~4.0",
"stephpy/timeline-bundle": "~3.0",
"stof/doctrine-extensions-bundle": "~1.0",

@ -63,14 +63,14 @@ return [
Oneup\FlysystemBundle\OneupFlysystemBundle::class => ['all' => true],
Sonata\CacheBundle\SonataCacheBundle::class => ['all' => true],
Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true],
Sonata\FormatterBundle\SonataFormatterBundle::class => ['all' => true],
HWI\Bundle\OAuthBundle\HWIOAuthBundle::class => ['all' => true],
Liip\ThemeBundle\LiipThemeBundle::class => ['all' => true],
A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true],
A2lix\TranslationFormBundle\A2lixTranslationFormBundle::class => ['all' => true],
Ivory\CKEditorBundle\IvoryCKEditorBundle::class => ['all' => true],
Oneup\UploaderBundle\OneupUploaderBundle::class => ['all' => true],
APY\DataGridBundle\APYDataGridBundle::class => ['all' => true],
Overblog\GraphQLBundle\OverblogGraphQLBundle::class => ['all' => true],
Gregwar\CaptchaBundle\GregwarCaptchaBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
Sonata\FormatterBundle\SonataFormatterBundle::class => ['all' => true],
];

@ -1,42 +1,42 @@
#fos_ck_editor:
# autoload: false
# base_path: "bundles/ivoryckeditor"
# js_path: "bundles/ivoryckeditor/ckeditor.js"
# default_config: default
# configs:
# chamilo:
# filebrowserBrowseRoute: elfinder
# filebrowserBrowseRouteParameters: []
# default:
# # default toolbar plus Format button
# toolbar:
# - [Bold, Italic, Underline, -, Cut, Copy, Paste, PasteText, PasteFromWord, -, Undo, Redo, -, NumberedList, BulletedList, -, Outdent, Indent, -, Blockquote, -, Image, Link, Unlink, Table]
# - [Format, Maximize, Source]
#
# filebrowserBrowseRoute: admin_chamilo_media_media_ckeditor_browser
# filebrowserImageBrowseRoute: admin_chamilo_media_media_ckeditor_browser
# # Display images by default when clicking the image dialog browse button
# filebrowserImageBrowseRouteParameters:
# provider: sonata.media.provider.image
# filebrowserUploadRoute: admin_chamilo_media_media_ckeditor_upload
# filebrowserUploadRouteParameters:
# provider: sonata.media.provider.file
# # Upload file as image when sending a file from the image dialog
# filebrowserImageUploadRoute: admin_chamilo_media_media_ckeditor_upload
# filebrowserImageUploadRouteParameters:
# provider: sonata.media.provider.image
# context: default # Optional, to upload in a custom context, see sonata_media.yaml
# format: medium
# plugins:
# wordcount:
# path: "/bundles/chamilocore/ckeditor/plugins/wordcount"
fos_ck_editor:
default_config: default
autoload: false
base_path: "public/libs/ckeditor"
js_path: "public/libs/ckeditor/ckeditor.js"
configs:
chamilo:
filebrowserBrowseRoute: elfinder
filebrowserBrowseRouteParameters: []
default:
# default toolbar plus Format button
toolbar:
- [Bold, Italic, Underline, -, Cut, Copy, Paste, PasteText, PasteFromWord, -, Undo, Redo, -, NumberedList, BulletedList, -, Outdent, Indent, -, Blockquote, -, Image, Link, Unlink, Table]
- [Format, Maximize, Source]
filebrowserBrowseRoute: admin_chamilo_media_media_ckeditor_browser
filebrowserImageBrowseRoute: admin_chamilo_media_media_ckeditor_browser
# Display images by default when clicking the image dialog browse button
filebrowserImageBrowseRouteParameters:
provider: sonata.media.provider.image
filebrowserUploadRoute: admin_chamilo_media_media_ckeditor_upload
filebrowserUploadRouteParameters:
provider: sonata.media.provider.file
# Upload file as image when sending a file from the image dialog
filebrowserImageUploadRoute: admin_chamilo_media_media_ckeditor_upload
filebrowserImageUploadRouteParameters:
provider: sonata.media.provider.image
context: default # Optional, to upload in a custom context, see sonata_media.yaml
format: medium
plugins:
wordcount:
path: "/bundles/chamilocore/ckeditor/plugins/wordcount"
filename: "plugin.js"
# adobeair:
# path: "/bundles/chamilocore/components/ckeditor/plugins/adobeair"
# filename: "plugin.js"
# iframedialog:
# path: "/bundles/chamilocore/components/ckeditor/plugins/iframedialog"
# filename: "plugin.js"
# docprops:
# path: "/bundles/chamilocore/components/ckeditor/plugins/docprops"
# filename: "plugin.js"
## adobeair:
## path: "/bundles/chamilocore/components/ckeditor/plugins/adobeair"
## filename: "plugin.js"
## iframedialog:
## path: "/bundles/chamilocore/components/ckeditor/plugins/iframedialog"
## filename: "plugin.js"
## docprops:
## path: "/bundles/chamilocore/components/ckeditor/plugins/docprops"
## filename: "plugin.js"

@ -1,43 +0,0 @@
ivory_ck_editor:
autoload: false
base_path: "bundles/ivoryckeditor"
# js_path: "bundles/ivoryckeditor/ckeditor.js"
js_path: "libs/ckeditor/ckeditor.js"
default_config: default
configs:
chamilo:
filebrowserBrowseRoute: elfinder
filebrowserBrowseRouteParameters: []
default:
# default toolbar plus Format button
toolbar:
- [Bold, Italic, Underline, -, Cut, Copy, Paste, PasteText, PasteFromWord, -, Undo, Redo, -, NumberedList, BulletedList, -, Outdent, Indent, -, Blockquote, -, Image, Link, Unlink, Table]
- [Format, Maximize, Source]
filebrowserBrowseRoute: admin_chamilo_media_media_ckeditor_browser
filebrowserImageBrowseRoute: admin_chamilo_media_media_ckeditor_browser
# Display images by default when clicking the image dialog browse button
filebrowserImageBrowseRouteParameters:
provider: sonata.media.provider.image
filebrowserUploadRoute: admin_chamilo_media_media_ckeditor_upload
filebrowserUploadRouteParameters:
provider: sonata.media.provider.file
# Upload file as image when sending a file from the image dialog
filebrowserImageUploadRoute: admin_chamilo_media_media_ckeditor_upload
filebrowserImageUploadRouteParameters:
provider: sonata.media.provider.image
context: default # Optional, to upload in a custom context, see sonata_media.yaml
format: medium
plugins:
wordcount:
path: "/bundles/chamilocore/ckeditor/plugins/wordcount"
filename: "plugin.js"
# adobeair:
# path: "/bundles/chamilocore/components/ckeditor/plugins/adobeair"
# filename: "plugin.js"
# iframedialog:
# path: "/bundles/chamilocore/components/ckeditor/plugins/iframedialog"
# filename: "plugin.js"
# docprops:
# path: "/bundles/chamilocore/components/ckeditor/plugins/docprops"
# filename: "plugin.js"

@ -8,9 +8,17 @@ oneup_flysystem:
local:
directory: '%kernel.project_dir%/var/home'
upload_adapter:
resource_adapter:
local:
directory: '%kernel.project_dir%/var/upload'
directory: '%kernel.project_dir%/var/upload/resource'
# resource_private_adapter:
# local:
# directory: '%kernel.project_dir%/var/upload/resource'
#
# resource_public_adapter:
# local:
# directory: '%kernel.project_dir%/public/upload/resource'
filesystems:
courses:
@ -25,5 +33,11 @@ oneup_flysystem:
visibility: private
alias: home_filesystem
upload:
adapter: upload_adapter
resource:
adapter: resource_adapter
# resource_public:
# adapter: resource_public_adapter
#
# resource_private:
# adapter: resource_private_adapter

@ -12,13 +12,13 @@ oneup_uploader:
custom_frontend:
class: Chamilo\CoreBundle\Controller\ResourceUploaderController
name: courses
upload:
resource:
#frontend: dropzone # or any uploader you use in the frontend
#frontend: blueimp
frontend: custom
storage:
type: flysystem
filesystem: oneup_flysystem.upload_filesystem
filesystem: oneup_flysystem.resource_filesystem
root_folder: true
custom_frontend:
class: Chamilo\CoreBundle\Controller\ResourceUploaderController

@ -52,9 +52,8 @@ sonata_admin:
- sonata.page.admin.page
# - sonata.news.admin.comment
# - sonata.news.admin.post
# - sonata.media.admin.media
- sonata.media.admin.media
- sonata.media.admin.gallery
- MediaMonks\SonataMediaBundle\Admin\MediaAdmin
# - sonata.admin.resource_file
# - sonata.comment.admin.thread
@ -127,6 +126,16 @@ sonata_admin:
# label_catalogue: SonataAdminBundle
# items:
# - sonata.admin.access_url
sonata.admin.resource:
label: Resource
label_catalogue: SonataDemoBundle
#icon: '<i class="fa fa-th"></i>'
items:
- sonata.admin.resource_node
- sonata.admin.resource_file
- sonata.admin.resource_type
- sonata.admin.c_document
assets:
stylesheets:
# The default stylesheet list:

@ -4,11 +4,12 @@ sonata_media:
gallery: Chamilo\MediaBundle\Entity\Gallery
gallery_has_media: Chamilo\MediaBundle\Entity\GalleryHasMedia
category: Chamilo\ClassificationBundle\Entity\Category
db_driver: doctrine_orm # | doctrine_mongodb
db_driver: doctrine_orm
default_context: default
contexts:
default: # the default context is mandatory
download:
strategy: sonata.media.security.superadmin_strategy
mode: http # X-Sendfile | http
providers:
- sonata.media.provider.dailymotion
@ -20,18 +21,18 @@ sonata_media:
small: {width: 100, quality: 100}
medium: {width: 300, quality: 100}
big: {width: 970, quality: 100}
sonata_collection:
providers:
- sonata.media.provider.image
formats:
preview: {width: 100, quality: 100}
wide: {width: 820, quality: 100}
sonata_category:
providers:
- sonata.media.provider.image
formats:
preview: {width: 100, quality: 100}
wide: {width: 820, quality: 100}
# sonata_collection:
# providers:
# - sonata.media.provider.image
# formats:
# preview: {width: 100, quality: 100}
# wide: {width: 820, quality: 100}
# sonata_category:
# providers:
# - sonata.media.provider.image
# formats:
# preview: {width: 100, quality: 100}
# wide: {width: 820, quality: 100}
# user:
# providers:
# - sonata.media.provider.image
@ -45,7 +46,7 @@ sonata_media:
filesystem:
# define where the uploaded file will be stored
local:
directory: '%kernel.root_dir%/../var/upload/media'
directory: '%kernel.root_dir%/../var/upload/resource'
create: true
providers:
file:
@ -68,9 +69,9 @@ sonata_media:
thumbnail: sonata.media.thumbnail.format # default value
# thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task
# thumbnail: sonata.media.thumbnail.liip_imagine # use the LiipImagineBundle to resize the image
pixlr:
enabled: true
referrer: App
# pixlr:
# enabled: true
# referrer: App
resizer:
simple:
# mode: outbound

@ -4,4 +4,4 @@ sonata_media_gallery:
sonata_media:
resource: '@SonataMediaBundle/Resources/config/routing/media.xml'
prefix: /media
prefix: /resource

@ -55,6 +55,28 @@ sylius_resource:
model: Chamilo\CourseBundle\Entity\CDocument
repository: Chamilo\CoreBundle\Repository\ResourceRepository
#
#sonata.media.provider.private:
# class: Sonata\MediaBundle\Provider\FileProvider
# tags:
# - { name: sonata.media.provider }
# arguments:
# - 'sonata.media.provider.private'
# - '@app.sonata.media.private.filesystem'
# - '@sonata.media.cdn.server'
# - '@sonata.media.generator.default'
# - '@sonata.media.thumbnail.format'
#
#chamilo.sonata.media.private.filesystem:
# class: Gaufrette\Filesystem
# arguments: ['@chamilo.sonata.media.private.adapter']
#
#chamilo.sonata.media.private.adapter:
# class: Sonata\MediaBundle\Filesystem\Local
# arguments:
# - "%kernel.root_dir%/../doclib/uploads"
# - true
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
@ -73,7 +95,7 @@ parameters:
mailer_user: admin@example.com
mailer_password: null
course_info_is_not_editable: false
sonata_media.cdn.host: '/%env(APP_URL_APPEND)%/public/uploads/media'
sonata_media.cdn.host: '/%env(APP_URL_APPEND)%/public/resource'
sonata_page.varnish.command: 'if [ ! -r "/etc/varnish/secret" ]; then echo "VALID ERROR :/"; else varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 {{ COMMAND }} "{{ EXPRESSION }}"; fi;'
router.request_context.base_url: '%url_append%'
asset.request_context.base_path: '%router.request_context.base_url%'

@ -1,2 +0,0 @@
*
!.gitignore

@ -141,3 +141,36 @@ services:
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
sonata.admin.resource_node:
class: Chamilo\CoreBundle\Admin\ResourceNodeAdmin
tags:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource node"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceNode
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
sonata.admin.resource_file:
class: Chamilo\CoreBundle\Admin\ResourceFileAdmin
tags:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource file"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceFile
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
sonata.admin.resource_type:
class: Chamilo\CoreBundle\Admin\ResourceTypeAdmin
tags:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "Resource type"}
arguments:
- ~
- Chamilo\CoreBundle\Entity\Resource\ResourceType
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]

@ -0,0 +1,61 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CourseBundle\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Form\Type\ModelAutocompleteType;
use Sonata\AdminBundle\Show\ShowMapper;
/**
* Class CDocumentAdmin.
*
* @package Chamilo\CourseBundle\Admin
*/
class CDocumentAdmin extends AbstractAdmin
{
/**
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('title')
->add('comment')
->add('resourceNode', ModelAutocompleteType::class, ['property' => 'name'])
;
}
/**
* @param ShowMapper $showMapper
*/
protected function configureShowField(ShowMapper $showMapper)
{
$showMapper
->add('title')
;
}
/**
* @param DatagridMapper $datagridMapper
*/
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('title')
;
}
/**
* @param ListMapper $listMapper
*/
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('title')
;
}
}

@ -54,3 +54,14 @@ services:
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]
sonata.admin.c_document:
class: Chamilo\CourseBundle\Admin\CDocumentAdmin
tags:
- {name: sonata.admin, manager_type: orm, audit: true, group: "LMS", label: "CDocument"}
arguments:
- ~
- Chamilo\CourseBundle\Entity\CDocument
- ~
calls:
- [setTranslationDomain, [ChamiloCoreBundle]]

@ -6,8 +6,7 @@ namespace Chamilo\PageBundle\Controller;
use Chamilo\CoreBundle\Controller\BaseController;
use Chamilo\PageBundle\Entity\Page;
use Chamilo\PageBundle\Entity\Snapshot;
//use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sonata\PageBundle\Entity\PageManager;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

Loading…
Cancel
Save