Browse Source

Add page bundle

Julio Montoya 9 years ago
parent
commit
a0954d5eea

+ 7 - 6
app/AppKernel.php

@@ -24,7 +24,7 @@ class AppKernel extends Kernel
 
             new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
             new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
-            new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
+            //new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
             new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
 
             new FOS\RestBundle\FOSRestBundle(),
@@ -50,22 +50,23 @@ class AppKernel extends Kernel
             new Sonata\DatagridBundle\SonataDatagridBundle(),
             new Sonata\MediaBundle\SonataMediaBundle(),
             //new Sonata\TranslationBundle\SonataTranslationBundle(),
-            //new Sonata\PageBundle\SonataPageBundle(),
+            new Sonata\PageBundle\SonataPageBundle(),
 
             new Sonata\jQueryBundle\SonatajQueryBundle(),
-            new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(
-            ),
+            //new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
 
             new Sonata\AdminBundle\SonataAdminBundle(),
             new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
 
+
             // CMF Integration
             new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
+            /*new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
 
             new Symfony\Cmf\Bundle\RoutingAutoBundle\CmfRoutingAutoBundle(),
             new Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
             new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),
-            new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),
+            new Symfony\Cmf\Bundle\MenuBundle\CmfMenuBundle(),*/
             //new Symfony\Cmf\Bundle\SearchBundle\CmfSearchBundle(),
             //new Symfony\Cmf\Bundle\BlogBundle\CmfBlogBundle(),
             //new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
@@ -102,7 +103,7 @@ class AppKernel extends Kernel
             // Based in Sonata
             //new Chamilo\ClassificationBundle\ChamiloClassificationBundle(),
             new Chamilo\MediaBundle\ChamiloMediaBundle(),
-            //new Chamilo\PageBundle\ChamiloPageBundle(),
+            new Chamilo\PageBundle\ChamiloPageBundle(),
 
             // Chamilo course tool
             new Chamilo\NotebookBundle\ChamiloNotebookBundle(),

+ 53 - 86
app/config/config.yml

@@ -37,7 +37,7 @@ imports:
     - { resource: sonata/sonata_classification.yml }
 
   # Sylius
-    - { resource: sylius/sylius_resource.yml }
+    - { resource: sylius.yml }
 
 #    - { resource: @CmfBlogBundle/Resources/config/cmf_routing_auto.xml }
 #    - { resource: @CmfBlogBundle/Resources/config/admin.yml }
@@ -178,30 +178,7 @@ doctrine_migrations:
     table_name: version
     name: Chamilo Migrations
 
-# Platform settings
-sylius_settings:
-    driver: doctrine/orm
-    resources:
-        parameter:
-            classes:
-                model: Chamilo\CoreBundle\Entity\SettingsCurrent
-                repository: Chamilo\CoreBundle\Entity\Repository\SettingsCurrentRepository
-
-# Course settings
-chamilo_course:
-    driver: doctrine/orm
-    resources:
-        parameter:
-            classes:
-                model: Chamilo\CourseBundle\Entity\CCourseSetting
-                repository: Chamilo\CourseBundle\Entity\Repository\CCourseSettingRepository
-
-doctrine_cache:
-    providers:
-        sylius_settings:
-            type: file_system
-        chamilo_settings:
-            type: file_system
+
 
 # Grid default template
 #apy_data_grid:
@@ -348,68 +325,58 @@ lunetics_locale:
         - session
         #- browser
     allowed_locales: "%locales%"
-
-doctrine_phpcr:
-    # configure the PHPCR session
-    session:
-        backend: "%phpcr_backend%"
-        workspace: "%phpcr_workspace%"
-        username: "%phpcr_user%"
-        password: "%phpcr_pass%"
-    # enable the ODM layer
-    odm:
-        auto_mapping: true
-        mappings:
-          SonataMediaBundle:
-              prefix: Sonata\MediaBundle\PHPCR
-
-          ChamiloMediaBundle:
-              prefix: Chamilo\MediaBundle\PHPCR
-        auto_generate_proxy_classes: "%kernel.debug%"
-
-        locales:
-            en: [es, fr]
-            es: [en, fr]
-            fr: [en, es]
-        locale_fallback: hardcoded
-        default_locale: en
-
-sonata_doctrine_phpcr_admin:
-    templates:
-        form:
-            # Default:
-            - SonataDoctrinePHPCRAdminBundle:Form:form_admin_fields.html.twig
-        filter:
-            # Default:
-            - SonataDoctrinePHPCRAdminBundle:Form:filter_admin_fields.html.twig
-        types:
-            list:
-                # Prototype
-                name:                 '1'
-            show:
-                # Prototype
-                name:                 '2'
-        pager_results:        SonataDoctrinePHPCRAdminBundle:Pager:simple_pager_results.html.twig
-
-    document_tree_defaults: [locale]
-    document_tree:
-        Doctrine\ODM\PHPCR\Document\Generic:
-            valid_children:
-                - all
-        Chamilo\CmsBundle\Document\Page:
-            valid_children:
-                - all
+#
+#doctrine_phpcr:
+#    # configure the PHPCR session
+#    session:
+#        backend: "%phpcr_backend%"
+#        workspace: "%phpcr_workspace%"
+#        username: "%phpcr_user%"
+#        password: "%phpcr_pass%"
+#    # enable the ODM layer
+#    odm:
+#        auto_mapping: true
+#        mappings:
+#          SonataMediaBundle:
+#              prefix: Sonata\MediaBundle\PHPCR
+#
+#          ChamiloMediaBundle:
+#              prefix: Chamilo\MediaBundle\PHPCR
+#        auto_generate_proxy_classes: "%kernel.debug%"
+#
+#        locales:
+#            en: [es, fr]
+#            es: [en, fr]
+#            fr: [en, es]
+#        locale_fallback: hardcoded
+#        default_locale: en
+#
+#sonata_doctrine_phpcr_admin:
+#    templates:
+#        form:
+#            # Default:
+#            - SonataDoctrinePHPCRAdminBundle:Form:form_admin_fields.html.twig
+#        filter:
+#            # Default:
+#            - SonataDoctrinePHPCRAdminBundle:Form:filter_admin_fields.html.twig
+#        types:
+#            list:
+#                # Prototype
+#                name:                 '1'
+#            show:
+#                # Prototype
+#                name:                 '2'
+#        pager_results:        SonataDoctrinePHPCRAdminBundle:Pager:simple_pager_results.html.twig
+#
+#    document_tree_defaults: [locale]
+#    document_tree:
+#        Doctrine\ODM\PHPCR\Document\Generic:
+#            valid_children:
+#                - all
+#        Chamilo\CmsBundle\Document\Page:
+#            valid_children:
+#                - all
 
 knp_menu:
     twig: true
 
-
-sylius_resource:
-    resources:
-        chamilo_notebook.notebook:
-            driver: doctrine/orm
-            templates: ChamiloNotebookBundle:Notebook
-            classes:
-                model: Chamilo\NotebookBundle\Entity\CNotebook
-                controller: Chamilo\NotebookBundle\Controller\NotebookController
-                repository: Chamilo\NotebookBundle\Entity\NotebookRepository

+ 0 - 4
app/config/routing.yml

@@ -32,10 +32,6 @@ _sonata_admin:
     type: sonata_admin
     prefix: /{_locale}/administration
 
-cmf_tree:
-    resource: .
-    type: 'cmf_tree'
-
 #cmf_search:
 #    resource: "@CmfSearchBundle/Resources/config/routing/phpcr/search.xml"
 

+ 6 - 6
app/config/routing_front.yml

@@ -22,13 +22,13 @@ sonata_user_change_password:
 #    resource: '@SonataCacheBundle/Resources/config/routing/cache.xml'
 #    prefix: /
 #
-#sonata_page_cache:
-#    resource: '@SonataPageBundle/Resources/config/routing/cache.xml'
-#    prefix: /
+sonata_page_cache:
+    resource: '@SonataPageBundle/Resources/config/routing/cache.xml'
+    prefix: /
 
-#sonata_page_exceptions:
-#    resource: '@SonataPageBundle/Resources/config/routing/exceptions.xml'
-#    prefix: /page
+sonata_page_exceptions:
+    resource: '@SonataPageBundle/Resources/config/routing/exceptions.xml'
+    prefix: /page
 
 sonata_media_gallery:
     resource: '@SonataMediaBundle/Resources/config/routing/gallery.xml'

+ 6 - 0
app/config/security.yml

@@ -19,6 +19,7 @@ security:
             - ROLE_DIRECTOR
             - ROLE_JURY_PRESIDENT
             - ROLE_CURRENT_COURSE_TEACHER
+            - SONATA
         ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
 
         ROLE_GLOBAL_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
@@ -31,6 +32,11 @@ security:
         ROLE_CURRENT_COURSE_STUDENT: [ROLE_CURRENT_COURSE_STUDENT]
         ROLE_CURRENT_COURSE_TEACHER: [ROLE_CURRENT_COURSE_TEACHER, ROLE_CURRENT_COURSE_STUDENT]
 
+        SONATA:
+            - ROLE_SONATA_PAGE_ADMIN_PAGE_EDIT # if you are not using acl then this line must be uncommented
+            - ROLE_SONATA_PAGE_ADMIN_BLOCK_EDIT
+
+
         ROLE_ANONYMOUS: [ROLE_ANONYMOUS]
 
     access_decision_manager:

+ 13 - 13
app/config/sonata/sonata_admin.yml

@@ -29,21 +29,21 @@ sonata_admin:
         user_block: ChamiloCoreBundle:Admin:admin_topnav.html.twig
 
     extensions:
-        cmf_core.admin_extension.translatable:
-            implements:
-                - Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface
-
-        cmf_core.admin_extension.publish_workflow.publishable:
-            implements:
-                - Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishableInterface
-        cmf_core.admin_extension.publish_workflow.time_period:
-            implements:
-                - Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface
+#        cmf_core.admin_extension.translatable:
+#            implements:
+#                - Symfony\Cmf\Bundle\CoreBundle\Translatable\TranslatableInterface
+#
+#        cmf_core.admin_extension.publish_workflow.publishable:
+#            implements:
+#                - Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishableInterface
+#        cmf_core.admin_extension.publish_workflow.time_period:
+#            implements:
+#                - Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishTimePeriodInterface
 
     dashboard:
-        blocks:
-            - { position: left, type: sonata_admin_doctrine_phpcr.tree_block }
-            - { position: right, type: sonata.admin.block.admin_list }
+#        blocks:
+#            - { position: left, type: sonata_admin_doctrine_phpcr.tree_block }
+#            - { position: right, type: sonata.admin.block.admin_list }
 
 #            - { position: left, type: sonata.admin.block.admin_list }
 #            - { position: right, type: sonata.admin_doctrine_orm.block.audit}

+ 4 - 4
app/config/sonata/sonata_block.yml

@@ -9,10 +9,10 @@ sonata_block:
 #        #"SonataDemoBundle:Builder:mainMenu": "Main Menu"
 
     blocks:
-        sonata_admin_doctrine_phpcr.tree_block:
-            settings:
-                id: '/cms'
-            contexts: [admin]
+#        sonata_admin_doctrine_phpcr.tree_block:
+#            settings:
+#                id: '/cms'
+#            contexts: [admin]
 
 
         # Chamilo blocks

+ 154 - 208
app/config/sonata/sonata_page.yml

@@ -1,214 +1,160 @@
 # more information can be found here http://sonata-project.org/bundles/page
-#
-#cmf_blog:
-#    persistence:
-#        phpcr:
-#            enabled:          true
-#    sonata_admin:
-#        enabled: true
-
-
-#    class:
-#        blog_admin: Symfony\Cmf\Bundle\BlogBundle\Admin\BlogAdmin # Optional
-#        post_admin: Symfony\Cmf\Bundle\BlogBundle\Admin\PostAdmin # Optional
-#        blog: Symfony\Cmf\Bundle\BlogBundle\Document\Blog # Optional
-#        post: Symfony\Cmf\Bundle\BlogBundle\Document\Post # Optional
 
 cmf_routing:
     chain:
         routers_by_id:
-            cmf_routing.dynamic_router: 20
+            # enable the DynamicRouter with high priority to allow overwriting configured routes with content
+            #symfony_cmf_routing_extra.dynamic_router: 200
+            # enable the symfony default router with a lower priority
+            sonata.page.router: 150
             router.default: 100
-    dynamic:
-        enabled: true
-        persistence:
-            phpcr:
-                use_sonata_admin: auto #hide routes in sonata
-                content_basepath: ~
-
-        controllers_by_class:
-#            Chamilo\CmsBundle\Document\Page: Chamilo\CmsBundle\Controller\DefaultController::pageAction
-#            Chamilo\CmsBundle\Document\Post: Chamilo\CmsBundle\Controller\DefaultController::postAction
-#            Symfony\Cmf\Bundle\BlogBundle\Document\Blog: cmf_blog.blog_controller:listAction
-#            Symfony\Cmf\Bundle\BlogBundle\Document\Post: cmf_blog.blog_controller:viewPostAction
-
-cmf_routing_auto:
-    persistence:
-        phpcr:
-            enabled: true
-
-cmf_core:
-    multilang:
-        locales: "%locales%"
-
-#cmf_search:
-#    show_paging: false
-#    persistence:
-#        phpcr:
-#            enabled:              true
-#            search_basepath:      /cms/page
-#            manager_registry:     doctrine_phpcr
-#            manager_name:         ~
-#            translation_strategy: ~
-#            search_fields:        []
-##            max_results:          ~
-
-#cmf_routing:
-#    chain:
-#        routers_by_id:
-#            # enable the DynamicRouter with high priority to allow overwriting configured routes with content
-#            #symfony_cmf_routing_extra.dynamic_router: 200
-#            # enable the symfony default router with a lower priority
-#            sonata.page.router: 150
-#            router.default: 100
-
-#sonata_page:
-#    class:
-#        page: Chamilo\PageBundle\Entity\Page
-#        site: Chamilo\PageBundle\Entity\Site
-#        block: Chamilo\PageBundle\Entity\Block
-#        snapshot: Chamilo\PageBundle\Entity\Snapshot
-#
-#    multisite: host_with_path_by_locale # host
-#    use_streamed_response: false # set the value to false in debug mode or if the reverse proxy does not handle streamed response
-#
-#    ignore_uri_patterns:
-#        - ^/administration(.*) # sonata admin
-#        - ^/api/(.*)
-#        - ^installer
-#        - ^/installer/(.*)
-#        - install.php
-#
-#    ignore_route_patterns:
-#        - (.*)administration(.*)     # ignore admin route, ie route containing 'admin'  # sonata admin
-#        - ^_(.*)            # ignore symfony routes
-#        - login
-#        - home
-#        - homepage
-#        - userportal
-#        - _settings
-#        - fos_user(.*)
-#        - chamilo_installer_flow
-#        - sylius_flow(.*)
-#
-#    ignore_routes:
-#        - sonata_page_cache_esi
-#        - sonata_page_cache_ssi
-#        - sonata_page_js_sync_cache
-#        - sonata_page_js_async_cache
-#        - sonata_cache_esi
-#        - sonata_cache_ssi
-#        - sonata_cache_js_async
-#        - sonata_cache_js_sync
-#        - sonata_cache_apc
-#        - chamilo_installer_flow
-#        - sylius_flow_start
-#        - sylius_flow_display
-#        - sylius_flow_forward
-#        - chamilo_core_user_user_mycourses
-#        - home
-#        - main
-#
-#    cache_invalidation:
-#        service:  sonata.page.cache.invalidation.simple
-#        recorder: sonata.page.cache.recorder
-#        classes:
-#            "Chamilo\PageBundle\Entity\Block": getId
-#
-#    assets:
-#        stylesheets:
-#            #- assetic/sonata_front_css.css
-#
-#        javascripts:
-#            #- assetic/sonata_front_js.js
-#
-#    default_template: default
-#    templates:
-#        default:
-#            #path: 'ApplicationSonataPageBundle::demo_layout.html.twig'
-#            path: '::layout.html.twig'
-#            name: 'default'
-#            containers:
-#                 header:
-#                     name: Header
-#                 content_top:
-#                     name: Top content
-#                 content:
-#                     name: Main content
-#                 content_bottom:
-#                     name: Bottom content
-#                 footer:
-#                     name: Footer
-#            matrix:
-#                 layout: |
-#                     HHHHHHHH
-#                     TTTTTTTT
-#                     CCCCCCCC
-#                     BBBBBBBB
-#                     FFFFFFFF
-#
-#                 mapping:
-#                     H: header
-#                     T: content_top
-#                     C: content
-#                     B: content_bottom
-#                     F: footer
-#
-#        2columns:
-#            #path: 'ApplicationSonataPageBundle::default_2columns_layout.html.twig'
-#            path: '::layout.html.twig'
-#            name: '2 columns layout'
-#            containers:
-#                 header:
-#                     name: Header
-#                 content_top:
-#                     name: Top content
-#                 left_col:
-#                     name: Left content
-#                 rigth_col:
-#                     name: Right content
-#                 content_bottom:
-#                     name: Bottom content
-#                 footer:
-#                     name: Footer
-#            matrix:
-#                 layout: |
-#                     HHHHHHHH
-#                     TTTTTTTT
-#                     LLLLRRRR
-#                     BBBBBBBB
-#                     FFFFFFFF
-#
-#                 mapping:
-#                     H: header
-#                     T: content_top
-#                     L: left_col
-#                     R: rigth_col
-#                     B: content_bottom
-#                     F: footer
-#
-#    page_defaults:
-#        homepage: { decorate: false, enabled: true }
-#
-#    caches:
-#        esi:
-#            token:    add an unique token here # default is a random value
-#            version:  3                        # version 3 is the default on debian wheezy ...
-#            servers:
-#                - %sonata_page.varnish.command% # you need to adapt this line to work with your configuration
-#
-#        ssi:
-#            token:    add an unique token here # default is a random value
-#
-#    catch_exceptions:
-#        not_found: [404]    # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
-#        fatal:     [500]    # so you can use the same page for different http errors or specify specific page for each error
-#
-## Enable Doctrine to map the provided entities
-#doctrine:
-#    orm:
-#        entity_managers:
-#            default:
-#                mappings:
-#                    ChamiloPageBundle: ~
-#                    SonataPageBundle: ~
+
+sonata_page:
+    class:
+        page: Chamilo\PageBundle\Entity\Page
+        site: Chamilo\PageBundle\Entity\Site
+        block: Chamilo\PageBundle\Entity\Block
+        snapshot: Chamilo\PageBundle\Entity\Snapshot
+
+    multisite: host_with_path_by_locale # host
+    use_streamed_response: false # set the value to false in debug mode or if the reverse proxy does not handle streamed response
+
+    ignore_uri_patterns:
+        - ^/administration(.*) # sonata admin
+        - ^/api/(.*)
+        - ^installer
+        - ^/installer/(.*)
+        - install.php
+
+    ignore_route_patterns:
+        - (.*)administration(.*)     # ignore admin route, ie route containing 'admin'  # sonata admin
+        - ^_(.*)            # ignore symfony routes
+        - login
+        - homepage
+        - userportal
+        - _settings
+        - fos_user(.*)
+        - chamilo_installer_flow
+        - sylius_flow(.*)
+
+    ignore_routes:
+        - sonata_page_cache_esi
+        - sonata_page_cache_ssi
+        - sonata_page_js_sync_cache
+        - sonata_page_js_async_cache
+        - sonata_cache_esi
+        - sonata_cache_ssi
+        - sonata_cache_js_async
+        - sonata_cache_js_sync
+        - sonata_cache_apc
+        - chamilo_installer_flow
+        - sylius_flow_start
+        - sylius_flow_display
+        - sylius_flow_forward
+        - chamilo_core_user_user_mycourses
+        - home
+        - main
+
+    cache_invalidation:
+        service:  sonata.page.cache.invalidation.simple
+        recorder: sonata.page.cache.recorder
+        classes:
+            "Chamilo\PageBundle\Entity\Block": getId
+
+    assets:
+        stylesheets:
+            #- assetic/sonata_front_css.css
+
+        javascripts:
+            #- assetic/sonata_front_js.js
+
+    default_template: default
+    templates:
+        default:
+            #path: 'ApplicationSonataPageBundle::demo_layout.html.twig'
+            path: '::layout.html.twig'
+            name: 'default'
+            containers:
+                 header:
+                     name: Header
+                 content_top:
+                     name: Top content
+                 content:
+                     name: Main content
+                 content_bottom:
+                     name: Bottom content
+                 footer:
+                     name: Footer
+            matrix:
+                 layout: |
+                     HHHHHHHH
+                     TTTTTTTT
+                     CCCCCCCC
+                     BBBBBBBB
+                     FFFFFFFF
+
+                 mapping:
+                     H: header
+                     T: content_top
+                     C: content
+                     B: content_bottom
+                     F: footer
+
+        2columns:
+            #path: 'ApplicationSonataPageBundle::default_2columns_layout.html.twig'
+            path: '::layout.html.twig'
+            name: '2 columns layout'
+            containers:
+                 header:
+                     name: Header
+                 content_top:
+                     name: Top content
+                 left_col:
+                     name: Left content
+                 rigth_col:
+                     name: Right content
+                 content_bottom:
+                     name: Bottom content
+                 footer:
+                     name: Footer
+            matrix:
+                 layout: |
+                     HHHHHHHH
+                     TTTTTTTT
+                     LLLLRRRR
+                     BBBBBBBB
+                     FFFFFFFF
+
+                 mapping:
+                     H: header
+                     T: content_top
+                     L: left_col
+                     R: rigth_col
+                     B: content_bottom
+                     F: footer
+
+    page_defaults:
+        homepage: { decorate: false, enabled: true }
+
+    caches:
+        esi:
+            token:    add an unique token here # default is a random value
+            version:  3                        # version 3 is the default on debian wheezy ...
+            servers:
+                - %sonata_page.varnish.command% # you need to adapt this line to work with your configuration
+
+        ssi:
+            token:    add an unique token here # default is a random value
+
+    catch_exceptions:
+        not_found: [404]    # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
+        fatal:     [500]    # so you can use the same page for different http errors or specify specific page for each error
+
+# Enable Doctrine to map the provided entities
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    ChamiloPageBundle: ~
+                    SonataPageBundle: ~

+ 10 - 34
composer.json

@@ -62,13 +62,13 @@
         "incenteev/composer-parameter-handler": "~2.0",
 
         "jms/serializer-bundle": "~0.12",
-
-        "doctrine/orm": "~2.4,<2.5",
-        "doctrine/dbal": "~2.4,<2.5",
+      "doctrine/orm": "~2.4",
+      "doctrine/dbal": "~2.4",
         "doctrine/migrations": "~1.0@dev",
         "doctrine/doctrine-migrations-bundle": "*@dev",
         "doctrine/doctrine-fixtures-bundle": "~2.2",
         "doctrine/data-fixtures": "~1.0@dev",
+      "symfony-cmf/routing-bundle": "~1.1",
 
         "knplabs/gaufrette": "~0.1.6",
 
@@ -105,7 +105,7 @@
         "jmontoyaa/migration-bundle":"dev-master",
 
         "sonata-project/easy-extends-bundle": "~2.1@dev",
-        "sonata-project/seo-bundle": "~2.0",
+      "sonata-project/seo-bundle": "~1@dev",
         "sonata-project/doctrine-extensions": "~1@dev",
         "sonata-project/intl-bundle": "~2.2@dev",
         "sonata-project/admin-bundle": "2.2.*",
@@ -116,6 +116,7 @@
         "sonata-project/user-bundle": "~2.2@dev",
         "sonata-project/cache-bundle": "~2.1@dev",
         "sonata-project/cache": "~1.0@dev",
+      "sonata-project/page-bundle": "~2.3@dev",
         "sonata-project/core-bundle": "2.3.x-dev",
         "sonata-project/formatter-bundle": "~2.4@dev",
         "sonata-project/news-bundle": "~2.3@dev",
@@ -124,33 +125,12 @@
         "sonata-project/timeline-bundle": "~2.3@dev",
         "sonata-project/classification-bundle": "~2.2@dev",
         "sonata-project/comment-bundle": "~2.2@dev",
-
         "sonata-project/translation-bundle": "^1.0",
 
-
-        "doctrine/phpcr-bundle": "~1.2",
-        "doctrine/phpcr-odm": "~1.2",
-        "jackalope/jackalope-doctrine-dbal": "~1.1,>=1.1.2",
-
-
-        "symfony-cmf/menu-bundle": "dev-master",
-        "sonata-project/doctrine-phpcr-admin-bundle": "^1.2",
-        "symfony-cmf/tree-browser-bundle": "~1.1",
-        "symfony-cmf/routing-bundle": "~1.3",
-        "symfony-cmf/routing-auto-bundle": "dev-master",
-        "symfony-cmf/routing-auto": "dev-master",
-        "symfony-cmf/routing": "~1.3",
-        "symfony-cmf/content-bundle": "dev-master",
-        "symfony-cmf/search-bundle": "^1.1",
-        "symfony-cmf/blog-bundle": "dev-version_upgrades",
-
-
-
         "mopa/bootstrap-bundle": "v3.0.0-beta3",
         "twbs/bootstrap": "v3.0.0",
-
-        "liip/theme-bundle": "dev-master",
-        "liip/imagine-bundle": "^1.3",
+      "liip/theme-bundle": "~1.3",
+      "liip/imagine-bundle": "~0.20",
 
         "egeloen/ckeditor-bundle": "~2.2",
         "helios-ag/fm-elfinder-bundle": "~5",
@@ -159,11 +139,6 @@
 
         "simplethings/entity-audit-bundle": "~0.5",
 
-
-
-
-
-
         "ramsey/array_column": "~1.1",
         "patchwork/utf8": "~1.2",
         "ddeboer/data-import": "@stable",
@@ -177,7 +152,7 @@
         "php-ffmpeg/php-ffmpeg": "0.5.1",
         "essence/essence": "^2.5",
         "jeroendesloovere/vcard": "^1.2",
-        "stof/doctrine-extensions-bundle": "^1.2",
+      "stof/doctrine-extensions-bundle": "~1.0",
         "alchemy/zippy": "^0.2.1",
         "hwi/oauth-bundle": "^0.3.9",
         "genemu/form-bundle": "2.2.*",
@@ -185,7 +160,8 @@
         "intervention/image": "^2.3",
         "apy/datagrid-bundle": "^2.2",
         "stephpy/timeline-bundle": "~2.0",
-        "lunetics/locale-bundle": "^2.4"
+      "lunetics/locale-bundle": "^2.4",
+      "sonata-project/page-bundle": "^2.3"
     },
     "require-dev": {
         "behat/behat": "2.5.*@stable",

+ 1 - 0
src/Chamilo/CoreBundle/DependencyInjection/ChamiloCoreExtension.php

@@ -24,6 +24,7 @@ class ChamiloCoreExtension extends Extension
             $container,
             new FileLocator(__DIR__ . '/../Resources/config')
         );
+
         $loader->load('services.yml');
         //$loader->load('admin.yml');
     }

+ 193 - 30
src/Chamilo/CoreBundle/Migrations/Schema/V2_0_0/Version20.php

@@ -62,25 +62,186 @@ class Version20 implements Migration, OrderedMigrationInterface
         );
 
         // Sonata changes:
+        $queries->addQuery(
+            'CREATE TABLE media__gallery (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, context VARCHAR(64) NOT NULL, default_format VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE media__media (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, provider_name VARCHAR(255) NOT NULL, provider_status INT NOT NULL, provider_reference VARCHAR(255) NOT NULL, provider_metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', width INT DEFAULT NULL, height INT DEFAULT NULL, length NUMERIC(10, 0) DEFAULT NULL, content_type VARCHAR(255) DEFAULT NULL, content_size INT DEFAULT NULL, copyright VARCHAR(255) DEFAULT NULL, author_name VARCHAR(255) DEFAULT NULL, context VARCHAR(64) DEFAULT NULL, cdn_is_flushable TINYINT(1) DEFAULT NULL, cdn_flush_at DATETIME DEFAULT NULL, cdn_status INT DEFAULT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE media__gallery_media (id INT AUTO_INCREMENT NOT NULL, gallery_id INT DEFAULT NULL, media_id INT DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_80D4C5414E7AF8F (gallery_id), INDEX IDX_80D4C541EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_namespaces (prefix VARCHAR(255) NOT NULL, uri VARCHAR(255) NOT NULL, PRIMARY KEY(prefix)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_workspaces (name VARCHAR(255) NOT NULL, PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_nodes (id INT AUTO_INCREMENT NOT NULL, path VARCHAR(255) NOT NULL, parent VARCHAR(255) NOT NULL, local_name VARCHAR(255) NOT NULL, namespace VARCHAR(255) NOT NULL, workspace_name VARCHAR(255) NOT NULL, identifier VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, props LONGTEXT NOT NULL, depth INT NOT NULL, sort_order INT DEFAULT NULL, UNIQUE INDEX UNIQ_A4624AD7B548B0F1AC10DC4 (path, workspace_name), UNIQUE INDEX UNIQ_A4624AD7772E836A1AC10DC4 (identifier, workspace_name), INDEX IDX_A4624AD73D8E604F (parent), INDEX IDX_A4624AD78CDE5729 (type), INDEX IDX_A4624AD7623C14D533E16B56 (local_name, namespace), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_internal_index_types (type VARCHAR(255) NOT NULL, node_id INT NOT NULL, PRIMARY KEY(type, node_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_binarydata (id INT AUTO_INCREMENT NOT NULL, node_id INT NOT NULL, property_name VARCHAR(255) NOT NULL, workspace_name VARCHAR(255) NOT NULL, idx INT DEFAULT 0 NOT NULL, data LONGBLOB NOT NULL, UNIQUE INDEX UNIQ_37E65615460D9FD7413BC13C1AC10DC4E7087E10 (node_id, property_name, workspace_name, idx), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_nodes_references (source_id INT NOT NULL, source_property_name VARCHAR(220) NOT NULL, target_id INT NOT NULL, INDEX IDX_F3BF7E1158E0B66 (target_id), PRIMARY KEY(source_id, source_property_name, target_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_nodes_weakreferences (source_id INT NOT NULL, source_property_name VARCHAR(220) NOT NULL, target_id INT NOT NULL, INDEX IDX_F0E4F6FA158E0B66 (target_id), PRIMARY KEY(source_id, source_property_name, target_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE phpcr_type_nodes (node_type_id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, supertypes VARCHAR(255) NOT NULL, is_abstract TINYINT(1) NOT NULL, is_mixin TINYINT(1) NOT NULL, queryable TINYINT(1) NOT NULL, orderable_child_nodes TINYINT(1) NOT NULL, primary_item VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_34B0A8095E237E06 (name), PRIMARY KEY(node_type_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C5414E7AF8F FOREIGN KEY (gallery_id) REFERENCES media__gallery (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C541EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id)'
+        );
+        $queries->addQuery(
+            'CREATE TABLE notification__message (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', state INT NOT NULL, restart_count INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, started_at DATETIME DEFAULT NULL, completed_at DATETIME DEFAULT NULL, INDEX idx_state (state), INDEX idx_created_at (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
 
 
-        $this->addSql('CREATE TABLE media__gallery (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, context VARCHAR(64) NOT NULL, default_format VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE media__media (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, provider_name VARCHAR(255) NOT NULL, provider_status INT NOT NULL, provider_reference VARCHAR(255) NOT NULL, provider_metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', width INT DEFAULT NULL, height INT DEFAULT NULL, length NUMERIC(10, 0) DEFAULT NULL, content_type VARCHAR(255) DEFAULT NULL, content_size INT DEFAULT NULL, copyright VARCHAR(255) DEFAULT NULL, author_name VARCHAR(255) DEFAULT NULL, context VARCHAR(64) DEFAULT NULL, cdn_is_flushable TINYINT(1) DEFAULT NULL, cdn_flush_at DATETIME DEFAULT NULL, cdn_status INT DEFAULT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE media__gallery_media (id INT AUTO_INCREMENT NOT NULL, gallery_id INT DEFAULT NULL, media_id INT DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_80D4C5414E7AF8F (gallery_id), INDEX IDX_80D4C541EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_namespaces (prefix VARCHAR(255) NOT NULL, uri VARCHAR(255) NOT NULL, PRIMARY KEY(prefix)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_workspaces (name VARCHAR(255) NOT NULL, PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_nodes (id INT AUTO_INCREMENT NOT NULL, path VARCHAR(255) NOT NULL, parent VARCHAR(255) NOT NULL, local_name VARCHAR(255) NOT NULL, namespace VARCHAR(255) NOT NULL, workspace_name VARCHAR(255) NOT NULL, identifier VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, props LONGTEXT NOT NULL, depth INT NOT NULL, sort_order INT DEFAULT NULL, UNIQUE INDEX UNIQ_A4624AD7B548B0F1AC10DC4 (path, workspace_name), UNIQUE INDEX UNIQ_A4624AD7772E836A1AC10DC4 (identifier, workspace_name), INDEX IDX_A4624AD73D8E604F (parent), INDEX IDX_A4624AD78CDE5729 (type), INDEX IDX_A4624AD7623C14D533E16B56 (local_name, namespace), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_internal_index_types (type VARCHAR(255) NOT NULL, node_id INT NOT NULL, PRIMARY KEY(type, node_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_binarydata (id INT AUTO_INCREMENT NOT NULL, node_id INT NOT NULL, property_name VARCHAR(255) NOT NULL, workspace_name VARCHAR(255) NOT NULL, idx INT DEFAULT 0 NOT NULL, data LONGBLOB NOT NULL, UNIQUE INDEX UNIQ_37E65615460D9FD7413BC13C1AC10DC4E7087E10 (node_id, property_name, workspace_name, idx), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_nodes_references (source_id INT NOT NULL, source_property_name VARCHAR(220) NOT NULL, target_id INT NOT NULL, INDEX IDX_F3BF7E1158E0B66 (target_id), PRIMARY KEY(source_id, source_property_name, target_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_nodes_weakreferences (source_id INT NOT NULL, source_property_name VARCHAR(220) NOT NULL, target_id INT NOT NULL, INDEX IDX_F0E4F6FA158E0B66 (target_id), PRIMARY KEY(source_id, source_property_name, target_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('CREATE TABLE phpcr_type_nodes (node_type_id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, supertypes VARCHAR(255) NOT NULL, is_abstract TINYINT(1) NOT NULL, is_mixin TINYINT(1) NOT NULL, queryable TINYINT(1) NOT NULL, orderable_child_nodes TINYINT(1) NOT NULL, primary_item VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_34B0A8095E237E06 (name), PRIMARY KEY(node_type_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
-        $this->addSql('ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C5414E7AF8F FOREIGN KEY (gallery_id) REFERENCES media__gallery (id)');
-        $this->addSql('ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C541EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id)');
-
-
-        $this->addSql('CREATE TABLE notification__message (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', state INT NOT NULL, restart_count INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, started_at DATETIME DEFAULT NULL, completed_at DATETIME DEFAULT NULL, INDEX idx_state (state), INDEX idx_created_at (created_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
+        $queries->addQuery(
+            'CREATE TABLE page__bloc (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, page_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(64) NOT NULL, settings LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', enabled TINYINT(1) DEFAULT NULL, position INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_FCDC1A97727ACA70 (parent_id), INDEX IDX_FCDC1A97C4663E4 (page_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE page__snapshot (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, page_id INT DEFAULT NULL, route_name VARCHAR(255) NOT NULL, page_alias VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, decorate TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, url LONGTEXT DEFAULT NULL, parent_id INT DEFAULT NULL, target_id INT DEFAULT NULL, content LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', publication_date_start DATETIME DEFAULT NULL, publication_date_end DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_3963EF9AF6BD1646 (site_id), INDEX IDX_3963EF9AC4663E4 (page_id), INDEX idx_snapshot_dates_enabled (publication_date_start, publication_date_end, enabled), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE page__page (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, parent_id INT DEFAULT NULL, target_id INT DEFAULT NULL, route_name VARCHAR(255) NOT NULL, page_alias VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, decorate TINYINT(1) NOT NULL, edited TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, slug LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, custom_url LONGTEXT DEFAULT NULL, request_method VARCHAR(255) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, meta_keyword VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, javascript LONGTEXT DEFAULT NULL, stylesheet LONGTEXT DEFAULT NULL, raw_headers LONGTEXT DEFAULT NULL, template VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_2FAE39EDF6BD1646 (site_id), INDEX IDX_2FAE39ED727ACA70 (parent_id), INDEX IDX_2FAE39ED158E0B66 (target_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'CREATE TABLE page__site (id INT AUTO_INCREMENT NOT NULL, enabled TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, relative_path VARCHAR(255) DEFAULT NULL, host VARCHAR(255) NOT NULL, enabled_from DATETIME DEFAULT NULL, enabled_to DATETIME DEFAULT NULL, is_default TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locale VARCHAR(6) DEFAULT NULL, title VARCHAR(64) DEFAULT NULL, meta_keywords VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__bloc ADD CONSTRAINT FK_FCDC1A97727ACA70 FOREIGN KEY (parent_id) REFERENCES page__bloc (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__bloc ADD CONSTRAINT FK_FCDC1A97C4663E4 FOREIGN KEY (page_id) REFERENCES page__page (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__snapshot ADD CONSTRAINT FK_3963EF9AF6BD1646 FOREIGN KEY (site_id) REFERENCES page__site (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__snapshot ADD CONSTRAINT FK_3963EF9AC4663E4 FOREIGN KEY (page_id) REFERENCES page__page (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39EDF6BD1646 FOREIGN KEY (site_id) REFERENCES page__site (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39ED727ACA70 FOREIGN KEY (parent_id) REFERENCES page__page (id) ON DELETE CASCADE'
+        );
+        $queries->addQuery(
+            'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39ED158E0B66 FOREIGN KEY (target_id) REFERENCES page__page (id) ON DELETE CASCADE'
+        );
 
+        $queries->addQuery(
+            'CREATE INDEX state ON notification__message (state)'
+        );
+        $queries->addQuery(
+            'CREATE INDEX createdAt ON notification__message (created_at)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE settings_current DROP FOREIGN KEY FK_62F79C3B9436187B'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_62f79c3b9436187b ON settings_current'
+        );
+        $queries->addQuery(
+            'CREATE INDEX access_url ON settings_current (access_url)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE settings_current ADD CONSTRAINT FK_62F79C3B9436187B FOREIGN KEY (access_url) REFERENCES access_url (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE access_url_rel_user DROP FOREIGN KEY FK_8557426373444FD5'
+        );
+        $queries->addQuery(
+            'ALTER TABLE access_url_rel_user DROP FOREIGN KEY FK_85574263A76ED395'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_85574263a76ed395 ON access_url_rel_user'
+        );
+        $queries->addQuery(
+            'CREATE INDEX idx_access_url_rel_user_user ON access_url_rel_user (user_id)'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_8557426373444fd5 ON access_url_rel_user'
+        );
+        $queries->addQuery(
+            'CREATE INDEX idx_access_url_rel_user_access_url ON access_url_rel_user (access_url_id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE access_url_rel_user ADD CONSTRAINT FK_8557426373444FD5 FOREIGN KEY (access_url_id) REFERENCES access_url (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE access_url_rel_user ADD CONSTRAINT FK_85574263A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course DROP FOREIGN KEY FK_12D110D391D79BD3'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_12d110d391d79bd3 ON session_rel_course'
+        );
+        $queries->addQuery(
+            'CREATE INDEX idx_session_rel_course_course_id ON session_rel_course (c_id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course ADD CONSTRAINT FK_12D110D391D79BD3 FOREIGN KEY (c_id) REFERENCES course (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course_rel_user DROP FOREIGN KEY FK_720167E91D79BD3'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course_rel_user DROP FOREIGN KEY FK_720167EA76ED395'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_720167ea76ed395 ON session_rel_course_rel_user'
+        );
+        $queries->addQuery(
+            'CREATE INDEX idx_session_rel_course_rel_user_id_user ON session_rel_course_rel_user (user_id)'
+        );
+        $queries->addQuery(
+            'DROP INDEX idx_720167e91d79bd3 ON session_rel_course_rel_user'
+        );
+        $queries->addQuery(
+            'CREATE INDEX idx_session_rel_course_rel_user_course_id ON session_rel_course_rel_user (c_id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course_rel_user ADD CONSTRAINT FK_720167E91D79BD3 FOREIGN KEY (c_id) REFERENCES course (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session_rel_course_rel_user ADD CONSTRAINT FK_720167EA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE session DROP FOREIGN KEY FK_D044D5D4D1DC2CFC'
+        );
+        $queries->addQuery('DROP INDEX idx_d044d5d4d1dc2cfc ON session');
+        $queries->addQuery('CREATE INDEX idx_id_coach ON session (id_coach)');
+        $queries->addQuery(
+            'ALTER TABLE session ADD CONSTRAINT FK_D044D5D4D1DC2CFC FOREIGN KEY (id_coach) REFERENCES user (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE c_group_info DROP FOREIGN KEY FK_CE06532491D79BD3'
+        );
+        $queries->addQuery('DROP INDEX idx_ce06532491d79bd3 ON c_group_info');
+        $queries->addQuery('CREATE INDEX course ON c_group_info (c_id)');
+        $queries->addQuery(
+            'ALTER TABLE c_group_info ADD CONSTRAINT FK_CE06532491D79BD3 FOREIGN KEY (c_id) REFERENCES course (id)'
+        );
+        $queries->addQuery(
+            'ALTER TABLE c_tool DROP FOREIGN KEY FK_8456658091D79BD3'
+        );
+        $queries->addQuery('DROP INDEX idx_8456658091d79bd3 ON c_tool');
+        $queries->addQuery('CREATE INDEX course ON c_tool (c_id)');
+        $queries->addQuery(
+            'ALTER TABLE c_tool ADD CONSTRAINT FK_8456658091D79BD3 FOREIGN KEY (c_id) REFERENCES course (id)'
+        );
 
         $queries->addQuery("ALTER TABLE resource_link ADD start_visibility_at DATETIME DEFAULT NULL, ADD end_visibility_at DATETIME DEFAULT NULL;");
 
@@ -159,6 +320,8 @@ class Version20 implements Migration, OrderedMigrationInterface
             $sql = "DELETE FROM settings_current WHERE variable = $setting";
             $queries->addQuery($sql);
         }
+
+
     }
 
     /**
@@ -167,20 +330,20 @@ class Version20 implements Migration, OrderedMigrationInterface
      */
     public function down(Schema $schema, QueryBag $queries)
     {
-        $this->addSql('DROP TABLE media__gallery');
-        $this->addSql('DROP TABLE media__media');
-        $this->addSql('DROP TABLE media__gallery_media');
-        $this->addSql('DROP TABLE phpcr_namespaces');
-        $this->addSql('DROP TABLE phpcr_workspaces');
-        $this->addSql('DROP TABLE phpcr_nodes');
-        $this->addSql('DROP TABLE phpcr_internal_index_types');
-        $this->addSql('DROP TABLE phpcr_binarydata');
-        $this->addSql('DROP TABLE phpcr_nodes_references');
-        $this->addSql('DROP TABLE phpcr_nodes_weakreferences');
-        $this->addSql('DROP TABLE phpcr_type_nodes');
-        $this->addSql('DROP TABLE phpcr_type_props');
-        $this->addSql('DROP TABLE phpcr_type_childs');
-        $this->addSql('DROP TABLE notification__message');
+        $queries->addQuery('DROP TABLE media__gallery');
+        $queries->addQuery('DROP TABLE media__media');
+        $queries->addQuery('DROP TABLE media__gallery_media');
+        $queries->addQuery('DROP TABLE phpcr_namespaces');
+        $queries->addQuery('DROP TABLE phpcr_workspaces');
+        $queries->addQuery('DROP TABLE phpcr_nodes');
+        $queries->addQuery('DROP TABLE phpcr_internal_index_types');
+        $queries->addQuery('DROP TABLE phpcr_binarydata');
+        $queries->addQuery('DROP TABLE phpcr_nodes_references');
+        $queries->addQuery('DROP TABLE phpcr_nodes_weakreferences');
+        $queries->addQuery('DROP TABLE phpcr_type_nodes');
+        $queries->addQuery('DROP TABLE phpcr_type_props');
+        $queries->addQuery('DROP TABLE phpcr_type_childs');
+        $queries->addQuery('DROP TABLE notification__message');
 
     }
 }

+ 1 - 0
src/Chamilo/CourseBundle/DependencyInjection/ChamiloCourseExtension.php

@@ -4,6 +4,7 @@
 namespace Chamilo\CourseBundle\DependencyInjection;
 
 use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
+//use Sylius\Bundle\ResourceBundle\DependencyInjection\AbstractResourceExtension; old
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\Config\FileLocator;
 use Symfony\Component\DependencyInjection\Loader;

+ 8 - 0
src/Chamilo/NotebookBundle/ChamiloNotebookBundle.php

@@ -18,4 +18,12 @@ class ChamiloNotebookBundle extends AbstractResourceBundle
             SyliusResourceBundle::DRIVER_DOCTRINE_ORM,
         );
     }
+
+    /**
+     *
+     */
+    public function getBundlePrefix()
+    {
+        parent::getBundlePrefix();
+    }
 }

+ 5 - 1
web/app_dev.php

@@ -29,11 +29,15 @@ require_once __DIR__.'/legacy.php';
 $request = RequestFactory::createFromGlobals('host_with_path_by_locale');
 $request->enableHttpMethodParameterOverride();*/
 
+$request = Sonata\PageBundle\Request\RequestFactory::createFromGlobals(
+    'host_with_path_by_locale'
+);
+
 $kernel = new AppKernel('dev', true);
 $kernel->loadClassCache();
 
 //Request::enableHttpMethodParameterOverride();
-$request = Request::createFromGlobals();
+//$request = Request::createFromGlobals();
 
 $response = $kernel->handle($request);
 $response->send();