diff --git a/modules/core/functions.php b/modules/core/functions.php index 9ade1c45e6..39b06fd0eb 100644 --- a/modules/core/functions.php +++ b/modules/core/functions.php @@ -443,6 +443,7 @@ function setup_base_page($name, $source=false, $use_layout=true) { add_output($name, 'folder_list_end', true, $source); add_output($name, 'content_section_start', true, $source); add_output($name, 'content_section_end', true, $source); + add_output($name, 'modals', true, $source); add_output($name, 'save_reminder', true, $source); add_output($name, 'content_end', false, $source, 'page_js', 'after'); } diff --git a/modules/core/output_modules.php b/modules/core/output_modules.php index c745a67b3d..135b3fb2a5 100644 --- a/modules/core/output_modules.php +++ b/modules/core/output_modules.php @@ -1647,6 +1647,112 @@ protected function output() { } } +/** + * modals + * @subpackage core/output + */ +class Hm_Output_modals extends Hm_Output_Module { + /** + * Outputs modals + */ + protected function output() { + $share_folder_modal = ''; + + return $share_folder_modal; + } +} + /** * Starts the message view page * @subpackage core/output diff --git a/modules/core/site.js b/modules/core/site.js index c22f5700f4..e9bf2e852f 100644 --- a/modules/core/site.js +++ b/modules/core/site.js @@ -58,6 +58,18 @@ $.fn.fadeOutAndRemove = function(timeout = 600) { return this; }; +$.fn.modal = function(action) { + const modalElement = this[0]; + if (modalElement) { + const modal = new bootstrap.Modal(modalElement); + if (action === 'show') { + modal.show(); + } else if (action === 'hide') { + modal.hide(); + } + } +}; + /* swipe event handler */ var swipe_event = function(el, callback, direction) { var start_x, start_y, dist_x, dist_y, threshold = 150, restraint = 100, diff --git a/modules/imap/functions.php b/modules/imap/functions.php index 02ee8b9053..ca57d4846d 100644 --- a/modules/imap/functions.php +++ b/modules/imap/functions.php @@ -111,7 +111,7 @@ function prepare_imap_message_list($msgs, $mod, $type) { * @return string */ if (!hm_exists('format_imap_folder_section')) { -function format_imap_folder_section($folders, $id, $output_mod, $with_input = false) { +function format_imap_folder_section($folders, $id, $output_mod, $with_input = false, $can_share_folders = false) { $results = '