From 17de9b38003c3883dd1b4c9ecb7358204c6a0a44 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Sun, 3 May 2020 09:13:11 +0200 Subject: [PATCH] Remove unused code, add support for symfony 5 --- composer.json | 81 ++-- config/bootstrap.php | 12 +- config/bundles.php | 35 +- config/packages/dev/debug.yaml | 3 +- config/packages/dev/jms_serializer.yaml | 7 - config/packages/dev/php_translation.yaml | 10 +- config/packages/prod/doctrine.yaml | 35 +- config/packages/prod/jms_serializer.yaml | 6 - config/packages/prod/monolog.yaml | 5 +- config/packages/test/framework.yaml | 7 +- config/packages/test/monolog.yaml | 7 +- config/packages/test/web_profiler.yaml | 1 + config/routes.yaml | 136 ++----- config/services.yaml | 52 +-- src/AdminBundle/ChamiloAdminBundle.php | 14 - .../Resources/views/layout.html.twig | 44 --- .../Resources/views/standard_layout.html.twig | 373 ------------------ .../ChamiloClassificationBundle.php | 14 - .../Document/Category.php | 40 -- src/ClassificationBundle/Document/Tag.php | 40 -- src/ClassificationBundle/Entity/Category.php | 26 -- .../Entity/Collection.php | 26 -- src/ClassificationBundle/Entity/Context.php | 28 -- src/ClassificationBundle/Entity/Tag.php | 26 -- .../config/doctrine/Category.orm.xml | 27 -- .../config/doctrine/Collection.orm.xml | 32 -- .../Resources/config/doctrine/Context.orm.xml | 27 -- .../Resources/config/doctrine/Tag.orm.xml | 32 -- .../config/serializer/Document.Category.xml | 17 - .../config/serializer/Document.Tag.xml | 17 - .../config/serializer/Entity.Category.xml | 17 - .../config/serializer/Entity.Collection.xml | 17 - .../config/serializer/Entity.Context.xml | 17 - .../config/serializer/Entity.Tag.xml | 17 - src/ContactBundle/Admin/CategoryAdmin.php | 44 --- src/ContactBundle/ChamiloContactBundle.php | 14 - .../Controller/ContactController.php | 88 ----- .../ChamiloContactExtension.php | 24 -- src/ContactBundle/Entity/Category.php | 120 ------ .../Entity/CategoryTranslation.php | 70 ---- src/ContactBundle/Entity/Contact.php | 9 - src/ContactBundle/Form/Type/ContactType.php | 72 ---- src/ContactBundle/Resources/config/admin.yml | 9 - .../Resources/config/routing.yml | 3 - .../Resources/translations/messages.de.po | 29 -- .../Resources/translations/messages.en.po | 1 - .../Resources/translations/messages.es.po | 26 -- .../Resources/translations/messages.fr.po | 29 -- .../Resources/views/contact.html.twig | 11 - .../Resources/views/index.html.twig | 13 - src/FaqBundle/Admin/CategoryAdmin.php | 65 --- src/FaqBundle/Admin/QuestionAdmin.php | 71 ---- src/FaqBundle/ChamiloFaqBundle.php | 16 - src/FaqBundle/Controller/FaqController.php | 188 --------- .../ChamiloFaqExtension.php | 25 -- src/FaqBundle/Entity/Category.php | 179 --------- src/FaqBundle/Entity/CategoryTranslation.php | 117 ------ src/FaqBundle/Entity/Question.php | 209 ---------- src/FaqBundle/Entity/QuestionTranslation.php | 131 ------ .../Repository/CategoryRepository.php | 76 ---- .../Repository/QuestionRepository.php | 53 --- src/FaqBundle/Resources/config/admin.yml | 18 - src/FaqBundle/Resources/config/routing.yml | 12 - src/FaqBundle/Resources/config/services.yml | 3 - .../Resources/views/Faq/index.html.twig | 80 ---- .../Faq/index_without_collapse.html.twig | 10 - .../Faq/preview_category_partial.html.twig | 9 - .../Faq/preview_question_partial.html.twig | 11 - src/Kernel.php | 19 +- src/MediaBundle/ChamiloMediaBundle.php | 19 - src/MediaBundle/Entity/Gallery.php | 35 -- src/MediaBundle/Entity/GalleryHasMedia.php | 28 -- src/MediaBundle/Entity/GalleryItem.php | 30 -- src/MediaBundle/Entity/Media.php | 28 -- .../Resources/config/doctrine/Gallery.orm.xml | 24 -- .../config/doctrine/GalleryHasMedia.orm.xml | 24 -- .../Resources/config/doctrine/Media.orm.xml | 24 -- .../config/serializer/Entity.Gallery.xml | 17 - .../config/serializer/Entity.GalleryItem.xml | 17 - .../config/serializer/Entity.Media.xml | 17 - .../views/Block/block_gallery.html.twig | 62 --- .../ChamiloNotificationBundle.php | 14 - src/NotificationBundle/Entity/Message.php | 28 -- .../Resources/config/doctrine/Message.orm.xml | 24 -- .../config/serializer/Entity.Message.xml | 17 - src/PageBundle/ChamiloPageBundle.php | 14 - src/PageBundle/Controller/PageController.php | 352 ----------------- src/PageBundle/Entity/Block.php | 28 -- src/PageBundle/Entity/Page.php | 28 -- src/PageBundle/Entity/Site.php | 28 -- src/PageBundle/Entity/Snapshot.php | 28 -- .../Resources/config/doctrine/Block.orm.xml | 24 -- .../Resources/config/doctrine/Page.orm.xml | 24 -- .../Resources/config/doctrine/Site.orm.xml | 24 -- .../config/doctrine/Snapshot.orm.xml | 24 -- src/PageBundle/Resources/config/routing.yml | 3 - .../config/serializer/Entity.Block.xml | 11 - .../config/serializer/Entity.Page.xml | 11 - .../config/serializer/Entity.Site.xml | 11 - .../config/serializer/Entity.Snapshot.xml | 11 - src/PageBundle/Resources/config/services.yml | 19 - .../Resources/views/1column_layout.html.twig | 5 - .../Resources/views/2columns_layout.html.twig | 21 - .../views/Block/breadcrumb.html.twig | 21 - .../Resources/views/base_layout.html.twig | 186 --------- .../Resources/views/latest.html.twig | 4 - src/TimelineBundle/ChamiloTimelineBundle.php | 14 - src/TimelineBundle/Entity/Action.php | 28 -- src/TimelineBundle/Entity/ActionComponent.php | 28 -- src/TimelineBundle/Entity/Component.php | 28 -- src/TimelineBundle/Entity/Timeline.php | 28 -- .../Resources/config/doctrine/Action.orm.xml | 21 - .../config/doctrine/ActionComponent.orm.xml | 21 - .../config/doctrine/Component.orm.xml | 25 -- .../config/doctrine/Timeline.orm.xml | 19 - .../config/serializer/Entity.Action.xml | 14 - .../serializer/Entity.ActionComponent.xml | 14 - .../config/serializer/Entity.Component.xml | 14 - .../config/serializer/Entity.Timeline.xml | 14 - .../Resources/views/Block/timeline.html.twig | 90 ----- src/UserBundle/Admin/GroupAdmin.php | 18 - src/UserBundle/Admin/UserAdmin.php | 185 --------- src/UserBundle/Admin/UserField.php | 53 --- src/UserBundle/Admin/UserFieldValuesAdmin.php | 46 --- src/UserBundle/ChamiloUserBundle.php | 14 - .../ChamiloUserExtension.php | 25 -- src/UserBundle/Resources/config/admin.yml | 14 - src/UserBundle/Resources/config/routing.yml | 4 - src/UserBundle/Resources/config/services.yml | 13 - .../FOSUserBundle/Security/login.html.twig | 2 +- 130 files changed, 136 insertions(+), 4983 deletions(-) delete mode 100644 config/packages/dev/jms_serializer.yaml delete mode 100644 config/packages/prod/jms_serializer.yaml delete mode 100644 src/AdminBundle/ChamiloAdminBundle.php delete mode 100644 src/AdminBundle/Resources/views/layout.html.twig delete mode 100644 src/AdminBundle/Resources/views/standard_layout.html.twig delete mode 100644 src/ClassificationBundle/ChamiloClassificationBundle.php delete mode 100644 src/ClassificationBundle/Document/Category.php delete mode 100644 src/ClassificationBundle/Document/Tag.php delete mode 100644 src/ClassificationBundle/Entity/Category.php delete mode 100644 src/ClassificationBundle/Entity/Collection.php delete mode 100644 src/ClassificationBundle/Entity/Context.php delete mode 100644 src/ClassificationBundle/Entity/Tag.php delete mode 100644 src/ClassificationBundle/Resources/config/doctrine/Category.orm.xml delete mode 100644 src/ClassificationBundle/Resources/config/doctrine/Collection.orm.xml delete mode 100644 src/ClassificationBundle/Resources/config/doctrine/Context.orm.xml delete mode 100644 src/ClassificationBundle/Resources/config/doctrine/Tag.orm.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Document.Category.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Document.Tag.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Entity.Category.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Entity.Collection.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Entity.Context.xml delete mode 100644 src/ClassificationBundle/Resources/config/serializer/Entity.Tag.xml delete mode 100644 src/ContactBundle/Admin/CategoryAdmin.php delete mode 100644 src/ContactBundle/ChamiloContactBundle.php delete mode 100644 src/ContactBundle/Controller/ContactController.php delete mode 100644 src/ContactBundle/DependencyInjection/ChamiloContactExtension.php delete mode 100644 src/ContactBundle/Entity/Category.php delete mode 100644 src/ContactBundle/Entity/CategoryTranslation.php delete mode 100644 src/ContactBundle/Entity/Contact.php delete mode 100644 src/ContactBundle/Form/Type/ContactType.php delete mode 100644 src/ContactBundle/Resources/config/admin.yml delete mode 100644 src/ContactBundle/Resources/config/routing.yml delete mode 100644 src/ContactBundle/Resources/translations/messages.de.po delete mode 100644 src/ContactBundle/Resources/translations/messages.en.po delete mode 100644 src/ContactBundle/Resources/translations/messages.es.po delete mode 100644 src/ContactBundle/Resources/translations/messages.fr.po delete mode 100644 src/ContactBundle/Resources/views/contact.html.twig delete mode 100644 src/ContactBundle/Resources/views/index.html.twig delete mode 100644 src/FaqBundle/Admin/CategoryAdmin.php delete mode 100644 src/FaqBundle/Admin/QuestionAdmin.php delete mode 100644 src/FaqBundle/ChamiloFaqBundle.php delete mode 100644 src/FaqBundle/Controller/FaqController.php delete mode 100644 src/FaqBundle/DependencyInjection/ChamiloFaqExtension.php delete mode 100644 src/FaqBundle/Entity/Category.php delete mode 100644 src/FaqBundle/Entity/CategoryTranslation.php delete mode 100644 src/FaqBundle/Entity/Question.php delete mode 100644 src/FaqBundle/Entity/QuestionTranslation.php delete mode 100644 src/FaqBundle/Repository/CategoryRepository.php delete mode 100644 src/FaqBundle/Repository/QuestionRepository.php delete mode 100644 src/FaqBundle/Resources/config/admin.yml delete mode 100644 src/FaqBundle/Resources/config/routing.yml delete mode 100644 src/FaqBundle/Resources/config/services.yml delete mode 100644 src/FaqBundle/Resources/views/Faq/index.html.twig delete mode 100644 src/FaqBundle/Resources/views/Faq/index_without_collapse.html.twig delete mode 100644 src/FaqBundle/Resources/views/Faq/preview_category_partial.html.twig delete mode 100644 src/FaqBundle/Resources/views/Faq/preview_question_partial.html.twig delete mode 100644 src/MediaBundle/ChamiloMediaBundle.php delete mode 100644 src/MediaBundle/Entity/Gallery.php delete mode 100644 src/MediaBundle/Entity/GalleryHasMedia.php delete mode 100644 src/MediaBundle/Entity/GalleryItem.php delete mode 100644 src/MediaBundle/Entity/Media.php delete mode 100644 src/MediaBundle/Resources/config/doctrine/Gallery.orm.xml delete mode 100644 src/MediaBundle/Resources/config/doctrine/GalleryHasMedia.orm.xml delete mode 100644 src/MediaBundle/Resources/config/doctrine/Media.orm.xml delete mode 100644 src/MediaBundle/Resources/config/serializer/Entity.Gallery.xml delete mode 100644 src/MediaBundle/Resources/config/serializer/Entity.GalleryItem.xml delete mode 100644 src/MediaBundle/Resources/config/serializer/Entity.Media.xml delete mode 100644 src/MediaBundle/Resources/views/Block/block_gallery.html.twig delete mode 100644 src/NotificationBundle/ChamiloNotificationBundle.php delete mode 100644 src/NotificationBundle/Entity/Message.php delete mode 100644 src/NotificationBundle/Resources/config/doctrine/Message.orm.xml delete mode 100644 src/NotificationBundle/Resources/config/serializer/Entity.Message.xml delete mode 100644 src/PageBundle/ChamiloPageBundle.php delete mode 100644 src/PageBundle/Controller/PageController.php delete mode 100644 src/PageBundle/Entity/Block.php delete mode 100644 src/PageBundle/Entity/Page.php delete mode 100644 src/PageBundle/Entity/Site.php delete mode 100644 src/PageBundle/Entity/Snapshot.php delete mode 100644 src/PageBundle/Resources/config/doctrine/Block.orm.xml delete mode 100644 src/PageBundle/Resources/config/doctrine/Page.orm.xml delete mode 100644 src/PageBundle/Resources/config/doctrine/Site.orm.xml delete mode 100644 src/PageBundle/Resources/config/doctrine/Snapshot.orm.xml delete mode 100644 src/PageBundle/Resources/config/routing.yml delete mode 100644 src/PageBundle/Resources/config/serializer/Entity.Block.xml delete mode 100644 src/PageBundle/Resources/config/serializer/Entity.Page.xml delete mode 100644 src/PageBundle/Resources/config/serializer/Entity.Site.xml delete mode 100644 src/PageBundle/Resources/config/serializer/Entity.Snapshot.xml delete mode 100644 src/PageBundle/Resources/config/services.yml delete mode 100644 src/PageBundle/Resources/views/1column_layout.html.twig delete mode 100644 src/PageBundle/Resources/views/2columns_layout.html.twig delete mode 100644 src/PageBundle/Resources/views/Block/breadcrumb.html.twig delete mode 100644 src/PageBundle/Resources/views/base_layout.html.twig delete mode 100644 src/PageBundle/Resources/views/latest.html.twig delete mode 100644 src/TimelineBundle/ChamiloTimelineBundle.php delete mode 100644 src/TimelineBundle/Entity/Action.php delete mode 100644 src/TimelineBundle/Entity/ActionComponent.php delete mode 100644 src/TimelineBundle/Entity/Component.php delete mode 100644 src/TimelineBundle/Entity/Timeline.php delete mode 100644 src/TimelineBundle/Resources/config/doctrine/Action.orm.xml delete mode 100644 src/TimelineBundle/Resources/config/doctrine/ActionComponent.orm.xml delete mode 100644 src/TimelineBundle/Resources/config/doctrine/Component.orm.xml delete mode 100644 src/TimelineBundle/Resources/config/doctrine/Timeline.orm.xml delete mode 100644 src/TimelineBundle/Resources/config/serializer/Entity.Action.xml delete mode 100644 src/TimelineBundle/Resources/config/serializer/Entity.ActionComponent.xml delete mode 100644 src/TimelineBundle/Resources/config/serializer/Entity.Component.xml delete mode 100644 src/TimelineBundle/Resources/config/serializer/Entity.Timeline.xml delete mode 100644 src/TimelineBundle/Resources/views/Block/timeline.html.twig delete mode 100644 src/UserBundle/Admin/GroupAdmin.php delete mode 100644 src/UserBundle/Admin/UserAdmin.php delete mode 100644 src/UserBundle/Admin/UserField.php delete mode 100644 src/UserBundle/Admin/UserFieldValuesAdmin.php delete mode 100644 src/UserBundle/ChamiloUserBundle.php delete mode 100644 src/UserBundle/DependencyInjection/ChamiloUserExtension.php delete mode 100644 src/UserBundle/Resources/config/admin.yml delete mode 100644 src/UserBundle/Resources/config/routing.yml delete mode 100644 src/UserBundle/Resources/config/services.yml diff --git a/composer.json b/composer.json index 6f26a9637a..3c357792db 100755 --- a/composer.json +++ b/composer.json @@ -11,6 +11,14 @@ "docs": "https://github.com/chamilo/docs", "issues": "https://github.com/chamilo/chamilo-lms/issues" }, + "replace": { + "paragonie/random_compat": "2.*", + "symfony/polyfill-ctype": "*", + "symfony/polyfill-iconv": "*", + "symfony/polyfill-php56": "*", + "symfony/polyfill-php70": "*", + "symfony/polyfill-php71": "*" + }, "autoload": { "psr-4": { "Chamilo\\": "src/" @@ -42,6 +50,7 @@ "require": { "a2lix/translation-form-bundle": "^3.0", "antishov/doctrine-extensions-bundle": "~1.4", + "api-platform/api-pack": "^1.2", "apy/datagrid-bundle" : "dev-master", "beberlei/doctrineextensions": "^1.2", "brumann/polyfill-unserialize": "^1.0", @@ -50,7 +59,7 @@ "cocur/slugify": "^4.0", "doctrine/data-fixtures": "~1.0", "doctrine/dbal": "~2.10", - "doctrine/doctrine-bundle": "~1.9", + "doctrine/doctrine-bundle": "~2.0", "doctrine/doctrine-fixtures-bundle": "^3.0", "doctrine/doctrine-migrations-bundle": "~2.0", "doctrine/orm": "~2.7", @@ -75,19 +84,18 @@ "ezyang/htmlpurifier": "~4.12", "firebase/php-jwt": "^5.0", "friendsofsymfony/jsrouting-bundle": "~2.0", - "friendsofsymfony/rest-bundle": "^2.7", + "friendsofsymfony/rest-bundle": "dev-master", "graphp/algorithms": "~0.8", "graphp/graphviz": "~0.2", "gregwar/captcha-bundle": "^2.0", "jbroadway/urlify": "~1.1", "jeroendesloovere/vcard": "~1.7", "jimmiw/php-time-ago": "~3.0", - "jms/serializer-bundle": "^3.5", "kigkonsult/icalcreator": "~2.29", "knplabs/doctrine-behaviors": "~2.0", "knplabs/gaufrette": "~0.9", "knplabs/knp-components": "~2.0", - "knplabs/knp-menu-bundle": "^2.0|~3.0", + "knplabs/knp-menu-bundle": "~3.0", "knpuniversity/oauth2-client-bundle": "~2.0", "laminas/laminas-config": "~3.2", "laminas/laminas-feed": "~2.10", @@ -102,6 +110,7 @@ "masterminds/html5": "^2.0", "michelf/php-markdown": "~1.8", "mpdf/mpdf": "~8.0", + "nesbot/carbon": "^2.33", "oneup/flysystem-bundle": "~3.0", "oneup/uploader-bundle": "~3.0", "overblog/graphql-bundle": "~0.11", @@ -116,61 +125,39 @@ "sabre/vobject": "~4.2", "sensio/framework-extra-bundle": "~5.0", "sensiolabs/security-checker": "~6.0", - "simplethings/entity-audit-bundle": "^1.0", - "sonata-project/admin-bundle": "~3.0", - "sonata-project/block-bundle": "~3.0|~4.0", - "sonata-project/cache-bundle": "~2.0|~3.0", - "sonata-project/classification-bundle": "~3.0", - "sonata-project/core-bundle": "~3.0", - "sonata-project/datagrid-bundle": "^2.5|~3.0", - "sonata-project/doctrine-extensions": "~1.6", - "sonata-project/doctrine-orm-admin-bundle": "~3.0", - "sonata-project/easy-extends-bundle": "~2.5", - "sonata-project/exporter": "~2.0", - "sonata-project/formatter-bundle": "~4.0", - "sonata-project/intl-bundle": "~2.5", - "sonata-project/media-bundle": "~3.0", - "sonata-project/notification-bundle": "~3.0", - "sonata-project/page-bundle": "~3.0", - "sonata-project/seo-bundle": "~2.7", - "sonata-project/timeline-bundle" : "~3.0", - "sonata-project/user-bundle": "~4.0", - "stephpy/timeline-bundle": "~3.0", "sunra/php-simple-html-dom-parser": "~1.5", "symfony/apache-pack": "^1.0", - "symfony/asset": "^4.0|^5.0", - "symfony/cache": "^4.0|^5.0", + "symfony/asset": "^5.0", "symfony/dotenv": "^5.0", - "symfony/expression-language": "^4.0|^5.0", + "symfony/expression-language": "^5.0", "symfony/flex": "^1.6", - "symfony/form": "^4.0|^5.0", - "symfony/framework-bundle": "^4.0|^5.0", - "symfony/http-kernel": "^4.0|^5.0", + "symfony/form": "^5.0", + "symfony/http-kernel": "^5.0", + "symfony/intl": "^5.0", "symfony/mailer": "^5.0", "symfony/monolog-bundle": "^3.1", "symfony/polyfill-apcu": "^1.9", "symfony/requirements-checker": "^1.1", - "symfony/security-bundle": "^4.0|^5.0", - "symfony/templating" : "^4.0|^5.0", - "symfony/translation": "^4.0|^5.0", - "symfony/twig-bundle": "^4.0|^5.0", - "symfony/validator": "^4.0|^5.0", + "symfony/security-bundle": "^5.0", + "symfony/string": "5.0.*", + "symfony/templating" : "^5.0", + "symfony/translation": "^5.0", + "symfony/twig-pack": "^1.0", + "symfony/validator": "^5.0", "symfony/webpack-encore-bundle": "^1.7", "symfony/yaml": "^5.0", "tgalopin/html-sanitizer-bundle": "^1.1", "twig/extensions": "^1.5", "vich/uploader-bundle": "^1.13", - "webit/eval-math": "~1.0", - "api-platform/api-pack": "^1.2", - "nesbot/carbon": "^2.33" + "webit/eval-math": "~1.0" }, "config": { - "component-dir": "public/assets" + "component-dir": "public/assets", + "sort-packages": true }, "require-dev": { "behat/behat": "@stable", "behat/mink": "dev-master", - "behat/mink-extension": "@stable", "behat/mink-goutte-driver": "@stable", "behat/mink-selenium2-driver": "@stable", "php-translation/symfony-bundle": "^0.12", @@ -191,12 +178,12 @@ ], "auto-scripts": { "cache:clear": "symfony-cmd", - "assets:install %PUBLIC_DIR%": "symfony-cmd", - "security-checker security:check": "script", - "requirements-checker": "script" + "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "install-ckeditor": { - "ckeditor:install %PUBLIC_DIR%/libs/ckeditor --clear=keep --tag=4.13.0 --exclude=samples --exclude=adapters ": "symfony-cmd" + "ckeditor:install %PUBLIC_DIR%/libs/ckeditor --clear=keep --tag=4.13.0 --exclude=samples --exclude=adapters ": "symfony-cmd", + "security-checker security:check": "script", + "requirements-checker": "script" }, "post-install-cmd": [ "@auto-scripts", @@ -211,5 +198,11 @@ "pre-update-cmd": [ ], "phpcs": "phpcs --standard=.php_cs.dist" + }, + "extra": { + "symfony": { + "allow-contrib": false, + "require": "5.0.*" + } } } diff --git a/config/bootstrap.php b/config/bootstrap.php index 976a776397..8853e9c8f3 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -4,14 +4,14 @@ use Symfony\Component\Dotenv\Dotenv; require dirname(__DIR__).'/vendor/autoload.php'; +if (!class_exists(Dotenv::class)) { + throw new LogicException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); +} // Load cached env vars if the .env.local.php file exists // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) -if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV']) { - foreach ($env as $k => $v) { - $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); - } -} elseif (!class_exists(Dotenv::class)) { - throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); +// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) +if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { + (new Dotenv(false))->populate($env); } else { // load all the .env files (new Dotenv(false))->loadEnv(dirname(__DIR__).'/.env'); diff --git a/config/bundles.php b/config/bundles.php index 097a13c198..2dcfc9726c 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -8,60 +8,28 @@ return [ Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Sonata\EasyExtendsBundle\SonataEasyExtendsBundle::class => ['all' => true], - Sonata\DatagridBundle\SonataDatagridBundle::class => ['all' => true], - Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], - Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true], - FOS\UserBundle\FOSUserBundle::class => ['all' => true], - Sonata\UserBundle\SonataUserBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle::class => ['all' => true], - Sonata\SeoBundle\SonataSeoBundle::class => ['all' => true], - Sonata\NotificationBundle\SonataNotificationBundle::class => ['all' => true], - Sonata\PageBundle\SonataPageBundle::class => ['all' => true], - Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true], - Sonata\ClassificationBundle\SonataClassificationBundle::class => ['all' => true], - Spy\TimelineBundle\SpyTimelineBundle::class => ['all' => true], - Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true], - Sonata\TimelineBundle\SonataTimelineBundle::class => ['all' => true], - JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - Sonata\MediaBundle\SonataMediaBundle::class => ['all' => true], FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true], FOS\RestBundle\FOSRestBundle::class => ['all' => true], Chamilo\CoreBundle\ChamiloCoreBundle::class => ['all' => true], Chamilo\ThemeBundle\ChamiloThemeBundle::class => ['all' => true], Chamilo\SkillBundle\ChamiloSkillBundle::class => ['all' => true], Chamilo\CourseBundle\ChamiloCourseBundle::class => ['all' => true], - Chamilo\AdminBundle\ChamiloAdminBundle::class => ['all' => true], - Chamilo\FaqBundle\ChamiloFaqBundle::class => ['all' => true], - Chamilo\ContactBundle\ChamiloContactBundle::class => ['all' => true], Chamilo\TicketBundle\ChamiloTicketBundle::class => ['all' => true], - Chamilo\PageBundle\ChamiloPageBundle::class => ['all' => true], - Chamilo\UserBundle\ChamiloUserBundle::class => ['all' => true], - Chamilo\ClassificationBundle\ChamiloClassificationBundle::class => ['all' => true], - Chamilo\MediaBundle\ChamiloMediaBundle::class => ['all' => true], - Chamilo\NotificationBundle\ChamiloNotificationBundle::class => ['all' => true], Chamilo\SettingsBundle\ChamiloSettingsBundle::class => ['all' => true], - Chamilo\TimelineBundle\ChamiloTimelineBundle::class => ['all' => true], Chamilo\GraphQlBundle\ChamiloGraphQlBundle::class => ['all' => true], Chamilo\LtiBundle\ChamiloLtiBundle::class => ['all' => true], Sylius\Bundle\SettingsBundle\SyliusSettingsBundle::class => ['all' => true], Oneup\FlysystemBundle\OneupFlysystemBundle::class => ['all' => true], - Sonata\CacheBundle\SonataCacheBundle::class => ['all' => true], - Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true], A2lix\TranslationFormBundle\A2lixTranslationFormBundle::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], - SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], HtmlSanitizer\Bundle\HtmlSanitizerBundle::class => ['all' => true], @@ -70,8 +38,7 @@ return [ KnpU\OAuth2ClientBundle\KnpUOAuth2ClientBundle::class => ['all' => true], Translation\Bundle\TranslationBundle::class => ['all' => true], Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], - Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], ]; diff --git a/config/packages/dev/debug.yaml b/config/packages/dev/debug.yaml index 26521cf681..26d4e53d2c 100644 --- a/config/packages/dev/debug.yaml +++ b/config/packages/dev/debug.yaml @@ -1,5 +1,4 @@ debug: # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. # See the "server:dump" command to start a new server. - #dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" - dump_destination: null + dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" diff --git a/config/packages/dev/jms_serializer.yaml b/config/packages/dev/jms_serializer.yaml deleted file mode 100644 index f946041021..0000000000 --- a/config/packages/dev/jms_serializer.yaml +++ /dev/null @@ -1,7 +0,0 @@ -jms_serializer: - visitors: - json_serialization: - options: - - JSON_PRETTY_PRINT - - JSON_UNESCAPED_SLASHES - - JSON_PRESERVE_ZERO_FRACTION diff --git a/config/packages/dev/php_translation.yaml b/config/packages/dev/php_translation.yaml index 53398fbca0..b5b7b970b7 100644 --- a/config/packages/dev/php_translation.yaml +++ b/config/packages/dev/php_translation.yaml @@ -1,5 +1,5 @@ -translation: - symfony_profiler: - enabled: true - webui: - enabled: true +#translation: +# symfony_profiler: +# enabled: true +# webui: +# enabled: true diff --git a/config/packages/prod/doctrine.yaml b/config/packages/prod/doctrine.yaml index 2f16f0fdea..efc36f449d 100644 --- a/config/packages/prod/doctrine.yaml +++ b/config/packages/prod/doctrine.yaml @@ -1,26 +1,27 @@ doctrine: orm: + auto_generate_proxy_classes: false metadata_cache_driver: - type: service - id: doctrine.system_cache_provider + type: pool + pool: doctrine.system_cache_pool query_cache_driver: - type: service - id: doctrine.system_cache_provider + type: pool + pool: doctrine.system_cache_pool result_cache_driver: - type: service - id: doctrine.result_cache_provider + type: pool + pool: doctrine.result_cache_pool -services: - doctrine.result_cache_provider: - class: Symfony\Component\Cache\DoctrineProvider - public: false - arguments: - - '@doctrine.result_cache_pool' - doctrine.system_cache_provider: - class: Symfony\Component\Cache\DoctrineProvider - public: false - arguments: - - '@doctrine.system_cache_pool' +#services: +# doctrine.result_cache_provider: +# class: Symfony\Component\Cache\DoctrineProvider +# public: false +# arguments: +# - '@doctrine.result_cache_pool' +# doctrine.system_cache_provider: +# class: Symfony\Component\Cache\DoctrineProvider +# public: false +# arguments: +# - '@doctrine.system_cache_pool' framework: cache: diff --git a/config/packages/prod/jms_serializer.yaml b/config/packages/prod/jms_serializer.yaml deleted file mode 100644 index e97b3b4c3f..0000000000 --- a/config/packages/prod/jms_serializer.yaml +++ /dev/null @@ -1,6 +0,0 @@ -#jms_serializer: -# visitors: -# json: -# options: -# - JSON_UNESCAPED_SLASHES -# - JSON_PRESERVE_ZERO_FRACTION diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml index 1677234d01..bfe69c0156 100644 --- a/config/packages/prod/monolog.yaml +++ b/config/packages/prod/monolog.yaml @@ -4,9 +4,8 @@ monolog: type: fingers_crossed action_level: error handler: nested - excluded_404s: - # regex: exclude all 404 errors from the logs - - ^/ + excluded_http_codes: [404, 405] + buffer_size: 50 # How many messages should be saved? Prevent memory leaks nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" diff --git a/config/packages/test/framework.yaml b/config/packages/test/framework.yaml index 8aa270e9bf..d051c84008 100644 --- a/config/packages/test/framework.yaml +++ b/config/packages/test/framework.yaml @@ -1,5 +1,4 @@ framework: - test: ~ - # Uncomment this section if you're using sessions - #session: - # storage_id: session.storage.mock_file + test: true + session: + storage_id: session.storage.mock_file diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml index 2762653c82..fc40641dc6 100644 --- a/config/packages/test/monolog.yaml +++ b/config/packages/test/monolog.yaml @@ -1,7 +1,12 @@ monolog: handlers: main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug - channels: ["!event"] diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml index 4b93142d40..154ed89317 100644 --- a/config/packages/test/web_profiler.yaml +++ b/config/packages/test/web_profiler.yaml @@ -1,5 +1,6 @@ web_profiler: toolbar: false intercept_redirects: false + framework: profiler: {collect: false} diff --git a/config/routes.yaml b/config/routes.yaml index 46ac47b1a0..a94e42f3f7 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,20 +1,6 @@ logout: path: /logout -_admin: - resource: routes/sonata_admin.yaml - prefix: /administration - -sonata_admin_redirect: - path: /administration/dashboard - -sonata_admin_my_dashboard: - path: /administration - controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction - defaults: - route: sonata_admin_dashboard - permanent: false - sonata_user_admin_security_logout: path: /logout @@ -22,95 +8,51 @@ oneup_uploader: resource: . type: uploader -#resources: -# type: rest -# prefix: /api/{tool}/{type} -# resource: Chamilo\CoreBundle\Controller\ResourceApiController - -# Resources - -#app_document: -# resource: | -# alias: app.document -# path: /resource/documents -# form: Chamilo\CoreBundle\Form\Type\DocumentType -# type: sylius.resource +legacy_main: + path: /main/{name} + defaults: {_controller: 'ChamiloCoreBundle:Legacy:classic'} + requirements: + name: .+ -#app_document_index: -# path: /courses/{course}/resource/documents/ -# methods: [GET, POST] -# defaults: -# _controller: Chamilo\CoreBundle\Controller\ResourceController:indexAction -# _sylius: -# template: ChamiloCoreBundle:Document:show.html.twig +legacy_plugin: + path: /plugin/{name} + defaults: {_controller: 'ChamiloCoreBundle:Legacy:plugin'} + requirements: + name: .+ -# Create a folder -#app_document_create: -# path: /courses/{course}/resource/documents/new -# methods: [GET, POST] -# defaults: -# _controller: app.controller.document:createAction -# _sylius: -# template: ChamiloCoreBundle:Document:create.html.twig -# form: Chamilo\CoreBundle\Form\Type\DocumentType +# web url shortcuts for legacy templates +web.ajax: + path: main/inc/ajax/ -# Create a document -#app_document_create_document: -# path: /courses/{course}/resource/documents/new_document -# methods: [GET, POST] -# defaults: -# _controller: app.controller.document:createDocumentAction -# _sylius: -# template: ChamiloCoreBundle:Document:create.html.twig -# form: Chamilo\CoreBundle\Form\Type\DocumentType -# -#app_document_show: -# path: /courses/{course}/resource/documents/{id} -# methods: [GET] -# defaults: -# _controller: app.controller.document:showAction -# _sylius: -# template: ChamiloCoreBundle:Document:show.html.twig -# -#app_document_update: -# path: /courses/{course}/resource/documents/{id}/edit -# methods: [GET, PUT, PATCH] -# defaults: -# _controller: app.controller.document:updateAction -# _sylius: -# template: ChamiloCoreBundle:Document:update.html.twig -# form: Chamilo\CoreBundle\Form\Type\DocumentType -# -#app_document_delete: -# path: /courses/{course}/resource/documents/{id} -# methods: [DELETE] -# defaults: -# _controller: app.controller.document:deleteAction +web.main: + path: main/ -#admin_dashboard: -# pattern: /administration/ -# defaults: -# _controller: FrameworkBundle:Redirect:redirect -# route: sonata_admin_dashboard -# permanent: true # this for 301 +# Core controllers +core_admin: + resource: '@ChamiloCoreBundle/Controller/Admin' + type: annotation + prefix: /admin -#admin_without_locale: -# pattern: /administration -# defaults: -# _controller: FrameworkBundle:Redirect:redirect -# route: sonata_admin_dashboard -# permanent: true # this for 301 - -#admin_dashboard_without_locale: -# pattern: /administration/dashboard -# defaults: -# _controller: FrameworkBundle:Redirect:redirect -# route: sonata_admin_dashboard -# permanent: true -#_api: -# resource: routing_api.yml -# prefix: /api +#resources: +# type: rest +# prefix: /api/{tool}/{type} +# resource: Chamilo\CoreBundle\Controller\ResourceApiController #liip_theme: # resource: "@LiipThemeBundle/Resources/config/routing.xml" # prefix: /theme + +# Redirects /url/ to /url always located at the end +#remove_trailing_slash: +# path: /{url} +# defaults: {_controller: 'ChamiloCoreBundle:Redirecting:removeTrailingSlash'} +# requirements: +# url: .*/$ +# _method: GET + +chamilo_graphql: + resource: "@ChamiloGraphQlBundle/Resources/config/routing.yaml" + +chamilo_lti: + resource: "@ChamiloLtiBundle/Resources/config/routing.yml" + diff --git a/config/services.yaml b/config/services.yaml index e419c47407..677e3ca354 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,7 +1,6 @@ # 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: -# container.dumper.inline_factories: true app_env: '%env(APP_ENV)%' password_encryption: '%env(APP_ENCRYPT_METHOD)%' secret: '%env(APP_SECRET)%' @@ -11,10 +10,10 @@ parameters: form: resources: - 'GeneratorBundle::fields.html.twig' - container.build_id: ~ course_info_is_not_editable: false - sonata_media.cdn.host: '/var/upload/media/' - 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;' + +# sonata_media.cdn.host: '/var/upload/media/' +# 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: '%env(APP_URL_APPEND)%' # asset.request_context.base_path: '%env(APP_URL_APPEND)%' @@ -45,8 +44,6 @@ services: public: true # Allows optimizing the container by removing unused services; this also means # fetching services directly from the container via $container->get() won't work. # The best practice is to be explicit about your dependencies anyway. - bind: - $passwordEncrypt: '%password_encryption%' Chamilo\CoreBundle\Component\Utils\Glide: arguments: @@ -56,18 +53,13 @@ services: # makes classes in src/ available to be used as services # this creates a service per class whose id is the fully-qualified class name - Chamilo\PageBundle\: - resource: '../src/PageBundle/*' - exclude: '../src/PageBundle/{Entity,Migrations,Tests}' - public: true - Vich\UploaderBundle\Naming\SubdirDirectoryNamer: public: true Chamilo\CoreBundle\Controller\ResourceController: arguments: - '@Chamilo\CoreBundle\Repository\ResourceFactory' - - '@Chamilo\CoreBundle\Block\BreadcrumbBlockService' +# - '@Chamilo\CoreBundle\Block\BreadcrumbBlockService' Symfony\Component\Mailer\Mailer: public: true @@ -83,32 +75,6 @@ services: chamilo_core.hook_factory: class: 'Chamilo\CoreBundle\Hook\HookFactory' - # makes classes in src/ available to be used as services - # this creates a service per class whose id is the fully-qualified class name - AdminBundle\: - resource: '../src/AdminBundle/*' - # you can exclude directories or files - # but if a service is unused, it's removed anyway - exclude: '../src/AdminBundle/{ChamiloAdminBundle.php,Entity,Repository,Tests}' - - ClassificationBundle\: - resource: '../src/ClassificationBundle/*' - # you can exclude directories or files - # but if a service is unused, it's removed anyway - exclude: '../src/ClassificationBundle/{ChamiloClassificationBundle.php,Entity,Admin,Document,Repository,Tests}' - - ContactBundle\: - resource: '../src/ContactBundle/*' - # you can exclude directories or files - # but if a service is unused, it's removed anyway - exclude: '../src/ContactBundle/{ChamiloContactBundle.php,Entity,Admin,Controller,DependencyInjection,Form,Repository,Tests}' - - Chamilo\UserBundle\: - resource: '../src/UserBundle/*' - # you can exclude directories or files - # but if a service is unused, it's removed anyway - exclude: '../src/UserBundle/{Admin,ChamiloUserBundle.php,Security/FOSUBUserProvider.php,DependencyInjection,Form,EventListener,Entity,Repository}' - chamilo_lti_utils: class: Chamilo\LtiBundle\Util\Utils arguments: ['@chamilo.settings.manager'] @@ -122,13 +88,14 @@ services: class: APY\DataGridBundle\Grid\GridRegistry public: true + sylius_settings: driver: doctrine/orm # Doctrine audit -sonata_doctrine_orm_admin: - audit: - force: false # Audits are set in the admin.yml files with audit:true +#sonata_doctrine_orm_admin: +# audit: +# force: false # Audits are set in the admin.yml files with audit:true # Grid default template apy_data_grid: @@ -161,5 +128,4 @@ cocur_slugify: imports: - {resource: ../src/CoreBundle/Resources/config/services.yml} - - {resource: ../src/PageBundle/Resources/config/services.yml} -# - {resource: ../vendor/knplabs/doctrine-behaviors/config/orm-services.yml} +# - {resource: ../src/PageBundle/Resources/config/services.yml} diff --git a/src/AdminBundle/ChamiloAdminBundle.php b/src/AdminBundle/ChamiloAdminBundle.php deleted file mode 100644 index ad05a170af..0000000000 --- a/src/AdminBundle/ChamiloAdminBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -#} - {##} - {##} - {##} - {##} - -{#{% endblock %}#} - -{#{% block javascripts %}#} - {#{{ parent() }}#} - - {##} - {##} - {##} - {##} - {##} - {##} - {##} - -{#{% endblock %}#} - -{#{% block footer %}#} -{#{% endblock %}#} diff --git a/src/AdminBundle/Resources/views/standard_layout.html.twig b/src/AdminBundle/Resources/views/standard_layout.html.twig deleted file mode 100644 index b413dd8186..0000000000 --- a/src/AdminBundle/Resources/views/standard_layout.html.twig +++ /dev/null @@ -1,373 +0,0 @@ -{# - -This file is part of the Sonata package. - -(c) Thomas Rabaix - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. - -#} - -{%- set _preview = block('preview') is defined ? block('preview')|trim : null %} -{% set _form = block('form') is defined ? block('form')|trim : null %} -{% set _show = block('show') is defined ? block('show')|trim : null %} -{% set _list_table = block('list_table') is defined ? block('list_table')|trim : null %} -{% set _list_filters = block('list_filters') is defined ? block('list_filters')|trim : null %} -{% set _tab_menu = block('tab_menu') is defined ? block('tab_menu')|trim : null %} -{% set _content = block('content') is defined ? block('content')|trim : null %} -{% set _title = block('title') is defined ? block('title')|trim : null %} -{% set _breadcrumb = block('breadcrumb') is defined ? block('breadcrumb')|trim : null %} -{% set _actions = block('actions') is defined ? block('actions')|trim : null %} -{% set _navbar_title = block('navbar_title') is defined ? block('navbar_title')|trim : null %} -{% set _list_filters_actions = block('list_filters_actions') is defined ? block('list_filters_actions')|trim : null -%} - - - - - {% block meta_tags %} - - - - {% endblock %} - - - - {% block stylesheets %} - {% for stylesheet in sonata_admin.adminPool.getOption('stylesheets', []) %} - - {% endfor %} - {% endblock %} - - {% block javascripts %} - {% block sonata_javascript_config %} - {% endblock %} - - {% block sonata_javascript_pool %} - {% for javascript in sonata_admin.adminPool.getOption('javascripts', []) %} - - {% endfor %} - {% endblock %} - - {# localize moment #} - {% set localeForMoment = canonicalize_locale_for_moment() %} - {% if localeForMoment %} - - {% endif %} - - {# localize select2 #} - {% if sonata_admin.adminPool.getOption('use_select2') %} - {% set localeForSelect2 = canonicalize_locale_for_select2() %} - {% if localeForSelect2 %} - - {% endif %} - {% endif %} - {% endblock %} - - - {% block sonata_head_title %} - {{ 'Admin'|trans({}, 'SonataAdminBundle') }} - - {% if _title is not empty %} - {{ _title|striptags|raw }} - {% else %} - {% if action is defined %} - - - {% for menu in breadcrumbs_builder.breadcrumbs(admin, action) %} - {% if not loop.first %} - {% if loop.index != 2 %} - > - {% endif %} - - {%- set translation_domain = menu.extra('translation_domain', 'messages') -%} - {%- set label = menu.label -%} - {%- if translation_domain is not same as(false) -%} - {%- set label = label|trans(menu.extra('translation_params', {}), translation_domain) -%} - {%- endif -%} - - {{ label }} - {% endif %} - {% endfor %} - {% endif %} - {% endif %} - {% endblock %} - - - - -
- - {% block sonata_header %} -
- {% block sonata_header_noscript_warning %} - - {% endblock %} - {% block logo %} - {% apply spaceless %} - - {% endapply %} - {% endblock %} - {% block sonata_nav %} - - {% endblock sonata_nav %} -
- {% endblock sonata_header %} - - {% block sonata_wrapper %} - {% block sonata_left_side %} - - {% endblock sonata_left_side %} - -
- {% block sonata_page_content %} -
- - {% block sonata_page_content_header %} - {% block sonata_page_content_nav %} - {% if _navbar_title is not empty - or _tab_menu is not empty - or _actions is not empty - or _list_filters_actions is not empty - %} - - {% endif %} - {% endblock sonata_page_content_nav %} - {% endblock sonata_page_content_header %} -
- -
- {% block sonata_admin_content %} - - {% block notice %} - {% include '@SonataCore/FlashMessage/render.html.twig' %} - {% endblock notice %} - - {% if _preview is not empty %} -
{{ _preview|raw }}
- {% endif %} - - {% if _content is not empty %} -
{{ _content|raw }}
- {% endif %} - - {% if _show is not empty %} -
{{ _show|raw }}
- {% endif %} - - {% if _form is not empty %} -
{{ _form|raw }}
- {% endif %} - - {% if _list_filters is not empty %} -
- {{ _list_filters|raw }} -
- {% endif %} - - {% if _list_table is not empty %} -
- {{ _list_table|raw }} -
- {% endif %} - {% endblock sonata_admin_content %} -
- {% endblock sonata_page_content %} -
- {% endblock sonata_wrapper %} -
- -{% if sonata_admin.adminPool.getOption('use_bootlint') %} - {% block bootlint %} - {# Bootlint - https://github.com/twbs/bootlint#in-the-browser #} - - {% endblock %} -{% endif %} - - - diff --git a/src/ClassificationBundle/ChamiloClassificationBundle.php b/src/ClassificationBundle/ChamiloClassificationBundle.php deleted file mode 100644 index e0ce8a5782..0000000000 --- a/src/ClassificationBundle/ChamiloClassificationBundle.php +++ /dev/null @@ -1,14 +0,0 @@ - project. - * - * (c) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Chamilo\ClassificationBundle\Document; - -use Sonata\ClassificationBundle\Document\BaseCategory as BaseCategory; - -/** - * This file has been generated by the EasyExtends bundle ( http://sonata-project.org/bundles/easy-extends ). - * - * References : - * working with object : http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html - * - * @author - */ -class Category extends BaseCategory -{ - /** - * @var int - */ - protected $id; - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } -} diff --git a/src/ClassificationBundle/Document/Tag.php b/src/ClassificationBundle/Document/Tag.php deleted file mode 100644 index 926c69d7bf..0000000000 --- a/src/ClassificationBundle/Document/Tag.php +++ /dev/null @@ -1,40 +0,0 @@ - project. - * - * (c) - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Chamilo\ClassificationBundle\Document; - -use Sonata\ClassificationBundle\Document\BaseTag as BaseTag; - -/** - * This file has been generated by the EasyExtends bundle ( http://sonata-project.org/bundles/easy-extends ). - * - * References : - * working with object : http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/working-with-objects.html - * - * @author - */ -class Tag extends BaseTag -{ - /** - * @var int - */ - protected $id; - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } -} diff --git a/src/ClassificationBundle/Entity/Category.php b/src/ClassificationBundle/Entity/Category.php deleted file mode 100644 index 48eefc89b5..0000000000 --- a/src/ClassificationBundle/Entity/Category.php +++ /dev/null @@ -1,26 +0,0 @@ -id; - } -} diff --git a/src/ClassificationBundle/Entity/Collection.php b/src/ClassificationBundle/Entity/Collection.php deleted file mode 100644 index ceae89a852..0000000000 --- a/src/ClassificationBundle/Entity/Collection.php +++ /dev/null @@ -1,26 +0,0 @@ -id; - } -} diff --git a/src/ClassificationBundle/Entity/Context.php b/src/ClassificationBundle/Entity/Context.php deleted file mode 100644 index ad5db4afb9..0000000000 --- a/src/ClassificationBundle/Entity/Context.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/ClassificationBundle/Entity/Tag.php b/src/ClassificationBundle/Entity/Tag.php deleted file mode 100644 index 7b46bb37dc..0000000000 --- a/src/ClassificationBundle/Entity/Tag.php +++ /dev/null @@ -1,26 +0,0 @@ -id; - } -} diff --git a/src/ClassificationBundle/Resources/config/doctrine/Category.orm.xml b/src/ClassificationBundle/Resources/config/doctrine/Category.orm.xml deleted file mode 100644 index 0d035318c3..0000000000 --- a/src/ClassificationBundle/Resources/config/doctrine/Category.orm.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/doctrine/Collection.orm.xml b/src/ClassificationBundle/Resources/config/doctrine/Collection.orm.xml deleted file mode 100644 index dae220081a..0000000000 --- a/src/ClassificationBundle/Resources/config/doctrine/Collection.orm.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/doctrine/Context.orm.xml b/src/ClassificationBundle/Resources/config/doctrine/Context.orm.xml deleted file mode 100644 index 7102a376dd..0000000000 --- a/src/ClassificationBundle/Resources/config/doctrine/Context.orm.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/doctrine/Tag.orm.xml b/src/ClassificationBundle/Resources/config/doctrine/Tag.orm.xml deleted file mode 100644 index cb0917ba3b..0000000000 --- a/src/ClassificationBundle/Resources/config/doctrine/Tag.orm.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Document.Category.xml b/src/ClassificationBundle/Resources/config/serializer/Document.Category.xml deleted file mode 100644 index cf0d800870..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Document.Category.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Document.Tag.xml b/src/ClassificationBundle/Resources/config/serializer/Document.Tag.xml deleted file mode 100644 index c16b7dab5d..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Document.Tag.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Entity.Category.xml b/src/ClassificationBundle/Resources/config/serializer/Entity.Category.xml deleted file mode 100644 index 719e5ff2c9..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Entity.Category.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Entity.Collection.xml b/src/ClassificationBundle/Resources/config/serializer/Entity.Collection.xml deleted file mode 100644 index 8ba530fa45..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Entity.Collection.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Entity.Context.xml b/src/ClassificationBundle/Resources/config/serializer/Entity.Context.xml deleted file mode 100644 index eb60e1754c..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Entity.Context.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ClassificationBundle/Resources/config/serializer/Entity.Tag.xml b/src/ClassificationBundle/Resources/config/serializer/Entity.Tag.xml deleted file mode 100644 index b72ac97027..0000000000 --- a/src/ClassificationBundle/Resources/config/serializer/Entity.Tag.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/ContactBundle/Admin/CategoryAdmin.php b/src/ContactBundle/Admin/CategoryAdmin.php deleted file mode 100644 index d2cfed0cc8..0000000000 --- a/src/ContactBundle/Admin/CategoryAdmin.php +++ /dev/null @@ -1,44 +0,0 @@ -add('headline', null, array('identifier' => true)) - //->add('name', null, array('identifier' => true)) - ->add('translations', null, ['identifier' => true]) - ->add('email', null, ['identifier' => true]) - ; - } - - protected function configureFormFields(FormMapper $formMapper) - { - $formMapper - //->add('name') - ->add('translations', TranslationsType::class, []) - ->add('email') - ; - } - - protected function configureDatagridFilters(DatagridMapper $datagridMapper) - { - $datagridMapper - ->add('translations', null, ['identifier' => true]) - ->add('email', null, ['identifier' => true]) - ; - } -} diff --git a/src/ContactBundle/ChamiloContactBundle.php b/src/ContactBundle/ChamiloContactBundle.php deleted file mode 100644 index 58aa5daab1..0000000000 --- a/src/ContactBundle/ChamiloContactBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -getUser(); - $data = []; - - if ($user) { - $data = [ - 'firstname' => $user->getFirstname(), - 'lastname' => $user->getFirstname(), - 'email' => $user->getEmail(), - ]; - } - - $form = $this->createForm(ContactType::class, $data); - - if ($request->isMethod('POST')) { - $form->bind($request); - - $em = $this->getDoctrine()->getManager(); - - $category = $form->get('category')->getData(); - /** @var Category $category */ - $category = $em->getRepository('ChamiloContactBundle:Category')->find($category); - - if ($form->isValid()) { - $message = new Email(); - $message->subject($form->get('subject')->getData()) - ->from($form->get('email')->getData()) - ->to($category->getEmail()) - ->setBody( - $this->renderView( - '@ChamiloContact/contact.html.twig', - [ - 'ip' => $request->getClientIp(), - 'firstname' => $form->get('firstname')->getData(), - 'lastname' => $form->get('lastname')->getData(), - 'subject' => $form->get('subject')->getData(), - 'email' => $form->get('email')->getData(), - 'message' => $form->get('message')->getData(), - ] - ) - ); - - $mailer->send($message); - - $this->addFlash( - 'success', - $this->get('translator')->trans('Your email has been sent! Thanks!') - ); - - return $this->redirect($this->generateUrl('contact')); - } - } - - return $this->render( - '@ChamiloContact/index.html.twig', - [ - 'form' => $form->createView(), - ] - ); - } -} diff --git a/src/ContactBundle/DependencyInjection/ChamiloContactExtension.php b/src/ContactBundle/DependencyInjection/ChamiloContactExtension.php deleted file mode 100644 index 1e68c8cf51..0000000000 --- a/src/ContactBundle/DependencyInjection/ChamiloContactExtension.php +++ /dev/null @@ -1,24 +0,0 @@ -load('admin.yml'); - } -} diff --git a/src/ContactBundle/Entity/Category.php b/src/ContactBundle/Entity/Category.php deleted file mode 100644 index a308a16560..0000000000 --- a/src/ContactBundle/Entity/Category.php +++ /dev/null @@ -1,120 +0,0 @@ -proxyCurrentLocaleTranslation($method, $arguments); - } - - /** - * @return string - */ - public function __toString() - { - return (string) $this->getName(); - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * - * @return Category - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } - - /** - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * @param string $email - * - * @return Category - */ - public function setEmail($email) - { - $this->email = $email; - - return $this; - } - - /** - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * @param int $id - * - * @return Category - */ - public function setId($id) - { - $this->id = $id; - - return $this; - } -} diff --git a/src/ContactBundle/Entity/CategoryTranslation.php b/src/ContactBundle/Entity/CategoryTranslation.php deleted file mode 100644 index 7636ed2a90..0000000000 --- a/src/ContactBundle/Entity/CategoryTranslation.php +++ /dev/null @@ -1,70 +0,0 @@ -name; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @return CategoryTranslation - */ - public function setName($name) - { - $this->name = $name; - - return $this; - } -} diff --git a/src/ContactBundle/Entity/Contact.php b/src/ContactBundle/Entity/Contact.php deleted file mode 100644 index 6896dd4000..0000000000 --- a/src/ContactBundle/Entity/Contact.php +++ /dev/null @@ -1,9 +0,0 @@ -add( - 'category', - EntityType::class, - ['class' => 'Chamilo\ContactBundle\Entity\Category'] - ) - ->add('firstname') - ->add('lastname') - ->add('email') - ->add('subject') - ->add('message', TextareaType::class) - ->add('send', SubmitType::class, ['attr' => ['class' => 'btn btn-primary']]) - ; - } - - public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $collectionConstraint = new Collection([ - 'category' => [ - new NotBlank(['message' => 'Category should not be blank.']), - ], - 'firstname' => [ - new NotBlank(['message' => 'Firstname should not be blank.']), - new Length(['min' => 2]), - ], - 'lastname' => [ - new NotBlank(['message' => 'Lastname should not be blank.']), - new Length(['min' => 2]), - ], - 'email' => [ - new NotBlank(['message' => 'Email should not be blank.']), - new Email(['message' => 'Invalid email address.']), - ], - 'subject' => [ - new NotBlank(['message' => 'Subject should not be blank.']), - new Length(['min' => 3]), - ], - 'message' => [ - new NotBlank(['message' => 'Message should not be blank.']), - new Length(['min' => 5]), - ], - ]); - - $resolver->setDefaults([ - 'constraints' => $collectionConstraint, - ]); - } -} diff --git a/src/ContactBundle/Resources/config/admin.yml b/src/ContactBundle/Resources/config/admin.yml deleted file mode 100644 index 734fb12b0d..0000000000 --- a/src/ContactBundle/Resources/config/admin.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - sonata.admin.contact_category: - class: Chamilo\ContactBundle\Admin\CategoryAdmin - tags: - - {name: sonata.admin, manager_type: orm, group: "LMS", label: "Contact category"} - arguments: - - ~ - - Chamilo\ContactBundle\Entity\Category - - ~ diff --git a/src/ContactBundle/Resources/config/routing.yml b/src/ContactBundle/Resources/config/routing.yml deleted file mode 100644 index 1024a00a5e..0000000000 --- a/src/ContactBundle/Resources/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -contact: - resource: "@ChamiloContactBundle/Controller/ContactController.php" - type: annotation diff --git a/src/ContactBundle/Resources/translations/messages.de.po b/src/ContactBundle/Resources/translations/messages.de.po deleted file mode 100644 index 10c485729f..0000000000 --- a/src/ContactBundle/Resources/translations/messages.de.po +++ /dev/null @@ -1,29 +0,0 @@ -msgid "Category" -msgstr "Kategorie" - -msgid "Firstname" -msgstr "Vorname" - -msgid "Lastname" -msgstr "Nachname" - -msgid "Email" -msgstr "E-mail" - -msgid "Subject" -msgstr "Betreff" - -msgid "Message" -msgstr "Nachricht" - -msgid "Send" -msgstr "Senden" - -msgid "You had a new message from %url%" -msgstr "Sie haben eine neue Nachricht erhalten von %url%" - -msgid "Your email has been sent! Thanks!" -msgstr "Ihre Nachricht wurde versendet. Vielen Dank !" - -msgid "Contact" -msgstr "Kontakt" diff --git a/src/ContactBundle/Resources/translations/messages.en.po b/src/ContactBundle/Resources/translations/messages.en.po deleted file mode 100644 index 8b13789179..0000000000 --- a/src/ContactBundle/Resources/translations/messages.en.po +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/ContactBundle/Resources/translations/messages.es.po b/src/ContactBundle/Resources/translations/messages.es.po deleted file mode 100644 index c238917f55..0000000000 --- a/src/ContactBundle/Resources/translations/messages.es.po +++ /dev/null @@ -1,26 +0,0 @@ -msgid "Category" -msgstr "Categoría" - -msgid "Firstname" -msgstr "Apellidos" - -msgid "Lastname" -msgstr "Nombre" - -msgid "Email" -msgstr "Correo electrónico" - -msgid "Subject" -msgstr "Asunto" - -msgid "Message" -msgstr "Mensaje" - -msgid "Send" -msgstr "Enviar" - -msgid "You had a new message from %url%" -msgstr "Ha recibido un nuevo mensaje de %url%" - -msgid "Your email has been sent! Thanks!" -msgstr "Su mensaje ha sido enviado! Gracias!" diff --git a/src/ContactBundle/Resources/translations/messages.fr.po b/src/ContactBundle/Resources/translations/messages.fr.po deleted file mode 100644 index 76355d52c1..0000000000 --- a/src/ContactBundle/Resources/translations/messages.fr.po +++ /dev/null @@ -1,29 +0,0 @@ -msgid "Category" -msgstr "Catégorie" - -msgid "Firstname" -msgstr "Prénom" - -msgid "Lastname" -msgstr "Nom" - -msgid "Email" -msgstr "E-mail" - -msgid "Subject" -msgstr "Sujet" - -msgid "Message" -msgstr "Message" - -msgid "Send" -msgstr "Envoyer" - -msgid "You had a new message from %url%" -msgstr "Un nouveau message vous a été envoyé depuis %url%" - -msgid "Your email has been sent! Thanks!" -msgstr "Votre message a été envoyé. Merci !" - -msgid "Contact" -msgstr "Contact" diff --git a/src/ContactBundle/Resources/views/contact.html.twig b/src/ContactBundle/Resources/views/contact.html.twig deleted file mode 100644 index 801a377137..0000000000 --- a/src/ContactBundle/Resources/views/contact.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{{ 'You had a new message from %url%' | trans({'%url%': url(app.request.attributes.get('_route'))} ) }} - -{{ 'Firstname' | trans }} : {{ firstname }} -{{ 'Lastname' | trans }} : {{ lastname }} - -Email: {{ email }} -IP: {{ ip }} - -{{ 'Subject' | trans }} : {{ subject }} -{{ 'Message' | trans }} : -{{ message|raw }} diff --git a/src/ContactBundle/Resources/views/index.html.twig b/src/ContactBundle/Resources/views/index.html.twig deleted file mode 100644 index 417a9a532b..0000000000 --- a/src/ContactBundle/Resources/views/index.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "@ChamiloTheme/Layout/base-layout.html.twig" %} - -{% block chamilo_content %} - -
- - {{ form_start(form) }} - {{ form_widget(form, {'attr': {'class': ''}}) }} - {{ form_end(form) }} -
-{% endblock %} diff --git a/src/FaqBundle/Admin/CategoryAdmin.php b/src/FaqBundle/Admin/CategoryAdmin.php deleted file mode 100644 index 4874711bac..0000000000 --- a/src/FaqBundle/Admin/CategoryAdmin.php +++ /dev/null @@ -1,65 +0,0 @@ - 1, - '_sort_by' => 'created_at', - '_sort_order' => 'Desc', - ]; - - protected function configureDatagridFilters(DatagridMapper $datagridMapper) - { - $datagridMapper - //->add('headline') - //->add('body') - ->add('rank') - ->add('isActive') - ; - } - - protected function configureListFields(ListMapper $listMapper) - { - $listMapper - //->add('headline', null, array('identifier' => true)) - ->add('translations', null, ['identifier' => true]) - ->add('rank') - ->add( - '_action', - 'actions', - [ - 'actions' => [ - //'show' => array(), - 'preview' => ['template' => 'ChamiloFaqBundle:Faq:preview_category_partial.html.twig'], - 'edit' => [], - 'delete' => [], - ], - ] - ) - ; - } - - protected function configureFormFields(FormMapper $formMapper) - { - $formMapper - ->add('translations', TranslationsType::class, []) - ->add('rank', null, ['required' => false]) -// ->add('slug') - ->add('isActive') - ->end() - ; - } -} diff --git a/src/FaqBundle/Admin/QuestionAdmin.php b/src/FaqBundle/Admin/QuestionAdmin.php deleted file mode 100644 index 0b8f88c63f..0000000000 --- a/src/FaqBundle/Admin/QuestionAdmin.php +++ /dev/null @@ -1,71 +0,0 @@ - 1, - '_sort_by' => 'issueDate', - '_sort_order' => 'Desc', - ]; - - protected function configureDatagridFilters(DatagridMapper $datagridMapper) - { - $datagridMapper - ->add('id') - ->add('isActive') - ; - } - - protected function configureListFields(ListMapper $listMapper) - { - $listMapper - ->addIdentifier('id') - ->add('translations', null, ['identifier' => true]) - ->add('Category') - ->add('rank') - ->add( - '_action', - 'actions', - [ - 'actions' => [ - //'show' => array(), - 'preview' => ['template' => 'ChamiloFaqBundle:Faq:preview_question_partial.html.twig'], - 'edit' => [], - 'delete' => [], - ], - ] - ); - } - - protected function configureFormFields(FormMapper $formMapper) - { - $formMapper - ->add('translations', TranslationsType::class, []) - ->add( - 'category', - null, - [ - 'expanded' => true, - 'required' => true, - 'attr' => ['class' => 'radio-list vertical'], - ] - ) - ->add('rank', null, ['required' => false]) - ->add('onlyAuthUsers') - ->add('isActive') - ->end(); - } -} diff --git a/src/FaqBundle/ChamiloFaqBundle.php b/src/FaqBundle/ChamiloFaqBundle.php deleted file mode 100644 index 64bad6627a..0000000000 --- a/src/FaqBundle/ChamiloFaqBundle.php +++ /dev/null @@ -1,16 +0,0 @@ -generateRedirectToDefaultSelection($categorySlug, $questionSlug); - if ($redirect) { - return $redirect; - } - } - - // Otherwise get the selected category and/or question as usual - $questions = []; - $categories = $this->getCategoryRepository()->retrieveActive(); - $selectedCategory = $this->getSelectedCategory($categorySlug); - $selectedQuestion = $this->getSelectedQuestion($questionSlug); - - if ($selectedCategory) { - $questions = $selectedCategory->getQuestions(); - } - - // Throw 404 if there is no category in the database - if (!$categories) { - throw $this->createNotFoundException('You need at least 1 active faq category in the database'); - } - - return $this->render( - '@ChamiloFaq/Faq/index.html.twig', - [ - 'categories' => $categories, - 'questions' => $questions, - 'selectedCategory' => $selectedCategory, - 'selectedQuestion' => $selectedQuestion, - ] - ); - } - - /** - * Index without any collapsing. Will just show all categories and questions at once. - * - * @param string $categorySlug - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * - * @return \Symfony\Component\HttpFoundation\Response - */ - public function indexWithoutCollapseAction($categorySlug) - { - if ($categorySlug) { - $categories = $this->getCategoryRepository()->retrieveActiveBySlug($categorySlug); - } else { - $categories = $this->getCategoryRepository()->retrieveActive(); - } - - if (!$categories) { - throw $this->createNotFoundException('Faq category not found'); - } - - return $this->render( - '@ChamiloFaq/Faq/index_without_collapse.html.twig', - [ - 'categories' => $categories, - 'categorySlug' => $categorySlug, - ] - ); - } - - /** - * Open first category or question if none was selected so far. - * - * @param string $categorySlug - * @param string $questionSlug - * - * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse - */ - protected function generateRedirectToDefaultSelection($categorySlug, $questionSlug) - { - $doRedirect = false; - //$config = $this->container->getParameter('faq'); - $config = []; - $config['select_first_category_by_default'] = false; - $config['select_first_question_by_default'] = false; - - if (!$categorySlug && $config['select_first_category_by_default']) { - $firstCategory = $this->getCategoryRepository()->retrieveFirst(); - if ($firstCategory instanceof Category) { - $categorySlug = $firstCategory->getSlug(); - $doRedirect = true; - } else { - throw $this->createNotFoundException('Tried to open the first faq category by default, but there was none.'); - } - } - - if (!$questionSlug && $config['select_first_question_by_default']) { - $firstQuestion = $this->getQuestionRepository()->retrieveFirstByCategorySlug($categorySlug); - if ($firstQuestion instanceof Question) { - $questionSlug = $firstQuestion->getSlug(); - $doRedirect = true; - } else { - throw $this->createNotFoundException('Tried to open the first faq question by default, but there was none.'); - } - } - - if ($doRedirect) { - return $this->redirect( - $this->generateUrl('faq', ['categorySlug' => $categorySlug, 'questionSlug' => $questionSlug], true) - ); - } - - return false; - } - - /** - * @param string $questionSlug - * - * @return Question - */ - protected function getSelectedQuestion($questionSlug = null) - { - $selectedQuestion = null; - - if (null !== $questionSlug) { - $selectedQuestion = $this->getQuestionRepository()->getQuestionBySlug($questionSlug); - } - - return $selectedQuestion; - } - - /** - * @param string $categorySlug - * - * @return Category - */ - protected function getSelectedCategory($categorySlug = null) - { - $selectedCategory = null; - - if (null !== $categorySlug) { - $selectedCategory = $this->getCategoryRepository()->getCategoryActiveBySlug($categorySlug); - } - - return $selectedCategory; - } - - /** - * @return QuestionRepository - */ - protected function getQuestionRepository() - { - return $this->container->get('faq.entity.question_repository'); - } - - /** - * @return CategoryRepository - */ - protected function getCategoryRepository() - { - return $this->container->get('faq.entity.category_repository'); - } -} diff --git a/src/FaqBundle/DependencyInjection/ChamiloFaqExtension.php b/src/FaqBundle/DependencyInjection/ChamiloFaqExtension.php deleted file mode 100644 index edf2aac920..0000000000 --- a/src/FaqBundle/DependencyInjection/ChamiloFaqExtension.php +++ /dev/null @@ -1,25 +0,0 @@ -load('admin.yml'); - $loader->load('services.yml'); - } -} diff --git a/src/FaqBundle/Entity/Category.php b/src/FaqBundle/Entity/Category.php deleted file mode 100644 index 3fd5591504..0000000000 --- a/src/FaqBundle/Entity/Category.php +++ /dev/null @@ -1,179 +0,0 @@ -proxyCurrentLocaleTranslation($method, $arguments); - } - - /** - * Returns a string representation of this object. - * - * @return string - */ - public function __toString() - { - return (string) $this->getHeadline(); - } - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get rank. - * - * @return string - */ - public function getRank() - { - return $this->rank; - } - - /** - * Set rank. - * - * @param string $rank - * - * @return Question - */ - public function setRank($rank) - { - $this->rank = $rank; - - return $this; - } - - /** - * Set is_active. - * - * @param bool $isActive - * - * @return Category - */ - public function setIsActive($isActive) - { - $this->isActive = $isActive; - - return $this; - } - - /** - * Get isActive. - * - * @return bool - */ - public function getIsActive() - { - return $this->isActive; - } - - /** - * Add question. - * - * @return Category - */ - public function addQuestion(Question $question) - { - $this->questions[] = $question; - - return $this; - } - - /** - * Remove question. - */ - public function removeQuestion(Question $question) - { - $this->questions->removeElement($question); - } - - /** - * Get questions. - * - * @return \Doctrine\Common\Collections\Collection - */ - public function getQuestions() - { - return $this->questions; - } - - /** - * Returns the route name for url generation. - * - * @return string - */ - public function getRouteName() - { - return 'faq'; - } - - /** - * Returns the route parameters for url generation. - * - * @return array - */ - public function getRouteParameters() - { - return [ - 'categorySlug' => $this->getSlug(), - ]; - } -} diff --git a/src/FaqBundle/Entity/CategoryTranslation.php b/src/FaqBundle/Entity/CategoryTranslation.php deleted file mode 100644 index b3c6223810..0000000000 --- a/src/FaqBundle/Entity/CategoryTranslation.php +++ /dev/null @@ -1,117 +0,0 @@ -headline; - } - - public function getHeadline() - { - return $this->headline; - } - - /** - * @return CategoryTranslation - */ - public function setHeadline($headline) - { - $this->headline = $headline; - - return $this; - } - - public function getBody() - { - return $this->body; - } - - /** - * @return CategoryTranslation - */ - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - public function getSlug() - { - return $this->slug; - } - - /** - * @return CategoryTranslation - */ - public function setSlug($slug) - { - $this->slug = $slug; - - return $this; - } -} diff --git a/src/FaqBundle/Entity/Question.php b/src/FaqBundle/Entity/Question.php deleted file mode 100644 index acf548302c..0000000000 --- a/src/FaqBundle/Entity/Question.php +++ /dev/null @@ -1,209 +0,0 @@ -proxyCurrentLocaleTranslation($method, $arguments); - } - - /** - * Returns a string representation of this object. - * - * @return string - */ - public function __toString() - { - return (string) $this->getHeadline(); - } - - /** - * Get id. - * - * @return int - */ - public function getId() - { - return $this->id; - } - - /** - * Get rank. - * - * @return string - */ - public function getRank() - { - return $this->rank; - } - - /** - * Set rank. - * - * @param string $rank - * - * @return Question - */ - public function setRank($rank) - { - $this->rank = $rank; - - return $this; - } - - /** - * Set category. - * - * @param Category $category - * - * @return Question - */ - public function setCategory(Category $category = null) - { - $this->category = $category; - - return $this; - } - - /** - * Get category. - * - * @return Category - */ - public function getCategory() - { - return $this->category; - } - - /** - * Returns the route name for url generation. - * - * @return string - */ - public function getRouteName() - { - return 'faq'; - } - - /** - * Returns the route parameters for url generation. - * - * @return array - */ - public function getRouteParameters() - { - return [ - 'categorySlug' => $this->getCategory()->getSlug(), - 'questionSlug' => $this->getSlug(), - ]; - } - - /** - * Returns a string representation of the entity build out of BundleName + EntityName + EntityId. - * - * @return string - */ - public function getEntityIdentifier() - { - return 'GenjFaqBundle:Question:'.$this->getId(); - } - - /** - * @return bool - */ - public function isOnlyAuthUsers() - { - return $this->onlyAuthUsers; - } - - /** - * @param bool $onlyAuthUsers - * - * @return Question - */ - public function setOnlyAuthUsers($onlyAuthUsers) - { - $this->onlyAuthUsers = $onlyAuthUsers; - - return $this; - } - - /** - * Set is_active. - * - * @param bool $isActive - * - * @return Question - */ - public function setIsActive($isActive) - { - $this->isActive = $isActive; - - return $this; - } - - /** - * Get isActive. - * - * @return bool - */ - public function getIsActive() - { - return $this->isActive; - } -} diff --git a/src/FaqBundle/Entity/QuestionTranslation.php b/src/FaqBundle/Entity/QuestionTranslation.php deleted file mode 100644 index 15248574d4..0000000000 --- a/src/FaqBundle/Entity/QuestionTranslation.php +++ /dev/null @@ -1,131 +0,0 @@ -headline; - } - - /** - * @return string - */ - public function getHeadline() - { - return $this->headline; - } - - /** - * @param string $headline - * - * @return QuestionTranslation - */ - public function setHeadline($headline) - { - $this->headline = $headline; - - return $this; - } - - /** - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * @param string $body - * - * @return QuestionTranslation - */ - public function setBody($body) - { - $this->body = $body; - - return $this; - } - - /** - * @return string - */ - public function getSlug() - { - return $this->slug; - } - - /** - * @param string $slug - * - * @return QuestionTranslation - */ - public function setSlug($slug) - { - $this->slug = $slug; - - return $this; - } -} diff --git a/src/FaqBundle/Repository/CategoryRepository.php b/src/FaqBundle/Repository/CategoryRepository.php deleted file mode 100644 index f721911703..0000000000 --- a/src/FaqBundle/Repository/CategoryRepository.php +++ /dev/null @@ -1,76 +0,0 @@ -createQueryBuilder('c') - ->where('c.isActive = :isActive') - ->orderBy('c.rank', 'ASC') - ->getQuery(); - - $query->setParameter('isActive', true); - - return $query->execute(); - } - - /** - * @param string $slug - */ - public function retrieveActiveBySlug($slug) - { - $query = $this->createQueryBuilder('c') - ->where('c.isActive = :isActive') - ->andWhere('c.slug = :slug') - ->orderBy('c.rank', 'ASC') - ->getQuery(); - - $query->setParameter('isActive', true); - $query->setParameter('slug', $slug); - - return $query->execute(); - } - - /** - * @param string $slug - */ - public function getCategoryActiveBySlug($slug) - { - $query = $this->createQueryBuilder('c') - ->join('c.translations', 't') - ->where('c.isActive = :isActive') - ->andWhere('t.slug = :slug') - ->getQuery(); - - $query->setParameter('isActive', true); - $query->setParameter('slug', $slug); - - return $query->getOneOrNullResult(); - } - - /** - * @return Category|null - */ - public function retrieveFirst() - { - $query = $this->createQueryBuilder('c') - ->where('c.isActive = :isActive') - ->orderBy('c.rank', 'ASC') - ->setMaxResults(1) - ->getQuery(); - - $query->setParameter('isActive', true); - - return $query->getOneOrNullResult(); - } -} diff --git a/src/FaqBundle/Repository/QuestionRepository.php b/src/FaqBundle/Repository/QuestionRepository.php deleted file mode 100644 index 346151ab99..0000000000 --- a/src/FaqBundle/Repository/QuestionRepository.php +++ /dev/null @@ -1,53 +0,0 @@ -createQueryBuilder('q') - ->join('q.category', 'c') - ->join('c.translations', 't') - ->where('t.slug = :categorySlug') - ->orderBy('q.rank', 'ASC') - ->setMaxResults(1) - ->getQuery(); - - $query->setParameter('categorySlug', $categorySlug); - - return $query->getOneOrNullResult(); - } - - /** - * @param string $slug - * - * @return Question|null - */ - public function getQuestionBySlug($slug) - { - $query = $this->createQueryBuilder('q') - ->join('q.translations', 't') - ->where('t.slug = :slug') - ->orderBy('q.rank', 'ASC') - ->setMaxResults(1) - ->getQuery(); - - $query->setParameter('slug', $slug); - - return $query->getOneOrNullResult(); - } -} diff --git a/src/FaqBundle/Resources/config/admin.yml b/src/FaqBundle/Resources/config/admin.yml deleted file mode 100644 index 308060bedd..0000000000 --- a/src/FaqBundle/Resources/config/admin.yml +++ /dev/null @@ -1,18 +0,0 @@ -services: - sonata.admin.faq_question: - class: Chamilo\FaqBundle\Admin\QuestionAdmin - tags: - - {name: sonata.admin, manager_type: orm, group: "Content", label: "Question"} - arguments: - - ~ - - Chamilo\FaqBundle\Entity\Question - - ~ - - sonata.admin.faq_category: - class: Chamilo\FaqBundle\Admin\CategoryAdmin - tags: - - {name: sonata.admin, manager_type: orm, group: "Content", label: "Category"} - arguments: - - ~ - - Chamilo\FaqBundle\Entity\Category - - ~ diff --git a/src/FaqBundle/Resources/config/routing.yml b/src/FaqBundle/Resources/config/routing.yml deleted file mode 100644 index a3bc961cd4..0000000000 --- a/src/FaqBundle/Resources/config/routing.yml +++ /dev/null @@ -1,12 +0,0 @@ -faq_index: - path: /faq - defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexAction', categorySlug: null, questionSlug: null} - -faq: - path: /faq/{categorySlug}/{questionSlug} - defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexAction', categorySlug: null, questionSlug: null} - -# Shows the entire FAQ at once, without collapsing any categories or questions. Useful if your FAQ is not that big. -faq_without_collapse: - path: /faq-without-collapse/{categorySlug} - defaults: {_controller: 'Chamilo\FaqBundle\Controller\FaqController::indexWithoutCollapseAction', categorySlug: null} diff --git a/src/FaqBundle/Resources/config/services.yml b/src/FaqBundle/Resources/config/services.yml deleted file mode 100644 index e59ae0a253..0000000000 --- a/src/FaqBundle/Resources/config/services.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - _defaults: - autowire: true diff --git a/src/FaqBundle/Resources/views/Faq/index.html.twig b/src/FaqBundle/Resources/views/Faq/index.html.twig deleted file mode 100644 index 6d2fea1138..0000000000 --- a/src/FaqBundle/Resources/views/Faq/index.html.twig +++ /dev/null @@ -1,80 +0,0 @@ -{% extends '@ChamiloTheme/Layout/layout_cms.html.twig' %} - -{% block sonata_page_container %} - - - -
- Go up -
-
- -
-

FAQ

-
-
    - {% for category in categories %} -
  • -

    {{ category.getHeadline|e }}

    -
  • -
      - {% set list = [false] %} - {% if is_granted('IS_AUTHENTICATED_FULLY') %} - {% set list = [false, true] %} - {% endif %} - - {% for question in category.questions if question.onlyAuthUsers in list %} - {% if question.isActive %} -
    • - - {{ question.getHeadline|e }} - -
    • - {% endif %} - {% endfor %} -
    - {% endfor %} -
-
-
- {% for category in categories %} - {% set list = [false] %} - {% if is_granted('IS_AUTHENTICATED_FULLY') %} - {% set list = [false, true] %} -

{{ category.getHeadline|e }}

- {% endif %} - - {% for question in category.questions if question.onlyAuthUsers in list %} - {% if question.isActive %} -
-
- {{ question.getHeadline|e }} -
-
-

{{ question.getBody }}

-
-
- {% endif %} - {% endfor %} - {% endfor %} -
-
-{% endblock %} diff --git a/src/FaqBundle/Resources/views/Faq/index_without_collapse.html.twig b/src/FaqBundle/Resources/views/Faq/index_without_collapse.html.twig deleted file mode 100644 index fc951ceb7d..0000000000 --- a/src/FaqBundle/Resources/views/Faq/index_without_collapse.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -

FAQ

- -{% for category in categories %} -

{{ category.headline|e }}

- {% for question in category.questions %} - {{ question.isAuth |var_dump }} -

{{ question.headline|e }}

-

{{ question.body }}

- {% endfor %} -{% endfor %} \ No newline at end of file diff --git a/src/FaqBundle/Resources/views/Faq/preview_category_partial.html.twig b/src/FaqBundle/Resources/views/Faq/preview_category_partial.html.twig deleted file mode 100644 index cff12569d3..0000000000 --- a/src/FaqBundle/Resources/views/Faq/preview_category_partial.html.twig +++ /dev/null @@ -1,9 +0,0 @@ - - - {{ 'Preview'|trans({}, 'SonataAdminBundle') }} - - diff --git a/src/FaqBundle/Resources/views/Faq/preview_question_partial.html.twig b/src/FaqBundle/Resources/views/Faq/preview_question_partial.html.twig deleted file mode 100644 index 5966c3df7e..0000000000 --- a/src/FaqBundle/Resources/views/Faq/preview_question_partial.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% if object.category %} - - - {{ 'Preview'|trans({}, 'SonataAdminBundle') }} - -{% endif %} - diff --git a/src/Kernel.php b/src/Kernel.php index 742ec3a86f..cac5669ffa 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -12,23 +12,17 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\RouteCollectionBuilder; -/** - * Class Kernel. - */ class Kernel extends BaseKernel { use MicroKernelTrait; - public const CONFIG_EXTS = '.{php,xml,yaml,yml}'; + private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; - /** - * @return \Generator|\Symfony\Component\HttpKernel\Bundle\BundleInterface[] - */ - public function registerBundles() + public function registerBundles(): iterable { $contents = require $this->getProjectDir().'/config/bundles.php'; foreach ($contents as $class => $envs) { - if (isset($envs['all']) || isset($envs[$this->environment])) { + if ($envs[$this->environment] ?? $envs['all'] ?? false) { yield new $class(); } } @@ -66,11 +60,12 @@ class Kernel extends BaseKernel protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); - $container->setParameter('container.dumper.inline_class_loader', true); + $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug); + $container->setParameter('container.dumper.inline_factories', true); $confDir = $this->getProjectDir().'/config'; $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); + $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob'); $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); } @@ -79,7 +74,7 @@ class Kernel extends BaseKernel { $confDir = $this->getProjectDir().'/config'; - $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob'); $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); } diff --git a/src/MediaBundle/ChamiloMediaBundle.php b/src/MediaBundle/ChamiloMediaBundle.php deleted file mode 100644 index 8681a8edf9..0000000000 --- a/src/MediaBundle/ChamiloMediaBundle.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ -class ChamiloMediaBundle extends Bundle -{ -} diff --git a/src/MediaBundle/Entity/Gallery.php b/src/MediaBundle/Entity/Gallery.php deleted file mode 100644 index 0ef0c73367..0000000000 --- a/src/MediaBundle/Entity/Gallery.php +++ /dev/null @@ -1,35 +0,0 @@ -id; - } - - public function addGalleryHasMedia(GalleryHasMediaInterface $galleryHasMedia) - { - } - - public function removeGalleryHasMedia(GalleryHasMediaInterface $galleryHasMedia) - { - } -} diff --git a/src/MediaBundle/Entity/GalleryHasMedia.php b/src/MediaBundle/Entity/GalleryHasMedia.php deleted file mode 100644 index 55aac009c5..0000000000 --- a/src/MediaBundle/Entity/GalleryHasMedia.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/MediaBundle/Entity/GalleryItem.php b/src/MediaBundle/Entity/GalleryItem.php deleted file mode 100644 index 1b3e2c83fd..0000000000 --- a/src/MediaBundle/Entity/GalleryItem.php +++ /dev/null @@ -1,30 +0,0 @@ -id; -// } -//} diff --git a/src/MediaBundle/Entity/Media.php b/src/MediaBundle/Entity/Media.php deleted file mode 100644 index 8571b10ef5..0000000000 --- a/src/MediaBundle/Entity/Media.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/MediaBundle/Resources/config/doctrine/Gallery.orm.xml b/src/MediaBundle/Resources/config/doctrine/Gallery.orm.xml deleted file mode 100644 index 347de9db78..0000000000 --- a/src/MediaBundle/Resources/config/doctrine/Gallery.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/MediaBundle/Resources/config/doctrine/GalleryHasMedia.orm.xml b/src/MediaBundle/Resources/config/doctrine/GalleryHasMedia.orm.xml deleted file mode 100644 index b07c27f234..0000000000 --- a/src/MediaBundle/Resources/config/doctrine/GalleryHasMedia.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/MediaBundle/Resources/config/doctrine/Media.orm.xml b/src/MediaBundle/Resources/config/doctrine/Media.orm.xml deleted file mode 100644 index de6b3632d8..0000000000 --- a/src/MediaBundle/Resources/config/doctrine/Media.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/MediaBundle/Resources/config/serializer/Entity.Gallery.xml b/src/MediaBundle/Resources/config/serializer/Entity.Gallery.xml deleted file mode 100644 index 71a40eb94b..0000000000 --- a/src/MediaBundle/Resources/config/serializer/Entity.Gallery.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/MediaBundle/Resources/config/serializer/Entity.GalleryItem.xml b/src/MediaBundle/Resources/config/serializer/Entity.GalleryItem.xml deleted file mode 100644 index c94e6c7086..0000000000 --- a/src/MediaBundle/Resources/config/serializer/Entity.GalleryItem.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/MediaBundle/Resources/config/serializer/Entity.Media.xml b/src/MediaBundle/Resources/config/serializer/Entity.Media.xml deleted file mode 100644 index cd3bbdd7f6..0000000000 --- a/src/MediaBundle/Resources/config/serializer/Entity.Media.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/MediaBundle/Resources/views/Block/block_gallery.html.twig b/src/MediaBundle/Resources/views/Block/block_gallery.html.twig deleted file mode 100644 index fa2a9f7995..0000000000 --- a/src/MediaBundle/Resources/views/Block/block_gallery.html.twig +++ /dev/null @@ -1,62 +0,0 @@ -{% extends '@SonataBlock/Block/block_base.html.twig' %} - -{% block block %} - {% if settings.format %} -
- {% if settings.title %} -

- {% if settings.icon %} - - {% endif %} - {% if settings.translation_domain %} - {{ settings.title|trans({}, settings.translation_domain) }} - {% else %} - {{ settings.title }} - {% endif %} -

- {% endif %} - - -
- {% endif %} -{% endblock %} - -{% block element_indicator %} -
  • -{% endblock element_indicator %} - -{% block element_display %} -
    - {% media element.media, settings.format %} - -
    -{% endblock element_display %} diff --git a/src/NotificationBundle/ChamiloNotificationBundle.php b/src/NotificationBundle/ChamiloNotificationBundle.php deleted file mode 100644 index a1abb36940..0000000000 --- a/src/NotificationBundle/ChamiloNotificationBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -id; - } -} diff --git a/src/NotificationBundle/Resources/config/doctrine/Message.orm.xml b/src/NotificationBundle/Resources/config/doctrine/Message.orm.xml deleted file mode 100644 index f31e6f5967..0000000000 --- a/src/NotificationBundle/Resources/config/doctrine/Message.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/NotificationBundle/Resources/config/serializer/Entity.Message.xml b/src/NotificationBundle/Resources/config/serializer/Entity.Message.xml deleted file mode 100644 index e232c750d6..0000000000 --- a/src/NotificationBundle/Resources/config/serializer/Entity.Message.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/src/PageBundle/ChamiloPageBundle.php b/src/PageBundle/ChamiloPageBundle.php deleted file mode 100644 index f939711587..0000000000 --- a/src/PageBundle/ChamiloPageBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -get('sonata.page.site.selector')->retrieve(); - - $criteria = ['enabled' => 1, 'site' => $site, 'decorate' => 1, 'routeName' => 'page_slug']; - $order = ['createdAt' => 'desc']; - // Get latest pages - $pages = $pageManager->findBy($criteria, $order, $number); - $pagesToShow = []; - /** @var Page $page */ - foreach ($pages as $page) { - // Skip homepage - if ('/' === $page->getUrl()) { - continue; - } - $criteria = ['pageId' => $page]; - /** @var Snapshot $snapshot */ - // Check if page has a valid snapshot - $snapshot = $this->get('sonata.page.manager.snapshot')->findEnableSnapshot($criteria); - if ($snapshot) { - $pagesToShow[] = $page; - } - } - - return $this->render( - '@ChamiloPage/latest.html.twig', - ['pages' => $pagesToShow] - ); - } - - /** - * Creates a site if needed checking the host and locale. - * Creates a first root page. - * Creates a page if it doesn't exists. - * Updates the page if page exists. - * - * @param string $pageSlug - * @param bool $redirect - * - * @throws \Exception - * - * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response - */ - public function createPage( - $pageSlug, - $redirect, - Request $request, - SiteManager $siteManager, - PageManager $pageManager, - TemplateManager $templateManager, - BlockInteractor $blockInteractor, - BlockManager $blockManager - ) { - $host = $request->getHost(); - $locale = $request->get('_locale'); - $criteria = [ - 'locale' => $locale, - 'host' => $host, - ]; - - $site = $siteManager->findOneBy($criteria); - // If site doesn't exists or the site has a different locale from request, create new one. - if (!$site || ($site && ($locale !== $site->getLocale()))) { - // Create new site for this host and language - $site = $siteManager->create(); - $site->setHost($host); - $site->setEnabled(true); - $site->setName($host.' in language '.$locale); - $site->setEnabledFrom(new \DateTime('now')); - $site->setEnabledTo(new \DateTime('+20 years')); - $site->setRelativePath(''); - $site->setIsDefault(false); - $site->setLocale($locale); - $site = $siteManager->save($site); - - // Create first root page - /** @var \Sonata\PageBundle\Model\Page $page */ - $page = $pageManager->create(); - $page->setSlug('homepage'); - $page->setUrl('/'); - $page->setName('homepage'); - $page->setTitle('home'); - $page->setEnabled(true); - $page->setDecorate(1); - $page->setRequestMethod('GET|POST|HEAD|DELETE|PUT'); - $page->setTemplateCode('default'); - $page->setRouteName('homepage'); - //$page->setParent($this->getReference('page-homepage')); - $page->setSite($site); - $pageManager->save($page); - } - - $em = $this->getDoctrine()->getManager(); - $page = null; - - $form = $this->createFormBuilder() - ->add('content', CKEditorType::class) - ->add('save', SubmitType::class, ['label' => 'Update']) - ->getForm(); - - $blockToEdit = null; - if ($site) { - // Getting parent - $criteria = ['site' => $site, 'enabled' => true, 'parent' => null]; - /** @var Page $page */ - $parent = $pageManager->findOneBy($criteria); - - // Check if a page exists for this site - $criteria = ['site' => $site, 'enabled' => true, 'parent' => $parent, 'slug' => $pageSlug]; - - /** @var Page $page */ - $page = $pageManager->findOneBy($criteria); - if ($page) { - $blocks = $page->getBlocks(); - /** @var Block $block */ - foreach ($blocks as $block) { - if ('Main content' === $block->getName()) { - $code = $block->getSetting('code'); - if ('content' === $code) { - $children = $block->getChildren(); - /** @var Block $child */ - foreach ($children as $child) { - if ('sonata.formatter.block.formatter' === $child->getType()) { - $blockToEdit = $child; - - break 2; - } - } - } - } - } - } else { - $page = $pageManager->create(); - $page->setSlug($pageSlug); - $page->setUrl('/'.$pageSlug); - $page->setName($pageSlug); - $page->setTitle($pageSlug); - $page->setEnabled(true); - $page->setDecorate(1); - $page->setRequestMethod('GET'); - $page->setTemplateCode('default'); - $page->setRouteName($pageSlug); - $page->setParent($parent); - $page->setSite($site); - - $pageManager->save($page); - - $template = $templateManager->get('default'); - $templateContainers = $template->getContainers(); - - $containers = []; - foreach ($templateContainers as $id => $area) { - $containers[$id] = [ - 'area' => $area, - 'block' => false, - ]; - } - - // Create blocks for this page - $parentBlock = null; - foreach ($containers as $id => $area) { - if (false === $area['block'] && false === $templateContainers[$id]['shared']) { - $block = $blockInteractor->createNewContainer( - [ - 'page' => $page, - 'name' => $templateContainers[$id]['name'], - 'code' => $id, - ] - ); - - if ('content' === $id && 'Main content' === $templateContainers[$id]['name']) { - $parentBlock = $block; - } - } - } - - // Create block in main content - $myBlock = $blockManager->create(); - $myBlock->setType('sonata.formatter.block.formatter'); - $myBlock->setSetting('format', 'richhtml'); - $myBlock->setSetting('content', ''); - $myBlock->setSetting('rawContent', ''); - $myBlock->setSetting('template', '@SonataFormatter/Block/block_formatter.html.twig'); - $myBlock->setParent($parentBlock); - $page->addBlocks($myBlock); - $pageManager->save($page); - } - } - - if ($blockToEdit) { - $form->setData(['content' => $blockToEdit->getSetting('content')]); - } - - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid() && $blockToEdit) { - $data = $form->getData(); - $content = $data['content']; - /** @var Block $blockToEdit */ - $blockToEdit->setSetting('rawContent', $content); - $blockToEdit->setSetting('content', $content); - $em->persist($blockToEdit); - $em->flush(); - $this->addFlash('success', $this->trans('Updated')); - - if (!empty($redirect)) { - return $this->redirect($redirect); - } - - return $this->redirectToRoute('home'); - } - - return $this->render( - '@ChamiloTheme/Index/page_edit.html.twig', - [ - 'page' => $page, - 'form' => $form->createView(), - 'current_locale' => $locale, - ] - ); - } - - /** - * The Chamilo index home page. - * - * @Route("/internal_page/edit/{slug}", methods={"GET", "POST"}, name="edit_page") - * - * @Security("has_role('ROLE_ADMIN')") - * - * @param string $slug - */ - public function editPageAction($slug, Request $request): Response - { - $defaultLocale = $request->getLocale(); - $localeFromGet = $request->get('_locale'); - if (!empty($localeFromGet)) { - $defaultLocale = $localeFromGet; - } - - return $this->forward( - 'Chamilo\PageBundle\Controller\PageController:createPage', - [ - 'pageSlug' => $slug, - 'redirect' => $this->generateUrl('edit_page', ['slug' => $slug, '_locale' => $defaultLocale]), - 'request' => $request, - ] - ); - } - - /** - * @Route("/internal_page/{slug}") - * - * @param bool $showEditPageLink - * - * @return Response - */ - public function renderPageAction( - string $slug, - Request $request, - $showEditPageLink = true, - SiteManager $siteManager, - PageManager $pageManager - ) { - $host = $request->getHost(); - $criteria = [ - 'locale' => $request->getLocale(), - 'host' => $host, - ]; - $site = $siteManager->findOneBy($criteria); - - $page = null; - $contentText = null; - - if ($site) { - // Parents only of homepage - $criteria = ['site' => $site, 'enabled' => true, 'slug' => $slug]; - /** @var Page $page */ - $page = $pageManager->findOneBy($criteria); - $blocks = $page->getBlocks(); - - foreach ($blocks as $block) { - if ('Main content' !== $block->getName()) { - continue; - } - - $code = $block->getSetting('code'); - - if ('content' !== $code) { - continue; - } - - $children = $block->getChildren(); - - /** @var Block $child */ - foreach ($children as $child) { - if ('sonata.formatter.block.formatter' !== $child->getType()) { - continue; - } - - $contentText = $child->getSetting('content'); - - break 2; - } - } - } - - return $this->render( - '@ChamiloTheme/Index/page.html.twig', - [ - 'page' => $page, - 'slug' => $slug, - 'show_edit_page_link' => $showEditPageLink, - 'content' => $contentText, - ] - ); - } -} diff --git a/src/PageBundle/Entity/Block.php b/src/PageBundle/Entity/Block.php deleted file mode 100644 index 582efe8303..0000000000 --- a/src/PageBundle/Entity/Block.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/PageBundle/Entity/Page.php b/src/PageBundle/Entity/Page.php deleted file mode 100644 index ef3676d472..0000000000 --- a/src/PageBundle/Entity/Page.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/PageBundle/Entity/Site.php b/src/PageBundle/Entity/Site.php deleted file mode 100644 index 6e089b7fc0..0000000000 --- a/src/PageBundle/Entity/Site.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/PageBundle/Entity/Snapshot.php b/src/PageBundle/Entity/Snapshot.php deleted file mode 100644 index 1e1f6f127a..0000000000 --- a/src/PageBundle/Entity/Snapshot.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/PageBundle/Resources/config/doctrine/Block.orm.xml b/src/PageBundle/Resources/config/doctrine/Block.orm.xml deleted file mode 100644 index 89688d0056..0000000000 --- a/src/PageBundle/Resources/config/doctrine/Block.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/PageBundle/Resources/config/doctrine/Page.orm.xml b/src/PageBundle/Resources/config/doctrine/Page.orm.xml deleted file mode 100644 index 3af84e846c..0000000000 --- a/src/PageBundle/Resources/config/doctrine/Page.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/PageBundle/Resources/config/doctrine/Site.orm.xml b/src/PageBundle/Resources/config/doctrine/Site.orm.xml deleted file mode 100644 index 11628fca80..0000000000 --- a/src/PageBundle/Resources/config/doctrine/Site.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/PageBundle/Resources/config/doctrine/Snapshot.orm.xml b/src/PageBundle/Resources/config/doctrine/Snapshot.orm.xml deleted file mode 100644 index 1db04a6c55..0000000000 --- a/src/PageBundle/Resources/config/doctrine/Snapshot.orm.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - diff --git a/src/PageBundle/Resources/config/routing.yml b/src/PageBundle/Resources/config/routing.yml deleted file mode 100644 index 7bf5edd89c..0000000000 --- a/src/PageBundle/Resources/config/routing.yml +++ /dev/null @@ -1,3 +0,0 @@ -page: - resource: '@ChamiloPageBundle/Controller/PageController.php' - type: annotation diff --git a/src/PageBundle/Resources/config/serializer/Entity.Block.xml b/src/PageBundle/Resources/config/serializer/Entity.Block.xml deleted file mode 100644 index c865e027ec..0000000000 --- a/src/PageBundle/Resources/config/serializer/Entity.Block.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/src/PageBundle/Resources/config/serializer/Entity.Page.xml b/src/PageBundle/Resources/config/serializer/Entity.Page.xml deleted file mode 100644 index 8c3c552922..0000000000 --- a/src/PageBundle/Resources/config/serializer/Entity.Page.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/src/PageBundle/Resources/config/serializer/Entity.Site.xml b/src/PageBundle/Resources/config/serializer/Entity.Site.xml deleted file mode 100644 index dcd6b34dd9..0000000000 --- a/src/PageBundle/Resources/config/serializer/Entity.Site.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/src/PageBundle/Resources/config/serializer/Entity.Snapshot.xml b/src/PageBundle/Resources/config/serializer/Entity.Snapshot.xml deleted file mode 100644 index 8e19431b4f..0000000000 --- a/src/PageBundle/Resources/config/serializer/Entity.Snapshot.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/src/PageBundle/Resources/config/services.yml b/src/PageBundle/Resources/config/services.yml deleted file mode 100644 index fdda8ce85a..0000000000 --- a/src/PageBundle/Resources/config/services.yml +++ /dev/null @@ -1,19 +0,0 @@ -services: - _defaults: - autowire: true - public: true - - Sonata\PageBundle\Entity\BlockInteractor: - alias: 'sonata.page.block_interactor' - - Sonata\PageBundle\Entity\SiteManager: - alias: 'sonata.page.manager.site' - - Sonata\PageBundle\Entity\PageManager: - alias: 'sonata.page.manager.page' - - Sonata\PageBundle\Page\TemplateManager: - alias: 'sonata.page.template_manager' - - Sonata\PageBundle\Entity\BlockManager: - alias: 'sonata.page.manager.block' diff --git a/src/PageBundle/Resources/views/1column_layout.html.twig b/src/PageBundle/Resources/views/1column_layout.html.twig deleted file mode 100644 index e04e760d6d..0000000000 --- a/src/PageBundle/Resources/views/1column_layout.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% extends '@ChamiloPage/base_layout.html.twig' %} - -{% block page_content %} - {{ parent() }} -{% endblock %} diff --git a/src/PageBundle/Resources/views/2columns_layout.html.twig b/src/PageBundle/Resources/views/2columns_layout.html.twig deleted file mode 100644 index b6f5373039..0000000000 --- a/src/PageBundle/Resources/views/2columns_layout.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{% extends '@ChamiloPage/base_layout.html.twig' %} - -{% block sonata_page_content %} - {{ parent() }} - {% if page is defined %} -
    - {% if page.name != 'global'%} - {{ sonata_page_render_container('left_col', 'global') }} - {% endif %} - {{ sonata_page_render_container('left_col', page) }} -
    -
    - {% if page.name != 'global'%} - {{ sonata_page_render_container('right_col', 'global') }} - {% endif %} - {{ sonata_page_render_container('right_col', page) }} -
    -
    - {% endif %} -{% endblock %} - diff --git a/src/PageBundle/Resources/views/Block/breadcrumb.html.twig b/src/PageBundle/Resources/views/Block/breadcrumb.html.twig deleted file mode 100644 index 4bb3a65c75..0000000000 --- a/src/PageBundle/Resources/views/Block/breadcrumb.html.twig +++ /dev/null @@ -1,21 +0,0 @@ -{# - -This file is part of the Sonata package. - -(c) Thomas Rabaix - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. - -#} - -{% extends 'knp_menu_ordered.html.twig' %} -{% block label %}{{ item.label|trans(item.getExtra('translation_params', {}), item.getExtra('translation_domain', 'SonataSeoBundle')) }}{% endblock %} - -{% block list %} - {% apply spaceless %} -
    - {{ parent() }} -
    - {% endapply %} -{% endblock %} diff --git a/src/PageBundle/Resources/views/base_layout.html.twig b/src/PageBundle/Resources/views/base_layout.html.twig deleted file mode 100644 index 4756d479b9..0000000000 --- a/src/PageBundle/Resources/views/base_layout.html.twig +++ /dev/null @@ -1,186 +0,0 @@ -{% extends '@ChamiloTheme/Layout/base-layout.html.twig' %} - -{% block page_content %} - {% block sonata_page_top_bar %} - {% block page_top_bar %} {# Deprecated block #} - {% if sonata_page.isEditor or ( app.user and is_granted('ROLE_PREVIOUS_ADMIN') ) %} - {% if sonata_page.isEditor and sonata_page.isInlineEditionOn %} - - - {% endif %} - - - - {% endif %} - {% endblock %} - {% endblock %} - - {% block sonata_page_asset_footer %} - {% block page_asset_footer %} {# Deprecated block #} - {% if page is defined %} - {% if page.javascript is not empty %} - - {% endif %} - {% if page.stylesheet is not empty %} - - {% endif %} - {% endif %} - {# - These includes can be done only at this point as all blocks are loaded, - Limition : this does not work if a global page is loaded from an ESI tag inside a container block - #} - {{ sonata_block_include_stylesheets('screen', app.request.basePath) }} - {{ sonata_block_include_javascripts('screen', app.request.basePath) }} - {% endblock %} - {% endblock %} - - {% block sonata_page_container %} -
    -
    -
    - {{ sonata_page_render_container('header', 'global') }} - {% if page.name != 'global' %} - {{ sonata_page_render_container('header', page) }} - {% endif %} -
    - - {% block sonata_page_breadcrumb %} -
    - {{ sonata_block_render_event('breadcrumb', { 'context': 'page', 'current_uri': app.request.requestUri }) }} -
    - {% endblock %} - - {% if page is defined %} -
    - {% if page.name != 'global' %} - {{ sonata_page_render_container('content_top', 'global') }} - {% endif %} - {{ sonata_page_render_container('content_top', page) }} -
    - {% endif %} - - {% block sonata_page_content %} -
    - {% if content is defined %} - {{ content|raw }} - {% else %} - {% set content = block('content') is defined ? block('content') : '' %} - {% if content|length > 0 %} - {{ content|raw }} - {% elseif page is defined %} - {{ sonata_page_render_container('content', page) }} - {% endif %} - {% endif %} -
    - {% endblock %} - - - {% if page is defined %} -
    - {{ sonata_page_render_container('content_bottom', page) }} - {% if page.name != 'global' %} - {{ sonata_page_render_container('content_bottom', 'global') }} - {% endif %} -
    - {% endif %} -
    - -
    - {{ sonata_page_render_container('footer', 'global') }} - {% if page.name != 'global' %} - {{ sonata_page_render_container('footer', page) }} - {% endif %} -
    -
    - {% endblock %} -{% endblock %} - diff --git a/src/PageBundle/Resources/views/latest.html.twig b/src/PageBundle/Resources/views/latest.html.twig deleted file mode 100644 index c814802378..0000000000 --- a/src/PageBundle/Resources/views/latest.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% for page in pages %} -

    {{ page.name }}

    -

    {{ sonata_page_render_container('content', page) }}

    -{% endfor %} \ No newline at end of file diff --git a/src/TimelineBundle/ChamiloTimelineBundle.php b/src/TimelineBundle/ChamiloTimelineBundle.php deleted file mode 100644 index d9ddfddc21..0000000000 --- a/src/TimelineBundle/ChamiloTimelineBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -id; - } -} diff --git a/src/TimelineBundle/Entity/ActionComponent.php b/src/TimelineBundle/Entity/ActionComponent.php deleted file mode 100644 index 273bdee588..0000000000 --- a/src/TimelineBundle/Entity/ActionComponent.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/TimelineBundle/Entity/Component.php b/src/TimelineBundle/Entity/Component.php deleted file mode 100644 index 33887aa6d8..0000000000 --- a/src/TimelineBundle/Entity/Component.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/TimelineBundle/Entity/Timeline.php b/src/TimelineBundle/Entity/Timeline.php deleted file mode 100644 index e5401554cb..0000000000 --- a/src/TimelineBundle/Entity/Timeline.php +++ /dev/null @@ -1,28 +0,0 @@ -id; - } -} diff --git a/src/TimelineBundle/Resources/config/doctrine/Action.orm.xml b/src/TimelineBundle/Resources/config/doctrine/Action.orm.xml deleted file mode 100644 index 0f0131275b..0000000000 --- a/src/TimelineBundle/Resources/config/doctrine/Action.orm.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/TimelineBundle/Resources/config/doctrine/ActionComponent.orm.xml b/src/TimelineBundle/Resources/config/doctrine/ActionComponent.orm.xml deleted file mode 100644 index 83b0374338..0000000000 --- a/src/TimelineBundle/Resources/config/doctrine/ActionComponent.orm.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/TimelineBundle/Resources/config/doctrine/Component.orm.xml b/src/TimelineBundle/Resources/config/doctrine/Component.orm.xml deleted file mode 100644 index 230e40ddaf..0000000000 --- a/src/TimelineBundle/Resources/config/doctrine/Component.orm.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/TimelineBundle/Resources/config/doctrine/Timeline.orm.xml b/src/TimelineBundle/Resources/config/doctrine/Timeline.orm.xml deleted file mode 100644 index 53fad24ec7..0000000000 --- a/src/TimelineBundle/Resources/config/doctrine/Timeline.orm.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/TimelineBundle/Resources/config/serializer/Entity.Action.xml b/src/TimelineBundle/Resources/config/serializer/Entity.Action.xml deleted file mode 100644 index 7702ffa55a..0000000000 --- a/src/TimelineBundle/Resources/config/serializer/Entity.Action.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/TimelineBundle/Resources/config/serializer/Entity.ActionComponent.xml b/src/TimelineBundle/Resources/config/serializer/Entity.ActionComponent.xml deleted file mode 100644 index 001a4b1755..0000000000 --- a/src/TimelineBundle/Resources/config/serializer/Entity.ActionComponent.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/TimelineBundle/Resources/config/serializer/Entity.Component.xml b/src/TimelineBundle/Resources/config/serializer/Entity.Component.xml deleted file mode 100644 index 9d9100831a..0000000000 --- a/src/TimelineBundle/Resources/config/serializer/Entity.Component.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/TimelineBundle/Resources/config/serializer/Entity.Timeline.xml b/src/TimelineBundle/Resources/config/serializer/Entity.Timeline.xml deleted file mode 100644 index fa803730f5..0000000000 --- a/src/TimelineBundle/Resources/config/serializer/Entity.Timeline.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/TimelineBundle/Resources/views/Block/timeline.html.twig b/src/TimelineBundle/Resources/views/Block/timeline.html.twig deleted file mode 100644 index 080dede19b..0000000000 --- a/src/TimelineBundle/Resources/views/Block/timeline.html.twig +++ /dev/null @@ -1,90 +0,0 @@ -{# - -This file is part of the Sonata package. - -(c) Thomas Rabaix - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. - -#} -{% extends sonata_block.templates.block_base %} - -{% block block %} -
    - {% if settings.title is not empty %} -
    -

    - {% if settings.icon %} - - {% endif %} - {% if settings.translation_domain %} - {{ settings.title|trans({}, settings.translation_domain) }} - {% else %} - {{ settings.title }} - {% endif %} -

    -
    - {% endif %} - -
    -
      - {% for entry in entries %} - {% if currentDay is not defined or currentDay != entry.createdAt|format_date %} - {% set currentDay = entry.createdAt|format_date %} -
    • - {{ currentDay }} -
    • - {% endif %} - - {% set subject = entry.getComponent('subject') %} - {% set target = entry.getComponent('target') %} - {% set target_text_component = entry.getComponent('target_text') %} - - {% if subject.data %} - {% set subject_text = sonata_timeline_generate_link(subject) %} - {% else %} - {% set subject_text %} - - {{ 'element_deleted'|trans({}, "SonataTimelineBundle") }} - - {% endset %} - {% endif %} - - {% if target.data is defined and target.data is not empty %} - {% set target_text = sonata_timeline_generate_link(target, entry) %} - {% elseif target_text_component %} - {% set target_text %} - - {{ target_text_component }} - - {% endset %} - {% else %} - {% set target_text %} - - {{ 'element_deleted'|trans({}, "SonataTimelineBundle") }} - - {% endset %} - {% endif %} - - {% set verb = "actions."~entry.verb %} - {% set icon = "actions.icon."~entry.verb %} - -
    • - -
      - - {{ entry.createdAt|format_time }} - -
      - {{ verb|trans({'%subject%': subject_text, '%target%': target_text}, "SonataTimelineBundle")|raw }} -
      -
      -
    • - {% else %} -

      {{ 'no_action'|trans({}, "SonataTimelineBundle") }}

      - {% endfor %} -
    -
    -
    -{% endblock %} diff --git a/src/UserBundle/Admin/GroupAdmin.php b/src/UserBundle/Admin/GroupAdmin.php deleted file mode 100644 index 1f8d49df71..0000000000 --- a/src/UserBundle/Admin/GroupAdmin.php +++ /dev/null @@ -1,18 +0,0 @@ -addIdentifier('name') - ->add('code') - ->add('roles') - ; - } -} diff --git a/src/UserBundle/Admin/UserAdmin.php b/src/UserBundle/Admin/UserAdmin.php deleted file mode 100644 index 0aafd8f162..0000000000 --- a/src/UserBundle/Admin/UserAdmin.php +++ /dev/null @@ -1,185 +0,0 @@ -tab('User') - ->with('Profile', ['class' => 'col-md-6'])->end() - ->with('General', ['class' => 'col-md-6'])->end() - //->with('Social', array('class' => 'col-md-6'))->end() - ->end() - ->tab('Security') - ->with('Status', ['class' => 'col-md-4'])->end() - ->with('Groups', ['class' => 'col-md-4'])->end() - ->with('Keys', ['class' => 'col-md-4'])->end() - ->with('Roles', ['class' => 'col-md-12'])->end() - ->end() - ->tab('ExtraFields') - ->with('ExtraFields', ['class' => 'col-md-4'])->end() - ->end(); - - $formMapper - ->tab('User') - ->with('General') - ->add('username') - ->add('email', EmailType::class) - /*->add( - 'plainPassword', - 'text', - array( - 'required' => (!$this->getSubject() || is_null( - $this->getSubject()->getId() - )), - ) - )*/ - ->end() - ->with('Profile') - /*->add( - 'dateOfBirth', - 'sonata_type_date_picker', - array( - 'years' => range(1900, $now->format('Y')), - 'dp_min_date' => '1-1-1900', - 'dp_max_date' => $now->format('c'), - 'required' => false, - ) - )*/ - ->add('firstname', null, ['required' => false]) - ->add('lastname', null, ['required' => false]) -// ->add('website', 'url', ['required' => false]) - ->add('biography', TextType::class, ['required' => false]) - /*->add( - 'gender', - 'sonata_user_gender', - array( - 'required' => true, - 'translation_domain' => $this->getTranslationDomain(), - ) - )*/ - //->add('locale', 'locale', array('required' => false)) - //->add('timezone', 'timezone', array('required' => false)) - //->add('phone', null, array('required' => false)) - ->end() - /*->with('Social') - ->add('facebookUid', null, array('required' => false)) - ->add('facebookName', null, array('required' => false)) - ->add('twitterUid', null, array('required' => false)) - ->add('twitterName', null, array('required' => false)) - ->add('gplusUid', null, array('required' => false)) - ->add('gplusName', null, array('required' => false)) - ->end()*/ - ->end(); - - //if ($this->getSubject() && !$this->getSubject()->hasRole('ROLE_SUPER_ADMIN')) { - if ($this->getSubject()) { - $formMapper - ->tab('Security') - ->with('Status') - ->add('locked', null, ['required' => false]) - ->add('expired', null, ['required' => false]) - ->add('enabled', null, ['required' => false]) - ->add('credentialsExpired', null, ['required' => false]) - ->end() - ->with('Groups') - ->add( - 'groups', - ModelType::class, - [ - 'required' => false, - 'expanded' => true, - 'multiple' => true, - ] - ) - ->end() - ->with('Roles') - ->add( - 'realRoles', - SecurityRolesType::class, - [ - 'label' => 'form.label_roles', - 'expanded' => true, - 'multiple' => true, - 'required' => false, - ] - ) - ->end() - ->end(); - } - - /*$formMapper - ->tab('Security') - ->with('Keys') - ->add('token', null, array('required' => false)) - ->add('twoStepVerificationCode', null, array('required' => false)) - ->end() - ->end();*/ -// -// $formMapper -// ->tab('ExtraFields') -// ->with('ExtraFields') -// ->add( -// 'extraFields', -// 'sonata_type_collection', -// array( -// 'cascade_validation' => true, -// /*'type_options' => array( -// // Prevents the "Delete" option from being displayed -// 'delete' => false, -// 'delete_options' => array( -// // You may otherwise choose to put the field but hide it -// 'type' => 'hidden', -// // In that case, you need to fill in the options as well -// 'type_options' => array( -// 'mapped' => false, -// 'required' => false, -// ) -// ) -// )*/ -// ), -// array( -// 'allow_delete' => true, -// 'by_reference' => false, -// 'edit' => 'inline', -// 'inline' => 'table', -// 'admin_code' => 'sonata.admin.user_field_values' -// /* 'edit' => 'inline', -// 'inline' => 'table', -// 'sortable' => 'position',*/ -// ) -// ) -// ->end() -// ->end(); - } - - protected function configureDatagridFilters(DatagridMapper $datagridMapper): void - { - $datagridMapper - ->add('username') - ->add('firstname') - ->add('lastname') - ->add('email') - ->add('officialCode') - ->add('groups') - ->add('active') - //->add('registrationDate', 'doctrine_orm_datetime_range', array('input_type' => 'timestamp')) - ; - } -} diff --git a/src/UserBundle/Admin/UserField.php b/src/UserBundle/Admin/UserField.php deleted file mode 100644 index 25f43fa50f..0000000000 --- a/src/UserBundle/Admin/UserField.php +++ /dev/null @@ -1,53 +0,0 @@ -add('field_type', 'text') - ->add('field_variable', 'text') - ->add('field_display_text', 'text') - ->add('field_default_value', 'text') - ->add('field_order', 'text') - ->add('field_visible', 'text') - ->add('field_changeable', 'text') - ->add('field_filter', 'text') - ->add('field_loggeable', 'text') - ->add('configuration'); - } - - protected function configureShowField(ShowMapper $showMapper) - { - $showMapper - ->add('id', 'text') - ->add('field_type', 'text') - ->add('field_variable', 'text'); - } - - protected function configureDatagridFilters(DatagridMapper $datagridMapper) - { - /*$datagridMapper - ->add('field_type') - ;*/ - } - - protected function configureListFields(ListMapper $listMapper) - { - $listMapper - ->addIdentifier('id') - ->add('field_variable', 'text') - ->add('field_type', 'text'); - } -} diff --git a/src/UserBundle/Admin/UserFieldValuesAdmin.php b/src/UserBundle/Admin/UserFieldValuesAdmin.php deleted file mode 100644 index 88a3bd6d73..0000000000 --- a/src/UserBundle/Admin/UserFieldValuesAdmin.php +++ /dev/null @@ -1,46 +0,0 @@ -add('field') - ->add('user') - ->add('field_value', 'text') - ->add('comment', 'textarea') - ->add('author'); - } - - protected function configureShowField(ShowMapper $showMapper) - { - $showMapper - ->add('id', 'text'); - } - - protected function configureDatagridFilters(DatagridMapper $datagridMapper) - { - $datagridMapper - ->add('id') - ->add('field'); - } - - protected function configureListFields(ListMapper $listMapper) - { - $listMapper - ->addIdentifier('id') - ->addIdentifier('field') - ->addIdentifier('user'); - } -} diff --git a/src/UserBundle/ChamiloUserBundle.php b/src/UserBundle/ChamiloUserBundle.php deleted file mode 100644 index ec538c2a39..0000000000 --- a/src/UserBundle/ChamiloUserBundle.php +++ /dev/null @@ -1,14 +0,0 @@ -load('admin.yml'); - $loader->load('services.yml'); - } -} diff --git a/src/UserBundle/Resources/config/admin.yml b/src/UserBundle/Resources/config/admin.yml deleted file mode 100644 index 9fdd550beb..0000000000 --- a/src/UserBundle/Resources/config/admin.yml +++ /dev/null @@ -1,14 +0,0 @@ -parameters: - sonata.user.admin.groupname: sonata_user - sonata.user.admin.label_catalogue: ChamiloUserBundle - sonata.user.admin.groupicon: '' - -services: - sonata.user.admin.user: - class: Chamilo\UserBundle\Admin\UserAdmin - tags: - - {name: sonata.admin, manager_type: orm, audit: true, group: 'LMS', label: users, label_catalogue: '%sonata.user.admin.label_catalogue%', label_translator_strategy: sonata.admin.label.strategy.underscore, icon: '%sonata.user.admin.groupicon%'} - arguments: ['', Chamilo\UserBundle\Entity\User, '%sonata.user.admin.user.controller%'] - calls: - - [setUserManager, ['@fos_user.user_manager']] - - [setTranslationDomain, ['%sonata.user.admin.user.translation_domain%']] diff --git a/src/UserBundle/Resources/config/routing.yml b/src/UserBundle/Resources/config/routing.yml deleted file mode 100644 index e1e28b08c0..0000000000 --- a/src/UserBundle/Resources/config/routing.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Controllers -controllers: - resource: '../src/UserBundle/Controller/' - type: annotation diff --git a/src/UserBundle/Resources/config/services.yml b/src/UserBundle/Resources/config/services.yml deleted file mode 100644 index c203552081..0000000000 --- a/src/UserBundle/Resources/config/services.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - _defaults: - autowire: true - public: true - - chamilo_user.security.user_provider: - class: Chamilo\UserBundle\Security\FOSUBUserProvider - arguments: - - '@sonata.user.orm.user_manager' - - {facebook: facebookId, google: googleId, github: githubId} - - chamilo_user.security.login_form_authenticator: - class: Chamilo\UserBundle\Security\LoginFormAuthenticator diff --git a/var/templates/themes/default/FOSUserBundle/Security/login.html.twig b/var/templates/themes/default/FOSUserBundle/Security/login.html.twig index 1fb362f928..49738a0f22 100644 --- a/var/templates/themes/default/FOSUserBundle/Security/login.html.twig +++ b/var/templates/themes/default/FOSUserBundle/Security/login.html.twig @@ -1,4 +1,4 @@ -{% extends "@ChamiloUser/layout.html.twig" %} +{% extends "@ChamiloCore/layout.html.twig" %} {% block fos_user_content %} {% block sonata_user_login %}