From 415d5e5f6f11274938fd8dc1f89f62e58d906415 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 25 Sep 2021 17:25:02 -0500 Subject: [PATCH] Plugins - Improve partial plugin interface - refs BT#19044 --- assets/js/app.js | 35 ++++++++----------- composer.json | 1 + public/main/admin/settings.lib.php | 24 +++++++++++-- public/main/admin/settings.php | 8 ++--- public/main/inc/lib/api.lib.php | 7 ++++ .../inc/lib/pear/HTML/QuickForm/checkbox.php | 6 ++++ .../inc/lib/pear/HTML/QuickForm/element.php | 3 +- .../inc/lib/pear/HTML/QuickForm/radio.php | 6 ++++ .../inc/lib/pear/HTML/QuickForm/select.php | 13 +++++++ .../main/inc/lib/pear/HTML/QuickForm/text.php | 7 ++++ 10 files changed, 82 insertions(+), 28 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 8c775b5da2..fd075a971f 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -162,29 +162,10 @@ $(function () { self = $(this); $.when(loadModalContent).done(function (modalContent) { - var modalDialog = $('#global-modal').find('.modal-dialog'), - modalSize = self.data('size') || get_url_params(contentUrl, 'modal_size'), - modalWidth = self.data('width') || get_url_params(contentUrl, 'width'), - modalTitle = self.data('title') || ' '; - - modalDialog.removeClass('modal-lg modal-sm').css('width', ''); - - if (modalSize && modalSize.length != 0) { - switch (modalSize) { - case 'lg': - modalDialog.addClass('modal-lg'); - break; - case 'sm': - modalDialog.addClass('modal-sm'); - break; - } - } else if (modalWidth) { - modalDialog.css('width', modalWidth + 'px'); - } - + var modalTitle = self.data('title') || ' '; $('#global-modal').find('.modal-title').text(modalTitle); $('#global-modal').find('.modal-body').html(modalContent); - $('#global-modal').modal('show'); + toggleModal('global-modal'); }); }); @@ -192,6 +173,10 @@ $(function () { $(".embed-responsive").find('iframe').remove(); }); + $('#close-global-model').on('click', function () { + toggleModal('global-modal'); + }); + // Expands an image modal $('a.expand-image').on('click', function (e) { e.preventDefault(); @@ -583,6 +568,14 @@ function copyTextToClipBoard(elementId) document.execCommand('copy'); } +function toggleModal(modalID) +{ + document.getElementById(modalID).classList.toggle("hidden"); + document.getElementById(modalID + "-backdrop").classList.toggle("hidden"); + document.getElementById(modalID).classList.toggle("flex"); + document.getElementById(modalID + "-backdrop").classList.toggle("flex"); +} + // Expose functions to be use inside chamilo. // @todo check if there's a better way to expose functions. window.expandColumnToggle = expandColumnToggle; diff --git a/composer.json b/composer.json index 02ec41fcb3..5585418164 100755 --- a/composer.json +++ b/composer.json @@ -70,6 +70,7 @@ "endroid/qr-code": "~4.2", "essence/essence": "~3.0", "ezyang/htmlpurifier": "~4.13", + "firebase/php-jwt": "^5.4", "friendsofsymfony/jsrouting-bundle": "~2.0", "graphp/algorithms": "~0.8", "graphp/graphviz": "~0.2", diff --git a/public/main/admin/settings.lib.php b/public/main/admin/settings.lib.php index 1f49bbdf59..3a7ce63ebc 100644 --- a/public/main/admin/settings.lib.php +++ b/public/main/admin/settings.lib.php @@ -181,9 +181,9 @@ function handlePlugins() $pluginRow .= ''; // Checkbox if (in_array($pluginName, $installed_plugins)) { - $pluginRow .= ''; + $pluginRow .= ''; } else { - $pluginRow .= ''; + $pluginRow .= ''; } $pluginRow .= ''; $pluginRow .= '

'.$plugin_info['title'].' v '.$plugin_info['version'].'

'; @@ -252,6 +252,26 @@ function handlePlugins() echo get_lang('Enable the selected plugins').''; echo ''; echo ''; + echo ' + '; } /** diff --git a/public/main/admin/settings.php b/public/main/admin/settings.php index d504325c27..e477cdee6c 100644 --- a/public/main/admin/settings.php +++ b/public/main/admin/settings.php @@ -302,7 +302,7 @@ if (!empty($_GET['category']) && exit; } } -$htmlHeadXtra[] = '