From a8a0b62018556567cdabb80aed8f7fa353c16980 Mon Sep 17 00:00:00 2001 From: Mohammad Zubair Ali Date: Tue, 26 Mar 2024 16:29:52 +0530 Subject: [PATCH 1/2] update apply global setting ui --- css/qsm-admin.css | 8 +++ js/qsm-admin.js | 7 +-- mlw_quizmaster2.php | 1 + php/admin/settings-page.php | 113 ++++++++++++++++++------------------ readme.txt | 22 ++++++- 5 files changed, 84 insertions(+), 67 deletions(-) diff --git a/css/qsm-admin.css b/css/qsm-admin.css index a95f69887..2a02d9df4 100644 --- a/css/qsm-admin.css +++ b/css/qsm-admin.css @@ -773,6 +773,14 @@ ul.changelog li.update div.two:before { #qsm-export-settings-options .select2-container{ max-width: 430px; } +.qsm-btn-link-global-settings { + line-height: 27px; + margin-right: 10px; +} +#qsm-export-settings-options .ms-options-wrap>.ms-options>.ms-search input{ + max-width: 100% !important; + border: 1px solid #dcdccfd4; +} .admin_page_mlw_quiz_options .qsm-info-widget { background: #fff; margin: 0 0 20px 0; diff --git a/js/qsm-admin.js b/js/qsm-admin.js index fe94e6156..29a895459 100644 --- a/js/qsm-admin.js +++ b/js/qsm-admin.js @@ -86,14 +86,8 @@ var QSMAdmin; MicroModal.show('qsm-global-default-popup'); }); $(document).on('click', '#qsm-apply-global-settings', function () { - console.log($('#qsm-select-quiz-apply').multiselect('getChecked')); - let selectedCount = $('#qsm-select-quiz-apply').find('option:selected').length; - jQuery("#qsm-quizzes-global-count").text(selectedCount); MicroModal.show('qsm-global-apply-default-popup'); }); - $(document).on('click', '#qsm-apply-global-default-btn', function () { - jQuery('#qsm-apply-global-settings-form').submit(); - }); $('#qmn_check_all').change(function () { $('.qmn_delete_checkbox').prop('checked', jQuery('#qmn_check_all').prop('checked')); @@ -184,6 +178,7 @@ var QSMAdmin; if( jQuery('#qsm-select-quiz-apply').length ) { $('#qsm-select-quiz-apply').multiselect({ columns: 1, + placeholder: qsm_admin_messages.select, search: true, selectAll: true, dropdownAutoWidth: false, diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index fa723ad31..15c9966e6 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -478,6 +478,7 @@ public function qsm_admin_scripts_style( $hook ) { 'variables' => __("Variables", 'quiz-master-next'), 'insert_variable' => __("Insert QSM variables", 'quiz-master-next'), 'select_all' => __("Select All", 'quiz-master-next'), + 'select' => __("Select", 'quiz-master-next'), ); $qsm_admin_messages = apply_filters( 'qsm_admin_messages_after', $qsm_admin_messages ); wp_localize_script( 'qsm_admin_js', 'qsm_admin_messages', $qsm_admin_messages ); diff --git a/php/admin/settings-page.php b/php/admin/settings-page.php index a7399c249..2f3229b56 100644 --- a/php/admin/settings-page.php +++ b/php/admin/settings-page.php @@ -87,8 +87,8 @@ public function init() { add_settings_field( 'items-per-page-question-bank', __( 'Items per page in question bank pagination', 'quiz-master-next' ), array( $this, 'items_per_page_question_bank' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'new-template-result-detail', __( 'New Template For Admin Results Details', 'quiz-master-next' ), array( $this, 'new_template_results_details' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'results-details', __( 'Template For Admin Results Details', 'quiz-master-next' ), array( $this, 'results_details_template' ), 'qmn_global_settings', 'qmn-global-section' ); + add_settings_field( 'api-key-options', __( 'Enable APIs', 'quiz-master-next' ), array( $this, 'api_key_options' ), 'qmn_global_settings', 'qmn-global-section' ); add_settings_field( 'api-key', __( 'API Key', 'quiz-master-next' ), array( $this, 'api_key_field' ), 'qmn_global_settings', 'qmn-global-section' ); - add_settings_field( 'api-key-options', __( 'API Key Options', 'quiz-master-next' ), array( $this, 'api_key_options' ), 'qmn_global_settings', 'qmn-global-section' ); } /** @@ -107,15 +107,15 @@ public function api_key_options() {