diff --git a/assets/app.js b/assets/app.js index 4c36e06..41edafa 100755 --- a/assets/app.js +++ b/assets/app.js @@ -45,6 +45,20 @@ window.CropSelectJs = require('crop-select-js/crop-select-js.min.js'); require('iframe-resizer/js/iframeResizer.min.js'); require('iframe-resizer/js/iframeResizer.contentWindow.min.js'); +// Slick +require('slick-carousel/slick/slick.css'); +require('slick-carousel/slick/slick-theme.css'); +const slick = require('slick-carousel/slick/slick.min.js'); +global.slick = slick; + +// Imageloaded +const imagesLoaded = require('imagesloaded/imagesloaded.js'); +global.imagesLoaded = imagesLoaded; + +// Masonry +const masonry = require('masonry-layout/dist/masonry.pkgd.min.js'); +global.masonry = masonry; + // Start the Stimulus application import './bootstrap'; diff --git a/assets/dropzone.js b/assets/dropzone.js index e2cb137..4cf1310 100755 --- a/assets/dropzone.js +++ b/assets/dropzone.js @@ -1,19 +1,21 @@ require('dropzone/dist/dropzone.css'); -/* -window.Dropzone = require('dropzone/dist/dropzone.js'); -*/ const { Dropzone } = require("dropzone"); document.addEventListener('DOMContentLoaded', function() { var elt = document.getElementById('mydropzone'); - console.log($(elt).data("maxfiles")) + maxFiles=elt.getAttribute("data-maxFiles"); + if(maxFiles!=1) maxFiles=null; + var mydropzone = new Dropzone(elt, { acceptedMimeTypes: $(elt).data("acceptedMimeTypes"), - maxFiles: $(elt).data("maxFiles"), + maxFiles: maxFiles, + init: function() { + dropzoneinit(this); + }, success: function( file, response ){ dropzonesuccess(file,response); }, }); - global.mydropzone=mydropzone; + window.mydropzone=mydropzone; }); \ No newline at end of file diff --git a/assets/js/app.js b/assets/js/app.js index 0b761ff..ec93a32 100755 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -85,8 +85,6 @@ $(document).ready(function() { $("#selmenu").modal("toggle"); }) - - // Forcer le resize des objects Resize(); diff --git a/assets/styles/app.css b/assets/styles/app.css index 91b60f1..271a6af 100755 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -560,6 +560,25 @@ border-width: 1px; padding:10px 0px 0px 0px; } +.widget-body .slick { + min-height: 200px; +} +.widget-body .slick-slide { + min-height: 200px; +} +.widget-body .slick-arrow { + display: none !important; +} + +.widget-body .slick-dots { + bottom: 5px; + color: var(--colorftbodydark); +} + +.widgetplaceholder { + background-color: var(--colorbgbodydark); +} + .cat-list { color: var(--colorfttitledark); background-color: var(--colorbgbodydark); @@ -568,3 +587,5 @@ border-width: 1px; cursor: pointer; } + + diff --git a/config/packages/oneup_uploader.yaml b/config/packages/oneup_uploader.yaml index 7fd2b2d..a58840f 100755 --- a/config/packages/oneup_uploader.yaml +++ b/config/packages/oneup_uploader.yaml @@ -12,7 +12,16 @@ oneup_uploader: frontend: dropzone storage: directory: "%kernel.project_dir%/var/tmp/icon" + slide: + frontend: dropzone + storage: + directory: "%kernel.project_dir%/var/tmp/slide" header: frontend: dropzone storage: - directory: "%kernel.project_dir%/var/tmp/header" \ No newline at end of file + directory: "%kernel.project_dir%/var/tmp/header" + file: + frontend: dropzone + namer: App\Service\UploadSamename + storage: + directory: "%kernel.project_dir%/var/tmp/file" diff --git a/config/routes.yaml b/config/routes.yaml index 30664a9..9ad23c9 100755 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -197,9 +197,9 @@ app_hydra_consent: #== Ckeditor ==================================================================================================== #-- Access all app_ckeditor_upload: - path: /all/upload + path: /all/upload/{{category}}/{{id}}/{{usage}} controller: App\Controller\MinioController::ckupload - defaults: { access: all } + defaults: { access: all, category: all, id: 0, usage: all } #== Audit ======================================================================================================= #--Access admin @@ -1038,191 +1038,182 @@ app_all_bookmark_heart: #-- Access admin app_admin_file_list: - path: /admin/file/list/{directory} + path: /admin/file/list/{category}/{id} controller: App\Controller\FileController::list defaults: { access: admin } app_admin_file_upload: - path: /admin/file/upload/{id}/{type} + path: /admin/file/upload/{category}/{id}/{type} controller: App\Controller\FileController::upload defaults: { access: admin } -app_admin_file_subdirectory: - path: /admin/file/subdirectory/{id}/{type} - controller: App\Controller\FileController::subdirectory +app_admin_file_folder: + path: /admin/file/folder/{category}/{id} + controller: App\Controller\FileController::folder defaults: { access: admin } app_admin_file_rename: - path: /admin/file/rename/{id}/{oldname} + path: /admin/file/rename/{category}/{id} controller: App\Controller\FileController::rename defaults: { access: admin } app_admin_file_trash: - path: /admin/file/trash/ + path: /admin/file/trash/{category}/{id} controller: App\Controller\FileController::trash defaults: { access: admin } app_admin_file_restaure: - path: /admin/file/restaure/ + path: /admin/file/restaure/{category}/{id} controller: App\Controller\FileController::restaure defaults: { access: admin } app_admin_file_purgetrash: - path: /admin/file/purgetrash/{directory} + path: /admin/file/purgetrash/{category}/{id} controller: App\Controller\FileController::purgetrash defaults: { access: admin } app_admin_file_delete: - path: /admin/file/delete/ + path: /admin/file/delete/{category}/{id} controller: App\Controller\FileController::delete defaults: { access: admin } app_admin_file_move: - path: /admin/file/move/ + path: /admin/file/move/{category}/{id} controller: App\Controller\FileController::move defaults: { access: admin } app_admin_file_view: - path: /admin/file/view/{directory}/{filename} + path: /admin/file/view/{category}/{id} controller: App\Controller\FileController::view - defaults: { access: admin } + defaults: { access: all } app_admin_file_show: - path: /admin/file/show/{directory}/{filename} + path: /admin/file/show/{category}/{id} controller: App\Controller\FileController::show - defaults: { access: admin } + defaults: { access: all } app_admin_file_download: - path: /admin/file/download/{directory}/{filename} + path: /admin/file/download/{category}/{id} controller: App\Controller\FileController::download - defaults: { access: admin } + defaults: { access: all } #-- Access all app_all_file_list: - path: /all/file/list/{directory} + path: /file/list/{category}/{id} controller: App\Controller\FileController::list defaults: { access: all } app_all_file_upload: - path: /all/file/upload/{id}/{type} + path: /all/file/upload/{category}/{id}/{type} controller: App\Controller\FileController::upload defaults: { access: all } -app_all_file_subdirectory: - path: /all/file/subdirectory/{id}/{type} - controller: App\Controller\FileController::subdirectory +app_all_file_folder: + path: /all/file/folder/{category}/{id} + controller: App\Controller\FileController::folder defaults: { access: all } app_all_file_rename: - path: /all/file/rename/{id}/{oldname} + path: /all/file/rename/{category}/{id} controller: App\Controller\FileController::rename defaults: { access: all } app_all_file_trash: - path: /all/file/trash/ + path: /all/file/trash/{category}/{id} controller: App\Controller\FileController::trash defaults: { access: all } app_all_file_restaure: - path: /all/file/restaure/ + path: /all/file/restaure/{category}/{id} controller: App\Controller\FileController::restaure defaults: { access: all } app_all_file_purgetrash: - path: /all/file/purgetrash/{directory} + path: /all/file/purgetrash/{category}/{id} controller: App\Controller\FileController::purgetrash defaults: { access: all } app_all_file_delete: - path: /all/file/delete + path: /all/file/delete/{category}/{id} controller: App\Controller\FileController::delete + defaults: { access: all } app_all_file_move: - path: /all/file/move/ + path: /all/file/move/{category}/{id} controller: App\Controller\FileController::move defaults: { access: all } app_all_file_view: - path: /all/file/view/{directory}/{filename} + path: /file/view/{category}/{id} controller: App\Controller\FileController::view - defaults: { access: all } - -app_all_file_download: - path: /all/file/download/{directory}/{filename} - controller: App\Controller\FileController::download - defaults: { access: all } + defaults: { access: all } app_all_file_show: - path: /all/file/show/{directory}/{filename} + path: /file/show/{category}/{id} controller: App\Controller\FileController::show defaults: { access: all } -#== SLIDE ================================================================================================================================================ +app_all_file_download: + path: /file/download/{category}/{id} + controller: App\Controller\FileController::download + defaults: { access: all } + + + +#== PAGEWIDGETSLIDE ================================================================================================================================================ #-- Access admin -app_admin_slide_list: - path: /config/slide/{idpage}/{idwidget} - controller: App\Controller\SlideController::list +app_admin_pagewidgetslide_upload: + path: /admin/pagewidgetslide/upload/{idwidget} + controller: App\Controller\PagewidgetslideController::upload defaults: { access: admin } -app_admin_slide_submit: - path: /config/slide/submit/{idpage}/{idwidget} - controller: App\Controller\SlideController::submit +app_admin_pagewidgetslide_list: + path: /admin/pagewidgetslide/{idwidget} + controller: App\Controller\PagewidgetslideController::list defaults: { access: admin } -app_admin_slide_update: - path: /config/slide/update/{idpage}/{id} - controller: App\Controller\SlideController::update +app_admin_pagewidgetslide_submit: + path: /config/pagewidgetslide/submit/{idwidget} + controller: App\Controller\PagewidgetslideController::submit defaults: { access: admin } -app_admin_slide_delete: - path: /config/slide/delete/{idpage}/{id} - controller: App\Controller\SlideController::delete +app_admin_pagewidgetslide_update: + path: /admin/pagewidgetslide/update/{idwidget}/{id} + controller: App\Controller\PagewidgetslideController::update defaults: { access: admin } -app_admin_slide_upload: - path: /config/slide/upload - controller: App\Controller\SlideController::upload +app_admin_pagewidgetslide_delete: + path: /admin/pagewidgetslide/delete/{idwidget}/{id} + controller: App\Controller\PagewidgetslideController::delete defaults: { access: admin } #-- Access all -app_all_slide_list: - path: /user/slide/{idpage}/{idwidget} - controller: App\Controller\SlideController::list +app_all_pagewidgetslide_upload: + path: /all/pagewidgetslide/upload/{idwidget} + controller: App\Controller\PagewidgetslideController::upload defaults: { access: all } -app_all_slide_submit: - path: /user/slide/submit/{idpage}/{idwidget} - controller: App\Controller\SlideController::submit +app_all_pagewidgetslide_list: + path: /all/pagewidgetslide/{idwidget} + controller: App\Controller\PagewidgetslideController::list defaults: { access: all } -app_all_slide_update: - path: /user/slide/update/{idpage}/{id} - controller: App\Controller\SlideController::update +app_all_pagewidgetslide_submit: + path: /all/pagewidgetslide/submit/{idwidget} + controller: App\Controller\PagewidgetslideController::submit defaults: { access: all } -app_all_slide_delete: - path: /user/slide/delete/{idpage}/{id} - controller: App\Controller\SlideController::delete +app_all_pagewidgetslide_update: + path: /all/pagewidgetslide/update/{idwidget}/{id} + controller: App\Controller\PagewidgetslideController::update defaults: { access: all } -app_all_slide_upload: - path: /user/slide/upload - controller: App\Controller\SlideController::upload +app_all_pagewidgetslide_delete: + path: /all/pagewidgetslide/delete/{idwidget}/{id} + controller: App\Controller\PagewidgetslideController::delete defaults: { access: all } -#== MESSAGE ================================================================================================================== - -# Access all -app_all_message_chat: - path: /all/message/chat/{id} - controller: App\Controller\WebsocketController::chat - defaults: { access: all } - -app_all_message_see: - path: /all/message/see - controller: App\Controller\WebsocketController::see - defaults: { access: all } #== PAGE TEMPLATE ======================================================================================================================================== @@ -1396,6 +1387,11 @@ app_admin_pagewidget_order: controller: App\Controller\PagewidgetController::order defaults: { access: admin } +app_admin_pagewidget_ckeditor: + path: /admin/pagewidget/ckeditor/{idwidget} + controller: App\Controller\PagewidgetController::ckeditor + defaults: { access: admin } + app_admin_pagewidget_view_url: path: /admin/pagewidget/view/url/{id} controller: App\Controller\PagewidgetController::viewurl @@ -1447,7 +1443,7 @@ app_admin_pagewidget_view_editor: defaults: { access: admin } app_admin_pagewidget_view_slide: - path: /admin/pagewidget/view/slide/{id} + path: /admin/pagewidget/view/pagewidgetslide/{id} controller: App\Controller\PagewidgetController::viewslide defaults: { access: admin } @@ -1517,6 +1513,11 @@ app_all_pagewidget_order: controller: App\Controller\PagewidgetController::order defaults: { access: all } +app_all_pagewidget_ckeditor: + path: /all/pagewidget/ckeditor/{idwidget} + controller: App\Controller\PagewidgetController::ckeditor + defaults: { access: all } + app_all_pagewidget_view_url: path: /pagewidget/view/url/{id} controller: App\Controller\PagewidgetController::viewurl @@ -1568,7 +1569,7 @@ app_all_pagewidget_view_editor: defaults: { access: all } app_all_pagewidget_view_slide: - path: /pagewidget/view/slide/{id} + path: /pagewidget/view/pagewidgetslide/{id} controller: App\Controller\PagewidgetController::viewslide defaults: { access: all } diff --git a/config/services.yaml b/config/services.yaml index f6bde1a..16ade73 100755 --- a/config/services.yaml +++ b/config/services.yaml @@ -174,6 +174,12 @@ services: tags: - name: 'doctrine.event_subscriber' + App\EventListener\PurgefileSubscriber: + public: true + arguments: ['@App\Service\MinioService'] + tags: + - name: 'doctrine.event_subscriber' + App\EventListener\Niveau01Subscriber: public: true arguments: ['@doctrine.orm.entity_manager','@App\Service\LdapService'] @@ -249,6 +255,9 @@ services: arguments: ["@doctrine.orm.entity_manager"] tags: - { name: kernel.event_listener, event: oneup_uploader.post_persist, method: onUpload } + + App\Service\UploadSamename: + public: true App\Service\LdapService: public: true diff --git a/migrations/Version20230123084600.php b/migrations/Version20230201080252.php similarity index 97% rename from migrations/Version20230123084600.php rename to migrations/Version20230201080252.php index 23553ee..45f1554 100644 --- a/migrations/Version20230123084600.php +++ b/migrations/Version20230201080252.php @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; /** * Auto-generated Migration: Please modify to your needs! */ -final class Version20230123084600 extends AbstractMigration +final class Version20230201080252 extends AbstractMigration { public function getDescription(): string { @@ -36,8 +36,8 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('CREATE SEQUENCE page_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE pagecategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE pagewidget_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE pagewidgetslide_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE registration_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE slide_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE useraccount_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE usergroupe_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE usermodo_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); @@ -107,6 +107,8 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('CREATE INDEX IDX_69400D9AFBE885E2 ON pagewidget (widget_id)'); $this->addSql('CREATE INDEX IDX_69400D9A54B9D732 ON pagewidget (icon_id)'); $this->addSql('COMMENT ON COLUMN pagewidget.parameter IS \'(DC2Type:array)\''); + $this->addSql('CREATE TABLE pagewidgetslide (id INT NOT NULL, pagewidget_id INT DEFAULT NULL, title VARCHAR(100) DEFAULT NULL, subtitle VARCHAR(250) DEFAULT NULL, url VARCHAR(500) DEFAULT NULL, target VARCHAR(32) NOT NULL, roworder INT DEFAULT NULL, image VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE INDEX IDX_DF96542055B7C7A2 ON pagewidgetslide (pagewidget_id)'); $this->addSql('CREATE TABLE registration (id INT NOT NULL, niveau01_id INT NOT NULL, niveau02_id INT DEFAULT NULL, niveau03_id INT DEFAULT NULL, niveau04_id INT DEFAULT NULL, username VARCHAR(128) NOT NULL, firstname VARCHAR(250) DEFAULT NULL, lastname VARCHAR(250) DEFAULT NULL, password VARCHAR(250) NOT NULL, salt VARCHAR(250) NOT NULL, email VARCHAR(128) NOT NULL, isvisible BOOLEAN NOT NULL, postaladress VARCHAR(250) DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, job VARCHAR(250) DEFAULT NULL, position VARCHAR(250) DEFAULT NULL, motivation TEXT DEFAULT NULL, note TEXT DEFAULT NULL, keyexpire TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, keyvalue VARCHAR(60) DEFAULT NULL, statut INT NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX UNIQ_62A8A7A7F85E0677 ON registration (username)'); $this->addSql('CREATE UNIQUE INDEX UNIQ_62A8A7A7E7927C74 ON registration (email)'); @@ -114,8 +116,6 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('CREATE INDEX IDX_62A8A7A74B487845 ON registration (niveau02_id)'); $this->addSql('CREATE INDEX IDX_62A8A7A7F3F41F20 ON registration (niveau03_id)'); $this->addSql('CREATE INDEX IDX_62A8A7A76E232799 ON registration (niveau04_id)'); - $this->addSql('CREATE TABLE slide (id INT NOT NULL, pagewidget_id INT DEFAULT NULL, title VARCHAR(100) DEFAULT NULL, subtitle VARCHAR(250) DEFAULT NULL, url VARCHAR(500) DEFAULT NULL, target VARCHAR(32) NOT NULL, roworder INT DEFAULT NULL, image VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_72EFEE6255B7C7A2 ON slide (pagewidget_id)'); $this->addSql('CREATE TABLE useraccount (id INT NOT NULL, niveau01_id INT NOT NULL, niveau02_id INT DEFAULT NULL, niveau03_id INT DEFAULT NULL, niveau04_id INT DEFAULT NULL, username VARCHAR(128) NOT NULL, apikey VARCHAR(255) NOT NULL, firstname VARCHAR(250) DEFAULT NULL, lastname VARCHAR(250) DEFAULT NULL, roles TEXT NOT NULL, password VARCHAR(250) NOT NULL, salt VARCHAR(250) NOT NULL, isactive BOOLEAN NOT NULL, email VARCHAR(128) NOT NULL, avatar VARCHAR(250) DEFAULT \'0\', isvisible BOOLEAN NOT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, job VARCHAR(250) DEFAULT NULL, position VARCHAR(250) DEFAULT NULL, motivation TEXT DEFAULT NULL, note TEXT DEFAULT NULL, preference TEXT DEFAULT NULL, keyexpire TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, keyvalue VARCHAR(60) DEFAULT NULL, visitedate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, visitecpt INT DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE UNIQUE INDEX UNIQ_E157AA1AF85E0677 ON useraccount (username)'); $this->addSql('CREATE UNIQUE INDEX UNIQ_E157AA1AE7927C74 ON useraccount (email)'); @@ -179,11 +179,11 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9AC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9AFBE885E2 FOREIGN KEY (widget_id) REFERENCES widget (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9A54B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE pagewidgetslide ADD CONSTRAINT FK_DF96542055B7C7A2 FOREIGN KEY (pagewidget_id) REFERENCES pagewidget (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A759FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A74B487845 FOREIGN KEY (niveau02_id) REFERENCES niveau02 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A7F3F41F20 FOREIGN KEY (niveau03_id) REFERENCES niveau03 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A76E232799 FOREIGN KEY (niveau04_id) REFERENCES niveau04 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE slide ADD CONSTRAINT FK_72EFEE6255B7C7A2 FOREIGN KEY (pagewidget_id) REFERENCES pagewidget (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1A59FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1A4B487845 FOREIGN KEY (niveau02_id) REFERENCES niveau02 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1AF3F41F20 FOREIGN KEY (niveau03_id) REFERENCES niveau03 (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); @@ -215,8 +215,8 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('DROP SEQUENCE page_id_seq CASCADE'); $this->addSql('DROP SEQUENCE pagecategory_id_seq CASCADE'); $this->addSql('DROP SEQUENCE pagewidget_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE pagewidgetslide_id_seq CASCADE'); $this->addSql('DROP SEQUENCE registration_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE slide_id_seq CASCADE'); $this->addSql('DROP SEQUENCE useraccount_id_seq CASCADE'); $this->addSql('DROP SEQUENCE usergroupe_id_seq CASCADE'); $this->addSql('DROP SEQUENCE usermodo_id_seq CASCADE'); @@ -251,11 +251,11 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9AC4663E4'); $this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9AFBE885E2'); $this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9A54B9D732'); + $this->addSql('ALTER TABLE pagewidgetslide DROP CONSTRAINT FK_DF96542055B7C7A2'); $this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A759FDD7AB'); $this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A74B487845'); $this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A7F3F41F20'); $this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A76E232799'); - $this->addSql('ALTER TABLE slide DROP CONSTRAINT FK_72EFEE6255B7C7A2'); $this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1A59FDD7AB'); $this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1A4B487845'); $this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1AF3F41F20'); @@ -286,8 +286,8 @@ final class Version20230123084600 extends AbstractMigration $this->addSql('DROP TABLE pagegroupe'); $this->addSql('DROP TABLE pagecategory'); $this->addSql('DROP TABLE pagewidget'); + $this->addSql('DROP TABLE pagewidgetslide'); $this->addSql('DROP TABLE registration'); - $this->addSql('DROP TABLE slide'); $this->addSql('DROP TABLE useraccount'); $this->addSql('DROP TABLE usergroupe'); $this->addSql('DROP TABLE usermodo'); diff --git a/package.json b/package.json index fa9a44c..25e4af3 100755 --- a/package.json +++ b/package.json @@ -28,10 +28,13 @@ "dropzone": "^6.0.0-beta.2", "file-loader": "^6.2.0", "iframe-resizer": "^4.3.2", + "imagesloaded": "^5.0.0", "jquery": "^3.6.0", "jquery-ui": "^1.13.1", "jqueryui": "^1.11.1", + "masonry-layout": "^4.2.2", "select2": "^4.1.0-rc.0", + "slick-carousel": "^1.8.1", "spectrum-colorpicker2": "^2.0.9", "yarn": "^1.22.19" } diff --git a/public/medias/file/3gp.png b/public/medias/file/3gp.png new file mode 100644 index 0000000..ee4ffa1 Binary files /dev/null and b/public/medias/file/3gp.png differ diff --git a/public/medias/file/7z.png b/public/medias/file/7z.png new file mode 100644 index 0000000..c633275 Binary files /dev/null and b/public/medias/file/7z.png differ diff --git a/public/medias/file/aac.png b/public/medias/file/aac.png new file mode 100644 index 0000000..68b0e15 Binary files /dev/null and b/public/medias/file/aac.png differ diff --git a/public/medias/file/ace.png b/public/medias/file/ace.png new file mode 100644 index 0000000..8eadf55 Binary files /dev/null and b/public/medias/file/ace.png differ diff --git a/public/medias/file/ai.png b/public/medias/file/ai.png new file mode 100644 index 0000000..13331d3 Binary files /dev/null and b/public/medias/file/ai.png differ diff --git a/public/medias/file/aicf.png b/public/medias/file/aicf.png new file mode 100644 index 0000000..abb5baf Binary files /dev/null and b/public/medias/file/aicf.png differ diff --git a/public/medias/file/aif.png b/public/medias/file/aif.png new file mode 100644 index 0000000..e1ec3e2 Binary files /dev/null and b/public/medias/file/aif.png differ diff --git a/public/medias/file/aiff.png b/public/medias/file/aiff.png new file mode 100644 index 0000000..f9f1faf Binary files /dev/null and b/public/medias/file/aiff.png differ diff --git a/public/medias/file/amr.png b/public/medias/file/amr.png new file mode 100644 index 0000000..2a8cdd3 Binary files /dev/null and b/public/medias/file/amr.png differ diff --git a/public/medias/file/asf.png b/public/medias/file/asf.png new file mode 100644 index 0000000..e34af3d Binary files /dev/null and b/public/medias/file/asf.png differ diff --git a/public/medias/file/asp.png b/public/medias/file/asp.png new file mode 100644 index 0000000..3895234 Binary files /dev/null and b/public/medias/file/asp.png differ diff --git a/public/medias/file/asx.png b/public/medias/file/asx.png new file mode 100644 index 0000000..86d43f7 Binary files /dev/null and b/public/medias/file/asx.png differ diff --git a/public/medias/file/aut.png b/public/medias/file/aut.png new file mode 100644 index 0000000..ec47d78 Binary files /dev/null and b/public/medias/file/aut.png differ diff --git a/public/medias/file/avi.png b/public/medias/file/avi.png new file mode 100644 index 0000000..b99e130 Binary files /dev/null and b/public/medias/file/avi.png differ diff --git a/public/medias/file/bat.png b/public/medias/file/bat.png new file mode 100644 index 0000000..99bf8e2 Binary files /dev/null and b/public/medias/file/bat.png differ diff --git a/public/medias/file/bin.png b/public/medias/file/bin.png new file mode 100644 index 0000000..95a18b4 Binary files /dev/null and b/public/medias/file/bin.png differ diff --git a/public/medias/file/blank.png b/public/medias/file/blank.png new file mode 100644 index 0000000..ae53a4e Binary files /dev/null and b/public/medias/file/blank.png differ diff --git a/public/medias/file/blend.png b/public/medias/file/blend.png new file mode 100644 index 0000000..034d2a3 Binary files /dev/null and b/public/medias/file/blend.png differ diff --git a/public/medias/file/bmp.png b/public/medias/file/bmp.png new file mode 100644 index 0000000..cf2fc0c Binary files /dev/null and b/public/medias/file/bmp.png differ diff --git a/public/medias/file/bup.png b/public/medias/file/bup.png new file mode 100644 index 0000000..b3cf601 Binary files /dev/null and b/public/medias/file/bup.png differ diff --git a/public/medias/file/c.png b/public/medias/file/c.png new file mode 100644 index 0000000..249e6c7 Binary files /dev/null and b/public/medias/file/c.png differ diff --git a/public/medias/file/cab.png b/public/medias/file/cab.png new file mode 100644 index 0000000..937b996 Binary files /dev/null and b/public/medias/file/cab.png differ diff --git a/public/medias/file/cad.png b/public/medias/file/cad.png new file mode 100644 index 0000000..8feb4fa Binary files /dev/null and b/public/medias/file/cad.png differ diff --git a/public/medias/file/cbr.png b/public/medias/file/cbr.png new file mode 100644 index 0000000..ee2e599 Binary files /dev/null and b/public/medias/file/cbr.png differ diff --git a/public/medias/file/cda.png b/public/medias/file/cda.png new file mode 100644 index 0000000..6e50176 Binary files /dev/null and b/public/medias/file/cda.png differ diff --git a/public/medias/file/cdl.png b/public/medias/file/cdl.png new file mode 100644 index 0000000..8ff738f Binary files /dev/null and b/public/medias/file/cdl.png differ diff --git a/public/medias/file/cdr.png b/public/medias/file/cdr.png new file mode 100644 index 0000000..8cebfdd Binary files /dev/null and b/public/medias/file/cdr.png differ diff --git a/public/medias/file/chm.png b/public/medias/file/chm.png new file mode 100644 index 0000000..7725a59 Binary files /dev/null and b/public/medias/file/chm.png differ diff --git a/public/medias/file/com.png b/public/medias/file/com.png new file mode 100644 index 0000000..5ffb3f4 Binary files /dev/null and b/public/medias/file/com.png differ diff --git a/public/medias/file/cpp.png b/public/medias/file/cpp.png new file mode 100644 index 0000000..0a6cd8b Binary files /dev/null and b/public/medias/file/cpp.png differ diff --git a/public/medias/file/cs.png b/public/medias/file/cs.png new file mode 100644 index 0000000..1b5614f Binary files /dev/null and b/public/medias/file/cs.png differ diff --git a/public/medias/file/css.png b/public/medias/file/css.png new file mode 100644 index 0000000..063cf1c Binary files /dev/null and b/public/medias/file/css.png differ diff --git a/public/medias/file/csv.png b/public/medias/file/csv.png new file mode 100644 index 0000000..a30188a Binary files /dev/null and b/public/medias/file/csv.png differ diff --git a/public/medias/file/dat.png b/public/medias/file/dat.png new file mode 100644 index 0000000..971e364 Binary files /dev/null and b/public/medias/file/dat.png differ diff --git a/public/medias/file/db.png b/public/medias/file/db.png new file mode 100644 index 0000000..934aafd Binary files /dev/null and b/public/medias/file/db.png differ diff --git a/public/medias/file/dir.png b/public/medias/file/dir.png new file mode 100644 index 0000000..9f7319f Binary files /dev/null and b/public/medias/file/dir.png differ diff --git a/public/medias/file/divx.png b/public/medias/file/divx.png new file mode 100644 index 0000000..ba65f7c Binary files /dev/null and b/public/medias/file/divx.png differ diff --git a/public/medias/file/dll.png b/public/medias/file/dll.png new file mode 100644 index 0000000..58b366c Binary files /dev/null and b/public/medias/file/dll.png differ diff --git a/public/medias/file/dmg.png b/public/medias/file/dmg.png new file mode 100644 index 0000000..3639185 Binary files /dev/null and b/public/medias/file/dmg.png differ diff --git a/public/medias/file/doc.png b/public/medias/file/doc.png new file mode 100644 index 0000000..0dcd05a Binary files /dev/null and b/public/medias/file/doc.png differ diff --git a/public/medias/file/docx.png b/public/medias/file/docx.png new file mode 100644 index 0000000..0257601 Binary files /dev/null and b/public/medias/file/docx.png differ diff --git a/public/medias/file/dotx.png b/public/medias/file/dotx.png new file mode 100644 index 0000000..b0220e3 Binary files /dev/null and b/public/medias/file/dotx.png differ diff --git a/public/medias/file/dss.png b/public/medias/file/dss.png new file mode 100644 index 0000000..19b6cad Binary files /dev/null and b/public/medias/file/dss.png differ diff --git a/public/medias/file/dvf.png b/public/medias/file/dvf.png new file mode 100644 index 0000000..4aba6cd Binary files /dev/null and b/public/medias/file/dvf.png differ diff --git a/public/medias/file/dwf.png b/public/medias/file/dwf.png new file mode 100644 index 0000000..1ccf432 Binary files /dev/null and b/public/medias/file/dwf.png differ diff --git a/public/medias/file/dwg.png b/public/medias/file/dwg.png new file mode 100644 index 0000000..3563237 Binary files /dev/null and b/public/medias/file/dwg.png differ diff --git a/public/medias/file/dxf.png b/public/medias/file/dxf.png new file mode 100644 index 0000000..2ed2465 Binary files /dev/null and b/public/medias/file/dxf.png differ diff --git a/public/medias/file/eml.png b/public/medias/file/eml.png new file mode 100644 index 0000000..21b0d72 Binary files /dev/null and b/public/medias/file/eml.png differ diff --git a/public/medias/file/eps.png b/public/medias/file/eps.png new file mode 100644 index 0000000..e3632e0 Binary files /dev/null and b/public/medias/file/eps.png differ diff --git a/public/medias/file/epub.png b/public/medias/file/epub.png new file mode 100644 index 0000000..a166ef4 Binary files /dev/null and b/public/medias/file/epub.png differ diff --git a/public/medias/file/exe.png b/public/medias/file/exe.png new file mode 100644 index 0000000..3faad87 Binary files /dev/null and b/public/medias/file/exe.png differ diff --git a/public/medias/file/files.json b/public/medias/file/files.json new file mode 100644 index 0000000..9f8c15d --- /dev/null +++ b/public/medias/file/files.json @@ -0,0 +1 @@ +{"mcd":"\/medias\/file\/mcd.png","epub":"\/medias\/file\/epub.png","qxd":"\/medias\/file\/qxd.png","docx":"\/medias\/file\/docx.png","ace":"\/medias\/file\/ace.png","rar":"\/medias\/file\/rar.png","rm":"\/medias\/file\/rm.png","rss":"\/medias\/file\/rss.png","cab":"\/medias\/file\/cab.png","eps":"\/medias\/file\/eps.png","odg":"\/medias\/file\/odg.png","asp":"\/medias\/file\/asp.png","cdl":"\/medias\/file\/cdl.png","asx":"\/medias\/file\/asx.png","dxf":"\/medias\/file\/dxf.png","ps":"\/medias\/file\/ps.png","odi":"\/medias\/file\/odi.png","bmp":"\/medias\/file\/bmp.png","aiff":"\/medias\/file\/aiff.png","pdd":"\/medias\/file\/pdd.png","ptb":"\/medias\/file\/ptb.png","ses":"\/medias\/file\/ses.png","mov":"\/medias\/file\/mov.png","ods":"\/medias\/file\/ods.png","doc":"\/medias\/file\/doc.png","vob":"\/medias\/file\/vob.png","mdb":"\/medias\/file\/mdb.png","c":"\/medias\/file\/c.png","blank":"\/medias\/file\/blank.png","aif":"\/medias\/file\/aif.png","rw":"\/medias\/file\/rw.png","tga":"\/medias\/file\/tga.png","odc":"\/medias\/file\/odc.png","odf":"\/medias\/file\/odf.png","page":"\/medias\/file\/page.png","xtm":"\/medias\/file\/xtm.png","swf":"\/medias\/file\/swf.png","sitx":"\/medias\/file\/sitx.png","dir":"\/medias\/file\/dir.png","aut":"\/medias\/file\/aut.png","flac":"\/medias\/file\/flac.png","cda":"\/medias\/file\/cda.png","ppt":"\/medias\/file\/ppt.png","m4v":"\/medias\/file\/m4v.png","java":"\/medias\/file\/java.png","dll":"\/medias\/file\/dll.png","resx":"\/medias\/file\/resx.png","otf":"\/medias\/file\/otf.png","webm":"\/medias\/file\/webm.png","gz":"\/medias\/file\/gz.png","m4b":"\/medias\/file\/m4b.png","oti":"\/medias\/file\/oti.png","hpp":"\/medias\/file\/hpp.png","asf":"\/medias\/file\/asf.png","php":"\/medias\/file\/php.png","zip":"\/medias\/file\/zip.png","ai":"\/medias\/file\/ai.png","indd":"\/medias\/file\/indd.png","dotx":"\/medias\/file\/dotx.png","opt":"\/medias\/file\/opt.png","mid":"\/medias\/file\/mid.png","exe":"\/medias\/file\/exe.png","h":"\/medias\/file\/h.png","wma":"\/medias\/file\/wma.png","otc":"\/medias\/file\/otc.png","svg":"\/medias\/file\/svg.png","xar":"\/medias\/file\/xar.png","py":"\/medias\/file\/py.png","msi":"\/medias\/file\/msi.png","wav":"\/medias\/file\/wav.png","log":"\/medias\/file\/log.png","sln":"\/medias\/file\/sln.png","rtf":"\/medias\/file\/rtf.png","dmg":"\/medias\/file\/dmg.png","cdr":"\/medias\/file\/cdr.png","amr":"\/medias\/file\/amr.png","psd":"\/medias\/file\/psd.png","odt":"\/medias\/file\/odt.png","xls":"\/medias\/file\/xls.png","css":"\/medias\/file\/css.png","xcf":"\/medias\/file\/xcf.png","cad":"\/medias\/file\/cad.png","blend":"\/medias\/file\/blend.png","com":"\/medias\/file\/com.png","3gp":"\/medias\/file\/3gp.png","ifo":"\/medias\/file\/ifo.png","divx":"\/medias\/file\/divx.png","hqx":"\/medias\/file\/hqx.png","mp4":"\/medias\/file\/mp4.png","sass":"\/medias\/file\/sass.png","hlp":"\/medias\/file\/hlp.png","trt":"\/medias\/file\/trt.png","odm":"\/medias\/file\/odm.png","oth":"\/medias\/file\/oth.png","cbr":"\/medias\/file\/cbr.png","key":"\/medias\/file\/key.png","pdf":"\/medias\/file\/pdf.png","ini":"\/medias\/file\/ini.png","ogg":"\/medias\/file\/ogg.png","pdb":"\/medias\/file\/pdb.png","fla":"\/medias\/file\/fla.png","csv":"\/medias\/file\/csv.png","bin":"\/medias\/file\/bin.png","gif":"\/medias\/file\/gif.png","tiff":"\/medias\/file\/tiff.png","wmv":"\/medias\/file\/wmv.png","less":"\/medias\/file\/less.png","otg":"\/medias\/file\/otg.png","qxp":"\/medias\/file\/qxp.png","mp3":"\/medias\/file\/mp3.png","cs":"\/medias\/file\/cs.png","pcx":"\/medias\/file\/pcx.png","avi":"\/medias\/file\/avi.png","flv":"\/medias\/file\/flv.png","html":"\/medias\/file\/html.png","m4p":"\/medias\/file\/m4p.png","qbb":"\/medias\/file\/qbb.png","dwf":"\/medias\/file\/dwf.png","jpg":"\/medias\/file\/jpg.png","png":"\/medias\/file\/png.png","vcd":"\/medias\/file\/vcd.png","wpd":"\/medias\/file\/wpd.png","rb":"\/medias\/file\/rb.png","cpp":"\/medias\/file\/cpp.png","pub":"\/medias\/file\/pub.png","rmvb":"\/medias\/file\/rmvb.png","webp":"\/medias\/file\/webp.png","qt":"\/medias\/file\/qt.png","ram":"\/medias\/file\/ram.png","7z":"\/medias\/file\/7z.png","sit":"\/medias\/file\/sit.png","jpeg":"\/medias\/file\/jpeg.png","pps":"\/medias\/file\/pps.png","db":"\/medias\/file\/db.png","sys":"\/medias\/file\/sys.png","ott":"\/medias\/file\/ott.png","aicf":"\/medias\/file\/aicf.png","xlsx":"\/medias\/file\/xlsx.png","tif":"\/medias\/file\/tif.png","ics":"\/medias\/file\/ics.png","xaml":"\/medias\/file\/xaml.png","xhtml":"\/medias\/file\/xhtml.png","pptx":"\/medias\/file\/pptx.png","odb":"\/medias\/file\/odb.png","ink":"\/medias\/file\/ink.png","jar":"\/medias\/file\/jar.png","xml":"\/medias\/file\/xml.png","sea":"\/medias\/file\/sea.png","aac":"\/medias\/file\/aac.png","js":"\/medias\/file\/js.png","mpeg":"\/medias\/file\/mpeg.png","otp":"\/medias\/file\/otp.png","rax":"\/medias\/file\/rax.png","scss":"\/medias\/file\/scss.png","qbw":"\/medias\/file\/qbw.png","sql":"\/medias\/file\/sql.png","txt":"\/medias\/file\/txt.png","dwg":"\/medias\/file\/dwg.png","bup":"\/medias\/file\/bup.png","yml":"\/medias\/file\/yml.png","ttf":"\/medias\/file\/ttf.png","mkv":"\/medias\/file\/mkv.png","tgz":"\/medias\/file\/tgz.png","ots":"\/medias\/file\/ots.png","dss":"\/medias\/file\/dss.png","ss":"\/medias\/file\/ss.png","chm":"\/medias\/file\/chm.png","dat":"\/medias\/file\/dat.png","pmg":"\/medias\/file\/pmg.png","ico":"\/medias\/file\/ico.png","ptt":"\/medias\/file\/ptt.png","eml":"\/medias\/file\/eml.png","mp2":"\/medias\/file\/mp2.png","bat":"\/medias\/file\/bat.png","htm":"\/medias\/file\/htm.png","lnk":"\/medias\/file\/lnk.png","net":"\/medias\/file\/net.png","dvf":"\/medias\/file\/dvf.png","mpg":"\/medias\/file\/mpg.png","iso":"\/medias\/file\/iso.png","wps":"\/medias\/file\/wps.png"} \ No newline at end of file diff --git a/public/medias/file/fla.png b/public/medias/file/fla.png new file mode 100644 index 0000000..74181e8 Binary files /dev/null and b/public/medias/file/fla.png differ diff --git a/public/medias/file/flac.png b/public/medias/file/flac.png new file mode 100644 index 0000000..d51e0fb Binary files /dev/null and b/public/medias/file/flac.png differ diff --git a/public/medias/file/flv.png b/public/medias/file/flv.png new file mode 100644 index 0000000..73bc4cc Binary files /dev/null and b/public/medias/file/flv.png differ diff --git a/public/medias/file/gif.png b/public/medias/file/gif.png new file mode 100644 index 0000000..6b07d08 Binary files /dev/null and b/public/medias/file/gif.png differ diff --git a/public/medias/file/gz.png b/public/medias/file/gz.png new file mode 100644 index 0000000..f502d1b Binary files /dev/null and b/public/medias/file/gz.png differ diff --git a/public/medias/file/h.png b/public/medias/file/h.png new file mode 100644 index 0000000..f5cc5e5 Binary files /dev/null and b/public/medias/file/h.png differ diff --git a/public/medias/file/hlp.png b/public/medias/file/hlp.png new file mode 100644 index 0000000..b76a27f Binary files /dev/null and b/public/medias/file/hlp.png differ diff --git a/public/medias/file/hpp.png b/public/medias/file/hpp.png new file mode 100644 index 0000000..ddcc8bf Binary files /dev/null and b/public/medias/file/hpp.png differ diff --git a/public/medias/file/hqx.png b/public/medias/file/hqx.png new file mode 100644 index 0000000..7a79c37 Binary files /dev/null and b/public/medias/file/hqx.png differ diff --git a/public/medias/file/htm.png b/public/medias/file/htm.png new file mode 100644 index 0000000..5bd36e1 Binary files /dev/null and b/public/medias/file/htm.png differ diff --git a/public/medias/file/html.png b/public/medias/file/html.png new file mode 100644 index 0000000..1feb23f Binary files /dev/null and b/public/medias/file/html.png differ diff --git a/public/medias/file/ico.png b/public/medias/file/ico.png new file mode 100644 index 0000000..f9fa9db Binary files /dev/null and b/public/medias/file/ico.png differ diff --git a/public/medias/file/ics.png b/public/medias/file/ics.png new file mode 100644 index 0000000..7a0f5c0 Binary files /dev/null and b/public/medias/file/ics.png differ diff --git a/public/medias/file/ifo.png b/public/medias/file/ifo.png new file mode 100644 index 0000000..564a756 Binary files /dev/null and b/public/medias/file/ifo.png differ diff --git a/public/medias/file/indd.png b/public/medias/file/indd.png new file mode 100644 index 0000000..986f2cf Binary files /dev/null and b/public/medias/file/indd.png differ diff --git a/public/medias/file/ini.png b/public/medias/file/ini.png new file mode 100644 index 0000000..c733325 Binary files /dev/null and b/public/medias/file/ini.png differ diff --git a/public/medias/file/ink.png b/public/medias/file/ink.png new file mode 100644 index 0000000..9bae508 Binary files /dev/null and b/public/medias/file/ink.png differ diff --git a/public/medias/file/iso.png b/public/medias/file/iso.png new file mode 100644 index 0000000..deb838d Binary files /dev/null and b/public/medias/file/iso.png differ diff --git a/public/medias/file/jar.png b/public/medias/file/jar.png new file mode 100644 index 0000000..7bfdf12 Binary files /dev/null and b/public/medias/file/jar.png differ diff --git a/public/medias/file/java.png b/public/medias/file/java.png new file mode 100644 index 0000000..6f108d6 Binary files /dev/null and b/public/medias/file/java.png differ diff --git a/public/medias/file/jpeg.png b/public/medias/file/jpeg.png new file mode 100644 index 0000000..f3df5d5 Binary files /dev/null and b/public/medias/file/jpeg.png differ diff --git a/public/medias/file/jpg.png b/public/medias/file/jpg.png new file mode 100644 index 0000000..2643b51 Binary files /dev/null and b/public/medias/file/jpg.png differ diff --git a/public/medias/file/js.png b/public/medias/file/js.png new file mode 100644 index 0000000..00d60ec Binary files /dev/null and b/public/medias/file/js.png differ diff --git a/public/medias/file/key.png b/public/medias/file/key.png new file mode 100644 index 0000000..44ab47e Binary files /dev/null and b/public/medias/file/key.png differ diff --git a/public/medias/file/less.png b/public/medias/file/less.png new file mode 100644 index 0000000..2d7b56f Binary files /dev/null and b/public/medias/file/less.png differ diff --git a/public/medias/file/lnk.png b/public/medias/file/lnk.png new file mode 100644 index 0000000..4c3bf40 Binary files /dev/null and b/public/medias/file/lnk.png differ diff --git a/public/medias/file/log.png b/public/medias/file/log.png new file mode 100644 index 0000000..373ce68 Binary files /dev/null and b/public/medias/file/log.png differ diff --git a/public/medias/file/m4b.png b/public/medias/file/m4b.png new file mode 100644 index 0000000..2ca9eaa Binary files /dev/null and b/public/medias/file/m4b.png differ diff --git a/public/medias/file/m4p.png b/public/medias/file/m4p.png new file mode 100644 index 0000000..66e5ca1 Binary files /dev/null and b/public/medias/file/m4p.png differ diff --git a/public/medias/file/m4v.png b/public/medias/file/m4v.png new file mode 100644 index 0000000..89968d1 Binary files /dev/null and b/public/medias/file/m4v.png differ diff --git a/public/medias/file/mcd.png b/public/medias/file/mcd.png new file mode 100644 index 0000000..79181cf Binary files /dev/null and b/public/medias/file/mcd.png differ diff --git a/public/medias/file/mdb.png b/public/medias/file/mdb.png new file mode 100644 index 0000000..7e1c904 Binary files /dev/null and b/public/medias/file/mdb.png differ diff --git a/public/medias/file/mid.png b/public/medias/file/mid.png new file mode 100644 index 0000000..fc50598 Binary files /dev/null and b/public/medias/file/mid.png differ diff --git a/public/medias/file/mkv.png b/public/medias/file/mkv.png new file mode 100644 index 0000000..ad2af8a Binary files /dev/null and b/public/medias/file/mkv.png differ diff --git a/public/medias/file/mov.png b/public/medias/file/mov.png new file mode 100644 index 0000000..54a8cc3 Binary files /dev/null and b/public/medias/file/mov.png differ diff --git a/public/medias/file/mp2.png b/public/medias/file/mp2.png new file mode 100644 index 0000000..b7d2dd7 Binary files /dev/null and b/public/medias/file/mp2.png differ diff --git a/public/medias/file/mp3.png b/public/medias/file/mp3.png new file mode 100644 index 0000000..b867f08 Binary files /dev/null and b/public/medias/file/mp3.png differ diff --git a/public/medias/file/mp4.png b/public/medias/file/mp4.png new file mode 100644 index 0000000..19e9c39 Binary files /dev/null and b/public/medias/file/mp4.png differ diff --git a/public/medias/file/mpeg.png b/public/medias/file/mpeg.png new file mode 100644 index 0000000..60f930e Binary files /dev/null and b/public/medias/file/mpeg.png differ diff --git a/public/medias/file/mpg.png b/public/medias/file/mpg.png new file mode 100644 index 0000000..ecdd37b Binary files /dev/null and b/public/medias/file/mpg.png differ diff --git a/public/medias/file/msi.png b/public/medias/file/msi.png new file mode 100644 index 0000000..788838f Binary files /dev/null and b/public/medias/file/msi.png differ diff --git a/public/medias/file/net.png b/public/medias/file/net.png new file mode 100644 index 0000000..da162c1 Binary files /dev/null and b/public/medias/file/net.png differ diff --git a/public/medias/file/odb.png b/public/medias/file/odb.png new file mode 100644 index 0000000..f032d43 Binary files /dev/null and b/public/medias/file/odb.png differ diff --git a/public/medias/file/odc.png b/public/medias/file/odc.png new file mode 100644 index 0000000..422129d Binary files /dev/null and b/public/medias/file/odc.png differ diff --git a/public/medias/file/odf.png b/public/medias/file/odf.png new file mode 100644 index 0000000..8173771 Binary files /dev/null and b/public/medias/file/odf.png differ diff --git a/public/medias/file/odg.png b/public/medias/file/odg.png new file mode 100644 index 0000000..b972510 Binary files /dev/null and b/public/medias/file/odg.png differ diff --git a/public/medias/file/odi.png b/public/medias/file/odi.png new file mode 100644 index 0000000..539dfe7 Binary files /dev/null and b/public/medias/file/odi.png differ diff --git a/public/medias/file/odm.png b/public/medias/file/odm.png new file mode 100644 index 0000000..be66724 Binary files /dev/null and b/public/medias/file/odm.png differ diff --git a/public/medias/file/ods.png b/public/medias/file/ods.png new file mode 100644 index 0000000..a3c5cc2 Binary files /dev/null and b/public/medias/file/ods.png differ diff --git a/public/medias/file/odt.png b/public/medias/file/odt.png new file mode 100644 index 0000000..1e72fd4 Binary files /dev/null and b/public/medias/file/odt.png differ diff --git a/public/medias/file/ogg.png b/public/medias/file/ogg.png new file mode 100644 index 0000000..6c76a4b Binary files /dev/null and b/public/medias/file/ogg.png differ diff --git a/public/medias/file/opt.png b/public/medias/file/opt.png new file mode 100644 index 0000000..840eebe Binary files /dev/null and b/public/medias/file/opt.png differ diff --git a/public/medias/file/otc.png b/public/medias/file/otc.png new file mode 100644 index 0000000..3421dcd Binary files /dev/null and b/public/medias/file/otc.png differ diff --git a/public/medias/file/otf.png b/public/medias/file/otf.png new file mode 100644 index 0000000..47cc793 Binary files /dev/null and b/public/medias/file/otf.png differ diff --git a/public/medias/file/otg.png b/public/medias/file/otg.png new file mode 100644 index 0000000..b71fd8a Binary files /dev/null and b/public/medias/file/otg.png differ diff --git a/public/medias/file/oth.png b/public/medias/file/oth.png new file mode 100644 index 0000000..32e6482 Binary files /dev/null and b/public/medias/file/oth.png differ diff --git a/public/medias/file/oti.png b/public/medias/file/oti.png new file mode 100644 index 0000000..cab8add Binary files /dev/null and b/public/medias/file/oti.png differ diff --git a/public/medias/file/otp.png b/public/medias/file/otp.png new file mode 100644 index 0000000..b419dc6 Binary files /dev/null and b/public/medias/file/otp.png differ diff --git a/public/medias/file/ots.png b/public/medias/file/ots.png new file mode 100644 index 0000000..712b039 Binary files /dev/null and b/public/medias/file/ots.png differ diff --git a/public/medias/file/ott.png b/public/medias/file/ott.png new file mode 100644 index 0000000..2540efd Binary files /dev/null and b/public/medias/file/ott.png differ diff --git a/public/medias/file/page.png b/public/medias/file/page.png new file mode 100644 index 0000000..b8d155e Binary files /dev/null and b/public/medias/file/page.png differ diff --git a/public/medias/file/pcx.png b/public/medias/file/pcx.png new file mode 100644 index 0000000..01f4acf Binary files /dev/null and b/public/medias/file/pcx.png differ diff --git a/public/medias/file/pdb.png b/public/medias/file/pdb.png new file mode 100644 index 0000000..0784213 Binary files /dev/null and b/public/medias/file/pdb.png differ diff --git a/public/medias/file/pdd.png b/public/medias/file/pdd.png new file mode 100644 index 0000000..54c73e1 Binary files /dev/null and b/public/medias/file/pdd.png differ diff --git a/public/medias/file/pdf.png b/public/medias/file/pdf.png new file mode 100644 index 0000000..b409dfe Binary files /dev/null and b/public/medias/file/pdf.png differ diff --git a/public/medias/file/php.png b/public/medias/file/php.png new file mode 100644 index 0000000..ae7f312 Binary files /dev/null and b/public/medias/file/php.png differ diff --git a/public/medias/file/pmg.png b/public/medias/file/pmg.png new file mode 100644 index 0000000..4d46b5f Binary files /dev/null and b/public/medias/file/pmg.png differ diff --git a/public/medias/file/png.png b/public/medias/file/png.png new file mode 100644 index 0000000..5b7231e Binary files /dev/null and b/public/medias/file/png.png differ diff --git a/public/medias/file/pps.png b/public/medias/file/pps.png new file mode 100644 index 0000000..b54a48c Binary files /dev/null and b/public/medias/file/pps.png differ diff --git a/public/medias/file/ppt.png b/public/medias/file/ppt.png new file mode 100644 index 0000000..2f0b0ad Binary files /dev/null and b/public/medias/file/ppt.png differ diff --git a/public/medias/file/pptx.png b/public/medias/file/pptx.png new file mode 100644 index 0000000..054035d Binary files /dev/null and b/public/medias/file/pptx.png differ diff --git a/public/medias/file/ps.png b/public/medias/file/ps.png new file mode 100644 index 0000000..e77d0f9 Binary files /dev/null and b/public/medias/file/ps.png differ diff --git a/public/medias/file/psd.png b/public/medias/file/psd.png new file mode 100644 index 0000000..7ebac35 Binary files /dev/null and b/public/medias/file/psd.png differ diff --git a/public/medias/file/ptb.png b/public/medias/file/ptb.png new file mode 100644 index 0000000..8c4e553 Binary files /dev/null and b/public/medias/file/ptb.png differ diff --git a/public/medias/file/ptt.png b/public/medias/file/ptt.png new file mode 100644 index 0000000..46b2e35 Binary files /dev/null and b/public/medias/file/ptt.png differ diff --git a/public/medias/file/pub.png b/public/medias/file/pub.png new file mode 100644 index 0000000..8c7fee7 Binary files /dev/null and b/public/medias/file/pub.png differ diff --git a/public/medias/file/py.png b/public/medias/file/py.png new file mode 100644 index 0000000..9e5668f Binary files /dev/null and b/public/medias/file/py.png differ diff --git a/public/medias/file/qbb.png b/public/medias/file/qbb.png new file mode 100644 index 0000000..8dc9d17 Binary files /dev/null and b/public/medias/file/qbb.png differ diff --git a/public/medias/file/qbw.png b/public/medias/file/qbw.png new file mode 100644 index 0000000..8295bd4 Binary files /dev/null and b/public/medias/file/qbw.png differ diff --git a/public/medias/file/qt.png b/public/medias/file/qt.png new file mode 100644 index 0000000..4deac47 Binary files /dev/null and b/public/medias/file/qt.png differ diff --git a/public/medias/file/qxd.png b/public/medias/file/qxd.png new file mode 100644 index 0000000..0c26f19 Binary files /dev/null and b/public/medias/file/qxd.png differ diff --git a/public/medias/file/qxp.png b/public/medias/file/qxp.png new file mode 100644 index 0000000..80e77d5 Binary files /dev/null and b/public/medias/file/qxp.png differ diff --git a/public/medias/file/ram.png b/public/medias/file/ram.png new file mode 100644 index 0000000..6371508 Binary files /dev/null and b/public/medias/file/ram.png differ diff --git a/public/medias/file/rar.png b/public/medias/file/rar.png new file mode 100644 index 0000000..4dbca6d Binary files /dev/null and b/public/medias/file/rar.png differ diff --git a/public/medias/file/rax.png b/public/medias/file/rax.png new file mode 100644 index 0000000..23ff73a Binary files /dev/null and b/public/medias/file/rax.png differ diff --git a/public/medias/file/rb.png b/public/medias/file/rb.png new file mode 100644 index 0000000..5b4a52b Binary files /dev/null and b/public/medias/file/rb.png differ diff --git a/public/medias/file/resx.png b/public/medias/file/resx.png new file mode 100644 index 0000000..571b573 Binary files /dev/null and b/public/medias/file/resx.png differ diff --git a/public/medias/file/rm.png b/public/medias/file/rm.png new file mode 100644 index 0000000..24281cd Binary files /dev/null and b/public/medias/file/rm.png differ diff --git a/public/medias/file/rmvb.png b/public/medias/file/rmvb.png new file mode 100644 index 0000000..1a969c8 Binary files /dev/null and b/public/medias/file/rmvb.png differ diff --git a/public/medias/file/rss.png b/public/medias/file/rss.png new file mode 100644 index 0000000..8ad29d1 Binary files /dev/null and b/public/medias/file/rss.png differ diff --git a/public/medias/file/rtf.png b/public/medias/file/rtf.png new file mode 100644 index 0000000..bea3f5d Binary files /dev/null and b/public/medias/file/rtf.png differ diff --git a/public/medias/file/rw.png b/public/medias/file/rw.png new file mode 100644 index 0000000..e5404ff Binary files /dev/null and b/public/medias/file/rw.png differ diff --git a/public/medias/file/sass.png b/public/medias/file/sass.png new file mode 100644 index 0000000..27ebf76 Binary files /dev/null and b/public/medias/file/sass.png differ diff --git a/public/medias/file/scss.png b/public/medias/file/scss.png new file mode 100644 index 0000000..33b47f4 Binary files /dev/null and b/public/medias/file/scss.png differ diff --git a/public/medias/file/sea.png b/public/medias/file/sea.png new file mode 100644 index 0000000..bdc4081 Binary files /dev/null and b/public/medias/file/sea.png differ diff --git a/public/medias/file/ses.png b/public/medias/file/ses.png new file mode 100644 index 0000000..b37fc19 Binary files /dev/null and b/public/medias/file/ses.png differ diff --git a/public/medias/file/sit.png b/public/medias/file/sit.png new file mode 100644 index 0000000..f4c13b7 Binary files /dev/null and b/public/medias/file/sit.png differ diff --git a/public/medias/file/sitx.png b/public/medias/file/sitx.png new file mode 100644 index 0000000..2f6f26e Binary files /dev/null and b/public/medias/file/sitx.png differ diff --git a/public/medias/file/sln.png b/public/medias/file/sln.png new file mode 100644 index 0000000..6c2405c Binary files /dev/null and b/public/medias/file/sln.png differ diff --git a/public/medias/file/sql.png b/public/medias/file/sql.png new file mode 100644 index 0000000..1742560 Binary files /dev/null and b/public/medias/file/sql.png differ diff --git a/public/medias/file/ss.png b/public/medias/file/ss.png new file mode 100644 index 0000000..c375353 Binary files /dev/null and b/public/medias/file/ss.png differ diff --git a/public/medias/file/svg.png b/public/medias/file/svg.png new file mode 100644 index 0000000..e24c417 Binary files /dev/null and b/public/medias/file/svg.png differ diff --git a/public/medias/file/swf.png b/public/medias/file/swf.png new file mode 100644 index 0000000..1ea773d Binary files /dev/null and b/public/medias/file/swf.png differ diff --git a/public/medias/file/sys.png b/public/medias/file/sys.png new file mode 100644 index 0000000..1e97f4c Binary files /dev/null and b/public/medias/file/sys.png differ diff --git a/public/medias/file/tga.png b/public/medias/file/tga.png new file mode 100644 index 0000000..2a97d3d Binary files /dev/null and b/public/medias/file/tga.png differ diff --git a/public/medias/file/tgz.png b/public/medias/file/tgz.png new file mode 100644 index 0000000..2572e1f Binary files /dev/null and b/public/medias/file/tgz.png differ diff --git a/public/medias/file/tif.png b/public/medias/file/tif.png new file mode 100644 index 0000000..5ee597d Binary files /dev/null and b/public/medias/file/tif.png differ diff --git a/public/medias/file/tiff.png b/public/medias/file/tiff.png new file mode 100644 index 0000000..024aa32 Binary files /dev/null and b/public/medias/file/tiff.png differ diff --git a/public/medias/file/trt.png b/public/medias/file/trt.png new file mode 100644 index 0000000..c48cc61 Binary files /dev/null and b/public/medias/file/trt.png differ diff --git a/public/medias/file/ttf.png b/public/medias/file/ttf.png new file mode 100644 index 0000000..57ebeea Binary files /dev/null and b/public/medias/file/ttf.png differ diff --git a/public/medias/file/txt.png b/public/medias/file/txt.png new file mode 100644 index 0000000..810fc7e Binary files /dev/null and b/public/medias/file/txt.png differ diff --git a/public/medias/file/vcd.png b/public/medias/file/vcd.png new file mode 100644 index 0000000..02a9847 Binary files /dev/null and b/public/medias/file/vcd.png differ diff --git a/public/medias/file/vob.png b/public/medias/file/vob.png new file mode 100644 index 0000000..5d11795 Binary files /dev/null and b/public/medias/file/vob.png differ diff --git a/public/medias/file/wav.png b/public/medias/file/wav.png new file mode 100644 index 0000000..523b9b6 Binary files /dev/null and b/public/medias/file/wav.png differ diff --git a/public/medias/file/webm.png b/public/medias/file/webm.png new file mode 100644 index 0000000..8dc4f4a Binary files /dev/null and b/public/medias/file/webm.png differ diff --git a/public/medias/file/webp.png b/public/medias/file/webp.png new file mode 100644 index 0000000..7dcd637 Binary files /dev/null and b/public/medias/file/webp.png differ diff --git a/public/medias/file/wma.png b/public/medias/file/wma.png new file mode 100644 index 0000000..08f36a8 Binary files /dev/null and b/public/medias/file/wma.png differ diff --git a/public/medias/file/wmv.png b/public/medias/file/wmv.png new file mode 100644 index 0000000..e41993a Binary files /dev/null and b/public/medias/file/wmv.png differ diff --git a/public/medias/file/wpd.png b/public/medias/file/wpd.png new file mode 100644 index 0000000..259fda0 Binary files /dev/null and b/public/medias/file/wpd.png differ diff --git a/public/medias/file/wps.png b/public/medias/file/wps.png new file mode 100644 index 0000000..334a9be Binary files /dev/null and b/public/medias/file/wps.png differ diff --git a/public/medias/file/xaml.png b/public/medias/file/xaml.png new file mode 100644 index 0000000..7a60433 Binary files /dev/null and b/public/medias/file/xaml.png differ diff --git a/public/medias/file/xar.png b/public/medias/file/xar.png new file mode 100644 index 0000000..3377a06 Binary files /dev/null and b/public/medias/file/xar.png differ diff --git a/public/medias/file/xcf.png b/public/medias/file/xcf.png new file mode 100644 index 0000000..d01a357 Binary files /dev/null and b/public/medias/file/xcf.png differ diff --git a/public/medias/file/xhtml.png b/public/medias/file/xhtml.png new file mode 100644 index 0000000..041b9cb Binary files /dev/null and b/public/medias/file/xhtml.png differ diff --git a/public/medias/file/xls.png b/public/medias/file/xls.png new file mode 100644 index 0000000..d3059d4 Binary files /dev/null and b/public/medias/file/xls.png differ diff --git a/public/medias/file/xlsx.png b/public/medias/file/xlsx.png new file mode 100644 index 0000000..6593a6d Binary files /dev/null and b/public/medias/file/xlsx.png differ diff --git a/public/medias/file/xml.png b/public/medias/file/xml.png new file mode 100644 index 0000000..9fcfced Binary files /dev/null and b/public/medias/file/xml.png differ diff --git a/public/medias/file/xtm.png b/public/medias/file/xtm.png new file mode 100644 index 0000000..03f3467 Binary files /dev/null and b/public/medias/file/xtm.png differ diff --git a/public/medias/file/yml.png b/public/medias/file/yml.png new file mode 100644 index 0000000..373f983 Binary files /dev/null and b/public/medias/file/yml.png differ diff --git a/public/medias/file/zip.png b/public/medias/file/zip.png new file mode 100644 index 0000000..30b5b4a Binary files /dev/null and b/public/medias/file/zip.png differ diff --git a/src/Command/InitCommand.php b/src/Command/InitCommand.php index 1e2d090..125cded 100755 --- a/src/Command/InitCommand.php +++ b/src/Command/InitCommand.php @@ -30,6 +30,7 @@ class InitCommand extends Command private $output; private $filesystem; + private $rootmedias; private $rootlog; private $appname; @@ -53,6 +54,7 @@ class InitCommand extends Command { $this->output = $output; $this->filesystem = new Filesystem(); + $this->rootmedias = $this->container->get('kernel')->getProjectDir().'/public/medias'; $this->rootlog = $this->container->get('kernel')->getLogDir().'/'; $this->appname = $this->container->getParameter('appName'); @@ -512,6 +514,20 @@ class InitCommand extends Command } $this->em->flush(); + // == FILES ================================================================================================================================================ + + $finder = new Finder(); + $finder->in('public/medias/file/'); + $finder->name('*.png'); + $files = []; + foreach ($finder as $file) { + $path = $this->container->getParameter('appAlias').'medias/file/'.$file->getRelativePathname(); + $key = pathinfo($file, PATHINFO_FILENAME); + $files[$key] = $path; + } + + $this->filesystem->dumpFile($this->rootmedias.'/file/files.json', json_encode($files)); + // == PAGECATEGORY ======================================================================================================================================== $entityPagecategory = $this->em->getRepository('App\Entity\Pagecategory')->find(1); @@ -641,7 +657,7 @@ class InitCommand extends Command $entityWidget->setRouteview('app_admin_pagewidget_view_link'); $entityWidget->setHeight('200'); $entityWidget->setAutoajust(true); - $entityWidget->setBorder(true); + $entityWidget->setBorder(false); $entityWidget->setOpened(true); $entityWidget->setViewheader(false); $entityWidget->setAccess(['admin', 'all', 'group']); @@ -698,6 +714,98 @@ class InitCommand extends Command $entityWidget->setParameter($parameter); $this->em->persist($entityWidget); + // Widget Carrousel + $entityWidget = $this->em->getRepository('App\Entity\Widget')->find(-1930); + if (!$entityWidget) { + $entityWidget = new Widget(); + } + $entityicon = $this->em->getRepository('App\Entity\Icon')->findoneby(['label' => 'icon/icon_easel.png']); + $entityWidget->setId(-1930); + $entityWidget->setRoworder(0); + $entityWidget->setIcon($entityicon); + $entityWidget->setName('Carrousel'); + $entityWidget->setDescription("Carrousel d'images"); + $entityWidget->setRouteview('app_admin_pagewidget_view_slide'); + $entityWidget->setHeight('400'); + $entityWidget->setAutoajust(false); + $entityWidget->setBorder(false); + $entityWidget->setOpened(true); + $entityWidget->setViewheader(false); + $entityWidget->setColorheaderback('#5b5b5b'); + $entityWidget->setColorheaderfont('#ffffff'); + $entityWidget->setColorbodyback('#5b5b5b'); + $entityWidget->setColorbodyfont('#ffffff'); + $entityWidget->setAccess(['admin', 'all', 'group']); + $parameter = ['fields' => [['id' => 'interval', 'loc' => 'col1', 'type' => 'integer', 'label' => 'Interval en seconde entre 2 images', 'value' => '5', 'mandatory' => 'false']]]; + $entityWidget->setParameter($parameter); + $this->em->persist($entityWidget); + + // Widget File + $entityWidget = $this->em->getRepository('App\Entity\Widget')->find(-1920); + if (!$entityWidget) { + $entityWidget = new Widget(); + } + $entityicon = $this->em->getRepository('App\Entity\Icon')->findoneby(['label' => 'icon/icon_folder.png']); + $entityWidget->setId(-1920); + $entityWidget->setRoworder(0); + $entityWidget->setIcon($entityicon); + $entityWidget->setName('Fichiers'); + $entityWidget->setDescription('Répertoire de fichiers'); + $entityWidget->setRouteview('app_admin_pagewidget_view_file'); + $entityWidget->setHeight('630'); + $entityWidget->setAutoajust(true); + $entityWidget->setBorder(false); + $entityWidget->setOpened(true); + $entityWidget->setViewheader(true); + $entityWidget->setAccess(['admin', 'all', 'group']); + $parameter = ['fields' => [['id' => 'modelist', 'loc' => 'col1', 'type' => 'modelist', 'label' => 'Mode Affichage', 'value' => '0', 'mandatory' => 'true']]]; + $entityWidget->setParameter($parameter); + $this->em->persist($entityWidget); + + // Widget Galery + $entityWidget = $this->em->getRepository('App\Entity\Widget')->find(-1910); + if (!$entityWidget) { + $entityWidget = new Widget(); + } + $entityicon = $this->em->getRepository('App\Entity\Icon')->findoneby(['label' => 'icon/icon_image.png']); + $entityWidget->setId(-1910); + $entityWidget->setRoworder(0); + $entityWidget->setIcon($entityicon); + $entityWidget->setName('Galerie'); + $entityWidget->setDescription("Galerie d'images"); + $entityWidget->setRouteview('app_admin_pagewidget_view_galery'); + $entityWidget->setHeight('630'); + $entityWidget->setAutoajust(true); + $entityWidget->setBorder(false); + $entityWidget->setOpened(true); + $entityWidget->setViewheader(true); + $entityWidget->setAccess(['admin', 'all', 'group']); + $parameter = ['fields' => []]; + $entityWidget->setParameter($parameter); + $this->em->persist($entityWidget); + + // Widget Texte + $entityWidget = $this->em->getRepository('App\Entity\Widget')->find(-1940); + if (!$entityWidget) { + $entityWidget = new Widget(); + } + $entityicon = $this->em->getRepository('App\Entity\Icon')->findoneby(['label' => 'icon/icon_compose.png']); + $entityWidget->setId(-1940); + $entityWidget->setRoworder(0); + $entityWidget->setIcon($entityicon); + $entityWidget->setName('Texte'); + $entityWidget->setDescription('Votre propre texte à éditer'); + $entityWidget->setRouteview('app_admin_pagewidget_view_editor'); + $entityWidget->setHeight('630'); + $entityWidget->setAutoajust(true); + $entityWidget->setBorder(true); + $entityWidget->setViewheader(true); + $entityWidget->setOpened(true); + $entityWidget->setAccess(['admin', 'all', 'group']); + $parameter = ['fields' => [['id' => 'html', 'loc' => 'col5', 'type' => 'hidden', 'label' => 'Texte', 'value' => '', 'mandatory' => 'false']]]; + $entityWidget->setParameter($parameter); + $this->em->persist($entityWidget); + $this->em->flush(); // == PAGETEMPALTE ======================================================================================================================================= @@ -763,11 +871,12 @@ class InitCommand extends Command $this->em->flush(); // Widget Nos Liens + /* $fields = ['fields' => [['id' => 'modedesktop', 'value' => 2]]]; $this->addWidget(-120, $entityPage, -1960, 'R1C2R1C1', 0, 'Nos Liens', true, $fields); // Widget Nos Fichiers - /* + $fields=["fields"=>[]]; $this->addWidget(-130,$entityPage,-1920,"R1C2R1C2",0,"Nos Fichiers",true,$fields); diff --git a/src/Controller/BookmarkController.php b/src/Controller/BookmarkController.php index b8a2208..ee9e300 100644 --- a/src/Controller/BookmarkController.php +++ b/src/Controller/BookmarkController.php @@ -24,32 +24,18 @@ class BookmarkController extends AbstractController // Initialisation de l'enregistrement $data = new Bookmark(); - // On s'assure que le widget existe $pagewidget = null; if ('false' == $touser) { - $pagewidget = $em->getRepository('App\Entity\Pagewidget')->find($idwidget); + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); if (!$pagewidget) { throw $this->createNotFoundException('Unable to find entity.'); } - // Vérifier que cet enregistrement est modifiable + // Vérifier que l'on peut générer un pagewidgetslide if ('all' == $access) { - if ('user' == $usage) { - $user = $pagewidget->getPage()->getUser(); - if ($user != $this->getUser()) { - throw $this->createNotFoundException('Permission denied'); - } - } elseif ('group' == $usage) { - $canadd = false; - foreach ($pagewidget->getPage()->getGroups() as $group) { - $usergroup = $em->getRepository('App\Entity\UserGroup')->findoneby(['user' => $this->getUser(), 'group' => $group]); - if (!$usergroup or $usergroup->getRolegroup() >= 50) { - $canadd = true; - } - } - if (!$canadd) { - throw $this->createNotFoundException('Permission denied'); - } + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); } } } @@ -117,32 +103,17 @@ class BookmarkController extends AbstractController throw $this->createNotFoundException('Unable to find entity.'); } - // On s'assure que le widget existe - $pagewidget = null; if ('false' == $touser) { - $pagewidget = $em->getRepository('App\Entity\Pagewidget')->find($idwidget); + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); if (!$pagewidget) { throw $this->createNotFoundException('Unable to find entity.'); } - // Vérifier que cet enregistrement est modifiable + // Vérifier que l'on peut générer un pagewidgetslide if ('all' == $access) { - if ('user' == $usage) { - $user = $pagewidget->getPage()->getUser(); - if ($user != $this->getUser()) { - throw $this->createNotFoundException('Permission denied'); - } - } elseif ('group' == $usage) { - $canadd = false; - foreach ($pagewidget->getPage()->getGroups() as $group) { - $usergroup = $em->getRepository('App\Entity\UserGroup')->findoneby(['user' => $this->getUser(), 'group' => $group]); - if (!$usergroup or $usergroup->getRolegroup() >= 50) { - $canadd = true; - } - } - if (!$canadd) { - throw $this->createNotFoundException('Permission denied'); - } + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); } } } @@ -206,32 +177,17 @@ class BookmarkController extends AbstractController throw $this->createNotFoundException('Unable to find entity.'); } - // On s'assure que le widget existe - $pagewidget = null; if ('false' == $touser) { - $pagewidget = $em->getRepository('App\Entity\Pagewidget')->find($idwidget); + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); if (!$pagewidget) { throw $this->createNotFoundException('Unable to find entity.'); } - // Vérifier que cet enregistrement est modifiable + // Vérifier que l'on peut générer un pagewidgetslide if ('all' == $access) { - if ('user' == $usage) { - $user = $pagewidget->getPage()->getUser(); - if ($user != $this->getUser()) { - throw $this->createNotFoundException('Permission denied'); - } - } elseif ('group' == $usage) { - $canadd = false; - foreach ($pagewidget->getPage()->getGroups() as $group) { - $usergroup = $em->getRepository('App\Entity\UserGroup')->findoneby(['user' => $this->getUser(), 'group' => $group]); - if (!$usergroup or $usergroup->getRolegroup() >= 50) { - $canadd = true; - } - } - if (!$canadd) { - throw $this->createNotFoundException('Permission denied'); - } + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); } } } diff --git a/src/Controller/FileController.php b/src/Controller/FileController.php new file mode 100644 index 0000000..0d94f55 --- /dev/null +++ b/src/Controller/FileController.php @@ -0,0 +1,721 @@ +minio = $minio; + } + + public function list($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + // Récupération des paramètres + $folder = $request->query->get('folder'); + $usage = $request->query->get('usage'); + $view = $request->get('view'); + $sort = $request->get('sort'); + $order = $request->get('order'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + + // Récupérer les files icons + $tbicons = json_decode(file_get_contents($this->getParameter('kernel.project_dir').'/public/medias/file/files.json'), true); + + // Récupérer les préférences utilisateur + if (!$this->getUser()) { + $preference['widgetfolder'][$id] = ['folder' => null, 'sort' => null, 'order' => null, 'view' => null]; + } else { + $preference = $this->getUser()->getPreference(); + if (is_null($preference)) { + $preference = []; + } + + // Initalisation des préférences si aucune + if (!array_key_exists('widgetfolder', $preference) || !array_key_exists($id, $preference['widgetfolder'])) { + $preference['widgetfolder'][$id] = ['folder' => null, 'sort' => null, 'order' => null, 'view' => null]; + } + } + + // Si aucun folder on récupére la preference + if (!$folder && $preference['widgetfolder'][$id]['folder']) { + $folder = $preference['widgetfolder'][$id]['folder']; + } + + // On s'assure que le folder existe toujours + if ($folder && 0 == $this->minio->countKeys($folder)) { + $folder = null; + } + + // On s'assure qu'il est bien dans le folder de base + if (false === stripos($folder, 'file/pagewidget/'.$id.'/')) { + $folder = null; + } + + // Si pas de folder on est sur la racine + if (!$folder) { + $folder = 'file/pagewidget/'.$id.'/'; + } + + // Trie + if (!$order) { + $order = $preference['widgetfolder'][$id]['order']; + } + if (!$order) { + $order = 'SORT_ASC'; + } + if (!$sort) { + $sort = $preference['widgetfolder'][$id]['sort']; + } + if (!$sort) { + $sort = 'name'; + } + + // View + if (!$view) { + $view = $preference['widgetfolder'][$id]['view']; + } + + // Récuperer les files et folders du folder en cours + $files = $this->minio->listFiles($folder, '/'); + $folders = $this->minio->listFolders($folder, '/'); + + // Ajouter basename et thumb des entrées récupérées + if ($files) { + foreach ($files as $key => $value) { + if ('.dir' == pathinfo($value['Key'], PATHINFO_BASENAME)) { + unset($files[$key]); + continue; + } + $files[$key]['basename'] = pathinfo($value['Key'], PATHINFO_BASENAME); + $files[$key]['dirname'] = pathinfo($value['Key'], PATHINFO_DIRNAME); + $files[$key]['extention'] = pathinfo($value['Key'], PATHINFO_EXTENSION); + + // thumb ? + if (1 == $this->minio->countKeys($files[$key]['dirname'].'/.thumb/'.$files[$key]['basename'])) { + $files[$key]['thumb'] = $this->generateUrl('app_minio_image', ['file' => $files[$key]['dirname'].'/.thumb/'.$files[$key]['basename']]); + } + // file icon ? + elseif (array_key_exists($files[$key]['extention'], $tbicons)) { + $files[$key]['thumb'] = $tbicons[$files[$key]['extention']]; + } + // blank file icon + else { + $files[$key]['thumb'] = $tbicons['blank']; + } + } + + $filesdate = array_column($files, 'LastModified'); + $filesname = array_column($files, 'basename'); + + switch ($sort) { + case 'name': + array_multisort($filesname, 'SORT_ASC' == $order ? SORT_ASC : SORT_DESC, $files); + break; + case 'date': + array_multisort($filesdate, 'SORT_ASC' == $order ? SORT_ASC : SORT_DESC, $files); + break; + } + } + + if ($folders) { + foreach ($folders as $key => $value) { + if ('.thumb' == pathinfo($value['Prefix'], PATHINFO_BASENAME) || '.trash' == pathinfo($value['Prefix'], PATHINFO_BASENAME)) { + unset($folders[$key]); + continue; + } + + $folders[$key]['basename'] = pathinfo($value['Prefix'], PATHINFO_BASENAME); + $folders[$key]['thumb'] = $tbicons['dir']; + } + + $foldersname = array_column($folders, 'basename'); + array_multisort($foldersname, 'SORT_ASC' == $order ? SORT_ASC : SORT_DESC, $folders); + } + + // Mise à jour des préférences + $preference['widgetfolder'][$id] = ['folder' => $folder, 'sort' => $sort, 'order' => $order, 'view' => $view]; + if ($this->getUser()) { + $this->getUser()->setPreference($preference); + $em->getManager()->flush(); + } + + // Construction de la navigation des folers + $basefolder = 'file/pagewidget/'.$id; + $parents = [['basename' => 'Home', 'folder' => $basefolder.'/']]; + $tmp = explode('/', $folder); + unset($tmp[0]); + unset($tmp[1]); + unset($tmp[2]); + array_pop($tmp); + + foreach ($tmp as $value) { + $basefolder = $basefolder.'/'.$value; + array_push($parents, ['basename' => $value, 'folder' => $basefolder.'/']); + } + + // Flag poubelle + $fgtrash = false; + if (stripos($folder, '.trash') >= 1) { + $fgtrash = true; + } + + return $this->render('File\list.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'access' => $access, + 'category' => $category, + 'id' => $id, + 'folder' => $folder, + 'usage' => $usage, + 'view' => $view, + 'sort' => $sort, + 'order' => $order, + 'canadd' => $canadd, + 'fgtrash' => $fgtrash, + 'parents' => $parents, + 'folders' => $folders, + 'files' => $files, + ]); + } + + public function upload($access, $category, $id, $type, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $folder = urldecode($request->get('folder')); + if (!$folder) { + $folder = 'file/'.$category.'/'.$id.'/'; + } + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($folder, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + return $this->render('File\upload.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'maxsize' => ('all' == $access ? 1200 : null), + 'access' => $access, + 'category' => $category, + 'id' => $id, + 'type' => $type, + 'folder' => $folder, + 'forcereload' => ('pagewidget' == $category), + ]); + } + + public function folder($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $infolder = $usage = $request->query->get('folder'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($infolder, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + $folder = $request->get('folder'); + $form = $this->createFormBuilder() + ->add('folder', TextType::class, ['label' => 'Répertoire']) + ->add('submit', SubmitType::class, ['label' => 'Valider', 'attr' => ['class' => 'btn btn-success']]) + ->getForm(); + + $form->handleRequest($request); + $toclose = false; + + if ($form->isSubmitted() && $form->isValid()) { + $data = $form->getData(); + if ('.thumb' == $data['folder'] || '.dir' == $data['folder'] || '.trash' == $data['folder']) { + $form->addError(new FormError('Nom de répertoire réservé, merci de choisir un autre nom de répertoire')); + $request->getSession()->getFlashBag()->clear(); + $request->getSession()->getFlashBag()->add('error', 'Nom de répertoire réservé, merci de choisir un autre nom de répertoire'); + } else { + $filesystem = new Filesystem(); + $filesystem->dumpFile($this->getParameter('kernel.project_dir').'/var/tmp/.dir', ''); + $this->minio->upload($this->getParameter('kernel.project_dir').'/var/tmp/.dir', $infolder.$data['folder'].'/.dir'); + $toclose = true; + } + } + + return $this->render('File\folder.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'access' => $access, + 'id' => $id, + 'folder' => $folder, + 'form' => $form->createView(), + 'toclose' => $toclose, + ]); + } + + public function rename($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $oldfile = $usage = $request->query->get('file'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($oldfile, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + $form = $this->createFormBuilder() + ->add('folder', TextType::class, ['label' => 'Renommer']) + ->add('submit', SubmitType::class, ['label' => 'Valider', 'attr' => ['class' => 'btn btn-success']]) + ->getForm(); + $form->handleRequest($request); + $toclose = false; + + if ($form->isSubmitted() && $form->isValid()) { + $data = $form->getData(); + if ('.thumb' == $data['folder'] || '.dir' == $data['folder'] || '.trash' == $data['folder']) { + $form->addError(new FormError('Nom réservé, merci de choisir un autre nom')); + $this->get('session')->getFlashBag()->clear(); + $request->getSession()->getFlashBag()->add('error', 'Nom réservé, merci de choisir un autre nom'); + } else { + $newfile = pathinfo($oldfile, PATHINFO_DIRNAME).'/'.$data['folder']; + if ('/' == substr($oldfile, -1)) { + $newfile = $newfile.'/'; + } + + $files = $this->minio->listFiles($oldfile); + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + + // Déplacer le fichier dans .trash + try { + $this->minio->move($file, str_replace($oldfile, $newfile, $file), true); + } catch (\Exception $e) { + } + + // Déplacer le thumb dans .trash + try { + $oldthumb = pathinfo($oldfile, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($oldfile, PATHINFO_BASENAME); + $newthumb = pathinfo($newfile, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($newfile, PATHINFO_BASENAME); + $this->minio->move($oldthumb, $newthumb, true); + } catch (\Exception $e) { + } + } + $toclose = true; + } + } else { + $form->get('folder')->setData(basename($oldfile)); + } + + return $this->render('File\folder.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'access' => $access, + 'id' => $id, + 'folder' => $oldfile, + 'form' => $form->createView(), + 'toclose' => $toclose, + ]); + } + + public function trash($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $file = $usage = $request->query->get('file'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($file, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + $files = $this->minio->listFiles($file); + + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + + // Déplacer le fichier dans .trash + try { + $this->minio->move($file, str_replace($basefolder, $basefolder.'.trash/', $file), true); + } catch (\Exception $e) { + } + + // Déplacer le thumb dans .trash + try { + $thumb = pathinfo($file, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($file, PATHINFO_BASENAME); + $this->minio->move($thumb, str_replace($basefolder, $basefolder.'.trash/', $thumb), true); + } catch (\Exception $e) { + } + } + + return new JsonResponse(); + } + + public function restaure($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $file = $usage = $request->query->get('file'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($file, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + $files = $this->minio->listFiles($file); + + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + + // Déplacer le fichier de .trash vers sa cible d'origine + try { + $this->minio->move($file, str_replace('/.trash/', '/', $file), true); + } catch (\Exception $e) { + } + + // Déplacer le thumb dans .trash + try { + $thumb = pathinfo($file, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($file, PATHINFO_BASENAME); + $this->minio->move($thumb, str_replace('/.trash/', '/', $thumb), true); + } catch (\Exception $e) { + } + } + + return new JsonResponse(); + } + + public function purgetrash($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/.trash'; + + $files = $this->minio->listFiles($basefolder); + + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + try { + $this->minio->delete($file); + } catch (\Exception $e) { + } + } + + return $this->redirectToRoute('app_'.$access.'_file_list', ['category' => $category, 'id' => $id]); + } + + public function delete($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $file = $usage = $request->query->get('file'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($file, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + // Si en mode naviation rechercher le prochain fichier à afficher + if (!$request->isXmlHttpRequest()) { + $files = $this->minio->listFiles(dirname($file).'/', '/'); + dump($files); + if ($files) { + $basename = basename($file); + $date = array_column($files, 'LastModified'); + array_multisort($date, SORT_DESC, $files); + + foreach ($files as $key => $tbfile) { + if ($basename == basename($tbfile['Key'])) { + $next = (array_key_exists($key + 1, $files) ? $files[$key + 1] : $files[0]); + if ($next['Key'] == $file) { + unset($next); + } + } + } + } + } + + $files = $this->minio->listFiles($file); + + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + + // Supprimer le fichier + try { + $this->minio->delete($file); + } catch (\Exception $e) { + } + + // Supprimer le thumb + try { + $thumb = pathinfo($file, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($file, PATHINFO_BASENAME); + $this->minio->delete($thumb); + } catch (\Exception $e) { + } + } + + // Appel ajax + if ($request->isXmlHttpRequest()) { + return new JsonResponse(); + } else { + if (isset($next)) { + return $this->redirectToRoute(str_replace('_admin_', '_'.$access.'_', 'app_admin_file_view'), ['category' => $category, 'id' => $id, 'usage' => $usage, 'file' => $next['Key']]); + } else { + return $this->render('File\redirect.html.twig'); + } + } + } + + public function move($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + $source = $usage = $request->query->get('source'); + $destination = $usage = $request->query->get('destination'); + + // Permission + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + $basefolder = 'file/'.$category.'/'.$id.'/'; + if (false === stripos($source, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + if (false === stripos($destination, $basefolder)) { + throw $this->createAccessDeniedException('Permission denied'); + } + + $isdirdest = false; + if ('/' == substr($source, -1)) { + $isdirdest = true; + $destination = $destination.basename($source).'/'; + // On ne peut déplacer un répertoire vers un répertoire enfant + if (0 === stripos($destination, $source)) { + return new JsonResponse(); + } + } + + $files = $this->minio->listFiles($source); + foreach ($files as $tbfile) { + $file = $tbfile['Key']; + if ($isdirdest) { + $dest = str_replace($source, $destination, $file); + } else { + $dest = str_replace(pathinfo($source, PATHINFO_DIRNAME).'/', $destination, $file); + } + + // Déplacer le fichier + try { + $this->minio->move($file, $dest, true); + } catch (\Exception $e) { + } + + // Thumb + if (!$isdirdest) { + $oldthumb = pathinfo($source, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($source, PATHINFO_BASENAME); + $newthumb = pathinfo($dest, PATHINFO_DIRNAME).'/.thumb/'.pathinfo($dest, PATHINFO_BASENAME); + + // Déplacer le thumb + try { + $this->minio->move($oldthumb, $newthumb, true); + } catch (\Exception $e) { + } + } + } + exit; + + return new JsonResponse(); + } + + public function view($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $file = $request->query->get('file'); + $basename = basename($file); + $path = dirname($file); + $usage = $request->query->get('usage'); + $navigation = boolval($request->query->get('navigation')); + + $canadd = $this->getPermission($em, $access, $category, $id, $usage); + + // Si en mode navigation on recherche le fichier précédent ou suivant + $next = []; + $prev = []; + + if ($navigation) { + $files = $this->minio->listFiles($path.'/', '/'); + if ($files) { + $date = array_column($files, 'LastModified'); + array_multisort($date, SORT_DESC, $files); + foreach ($files as $key => $value) { + if ($basename == basename($value['Key'])) { + $next = (array_key_exists($key + 1, $files) ? $files[$key + 1] : $files[0]); + $prev = (array_key_exists($key - 1, $files) ? $files[$key - 1] : end($files)); + } + } + } + } + + $tmpfile = $this->minio->download($file, basename($file)); + if (str_starts_with(mime_content_type($tmpfile), 'image/') || 'application/pdf' == mime_content_type($tmpfile) || 'text/plain' == mime_content_type($tmpfile)) { + return $this->render('File\view.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'access' => $access, + 'category' => $category, + 'id' => $id, + 'usage' => $usage, + 'navigation' => $navigation, + 'file' => $file, + 'basename' => basename($file), + 'canadd' => $canadd, + 'prev' => $prev, + 'next' => $next, + 'isimage' => str_starts_with(mime_content_type($tmpfile), 'image/'), + ]); + } else { + $response = new BinaryFileResponse($tmpfile); + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, basename($file)); + + return $response; + } + } + + public function show($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $file = $request->query->get('file'); + $usage = $request->query->get('usage'); + $this->getPermission($em, $access, $category, $id, $usage); + + $tmpfile = $this->minio->download($file, basename($file)); + if (str_starts_with(mime_content_type($tmpfile), 'image/') || 'application/pdf' == mime_content_type($tmpfile) || 'text/plain' == mime_content_type($tmpfile)) { + $response = new BinaryFileResponse($tmpfile); + $response->headers->set('Content-Type', mime_content_type($tmpfile)); + } else { + $response = new BinaryFileResponse($tmpfile); + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, basename($file)); + } + + return $response; + } + + public function download($access, $category, $id, Request $request, ManagerRegistry $em): Response + { + $file = $request->query->get('file'); + $usage = $request->query->get('usage'); + $this->getPermission($em, $access, $category, $id, $usage); + $tmpfile = $this->minio->download($file, basename($file)); + $response = new BinaryFileResponse($tmpfile); + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, basename($file)); + + return $response; + } + + public function getPermission($em, $access, $category, $id, $usage = '') + { + if ('all' == $access) { + switch ($category) { + case 'pagewidget': + // Récupération du widget + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($id); + + // Vérifier que l'on peut voir + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCansee($this->getUser(), $pagewidget)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Retourner la permission d'ajout + return $em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage); + break; + + case 'projecttask': + // Récupération de la tache + $projecttask = $em->getRepository('CadolesPortalBundle:Projecttask')->find($id); + if (!$projecttask) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // On s'assure que l'utilisateur à la permission de voir + $project = $projecttask->getProject(); + $user = $this->getUser(); + $em->getRepository('CadolesPortalBundle:Project')->getPermission($user, $project, $cansee, $canupdate, $canadd); + if (!$cansee) { + throw $this->createAccessDeniedException('Permission denied'); + } + + return $canupdate; + break; + + case 'calendarevent': + // Récupération de l'event' + $calendarevent = $em->getRepository('CadolesPortalBundle:Calendarevent')->find($id); + if (!$calendarevent) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // On s'assure que l'utilisateur à la permission de voir + $calendar = $calendarevent->getCalendar(); + $user = $this->getUser(); + $em->getRepository('CadolesPortalBundle:Calendar')->getPermission($user, $calendar, $cansee, $canupdate, $canadd); + if (!$cansee) { + throw $this->createAccessDeniedException('Permission denied'); + } + + return $canadd; + break; + } + } else { + return true; + } + } +} diff --git a/src/Controller/IconController.php b/src/Controller/IconController.php index bced494..eb8f640 100644 --- a/src/Controller/IconController.php +++ b/src/Controller/IconController.php @@ -147,7 +147,7 @@ class IconController extends AbstractController return $this->redirectToRoute(str_replace('_admin_', '_'.$access.'_', $this->route).'_update', ['id' => $id, 'inframe' => $inframe]); } - return $this->redirectToRoute(str_replace('_admin_', '_'.$access.'_', $this->route)); + return $this->redirectToRoute(str_replace('_admin_', '_'.$access.'_', $this->route), ['inframe' => $inframe]); } public function select($access, Request $request, ManagerRegistry $em): Response diff --git a/src/Controller/MinioController.php b/src/Controller/MinioController.php index 65f6018..36fada7 100755 --- a/src/Controller/MinioController.php +++ b/src/Controller/MinioController.php @@ -3,8 +3,8 @@ namespace App\Controller; use App\Service\MinioService; +use Doctrine\Persistence\ManagerRegistry; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -21,23 +21,28 @@ class MinioController extends AbstractController $this->minio = $minio; } - public function ckupload($access, Request $request): Response + public function ckupload($access, $category, $id, $usage, Request $request, ManagerRegistry $em): Response { // Fichier temporaire uploadé $tmpfile = $request->files->get('upload'); $extention = $tmpfile->getClientOriginalExtension(); - // Répertoire de Destination - $fs = new Filesystem(); - $rootdir = $this->getParameter('kernel.project_dir').'/var/tmp'; - $fs->mkdir($rootdir.'/ckeditor'); - // Fichier cible $targetName = uniqid().'.'.$extention; - $targetFile = 'ckeditor/'.$targetName; - $targetUrl = $this->generateUrl('app_minio_document', ['file' => 'ckeditor/'.$targetName]); + if ('all' == $category) { + $targetFile = 'ckeditor/'.$targetName; + } else { + if ('pagewidget' == $category) { + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($id); + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + $this->createAccessDeniedException('Permission denied'); + } + } - // move_uploaded_file($tmpfile,$targetFile); + $targetFile = 'file/'.$category.'/'.$id.'/'.$targetName; + } + + $targetUrl = $this->generateUrl('app_minio_document', ['file' => $targetFile]); $this->minio->upload($tmpfile, $targetFile, true); $output['uploaded'] = 1; @@ -52,9 +57,22 @@ class MinioController extends AbstractController return $this->redirectToRoute('app_minio_image', ['file' => 'logo/'.$request->getSession()->get('logolight')]); } - public function image(Request $request): Response + public function image(Request $request, ManagerRegistry $em): Response { $file = $request->query->get('file'); + + return $this->returnminio($file, $em); + } + + public function document(Request $request, ManagerRegistry $em) + { + $file = $request->query->get('file'); + + return $this->returnminio($file, $em); + } + + private function returnminio($file, $em) + { switch ($file) { case 'avatar/admin.jpg': case 'avatar/noavatar.png': @@ -79,6 +97,26 @@ class MinioController extends AbstractController return $response; } + // Slide = on s'assure que le user puisse voir + elseif (0 === stripos($file, 'slide/')) { + $idwidget = explode('/', $file)[1]; + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$em->getRepository("App\Entity\Pagewidget")->getCansee($this->getUser(), $pagewidget)) { + $this->createAccessDeniedException('Permission denied'); + } + + return new Response($this->minio->image($file, $file)); + } + // Pagewidgtet = on s'assure que le user puisse voir + elseif (0 === stripos($file, 'file/pagewidget/')) { + $idwidget = explode('/', $file)[2]; + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$em->getRepository("App\Entity\Pagewidget")->getCansee($this->getUser(), $pagewidget)) { + $this->createAccessDeniedException('Permission denied'); + } + + return new Response($this->minio->image($file, $file)); + } // C'est une url = on affiche l'url elseif (0 === stripos($file, 'http')) { $filePath = $file; @@ -90,24 +128,5 @@ class MinioController extends AbstractController } break; } - - return new Response($content, 200, [ - 'Content-Type' => mime_content_type($filePath), - 'Cache-Control' => 'max-age='.(60 * 60 * 24 * 7), - 'Expires' => gmdate(DATE_RFC1123, time() + 60 * 60 * 24 * 365), - ]); - } - - public function document(Request $request) - { - $file = $request->query->get('file'); - $filePath = $this->minio->download($file, $file, true); - $content = file_get_contents($filePath); - - return new Response($content, 200, [ - 'Content-Type' => mime_content_type($filePath), - 'Cache-Control' => 'max-age='.(60 * 60 * 24 * 7), - 'Expires' => gmdate(DATE_RFC1123, time() + 60 * 60 * 24 * 365), - ]); } } diff --git a/src/Controller/PageController.php b/src/Controller/PageController.php index db25c13..13460b8 100644 --- a/src/Controller/PageController.php +++ b/src/Controller/PageController.php @@ -267,7 +267,7 @@ class PageController extends AbstractController if ('all' == $access) { $em->getRepository($this->entity)->getPermission($this->getUser(), $entity, $cansee, $canupdate, $canadd); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } @@ -343,7 +343,7 @@ class PageController extends AbstractController if ('all' == $access) { $em->getRepository($this->entity)->getPermission($this->getUser(), $data, $cansee, $canupdate, $canadd); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } @@ -383,7 +383,7 @@ class PageController extends AbstractController if ('all' == $access) { $em->getRepository($this->entity)->getPermission($this->getUser(), $entity, $cansee, $canupdate, $canadd); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } diff --git a/src/Controller/PagetemplateController.php b/src/Controller/PagetemplateController.php index 2765668..c4a5496 100644 --- a/src/Controller/PagetemplateController.php +++ b/src/Controller/PagetemplateController.php @@ -213,7 +213,7 @@ class PagetemplateController extends AbstractController if ('all' == $access) { $em->getRepository($this->entity)->getPermission($this->getUser(), $data, $cansee, $canupdate); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } diff --git a/src/Controller/PagewidgetController.php b/src/Controller/PagewidgetController.php index 599fd4c..4533064 100644 --- a/src/Controller/PagewidgetController.php +++ b/src/Controller/PagewidgetController.php @@ -3,13 +3,11 @@ namespace App\Controller; use App\Entity\Pagewidget; +use App\Form\PagewidgetckeditorType; use App\Form\PagewidgetType; +use App\Service\MinioService; use Doctrine\Persistence\ManagerRegistry; -use GuzzleHttp\Exception\RequestException; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -21,6 +19,8 @@ class PagewidgetController extends AbstractController private $twig = 'Pagewidget/'; private $route = 'app_admin_pagewidget'; + private $minio; + private $em; private $user; private $entity; @@ -34,6 +34,11 @@ class PagewidgetController extends AbstractController private $canupdate; private $canadd; + public function __construct(MinioService $minio) + { + $this->minio = $minio; + } + private function searchArray($array, $key, $value) { $results = []; @@ -114,7 +119,7 @@ class PagewidgetController extends AbstractController throw $this->createNotFoundException('Unable to find entity.'); } if (2 != $page->getPagecategory()->getId()) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } // Sur validation @@ -176,7 +181,6 @@ class PagewidgetController extends AbstractController public function update($access, $idpage, $idwidget, Request $request, ManagerRegistry $em): Response { $usage = $request->query->get('usage'); - $group = $request->query->get('group'); // Recherche du pagewidget $entity = $em->getRepository($this->labelentity)->find($idwidget); @@ -188,7 +192,7 @@ class PagewidgetController extends AbstractController if ('all' == $access) { $em->getRepository('App\Entity\Page')->getPermission($this->getUser(), $entity->getPage(), $cansee, $canupdate, $canadd); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } @@ -227,11 +231,7 @@ class PagewidgetController extends AbstractController } // Retour - if ($group) { - return $this->redirect($this->generateUrl('app_'.$access.'_page_'.$usage.'_view', ['id' => $idpage, 'group' => $group])); - } else { - return $this->redirect($this->generateUrl('app_'.$access.'_page_'.$usage.'_view', ['id' => $idpage])); - } + return $this->redirect($this->generateUrl('app_'.$access.'_page_'.$usage.'_view', ['id' => $idpage])); } $icons = $em->getRepository('App\Entity\Icon')->findBy(['user' => null]); @@ -271,7 +271,7 @@ class PagewidgetController extends AbstractController if ('all' == $access) { $em->getRepository('App\Entity\Page')->getPermission($this->getUser(), $entity->getPage(), $cansee, $canupdate, $canadd); if (!$canupdate) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } @@ -281,7 +281,7 @@ class PagewidgetController extends AbstractController $em->getManager()->flush(); } catch (\Exception $e) { $request->getSession()->getFlashBag()->add('error', $e->getMessage()); - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } return new JsonResponse($output); @@ -305,6 +305,52 @@ class PagewidgetController extends AbstractController return new JsonResponse([]); } + public function ckeditor($access, $idwidget, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // Recherche du pagewidget + $entity = $em->getRepository($this->labelentity)->find($idwidget); + if (!$entity) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // On s'assure que l'utilisateur à la permission de modifier + if ('all' == $access) { + $em->getRepository('App\Entity\Page')->getPermission($this->getUser(), $entity->getPage(), $cansee, $canupdate, $canadd); + if (!$canadd) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Création du formulaire + $form = $this->createForm(PagewidgetckeditorType::class, ['ckeditor' => $entity->getParameter()['fields'][0]['value']], ['idwidget' => $idwidget, 'usage' => $usage]); + + // Récupération des data du formulaire + $form->handleRequest($request); + if ($form->get('submit')->isClicked() && $form->isValid()) { + $ckeditor = $form->get('ckeditor')->getData(); + $param = $entity->getParameter(); + $param['fields'][0]['value'] = $ckeditor; + $entity->setParameter($param); + $em->getManager()->flush(); + + // Retour + return $this->redirect($this->generateUrl('app_'.$access.'_page_'.$usage.'_view', ['id' => $entity->getPage()->getId()])); + } + + return $this->render($this->twig.'ckeditor.html.twig', [ + 'useheader' => ('admin' == $access), + 'usemenu' => false, + 'usesidebar' => ('admin' == $access), + 'entity' => $entity, + 'usage' => $usage, + 'access' => $access, + 'idpage' => $entity->getPage()->getId(), + 'form' => $form->createView(), + ]); + } + protected function setRequest($em, $request, $id, $access) { $this->em = $em; @@ -329,7 +375,7 @@ class PagewidgetController extends AbstractController $this->page = $this->entity->getPage(); $this->em->getRepository('App\Entity\Page')->getPermission($this->user, $this->page, $this->cansee, $this->canupdate, $this->canadd); if (!$this->cansee) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } } @@ -386,8 +432,10 @@ class PagewidgetController extends AbstractController // Paramétres toujours présent dans un rendu de widget $allways = [ 'entity' => $this->entity, - 'canupdate' => $this->canupdate, + 'canupdate' => $this->canupdate, // Permissions de modifier le widget + 'canadd' => $this->canadd, // Permission d'ajouter des éléments au widget 'access' => $this->access, + 'usage' => $this->usage, ]; // Parametres spéficiques @@ -426,14 +474,6 @@ class PagewidgetController extends AbstractController $imagemedia = true; } } - // Si url classique on igonore l'usage de la sonde dnma - else { - if (false === stripos($url, '?')) { - $url .= '?notsondednma=true'; - } else { - $url .= '¬sondednma=true'; - } - } // Spécifique Deviant Art if (false !== strpos($url, 'images-wixmp')) { @@ -621,419 +661,6 @@ class PagewidgetController extends AbstractController ]); } - public function viewflux(Request $request, $id, $access = 'config') - { - // Récupération de la requete - $this->setRequest($em, $request, $id, $access); - - // Valeur par défaut - $modelist = 0; - $fluxsordered = null; - $feeds = null; - - // Récupération des paramétres du widget - foreach ($this->entity->getParameter()['fields'] as $parameter) { - switch ($parameter['id']) { - case 'modelist': - $modelist = $parameter['value']; - break; - } - } - - // Profilage - $fluxs = $this->em->getRepository('App:Flux')->getUserFluxs($this->user); - - $feeds = []; - $filesystem = new Filesystem(); - - // Généraltion du cache associés aux flux - foreach ($fluxs as $keyflux => $flux) { - // On regarde si le flux a été lu il y a peu - $toregen = true; - $url = $flux->getUrl(); - - // Feed lié à un user interne - $filecache = 'uploads/flux/flux-'.$flux->getId().'.txt'; - if (false !== stripos($url, '##userid##')) { - if ($user) { - $url = str_replace('##userid##', $user->getId(), $url); - $filecache = $filecache = 'uploads/flux/flux-'.$user->getId().'-'.$flux->getId().'.txt'; - } - } - - // Si le fichie cache existe - if ($filesystem->exists($filecache)) { - // On récupère la date de modification du fichier - $timestampfile = filemtime($filecache); - $datetimeFormat = 'Y-m-d H:i:s'; - $datefile = new \DateTime(); - $datefile->setTimestamp($timestampfile); - - // On ajoute 30mn - $datefile->add(new \DateInterval('PT30M')); - - // Si la date est inférieur à maintenant on regénère le flux - $now = new \DateTime(); - if ($datefile >= $now) { - $toregen = false; - $backup = unserialize(file_get_contents($filecache)); - $feeds = array_merge($feeds, $backup); - if (empty($backup)) { - unset($fluxs[$keyflux]); - } - } - } - - // Si le fichier est trop ancien on relit le flus - if ($toregen) { - $PROXYactivate = $this->em->getRepository('App:Config')->find('PROXYactivate')->getValue(); - $weburl = $this->getParameter('weburl'); - - if (0 == stripos($url, '/')) { - $url = 'https://'.$weburl.$url; - $PROXYactivate = false; - } - if (0 === stripos($url, 'https://'.$weburl)) { - $PROXYactivate = false; - } - if (0 === stripos($url, 'http://'.$weburl)) { - $PROXYactivate = false; - } - - if ($PROXYactivate) { - $PROXYserver = $this->em->getRepository('App:Config')->find('PROXYserver')->getValue(); - $PROXYport = $this->em->getRepository('App:Config')->find('PROXYport')->getValue(); - $clientguzzle = new \GuzzleHttp\Client(['timeout' => 3, 'verify' => false, 'proxy' => ['http' => 'http://'.$PROXYserver.':'.$PROXYport, 'https' => 'http://'.$PROXYserver.':'.$PROXYport]]); - } else { - $clientguzzle = new \GuzzleHttp\Client(['timeout' => 3, 'verify' => false]); - } - - try { - $clientguzzle->request('GET', $url); - } catch (RequestException $e) { - if ($e->hasResponse()) { - continue; - } - } - - // On lit le flux rss - $client = new \FeedIo\Adapter\Guzzle\Client($clientguzzle); - $logger = new \Psr\Log\NullLogger(); - $feedIo = new \FeedIo\FeedIo($client, $logger); - - try { - $result = $feedIo->read($url); - } catch (\Exception $e) { - $result = null; - } - - if ($result) { - $feedtitle = $result->getFeed()->getTitle(); - - $backup = []; - - // Pour chaque articles - $nbflux = 0; - foreach ($result->getFeed() as $item) { - $title = $item->getTitle(); - $link = $item->getLink(); - $description = substr(strip_tags($item->getDescription()), 0, 250); - $description = str_replace('¶', '', $description); - $date = $item->getLastModified(); - $dateformat = ($date ? $item->getLastModified()->format('d/m/Y H:i:s') : ''); - $content = $item->getDescription(); - $media = $item->getMedias(); - $mediaurl = ''; - - foreach ($item->getMedias() as $itemMedia) { - if ('image/jpeg' == $itemMedia->getType()) { - $mediaurl = $itemMedia->getUrl(); - } - } - - foreach ($item->getAllElements() as $element) { - if ('content:encoded' == $element->getName()) { - $content = $element->getValue(); - } - } - - if ('' != $mediaurl) { - $imgurl = $mediaurl; - } else { - // Récupérer la première image du contenu - $imgcontent = ''; - $imgurl = ''; - $imgstart = stripos($content, '', $imgstart); - $imgcontent = substr($content, $imgstart, $imgend - $imgstart + 1); - - $imgstart = stripos($imgcontent, 'src='); - $imgurl = substr($imgcontent, $imgstart + 5); - $imgend = stripos($imgurl, '"'); - - if (false === $imgend) { - $imgend = stripos($imgurl, "'"); - } - $imgurl = substr($imgurl, 0, $imgend); - } - } - - // Garder le flux - $tmp = [ - 'feedtitle' => $feedtitle, - 'title' => $title, - 'link' => $link, - 'description' => $description, - 'date' => $date, - 'dateformat' => $dateformat, - 'content' => $content, - 'image' => $imgurl, - 'color' => $flux->getColor(), - 'fluxid' => $flux->getId(), - 'fluxtitle' => $flux->getTitle(), - ]; - - array_push($feeds, $tmp); - array_push($backup, $tmp); - - ++$nbflux; - if ($nbflux >= $flux->getMaxread() && $flux->getMaxread() > 0) { - break; - } - } - - if (0 == $nbflux) { - unset($fluxs[$keyflux]); - } - - // On sauvegarde le résultat en fichier on rechargera son contenu que s'il n'a pas été lu depuis 30mn - $filesystem->dumpFile($filecache, serialize($backup)); - } - } - } - - // Trie des fluxs - $fluxsordered = $fluxs->getIterator(); - $fluxsordered->uasort(function ($first, $second) { - return (int) $first->getRowOrder() > (int) $second->getRowOrder() ? 1 : -1; - }); - - // Trie des feeds - $libelle = []; - foreach ($feeds as $key => $valeur) { - $libelle[$key] = $valeur['date']; - } - array_multisort($libelle, SORT_DESC, $feeds); - - // Render - return $this->getRender('viewflux.html.twig', [ - 'modelist' => $modelist, - 'fluxs' => $fluxsordered, - 'feeds' => $feeds, - ]); - } - - public function viewrss(Request $request, $id, $access = 'config') - { - // Récupération de la requete - $this->setRequest($em, $request, $id, $access); - - // Valeur par défaut - $modelist = 0; - $fluxs = ['id' => 0]; - $feeds = null; - - // Récupération des paramétres du widget - $url = ''; - $nbarticle = '_blank'; - $modelist = 0; - foreach ($this->entity->getParameter()['fields'] as $parameter) { - switch ($parameter['id']) { - case 'url': - $url = $parameter['value']; - break; - case 'nbarticle': - $nbarticle = $parameter['value']; - break; - case 'modelist': - $modelist = $parameter['value']; - break; - } - } - - // On regarde si le flux a été lu il y a peu - $toregen = true; - $filecache = $filecache = 'uploads/flux/widget-'.$id.'.txt'; - $user = $this->getUser(); - if (false !== stripos($url, '##userid##')) { - if ($user) { - $url = str_replace('##userid##', $user->getId(), $url); - $filecache = $filecache = 'uploads/flux/widget-'.$user->getId().'-'.$id.'.txt'; - } - } - - $filesystem = new Filesystem(); - if ($filesystem->exists($filecache)) { - // On récupère la date de modification du fichier - $timestampfile = filemtime($filecache); - $datetimeFormat = 'Y-m-d H:i:s'; - $datefile = new \DateTime(); - $datefile->setTimestamp($timestampfile); - - // On ajoute 30mn - $datefile->add(new \DateInterval('PT30M')); - - // Si la date est inférieur à maintenant on regénère le flux - $now = new \DateTime(); - if ($datefile >= $now) { - $toregen = false; - $feeds = unserialize(file_get_contents($filecache)); - } - } - - // Si le fichier est trop ancien on relit le flus - if ($toregen) { - // Connexion au client - $PROXYactivate = $this->em->getRepository('App:Config')->find('PROXYactivate')->getValue(); - $weburl = $this->getParameter('weburl'); - if (0 == stripos($url, '/')) { - $url = 'https://'.$weburl.$url; - $PROXYactivate = false; - } - if (0 === stripos($url, 'https://'.$weburl)) { - $PROXYactivate = false; - } - if (0 === stripos($url, 'http://'.$weburl)) { - $PROXYactivate = false; - } - - if ($PROXYactivate) { - $PROXYserver = $this->em->getRepository('App:Config')->find('PROXYserver')->getValue(); - $PROXYport = $this->em->getRepository('App:Config')->find('PROXYport')->getValue(); - $clientguzzle = new \GuzzleHttp\Client(['timeout' => 3, 'verify' => false, 'proxy' => ['http' => 'http://'.$PROXYserver.':'.$PROXYport, 'https' => 'http://'.$PROXYserver.':'.$PROXYport]]); - } else { - $clientguzzle = new \GuzzleHttp\Client(['timeout' => 3, 'verify' => false]); - } - - try { - $clientguzzle->request('GET', $url); - } catch (RequestException $e) { - if ($e->hasResponse()) { - // Render - $feeds = []; - - return $this->getRender('viewflux.html.twig', [ - 'fluxs' => $fluxs, - 'feeds' => $feeds, - 'modelist' => $modelist, - ]); - } - } - - $client = new \FeedIo\Adapter\Guzzle\Client($clientguzzle); - $logger = new \Psr\Log\NullLogger(); - $feedIo = new \FeedIo\FeedIo($client, $logger); - - $feeds = []; - - // On lit le flux rss - try { - $result = $feedIo->read($url); - } catch (\Exception $e) { - $result = null; - } - - if ($result) { - $feedtitle = $result->getFeed()->getTitle(); - - // Pour chaque articles - $nbflux = 0; - foreach ($result->getFeed() as $item) { - $title = $item->getTitle(); - $link = $item->getLink(); - $description = substr(strip_tags($item->getDescription()), 0, 250); - $description = str_replace('¶', '', $description); - $date = $item->getLastModified(); - $dateformat = ($date ? $item->getLastModified()->format('d/m/Y H:i:s') : ''); - $content = $item->getDescription(); - $media = $item->getMedias(); - $mediaurl = ''; - - foreach ($item->getMedias() as $itemMedia) { - if ('image/jpeg' == $itemMedia->getType()) { - $mediaurl = $itemMedia->getUrl(); - } - } - - foreach ($item->getAllElements() as $element) { - if ('content:encoded' == $element->getName()) { - $content = $element->getValue(); - } - } - - if ('' != $mediaurl) { - $imgurl = $mediaurl; - } else { - // Récupérer la première image du contenu - $imgcontent = ''; - $imgurl = ''; - $imgstart = stripos($content, '', $imgstart); - $imgcontent = substr($content, $imgstart, $imgend - $imgstart + 1); - - $imgstart = stripos($imgcontent, 'src='); - $imgurl = substr($imgcontent, $imgstart + 5); - $imgend = stripos($imgurl, '"'); - - if (false === $imgend) { - $imgend = stripos($imgurl, "'"); - } - $imgurl = substr($imgurl, 0, $imgend); - } - } - - // Garder le flux - array_push($feeds, [ - 'feedtitle' => $feedtitle, - 'title' => $title, - 'link' => $link, - 'description' => $description, - 'date' => $date, - 'dateformat' => $dateformat, - 'content' => $content, - 'image' => $imgurl, - // "color" => $flux->getColor(), - 'fluxid' => 0, - 'fluxtitle' => $this->entity->getName(), - ]); - - ++$nbflux; - if ($nbflux >= $nbarticle && $nbarticle > 0) { - break; - } - } - - $libelle = []; - foreach ($feeds as $key => $valeur) { - $libelle[$key] = $valeur['date']; - } - array_multisort($libelle, SORT_DESC, $feeds); - - // On sauvegarde le résultat en fichier on rechargera son contenu que s'il n'a pas été lu depuis 30mn - $filesystem->dumpFile($filecache, serialize($feeds)); - } - } - - // Render - return $this->getRender('viewflux.html.twig', [ - 'fluxs' => $fluxs, - 'feeds' => $feeds, - 'modelist' => $modelist, - ]); - } - public function viewbookmark($id, $access, Request $request, ManagerRegistry $em) { // Récupération de la requete @@ -1087,7 +714,6 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('viewlink.html.twig', [ - 'canadd' => $this->canadd, 'url' => $url, 'target' => $target, ]); @@ -1106,14 +732,13 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('viewinfo.html.twig', [ - 'canadd' => $this->canupdate, 'usage' => $this->usage, 'id' => $id, 'idpage' => $this->entity->getPage()->getId(), ]); } - public function vieweditor(Request $request, $id, $access = 'config') + public function vieweditor($id, $access, Request $request, ManagerRegistry $em) { // Récupération de la requete $this->setRequest($em, $request, $id, $access); @@ -1130,12 +755,11 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('vieweditor.html.twig', [ - 'canadd' => false, 'html' => $html, ]); } - public function viewslide(Request $request, $id, $access = 'config') + public function viewslide($id, $access, Request $request, ManagerRegistry $em) { // Récupération de la requete $this->setRequest($em, $request, $id, $access); @@ -1151,17 +775,16 @@ class PagewidgetController extends AbstractController } // Récupération des slides - $slides = $this->em->getRepository('App:Slide')->findBy(['pagewidget' => $this->entity], ['roworder' => 'ASC', 'title' => 'ASC']); + $slides = $this->em->getRepository('App\Entity\Pagewidgetslide')->findBy(['pagewidget' => $this->entity], ['roworder' => 'ASC', 'title' => 'ASC']); // Render return $this->getRender('viewslide.html.twig', [ - 'canadd' => $this->canadd, 'slides' => $slides, 'interval' => $interval, ]); } - public function viewfile(Request $request, $id, $access = 'config') + public function viewfile($id, $access, Request $request, ManagerRegistry $em) { // Récupération de la requete $this->setRequest($em, $request, $id, $access); @@ -1176,48 +799,32 @@ class PagewidgetController extends AbstractController } } + // Préference + $widgetfolder = $this->getKeyPreference($this->entity, 'widgetfolder', ''); + $view = ($widgetfolder && $widgetfolder['view'] ? $widgetfolder['view'] : $view); + // Render return $this->getRender('viewfile.html.twig', [ - 'canadd' => $this->canadd, - 'directory' => 'widget-'.$id, + 'category' => 'pagewidget', + 'id' => $id, 'view' => $view, ]); } - public function viewgalery(Request $request, $id, $access = 'config') + public function viewgalery($id, $access, Request $request, ManagerRegistry $em) { // Récupération de la requete $this->setRequest($em, $request, $id, $access); - $directory = $this->get('kernel')->getRootDir().'/../uploads/file/widget-'.$id; - $files = []; - $fs = new Filesystem(); - - if ($fs->exists($directory)) { - $finder = new Finder(); - $finder->sortByName()->in($directory)->exclude('thumb')->exclude('thumbmini'); - - foreach ($finder as $file) { - $tmp = []; - $tmp['name'] = $file->getRelativePathname(); - $tmp['extension'] = $file->getExtension(); - $fileinfo = new file($file->getPathname()); - $tmp['minetype'] = $fileinfo->getMimeType(); - $tmp['minefamily'] = explode('/', $tmp['minetype'])[0]; - - $tmp['thumb'] = ''; - if ($fs->exists($directory.'/thumb/'.$tmp['name'])) { - $data = file_get_contents($directory.'/thumb/'.$tmp['name']); - $tmp['thumb'] = 'data:image/'.$tmp['extension'].';base64,'.base64_encode($data); - } - - array_push($files, $tmp); - } + $directory = 'file/pagewidget/'.$id.'/.thumb/'; + $files = $this->minio->listFiles($directory, '/'); + if ($files) { + $date = array_column($files, 'LastModified'); + array_multisort($date, SORT_DESC, $files); } // Render return $this->getRender('viewgalery.html.twig', [ - 'canadd' => $this->canadd, 'files' => $files, ]); } @@ -1243,7 +850,6 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('viewcalendar.html.twig', [ - 'canadd' => $this->canadd, 'events' => $events, 'nbday' => $nbday, 'firstcalendar' => $firstcalendar, @@ -1283,7 +889,6 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('viewblog.html.twig', [ - 'canadd' => $this->canadd, 'blogarticles' => $blogarticles, 'nbarticle' => $nbarticle, 'firstblog' => $firstblog, @@ -1344,124 +949,10 @@ class PagewidgetController extends AbstractController // Render return $this->getRender('viewproject.html.twig', [ - 'canadd' => $this->canupdate, 'projecttasks' => $projecttasks, 'nbarticle' => $nbarticle, 'firstproject' => $firstproject, 'usage' => $this->usage, ]); } - - public function viewchat(Request $request, $id, $access = 'config') - { - // Récupération de la requete - $this->setRequest($em, $request, $id, $access); - - $group = $this->group; - if ('group' != $this->usage || !$group) { - $group = $this->em->getRepository('App:Group')->findOneBy(['fgall' => true])->getId(); - } - - // Render - return $this->getRender('viewchat.html.twig', [ - 'canadd' => $this->canupdate, - 'onheader' => false, - 'tool' => 'app_websocket_chat', - 'usage' => $this->usage, - 'group' => $group, - ]); - } - - public function viewgroup(Request $request, $id, $access = 'config') - { - // Récupération de la requete - $this->setRequest($em, $request, $id, $access); - - $user = $this->getUser(); - $mygroups = []; - $this->getDoctrine()->getRepository('App\Entity\Page')->getPagesUser($user, null, $default, $pagesuser, $pagesadmin, $groupsshared); - if (is_array($groupsshared)) { - foreach ($groupsshared as $groupshared) { - $title = $groupshared->getLabel(); - $idpage = $groupshared->pagesshared[0]->getId(); - $color = $groupshared->getColor(); - $icon = null; - if ($groupshared->getIcon()) { - $icon = '/'.$groupshared->getIcon()->getLabel(); - } - - array_push($mygroups, ['title' => $title, 'icon' => $icon, 'id' => $idpage, 'color' => $color]); - } - } - - // Render - return $this->getRender('viewgroup.html.twig', [ - 'canadd' => $user, - 'usage' => $this->usage, - 'groups' => $mygroups, - ]); - } - - public function viewgroupmessage(Request $request, $id, $access = 'config') - { - // Récupération de la requete - $this->setRequest($em, $request, $id, $access); - - // Récupération des paramétres du widget - $modelist = 1; - $nbarticle = 5; - foreach ($this->entity->getParameter()['fields'] as $parameter) { - switch ($parameter['id']) { - case 'modelist': - $modelist = $parameter['value']; - break; - case 'nbarticle': - $nbarticle = $parameter['value']; - break; - } - } - - $mymsg = []; - $user = $this->getUser(); - $this->getDoctrine()->getRepository('App\Entity\Page')->getPagesUser($user, null, $default, $pagesuser, $pagesadmin, $groupsshared); - if (is_array($groupsshared)) { - foreach ($groupsshared as $groupshared) { - // On récupère les info du groupe - $title = $groupshared->getLabel(); - $idpage = $groupshared->pagesshared[0]->getId(); - $color = $groupshared->getColor(); - - // On récupère l'ensemble des messages du groupes - $messages = $this->getDoctrine()->getRepository('CadolesWebsocketBundle:Message')->findBy(['group' => $groupshared]); - foreach ($messages as $key => $message) { - // persistante collection à revoir - if ($message->getSees()->count() > 0) { - if ($message->getSees()->contains($user)) { - unset($messages[$key]); - } - } - } - - foreach ($messages as $key => $message) { - $tmp = ['id' => $message->getId(), 'user' => $message->getUser(), 'date' => $message->getSubmitdate(), 'topic' => $message->getTopic(), 'pageid' => $idpage, 'pagetitle' => $title, 'color' => $color]; - array_push($mymsg, $tmp); - } - } - - $ord = []; - foreach ($mymsg as $key => $value) { - $ord[] = $value['date']; - } - array_multisort($ord, SORT_DESC, $mymsg); - } - - // Render - return $this->getRender('viewgroupmessage.html.twig', [ - 'canadd' => $user, - 'usage' => $this->usage, - 'modelist' => $modelist, - 'messages' => $mymsg, - 'nbarticle' => $nbarticle, - ]); - } } diff --git a/src/Controller/PagewidgetslideController.php b/src/Controller/PagewidgetslideController.php new file mode 100644 index 0000000..2f1133b --- /dev/null +++ b/src/Controller/PagewidgetslideController.php @@ -0,0 +1,223 @@ +query->get('usage'); + + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$pagewidget) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // Vérifier que l'on peut générer un pagewidgetslide + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Recherche des pagewidgetslides du widget + $datas = $em->getRepository($this->labelentity)->findBy(['pagewidget' => $pagewidget], ['roworder' => 'ASC', 'title' => 'ASC']); + + return $this->render($this->twig.'list.html.twig', [ + 'useheader' => ('admin' == $access), + 'usemenu' => ('admin' == $access), + 'usesidebar' => ('admin' == $access), + 'maxsize' => ('all' == $access ? 1200 : null), + 'access' => $access, + 'pagewidget' => $pagewidget, + 'usage' => $usage, + $this->data.'s' => $datas, + ]); + } + + public function submit($idwidget, $access, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // Initialisation de l'enregistrement + $data = new Pagewidgetslide(); + $data->setRoworder(0); + + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$pagewidget) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // Vérifier que l'on peut générer un pagewidgetslide + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Création du formulaire + $form = $this->createForm(PagewidgetslideType::class, $data, ['mode' => 'submit']); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + if ($data->getImage()) { + $data->setPagewidget($pagewidget); + + // Sauvegarde + $em->getManager()->persist($data); + $em->getManager()->flush(); + + // Retour à la page + return $this->redirect($this->generateUrl('app_'.$access.'_pagewidgetslide_list', ['idwidget' => $idwidget, 'usage' => $usage])); + } + } + + return $this->render($this->twig.'edit.html.twig', [ + 'useheader' => ('admin' == $access), + 'usemenu' => ('admin' == $access), + 'usesidebar' => ('admin' == $access), + 'maxsize' => ('all' == $access ? 1200 : null), + 'entity' => $data, + 'mode' => 'submit', + 'access' => $access, + 'pagewidget' => $pagewidget, + 'usage' => $usage, + 'form' => $form->createView(), + ]); + } + + public function update($id, $idwidget, $access, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // Récupération de l'enregistrement courant + $data = $em->getRepository("App\Entity\Pagewidgetslide")->find($id); + if (!$data) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$pagewidget) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // Vérifier que l'on peut générer un pagewidgetslide + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Création du formulaire + $form = $this->createForm(PagewidgetslideType::class, $data, ['mode' => 'update']); + + // Récupération des data du formulaire + $form->handleRequest($request); + + // Sur validation + if ($form->get('submit')->isClicked() && $form->isValid()) { + $data = $form->getData(); + if ($data->getImage()) { + // Sauvegarde + $em->getManager()->flush(); + + // Retour à la page + return $this->redirect($this->generateUrl('app_'.$access.'_pagewidgetslide_list', ['idwidget' => $idwidget, 'usage' => $usage])); + } + } + + // Affichage du formulaire + return $this->render($this->twig.'edit.html.twig', [ + 'useheader' => ('admin' == $access), + 'usemenu' => ('admin' == $access), + 'usesidebar' => ('admin' == $access), + 'maxsize' => ('all' == $access ? 1200 : null), + 'entity' => $data, + 'mode' => 'update', + 'access' => $access, + 'pagewidget' => $pagewidget, + 'usage' => $usage, + 'form' => $form->createView(), + ]); + } + + public function delete($id, $idwidget, $access, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // Récupération de l'enregistrement courant + $data = $em->getRepository("App\Entity\Pagewidgetslide")->find($id); + if (!$data) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$pagewidget) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // Vérifier que l'on peut générer un pagewidgetslide + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + // Tentative de suppression + try { + $em->getManager()->remove($data); + $em->getManager()->flush(); + } catch (\Exception $e) { + $request->getSession()->getFlashBag()->add('error', $e->getMessage()); + throw $this->createAccessDeniedException('Permission denied'); + } + + // Retour à la list + return $this->redirect($this->generateUrl('app_'.$access.'_pagewidgetslide_list', ['idwidget' => $idwidget, 'usage' => $usage])); + } + + public function upload($idwidget, $access, Request $request, ManagerRegistry $em): Response + { + $usage = $request->query->get('usage'); + + // On s'assure que le widget existe + $pagewidget = $em->getRepository("App\Entity\Pagewidget")->find($idwidget); + if (!$pagewidget) { + throw $this->createNotFoundException('Unable to find entity.'); + } + + // Vérifier que l'on peut générer un pagewidgetslide + if ('all' == $access) { + if (!$em->getRepository("App\Entity\Pagewidget")->getCanadd($this->getUser(), $pagewidget, $usage)) { + throw $this->createAccessDeniedException('Permission denied'); + } + } + + return $this->render($this->twig.'upload.html.twig', [ + 'useheader' => false, + 'usemenu' => false, + 'usesidebar' => false, + 'pagewidget' => $pagewidget, + ]); + } +} diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 691a1ca..394622e 100755 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -376,7 +376,7 @@ class UserController extends AbstractController { // Vérifier que l'on puisse créer if ('SQL' != $this->getParameter('appMasteridentity') && $this->getParameter('appSynchroPurgeUser')) { - throw $this->createNotFoundException('Permission denied'); + throw $this->createAccessDeniedException('Permission denied'); } // Controler les permissions diff --git a/src/Entity/Pagewidget.php b/src/Entity/Pagewidget.php index e0cb6df..4b96efe 100755 --- a/src/Entity/Pagewidget.php +++ b/src/Entity/Pagewidget.php @@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping as ORM; * * @ORM\Entity * @ORM\Table(name="pagewidget") + * @ORM\Entity(repositoryClass="App\Repository\PagewidgetRepository") */ class Pagewidget { @@ -142,14 +143,14 @@ class Pagewidget * @var ArrayCollection * @var Slide * - * @ORM\OneToMany(targetEntity="Slide", mappedBy="pagewidget", cascade={"persist"}, orphanRemoval=true) + * @ORM\OneToMany(targetEntity="Pagewidgetslide", mappedBy="pagewidget", cascade={"persist"}, orphanRemoval=true) */ - private $slides; + private $pagewidgetslides; public function __construct() { $this->bookmarks = new ArrayCollection(); - $this->slides = new ArrayCollection(); + $this->pagewidgetslides = new ArrayCollection(); } // A garder pour forcer l'id en init @@ -388,29 +389,29 @@ class Pagewidget } /** - * @return Collection + * @return Collection */ - public function getSlides(): Collection + public function getPagewidgetslides(): Collection { - return $this->slides; + return $this->pagewidgetslides; } - public function addSlide(Slide $slide): self + public function addPagewidgetslide(Pagewidgetslide $pagewidgetslide): self { - if (!$this->slides->contains($slide)) { - $this->slides->add($slide); - $slide->setPagewidget($this); + if (!$this->pagewidgetslides->contains($pagewidgetslide)) { + $this->pagewidgetslides->add($pagewidgetslide); + $pagewidgetslide->setPagewidget($this); } return $this; } - public function removeSlide(Slide $slide): self + public function removePagewidgetslide(Pagewidgetslide $pagewidgetslide): self { - if ($this->slides->removeElement($slide)) { + if ($this->pagewidgetslides->removeElement($pagewidgetslide)) { // set the owning side to null (unless already changed) - if ($slide->getPagewidget() === $this) { - $slide->setPagewidget(null); + if ($pagewidgetslide->getPagewidget() === $this) { + $pagewidgetslide->setPagewidget(null); } } diff --git a/src/Entity/Slide.php b/src/Entity/Pagewidgetslide.php old mode 100755 new mode 100644 similarity index 50% rename from src/Entity/Slide.php rename to src/Entity/Pagewidgetslide.php index ec7caf6..361d990 --- a/src/Entity/Slide.php +++ b/src/Entity/Pagewidgetslide.php @@ -6,9 +6,10 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity - * @ORM\Table(name="slide") + * @ORM\Table(name="pagewidgetslide") + * @ORM\HasLifecycleCallbacks */ -class Slide +class Pagewidgetslide { /** * @var int @@ -62,185 +63,96 @@ class Slide private $image; /** - * @ORM\ManyToOne(targetEntity="Pagewidget", inversedBy="slides") + * @ORM\ManyToOne(targetEntity="Pagewidget", inversedBy="pagewidgetslides") */ private $pagewidget; - /** - * Get id. - * - * @return int - */ - public function getId() + public function getId(): ?int { return $this->id; } - /** - * Set title. - * - * @param string $title - * - * @return Slide - */ - public function setTitle($title) + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(?string $title): self { $this->title = $title; return $this; } - /** - * Get title. - * - * @return string - */ - public function getTitle() + public function getSubtitle(): ?string { - return $this->title; + return $this->subtitle; } - /** - * Set subtitle. - * - * @param string $subtitle - * - * @return Slide - */ - public function setSubtitle($subtitle) + public function setSubtitle(?string $subtitle): self { $this->subtitle = $subtitle; return $this; } - /** - * Get subtitle. - * - * @return string - */ - public function getSubtitle() + public function getUrl(): ?string { - return $this->subtitle; + return $this->url; } - /** - * Set url. - * - * @param string $url - * - * @return Slide - */ - public function setUrl($url) + public function setUrl(?string $url): self { $this->url = $url; return $this; } - /** - * Get url. - * - * @return string - */ - public function getUrl() + public function getTarget(): ?string { - return $this->url; + return $this->target; } - /** - * Set target. - * - * @param string $target - * - * @return Slide - */ - public function setTarget($target) + public function setTarget(string $target): self { $this->target = $target; return $this; } - /** - * Get target. - * - * @return string - */ - public function getTarget() + public function getRoworder(): ?int { - return $this->target; + return $this->roworder; } - /** - * Set roworder. - * - * @param int $roworder - * - * @return Slide - */ - public function setRoworder($roworder) + public function setRoworder(?int $roworder): self { $this->roworder = $roworder; return $this; } - /** - * Get roworder. - * - * @return int - */ - public function getRoworder() + public function getImage(): ?string { - return $this->roworder; + return $this->image; } - /** - * Set image. - * - * @param string $image - * - * @return Slide - */ - public function setImage($image) + public function setImage(?string $image): self { $this->image = $image; return $this; } - /** - * Get image. - * - * @return string - */ - public function getImage() + public function getPagewidget(): ?Pagewidget { - return $this->image; + return $this->pagewidget; } - /** - * Set pagewidget. - * - * @param Pagewidget $pagewidget - * - * @return Slide - */ - public function setPagewidget(Pagewidget $pagewidget = null) + public function setPagewidget(?Pagewidget $pagewidget): self { $this->pagewidget = $pagewidget; return $this; } - - /** - * Get pagewidget. - * - * @return Pagewidget - */ - public function getPagewidget() - { - return $this->pagewidget; - } } diff --git a/src/EventListener/PurgefileSubscriber.php b/src/EventListener/PurgefileSubscriber.php new file mode 100755 index 0000000..5990b7a --- /dev/null +++ b/src/EventListener/PurgefileSubscriber.php @@ -0,0 +1,73 @@ +minio = $minio; + } + + public function getSubscribedEvents(): array + { + return [ + Events::preRemove, + ]; + } + + public function preRemove(LifecycleEventArgs $args): void + { + $this->entity = $args->getObject(); + + // Sur suppression de pagewidget + if ($this->entity instanceof Pagewidget) { + try { + $files = $this->minio->listFiles('file/pagewidget/'.$this->entity->getId().'/'); + if ($files) { + foreach ($files as $file) { + $this->minio->delete($file['Key']); + } + } + } catch (\Exception $e) { + } + } + + // Sur suppression pagewidgetslide + if ($this->entity instanceof Pagewidgetslide) { + try { + $files = $this->minio->listFiles($this->entity->getImage()); + if ($files) { + foreach ($files as $file) { + $this->minio->delete($file['Key']); + } + } + } catch (\Exception $e) { + } + } + + // Sur suppression icon + if ($this->entity instanceof Icon) { + try { + $files = $this->minio->listFiles($this->entity->getLabel()); + if ($files) { + foreach ($files as $file) { + $this->minio->delete($file['Key']); + } + } + } catch (\Exception $e) { + } + } + } +} diff --git a/src/Form/PagewidgetckeditorType.php b/src/Form/PagewidgetckeditorType.php new file mode 100644 index 0000000..0ea0306 --- /dev/null +++ b/src/Form/PagewidgetckeditorType.php @@ -0,0 +1,40 @@ +add('submit', SubmitType::class, [ + 'label' => 'Valider', + 'attr' => ['class' => 'btn btn-success'], + ]) + ->add('ckeditor', CKEditorType::class, [ + 'label' => 'Texte', + 'required' => false, + 'config_name' => 'full_config', + 'config' => [ + 'height' => 600, + 'filebrowserUploadRoute' => 'app_ckeditor_upload', + 'filebrowserUploadRouteParameters' => ['category' => 'pagewidget', 'id' => $options['idwidget'], 'usage' => $options['usage']], + ], + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'mode' => 'string', + 'idwidget' => 'string', + 'usage' => 'string', + ]); + } +} diff --git a/src/Form/PagewidgetslideType.php b/src/Form/PagewidgetslideType.php new file mode 100644 index 0000000..7013c26 --- /dev/null +++ b/src/Form/PagewidgetslideType.php @@ -0,0 +1,66 @@ +add('submit', SubmitType::class, [ + 'label' => 'Valider', + 'attr' => ['class' => 'btn btn-success'], + ]) + + ->add('title', TextType::class, [ + 'label' => 'Titre', + 'required' => false, + ]) + + ->add('subtitle', TextareaType::class, [ + 'label' => 'Sous Titre', + 'required' => false, + 'attr' => ['rows' => '4'], + ]) + + ->add('roworder', IntegerType::class, [ + 'label' => 'Ordre', + ]) + + ->add('url', TextType::class, [ + 'label' => 'URL', + 'required' => false, + ]) + + ->add('target', ChoiceType::class, [ + 'label' => 'Ouvrir le lien dans', + 'choices' => [ + 'Nouvel onglet/fenêtre' => '_blank', + 'iFrame' => 'frame', + 'Onglet courant' => '_self', + ], + ]) + + ->add('image', HiddenType::class, [ + 'label' => 'image', + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => 'App\Entity\Pagewidgetslide', + 'mode' => 'string', + ]); + } +} diff --git a/src/Repository/PagewidgetRepository.php b/src/Repository/PagewidgetRepository.php new file mode 100644 index 0000000..e8f35b0 --- /dev/null +++ b/src/Repository/PagewidgetRepository.php @@ -0,0 +1,110 @@ + + * + * @method Pagewidget|null find($id, $lockMode = null, $lockVersion = null) + * @method Pagewidget|null findOneBy(array $criteria, array $orderBy = null) + * @method Pagewidget[] findAll() + * @method Pagewidget[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class PagewidgetRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Pagewidget::class); + } + + public function save(Pagewidget $entity, bool $flush = false): void + { + $this->getEntityManager()->persist($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function remove(Pagewidget $entity, bool $flush = false): void + { + $this->getEntityManager()->remove($entity); + + if ($flush) { + $this->getEntityManager()->flush(); + } + } + + public function getCansee($user, $pagewidget) + { + $cansee = false; + + if (!$pagewidget) { + return $cansee; + } + + $page = $pagewidget->getPage(); + if (!$page) { + return $cansee; + } + + // Si visiteur la page partage avec visitor ? + if (!$user) { + if ($page->getRoles() && in_array('ROLE_ANONYME', $page->getRoles())) { + $cansee = true; + } + } else { + // Si propriétaire de la page il peut voir + if ($page->getUser() == $user) { + $cansee = true; + } + // Si membre du groupe il peut voir + else { + foreach ($page->getGroups() as $group) { + $usergroup = $this->getEntityManager()->getRepository('App\Entity\UserGroup')->findoneby(['user' => $user, 'group' => $group]); + if ($usergroup) { + $cansee = true; + } + } + } + } + + return $cansee; + } + + public function getCanadd($user, $pagewidget, $usage) + { + $canadd = false; + + if (!$pagewidget) { + return $canadd; + } + + $page = $pagewidget->getPage(); + if (!$page) { + return $canadd; + } + + if ($user) { + // Si propriétaire de la page il peut ajouter + if ($page->getUser() == $user) { + $canadd = true; + } + // Si membre du groupe il peut ajouter + else { + foreach ($page->getGroups() as $group) { + $usergroup = $this->getEntityManager()->getRepository('App\Entity\UserGroup')->findoneby(['user' => $user, 'group' => $group]); + if ($usergroup and $usergroup->getRolegroup() >= 50) { + $canadd = true; + } + } + } + } + + return $canadd; + } +} diff --git a/src/Service/MinioService.php b/src/Service/MinioService.php index 92c7edf..c3cffd6 100755 --- a/src/Service/MinioService.php +++ b/src/Service/MinioService.php @@ -106,6 +106,8 @@ class MinioService $tmpdir = $this->rootPath.'/var/tmp'; @unlink($tmpdir.'/'.$filename); } + + return true; } /** @@ -173,17 +175,18 @@ class MinioService } /** - * listKeys. + * listFiles. * * @return array */ - public function listKeys(string $prefix) + public function listFiles(string $prefix, string $delimiter = '') { // On utilise un path spécifique car listObjectsV2 utilise une autre config de client try { $response = $this->client->listObjectsV2([ 'Bucket' => $this->minioBucket, 'Prefix' => $prefix, + 'Delimiter' => $delimiter, ]); return $response->get('Contents'); @@ -193,6 +196,28 @@ class MinioService } } + /** + * listFolders. + * + * @return array + */ + public function listFolders(string $prefix, string $delimiter = '') + { + // On utilise un path spécifique car listObjectsV2 utilise une autre config de client + try { + $response = $this->client->listObjectsV2([ + 'Bucket' => $this->minioBucket, + 'Prefix' => $prefix, + 'Delimiter' => $delimiter, + ]); + + return $response->get('CommonPrefixes'); + } catch (Exception $e) { + \Sentry\captureException($e); + throw new Exception(self::ERR_UNAVAILABLE); + } + } + /** * download. * diff --git a/src/Service/UploadListener.php b/src/Service/UploadListener.php index 6bfae33..3ed218d 100755 --- a/src/Service/UploadListener.php +++ b/src/Service/UploadListener.php @@ -16,6 +16,61 @@ class UploadListener $this->minio = $minio; } + public function onUpload(PostPersistEvent $event) + { + $type = $event->getType(); + + switch ($type) { + case 'file' : + $request = $event->getRequest(); + $folder = $request->get('folder'); + + $file = $event->getFile(); + $filename = $file->getFilename(); + + $response = $event->getResponse(); + $response['file'] = $filename; + + $return = $this->minio->upload($file, $folder.$filename, true); + + // Création d'un thumb dans le cas d'un fichier de type imapge + if ($return && in_array(strtolower($file->GetExtension()), ['jpg', 'jpeg', 'jpe', 'png', 'gif', 'bmp'])) { + $max_width = 300; + $width = $this->getWidth($file); + $height = $this->getHeight($file); + $scale = $max_width / $width; + $this->resizeImage($file, $width, $height, $scale); + + $this->minio->upload($file, $folder.'.thumb/'.$filename, true); + } + + break; + + case 'slide' : + $request = $event->getRequest(); + $folder = $request->get('folder'); + + $file = $event->getFile(); + $filename = $file->getFilename(); + + $response = $event->getResponse(); + $response['file'] = $filename; + + $this->minio->upload($file, $type.'/'.$folder.'/'.$filename, true); + break; + + default: + $file = $event->getFile(); + $filename = $file->getFilename(); + + $response = $event->getResponse(); + $response['file'] = $filename; + + $this->minio->upload($file, $type.'/'.$filename, true); + break; + } + } + protected function getHeight($image) { $size = getimagesize($image); @@ -40,7 +95,7 @@ class UploadListener $newImageWidth = ceil($width * $scale); $newImageHeight = ceil($height * $scale); $newImage = imagecreatetruecolor($newImageWidth, $newImageHeight); - $source = null; + $fullname = $image->getPath().'/'.basename($image); switch ($imageType) { case 'image/gif': @@ -64,37 +119,19 @@ class UploadListener switch ($imageType) { case 'image/gif': - imagegif($newImage, $image); + imagegif($newImage, $fullname); break; case 'image/pjpeg': case 'image/jpeg': case 'image/jpg': - imagejpeg($newImage, $image, 90); + imagejpeg($newImage, $fullname, 90); break; case 'image/png': case 'image/x-png': - imagepng($newImage, $image); + imagepng($newImage, $fullname); break; } - chmod($image, 0640); - return $image; } - - public function onUpload(PostPersistEvent $event) - { - $type = $event->getType(); - - switch ($type) { - default: - $file = $event->getFile(); - $filename = $file->getFilename(); - $response = $event->getResponse(); - $response['file'] = $filename; - - $this->minio->upload($file, $type.'/'.$filename, true); - break; - } - } } diff --git a/src/Service/UploadSamename.php b/src/Service/UploadSamename.php new file mode 100644 index 0000000..9d3ad2f --- /dev/null +++ b/src/Service/UploadSamename.php @@ -0,0 +1,14 @@ +getClientOriginalName(); + } +} diff --git a/templates/File/folder.html.twig b/templates/File/folder.html.twig new file mode 100644 index 0000000..2d1f02d --- /dev/null +++ b/templates/File/folder.html.twig @@ -0,0 +1,50 @@ +{% extends 'base.html.twig' %} + +{% block localstyle %} + +{% endblock %} + +{% block body %} + {{ form_start(form) }} +

+ {{ form_widget(form.submit) }} Annuler +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {{ form_row(form.folder) }} + {{ form_end(form) }} + + +{% endblock %} + + + +{% block localscript %} + + +{% endblock %} diff --git a/templates/File/list.html.twig b/templates/File/list.html.twig new file mode 100644 index 0000000..6c5c61f --- /dev/null +++ b/templates/File/list.html.twig @@ -0,0 +1,346 @@ +{% extends 'base.html.twig' %} + +{% block localstyle %} + +{% endblock %} +{% block body %} + +
+ + + +
+ +
+ {% for dir in folders %} +
+
+
+ + + +
+

{{ dir.basename }}

+
+
+ +
+ {% if canadd %} + {% if fgtrash %} + + + + + + + + {% else %} + + + + + {% endif %} + {% endif %} +
+
+
+
+ {% endfor %} + + {% for file in files %} +
+
+
+ + + +
+

{{ file.basename }}

+
le {{ file.LastModified|date("d/m/Y H:i")}}
+
+
+ +
+ {% if canadd %} + {% if fgtrash %} + + + + + + + + {% else %} + + + + + {% endif %} + {% endif %} +
+
+
+
+ {% endfor %} +
+ + + +{% endblock %} + + +{% block localscript %} + +{% endblock %} + + + diff --git a/templates/File/redirect.html.twig b/templates/File/redirect.html.twig new file mode 100644 index 0000000..b9389a4 --- /dev/null +++ b/templates/File/redirect.html.twig @@ -0,0 +1,22 @@ +{% extends 'base.html.twig' %} + +{% block localstyle %} + +{% endblock %} + +{% block localscript %} + + + +{% endblock %} + + + + diff --git a/templates/File/upload.html.twig b/templates/File/upload.html.twig new file mode 100644 index 0000000..2ecf7ed --- /dev/null +++ b/templates/File/upload.html.twig @@ -0,0 +1,74 @@ +{% extends 'base.html.twig' %} + +{% block encoretags %} + {{ encore_entry_link_tags('dropzone') }} +{% endblock %} + +{% block localstyle %} + +{% endblock %} + +{% block body %} + Annuler + +
+
+{% endblock %} + + +{% block localscript %} + {{ encore_entry_script_tags('dropzone') }} + + +{% endblock %} + diff --git a/templates/File/view.html.twig b/templates/File/view.html.twig new file mode 100644 index 0000000..1b360b4 --- /dev/null +++ b/templates/File/view.html.twig @@ -0,0 +1,126 @@ +{% extends 'base.html.twig' %} + +{% block localstyle %} + +{% endblock %} + +{% block body %} +
+

{{basename}}

+
+ + {%if canadd %} +     + {%endif%} +
+
+ + {% if navigation %} + {% if not next is empty %} + + {% endif %} + {% if not prev is empty %} + + {% endif %} + {% endif %} + + {% if isimage %} + + {%else%} + + {%endif%} +{% endblock %} + + +{% block localscript %} + + + +{% endblock %} + + + + diff --git a/templates/Page/pages.html.twig b/templates/Page/pages.html.twig index 7cbab6f..9e4748c 100644 --- a/templates/Page/pages.html.twig +++ b/templates/Page/pages.html.twig @@ -99,7 +99,7 @@ {% endblock %} {% block menuuser %} - {% if canadd %} + {% if canadd and app.user %} {% endif %} diff --git a/templates/Page/viewwidget.html.twig b/templates/Page/viewwidget.html.twig index 9cb5d81..e9ea46d 100644 --- a/templates/Page/viewwidget.html.twig +++ b/templates/Page/viewwidget.html.twig @@ -68,7 +68,12 @@ {% block localscript %} +{% endblock %} \ No newline at end of file diff --git a/templates/Pagewidget/viewalert.html.twig b/templates/Pagewidget/viewalert.html.twig index e0130a6..086289b 100644 --- a/templates/Pagewidget/viewalert.html.twig +++ b/templates/Pagewidget/viewalert.html.twig @@ -1,4 +1,4 @@ -{% set widgetname="item" %} +{% set widgetname="alert" %} {% extends 'Pagewidget/widget.twig' %} {% block widgetbody %} {% for alert in alerts %} diff --git a/templates/Pagewidget/viewbookmark.html.twig b/templates/Pagewidget/viewbookmark.html.twig index 3f6ecd4..035f218 100644 --- a/templates/Pagewidget/viewbookmark.html.twig +++ b/templates/Pagewidget/viewbookmark.html.twig @@ -1,4 +1,4 @@ -{% set widgetname="item" %} +{% set widgetname="bookmark" %} {% extends 'Pagewidget/widget.twig' %} {% block widgetaction %} diff --git a/templates/Pagewidget/viewchat.html.twig b/templates/Pagewidget/viewchat.html.twig deleted file mode 100644 index e66f81b..0000000 --- a/templates/Pagewidget/viewchat.html.twig +++ /dev/null @@ -1,76 +0,0 @@ -{% import "Pagewidget/constants.twig" as constants %} - -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} -{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %} -{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %} - -{% set colorbodyback = entity.colorbodyback %} -{% if colorbodyback is null %} - {% set colorbodyback = app.session.get('colorbgbodydark') %} -{% endif %} - -{% set colorbodyfont = entity.colorbodyfont %} -{% if colorbodyfont is null %} - {% set colorbodyfont = app.session.get('colorfttitledark') %} -{% endif %} -{% set colorbody = app.session.get('colorbgbodylight') %} -{% set colormain = app.session.get('colorbgbodydark') %} - -{% if app.user %} - - -{%if mini %} - -{% else %} -
-
- {% if canupdate %} - - - {% endif %} - {% if look=="list" %} - - {% else %} - - {% endif %} -
- - - - {% if onheader %} -
- -
- {% else %} -
- {% if entity.icon %} - - {% else %} - - {% endif %} - {{ entity.name }} -
- -
- {% if group is not null %} - {{ render(url('app_message_chat',{'id':group,'framed':true,'border':entity.border,'colorbodybacklight':colorbodyback, 'colorbodyback':colorbodyback,'colorbodyfont':colorbodyfont,'colorbody':colorbody,'colormain':colormain})) }} - {% endif %} -
- {% endif %} -
-{% endif %} - -{%endif%} \ No newline at end of file diff --git a/templates/Pagewidget/vieweditor.html.twig b/templates/Pagewidget/vieweditor.html.twig index 8379538..f7abbe4 100644 --- a/templates/Pagewidget/vieweditor.html.twig +++ b/templates/Pagewidget/vieweditor.html.twig @@ -1,56 +1,28 @@ -{% set theme = app.session.get('theme') %} -{% if theme is not empty %} - {{ include('@Theme/'~theme~'/function.html.twig') }} -{% endif %} +{% set widgetname="editor" %} +{% extends 'Pagewidget/widget.twig' %} -{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} +{% block widgetaction %} + {% if canadd %} + + {% endif %} +{% endblock %} -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} - -{%if mini %} -
-
- - {% if entity.icon %} - - {% else %} - - {% endif %} - +{% block widgetbody %} + {% if html is empty and canadd %} +
+
+ Modifier votre texte
-
-{% else %} -
-
- {% if canupdate %} - - - {% endif %} - - {% if look=="list" %} - - {% else %} - - {% endif %} + {% else %} +
+ {{ html | raw }}
+ {% endif %} + +{% endblock %} + + -
- {% if entity.icon %} - - {% else %} - - {% endif %} - {{ entity.name }} -
- -
- {{ html | raw }} -
-
-{% endif %} diff --git a/templates/Pagewidget/viewfile.html.twig b/templates/Pagewidget/viewfile.html.twig index 8d57522..3665846 100644 --- a/templates/Pagewidget/viewfile.html.twig +++ b/templates/Pagewidget/viewfile.html.twig @@ -1,67 +1,15 @@ -{% import "Pagewidget/constants.twig" as constants %} +{% set widgetname="file" %} +{% extends 'Pagewidget/widget.twig' %} -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} -{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} -{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %} +{% block widgetaction %} + {% if canupdate %} + + {% endif %} +{% endblock %} -{% set colorbodyback = entity.colorbodyback %} -{% if colorbodyback is null %} - {% set colorbodyback = app.session.get('colorbgbodydark') %} -{% endif %} - -{% set colorbodyfont = entity.colorbodyfont %} -{% if entity.border and colorbodyfont is null %} - {% set colorbodyfont = app.session.get('colorfttitledark') %} -{% endif %} - -{% if colorbodyfont is null %} - {% set colorbodyfont = app.session.get('colorbgbodydark') %} -{% endif %} - -{%if mini %} - -{% else %} -
-
- {% if canupdate %} - - - {% endif %} - - {% if look=="list" %} - - {% else %} - - {% endif %} -
- -
- {% if entity.icon %} - - {% else %} - - {% endif %} - {{ entity.name }} -
- -
- -
-
-{% endif %} +{% block widgetbody %} + +{% endblock %} diff --git a/templates/Pagewidget/viewgalery.html.twig b/templates/Pagewidget/viewgalery.html.twig index 62029c3..39514e9 100644 --- a/templates/Pagewidget/viewgalery.html.twig +++ b/templates/Pagewidget/viewgalery.html.twig @@ -1,123 +1,23 @@ -{% set theme = app.session.get('theme') %} -{% if theme is not empty %} - {{ include('@Theme/'~theme~'/function.html.twig') }} -{% endif %} +{% set widgetname="galery" %} +{% extends 'Pagewidget/widget.twig' %} -{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} +{% block widgetaction %} + {% if canadd %} + + {% endif %} +{% endblock %} -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} -{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} - -{% set color = app.session.get('color') %} - -{% set colorbodyback = entity.colorbodyback %} -{% if colorbodyback is null %} - {% set colorbodyback = color['main'] %} -{% endif %} - - -{% set colorbodyfont = entity.colorbodyfont %} -{% if colorbodyfont is null %} - {% set colorbodyfont = color['fontcolorhover'] %} -{% endif %} - -{%if mini %} -
-
- - {% if entity.icon %} - - {% else %} - - {% endif %} - +{% block widgetbody %} + {% if canadd %} + Ajouter des Images + {% endif %} + + -{% else %} -
-
- {% if canupdate %} - - - {% endif %} - - {% if canadd %} - - {% endif %} - - {% if look=="list" %} - - {% else %} - - {% endif %} -
- -
- {% if entity.icon %} - - {% else %} - - {% endif %} - {{ entity.name }} -
- - {% if files|length>0 or canadd %} -
-
- {% if canadd %} -
-
- {% endif %} - - {% for file in files|sort %} - {% if loop.index==1 and not canadd %} -
-
- {% endif %} - -
-
- {% if canadd %} - - {% endif %} - - - - - -
-
- {% endfor %} - - {% if canadd %} - - {% endif %} -
-
- {% endif %} + {% endfor %}
-{% endif %} - - - +{% endblock %} \ No newline at end of file diff --git a/templates/Pagewidget/viewgroupmessage.html.twig b/templates/Pagewidget/viewgroupmessage.html.twig deleted file mode 100644 index 7b9ccc3..0000000 --- a/templates/Pagewidget/viewgroupmessage.html.twig +++ /dev/null @@ -1,121 +0,0 @@ -{% set theme = app.session.get('theme') %} -{% if theme is not empty %} - {{ include('@Theme/'~theme~'/function.html.twig') }} -{% endif %} - -{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} - -{% set colormain = constants.mycolormain() %} -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} -{% set stylewidgetbodyreverse = constants.mystylewidgetbodyreverse(entity) %} -{% set color = app.session.get('color') %} - -{% set colorbodyfont = entity.colorbodyfont %} -{% if colorbodyfont is null %} - {% set colorbodyfont = color['fontcolorhover'] %} -{% endif %} - -{% set colorbodyback = entity.colorbodyback %} -{% if colorbodyback is null %} - {% set colorbodyback = color['main'] %} -{% endif %} - -{% set colorbodyfont = entity.colorbodyfont %} -{% if colorbodyfont is null %} - {% if colorbodyback==color['fontcolorhover'] %} - {% set colorbodyfont = color['main'] %} - {% else %} - {% set colorbodyfont = color['fontcolorhover'] %} - {% endif %} -{% endif %} - -{% if modelist==0 %} - {% set stylegrid="grid-preview" %} -{% elseif modelist==1 %} - {% set stylegrid="grid-list" %} -{% endif %} - -{%if mini %} - -{% else %} -
- -
- {% if canupdate %} - - - {% endif %} - - {% if look=="list" %} - - {% else %} - - {% endif %} -
- - - -
- {% if entity.icon %} - - {% else %} - - {% endif %} - {{ entity.name }} -
- - - {% if messages is not empty %} -
-
-
-
- {% set nbaff=0 %} - {% for message in messages %} - {% set nbaff=nbaff+1 %} - {% set class="" %} - {% set style="" %} - {% if nbaff > nbarticle %} - {% set class="msg-hidden" %} - {% set style="display:none" %} - {% endif %} - -
-
- -
-
- {% endfor %} -
-
- {% endif %} -
-{% endif %} - - diff --git a/templates/Pagewidget/viewinfo.html.twig b/templates/Pagewidget/viewinfo.html.twig index 475c4af..d8a9c25 100644 --- a/templates/Pagewidget/viewinfo.html.twig +++ b/templates/Pagewidget/viewinfo.html.twig @@ -38,7 +38,7 @@
{% endfor %} - {%if canadd %} + {%if canupdate %}
diff --git a/templates/Pagewidget/viewitemessential.html.twig b/templates/Pagewidget/viewitemessential.html.twig index 38c7d9d..25c615d 100644 --- a/templates/Pagewidget/viewitemessential.html.twig +++ b/templates/Pagewidget/viewitemessential.html.twig @@ -1,4 +1,4 @@ -{% set widgetname="item" %} +{% set widgetname="itemessential" %} {% extends 'Pagewidget/widget.twig' %} {% block widgetaction %} diff --git a/templates/Pagewidget/viewseparator.html.twig b/templates/Pagewidget/viewseparator.html.twig deleted file mode 100644 index 8f30d55..0000000 --- a/templates/Pagewidget/viewseparator.html.twig +++ /dev/null @@ -1,63 +0,0 @@ -{% set theme = app.session.get('theme') %} -{% if theme is not empty %} - {{ include('@Theme/'~theme~'/function.html.twig') }} -{% endif %} - -{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} - -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbodyframe = constants.mystylewidgetbodyframe(entity) %} -{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %} - -{% set color = app.session.get('color') %} -{% set colorbodyfont = entity.colorbodyfont %} -{% if colorbodyfont is null %} - {% set colorbodyfont = color['main'] %} -{% endif %} - -{%if not mini %} -
- {% if canupdate %} -
- - -
- {% endif %} - - -
- {% if seeicon %} - {% if entity.icon %} - - {% else %} - - {% endif %} - {% endif %} - - {% if seetitle %} - {{ entity.name }} - {% else %} - -
- {% endif %} -
-
-{% endif %} - - - diff --git a/templates/Pagewidget/viewslide.html.twig b/templates/Pagewidget/viewslide.html.twig index e73952c..af73412 100644 --- a/templates/Pagewidget/viewslide.html.twig +++ b/templates/Pagewidget/viewslide.html.twig @@ -1,94 +1,51 @@ -{% set theme = app.session.get('theme') %} -{% if theme is not empty %} - {{ include('@Theme/'~theme~'/function.html.twig') }} -{% endif %} +{% set widgetname="slide" %} +{% extends 'Pagewidget/widget.twig' %} -{% import "@CadolesPortal/Pagewidget/constants.twig" as constants %} +{% block widgetaction %} + {% if canadd %} + + {% endif %} +{% endblock %} -{% set stylewidget = constants.mystylewidget(entity) %} -{% set stylewidgetmenu = constants.mystylewidgetmenu(entity) %} -{% set stylewidgetheader = constants.mystylewidgetheader(entity) %} -{% set stylewidgetbody = constants.mystylewidgetbody(entity) %} -{% set stylewidgetbodyimage = constants.mystylewidgetbodyimage(entity) %} +{% block widgetbody %} +{% set intervalmilli = interval * 1000 %} -{% set color = app.session.get('color') %} -{% set stylelink = "color:#" ~ entity.colorheaderfont ~ ";" %} -{% if entity.colorheaderfont is null %} - {% set stylelink = "color:#" ~ color['fontcolorhover'] ~ ";" %} -{% endif %} - -{% if app.user %} - {% set username = app.user.username %} -{% else %} - {% set username = "" %} -{% endif %} - -{%if mini %} -
-
- - {% if entity.icon %} - - {% else %} - - {% endif %} - +
+ {% if slides is empty and canadd %} +
+
+ Gérer le Carrousel
-
-{% else %} -
-
- {% if canupdate %} - - - {% endif %} + {% endif %} - {% if canadd %} - - {% endif %} - - {% if look=="list" %} - + {% for slide in slides %} + {% if slide.url is not empty %} + {% set url=slide.url|replace({'#login#': username}) %} + {% if slide.target == 'frame' %} + {% else %} - - {% endif %} -
+ + {% endif %} + {% endif %} + + + {% if slide.url is not empty %} + + {% endif %} + {% endfor %} +
+ +{% endblock %} diff --git a/templates/Pagewidget/widget.twig b/templates/Pagewidget/widget.twig index 9b58b0c..023cb52 100644 --- a/templates/Pagewidget/widget.twig +++ b/templates/Pagewidget/widget.twig @@ -1,14 +1,46 @@ {% set widgethaveheader=entity.viewheader %} + +{% if widgetname=="alert" and canupdate and alerts|length ==0 %} + {% set widgethaveheader=true %} +{% endif %} +{% if widgetname=="item" and canupdate and items|length==0 and withbookmark==1 %} + {% set widgethaveheader=true %} +{% endif %} +{% if widgetname=="bookmark" and canadd and bookmarks|length==0 %} + {% set widgethaveheader=true %} +{% endif %} +{% if widgetname=="editor" and canadd and html is empty %} + {% set widgethaveheader=true %} +{% endif %} + + +{% set viewwidget=true %} +{% if not widgethaveheader and widgetname=="alert" and not canupdate and alerts|length ==0 %} + {% set viewwidget=false %} +{% endif %} +{% if not widgethaveheader and widgetname=="item" and not canupdate and items|length ==0 and withbookmark==1 %} + {% set viewwidget=false %} +{% endif %} +{% if not widgethaveheader and widgetname=="bookmark" and not canadd and bookmarks|length ==0 %} + {% set viewwidget=false %} +{% endif %} +{% if not widgethaveheader and widgetname=="editor" and not canadd and html is empty %} + {% set viewwidget=false %} +{% endif %} + + + + {%if widgethaveheader %} {% set widgetstyle=(entity.colorheaderback ? "border-color:"~entity.colorheaderback~";" : "border-color:var(--colorbgbodydark);") %} {% set widgetstylemenu=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %} {%else%} -{% set widgetstyle=(entity.colorbodyback ? "border-color:"~entity.colorbodyback~";" : "border-color:var(--colorbgbodydark);") %} +{% set widgetstyle=(viewwidget ? "display:block;" : "display:none;")~(entity.colorbodyback ? "border-color:"~entity.colorbodyback~";" : "border-color:var(--colorbgbodydark);") %} {% set widgetstylemenu="margin:-26px 0px 0px 0px; padding: 1px 10px; background-color:var(--colorbgbodydark); color: var(--colorfttitledark); border-radius: 5px;" %} {%endif%} {% set widgetstyleheader=(entity.colorheaderback ? "background-color:"~entity.colorheaderback~";" : "background-color:var(--colorbgbodydark);")~(entity.colorheaderfont ? "color:"~entity.colorheaderfont~";" : "color:var(--colorfttitledark);") %} -{% set widgetstylebody=(entity.colorbodyback ? "background-color:"~entity.colorbodyback~";" : "background-color:var(--colorbgbodylight);")~(entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);")~(entity.isopened ? "display:block;" : "display:none;")~(widgetname=="url" ? "padding:0px;" : "")~(not widgethaveheader and not entity.border ? "padding-top: 0px" : "")~(entity.autoajust ? "" : "height:"~entity.height~"px;") %} +{% set widgetstylebody=(entity.colorbodyback ? "background-color:"~entity.colorbodyback~";" : "background-color:var(--colorbgbodylight);")~(entity.colorbodyfont ? "color:"~entity.colorbodyfont~";" : "color:var(--colorfttitlelight);")~(entity.isopened ? "display:block;" : "display:none;")~(widgetname=="url" ? "padding:0px;" : "")~(not widgethaveheader and not entity.border ? "padding-top: 0px;" : "")~(entity.autoajust ? "" : "height:"~entity.height~"px;") %} {% set widgeicon= entity.icon ? path('app_minio_image',{file:entity.icon.label}) : path('app_minio_image',{file:"icon/icon_pin.png"}) %} {% if modedesktop is defined %} @@ -59,7 +91,7 @@
{%endif%} -
+
{% block widgetbody %} {% endblock %}
diff --git a/templates/Pagewidgetslide/edit.html.twig b/templates/Pagewidgetslide/edit.html.twig new file mode 100755 index 0000000..111e1e8 --- /dev/null +++ b/templates/Pagewidgetslide/edit.html.twig @@ -0,0 +1,67 @@ +{% extends 'base.html.twig' %} + +{% block body %} +{{ form_start(form) }} +

+ {% if mode=="update" %} + Modification Carrousel + {% elseif mode=="submit" %} + Création Carrousel + {% endif %} +

+ + {{ form_widget(form.submit) }} + Annuler + + {% if mode=="update" %} + + Supprimer + + {% endif %} + +

+ + {% if app.session.flashbag.has('error') %} +
+ Erreur
+ {% for flashMessage in app.session.flashbag.get('error') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + {% if app.session.flashbag.has('notice') %} +
+ Information
+ {% for flashMessage in app.session.flashbag.get('notice') %} + {{ flashMessage }}
+ {% endfor %} +
+ {% endif %} + + +
+
+ {{ form_row(form.title) }} + {{ form_row(form.subtitle) }} + +
+ + Modifier +
+
+ + +
+ {{ form_row(form.roworder) }} + {{ form_row(form.url) }} + le mot clé #login# sera remplacé par le login de l'utilisateur

+ {{ form_row(form.target) }} +
+
+{{ form_end(form) }} +{% endblock %} + diff --git a/templates/Pagewidgetslide/list.html.twig b/templates/Pagewidgetslide/list.html.twig new file mode 100644 index 0000000..643da46 --- /dev/null +++ b/templates/Pagewidgetslide/list.html.twig @@ -0,0 +1,18 @@ +{% extends 'base.html.twig' %} + +{% block body %} +

Gestion des Carrousels

+ +

+ Ajouter + Retour +

+ + + {% for pagewidgetslide in pagewidgetslides %} + + + + {% endfor %} +{% endblock %} + diff --git a/templates/Pagewidgetslide/upload.html.twig b/templates/Pagewidgetslide/upload.html.twig new file mode 100755 index 0000000..a8344b9 --- /dev/null +++ b/templates/Pagewidgetslide/upload.html.twig @@ -0,0 +1,43 @@ +{% extends 'base.html.twig' %} + +{% block encoretags %} + {{ encore_entry_link_tags('dropzone') }} +{% endblock %} + +{% block body %} + Annuler + +
+
+{% endblock %} + + + +{% block localscript %} + {{ encore_entry_script_tags('dropzone') }} + + +{% endblock %} diff --git a/templates/base.html.twig b/templates/base.html.twig index d2eaf27..a3b15e8 100755 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -183,6 +183,9 @@
+ + + {% block localscript %}{% endblock %} diff --git a/yarn.lock b/yarn.lock index 2357061..0dfa1ac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2373,6 +2373,11 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +desandro-matches-selector@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/desandro-matches-selector/-/desandro-matches-selector-2.0.2.tgz#717beed4dc13e7d8f3762f707a6d58a6774218e1" + integrity sha512-+1q0nXhdzg1IpIJdMKalUwvvskeKnYyEe3shPRwedNcWtnhEKT3ZxvFjzywHDeGcKViIxTCAoOYQWP1qD7VNyg== + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -2569,6 +2574,16 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== +ev-emitter@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ev-emitter/-/ev-emitter-1.1.1.tgz#8f18b0ce5c76a5d18017f71c0a795c65b9138f2a" + integrity sha512-ipiDYhdQSCZ4hSbX4rMW+XzNKMD1prg/sTvoVmSLkuQ1MVlwjJQQA+sW8tMYR3BLUr9KjodFV4pvzunvRhd33Q== + +ev-emitter@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ev-emitter/-/ev-emitter-2.1.2.tgz#91737a2deae9fa95453e7e86cfae976f8c3ced38" + integrity sha512-jQ5Ql18hdCQ4qS+RCrbLfz1n+Pags27q5TwMKvZyhp5hh2UULUYZUy1keqj6k6SYsdqIYjnmz7xyyEY0V67B8Q== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -2720,6 +2735,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +fizzy-ui-utils@^2.0.0: + version "2.0.7" + resolved "https://registry.yarnpkg.com/fizzy-ui-utils/-/fizzy-ui-utils-2.0.7.tgz#7df45dcc4eb374a08b65d39bb9a4beedf7330505" + integrity sha512-CZXDVXQ1If3/r8s0T+v+qVeMshhfcuq0rqIFgJnrtd+Bu8GmDmqMjntjUePypVtjHXKJ6V4sw9zeyox34n9aCg== + dependencies: + desandro-matches-selector "^2.0.0" + follow-redirects@^1.0.0: version "1.15.2" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" @@ -2788,6 +2810,11 @@ get-port@^3.1.0: resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== +get-size@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/get-size/-/get-size-2.0.3.tgz#54a1d0256b20ea7ac646516756202769941ad2ef" + integrity sha512-lXNzT/h/dTjTxRbm9BXb+SGxxzkm97h/PCIKtlN/CBCxxmkkIVV21udumMS93MuVTDX583gqc94v3RjuHmI+2Q== + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -3003,6 +3030,13 @@ iframe-resizer@^4.3.2: resolved "https://registry.yarnpkg.com/iframe-resizer/-/iframe-resizer-4.3.2.tgz#42dd88345d18b9e377b6044dddb98c664ab0ce6b" integrity sha512-gOWo2hmdPjMQsQ+zTKbses08mDfDEMh4NneGQNP4qwePYujY1lguqP6gnbeJkf154gojWlBhIltlgnMfYjGHWA== +imagesloaded@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/imagesloaded/-/imagesloaded-5.0.0.tgz#e614e5de482769dd7d571ca62d947d0d00183847" + integrity sha512-/0JGSubc1MTCoDKVmonLHgbifBWHdyLkun+R/151E1c5n79hiSxcd7cB7mPXFgojYu8xnRZv7GYxzKoxW8BetQ== + dependencies: + ev-emitter "^2.1.2" + import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -3422,6 +3456,14 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +masonry-layout@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/masonry-layout/-/masonry-layout-4.2.2.tgz#d57b44af13e601bfcdc423f1dd8348b5524de348" + integrity sha512-iGtAlrpHNyxaR19CvKC3npnEcAwszXoyJiI8ARV2ePi7fmYhIud25MHK8Zx4P0LCC4d3TNO9+rFa1KoK1OEOaA== + dependencies: + get-size "^2.0.2" + outlayer "^2.1.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -3693,6 +3735,15 @@ open@^8.0.9: is-docker "^2.1.1" is-wsl "^2.2.0" +outlayer@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/outlayer/-/outlayer-2.1.1.tgz#29863b6de10ea5dadfffcadfa0d728907387e9a2" + integrity sha512-+GplXsCQ3VrbGujAeHEzP9SXsBmJxzn/YdDSQZL0xqBmAWBmortu2Y9Gwdp9J0bgDQ8/YNIPMoBM13nTwZfAhw== + dependencies: + ev-emitter "^1.0.0" + fizzy-ui-utils "^2.0.0" + get-size "^2.0.2" + p-limit@^2.0.0, p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -4545,6 +4596,11 @@ signal-exit@^3.0.3: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +slick-carousel@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/slick-carousel/-/slick-carousel-1.8.1.tgz#a4bfb29014887bb66ce528b90bd0cda262cc8f8d" + integrity sha512-XB9Ftrf2EEKfzoQXt3Nitrt/IPbT+f1fgqBdoxO3W/+JYvtEOW6EgxnWfr9GH6nmULv7Y2tPmEX3koxThVmebA== + sockjs@^0.3.24: version "0.3.24" resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce"