Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zubairraeen committed Sep 11, 2024
1 parent fdde6dc commit 0d52cd3
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 104 deletions.
35 changes: 13 additions & 22 deletions css/qsm-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -833,18 +833,13 @@ ul.changelog li.update div.two:before {
.qsm_tab_content label {
margin-right: 5px;
}
.qsm-sub-text-tab-menu,
.qsm-sub-tab-menu {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: stretch;
border-bottom: 1px solid #cecece;
}
/* .qsm-sub-text-tab-menu {
display: inline-block;
width: 100%;
} */
.save-text-changes {
display: flex;
flex-direction: row-reverse;
Expand Down Expand Up @@ -926,8 +921,8 @@ ul.changelog li.update div.two:before {
padding: 10px 6px;
width: 100%;
}
.qsm-sub-text-tab-menu a,
.qsm-sub-tab-menu a,
.qsm-sub-text-tab-menu a,
.qsm_tab_content a {
cursor: pointer;
text-decoration: none;
Expand Down Expand Up @@ -3125,7 +3120,8 @@ input#duplicate_questions {
.auto-fold .option-page-result-page-tab-footer {
left: 36px;
}
.option-page-option-tab-footer, .option-page-result-page-tab-footer, .contact-page-tab-footer {
.option-page-option-tab-footer, .option-page-result-page-tab-footer,
.contact-page-tab-footer {
position: fixed;
bottom: 0;
right: 0;
Expand All @@ -3152,7 +3148,9 @@ input#duplicate_questions {
width: 60%;
}
@media screen and (min-width: 1900px) {
.option-page-option-tab-footer,.option-page-result-page-tab-footer,.contact-page-tab-footer {
.option-page-option-tab-footer,
.option-page-result-page-tab-footer,
.contact-page-tab-footer {
flex-direction: row-reverse;
}
}
Expand Down Expand Up @@ -3189,25 +3187,19 @@ input#duplicate_questions {
margin: 0 10px 0 0;
}
@media screen and (min-width: 961px) {
.folded .option-page-result-page-tab-footer {
left: 36px !important;
}
.option-page-result-page-tab-footer {
left: 160px !important;
}
.folded .option-page-option-tab-footer,
.folded .contact-page-tab-footer {
.folded .option-page-result-page-tab-footer,
.folded .contact-page-tab-footer,
.folded .option-page-option-tab-footer {
left: 36px !important;
}
.option-page-option-tab-footer,
.contact-page-tab-footer {
.option-page-result-page-tab-footer,
.contact-page-tab-footer,
.option-page-option-tab-footer {
left: 160px !important;
}
}
@media screen and (max-width: 782px) {
.option-page-result-page-tab-footer {
left: 0 !important;
}
.option-page-result-page-tab-footer,
.option-page-option-tab-footer,
.contact-page-tab-footer {
left: 0 !important;
Expand Down Expand Up @@ -3470,7 +3462,6 @@ input#preferred-date-format-custom {
content: "";
width: calc(100% + 26px);
}

/* Extra shortcodes popup */
button.button.qsm-extra-shortcode-popup {
display: flex;
Expand Down
16 changes: 2 additions & 14 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,6 @@ var QSMAdmin;
MicroModal.show('modal-proctor-quiz');
});

$(document).on('click', '.quiz_style_tab_content #qsm_ultimate_progress_bar', function (e) {
e.preventDefault();
MicroModal.show('qsm-ultimate-upgrade');
});

jQuery(document).on('click', '#btn_export', function (e) {
e.preventDefault();
jQuery.ajax({
Expand Down Expand Up @@ -790,13 +785,6 @@ jQuery('.quiz_text_tab').click(function (e) {
if(current_id == 'qsm_general_text'){ jQuery(".current_general")[0].click();}
if(current_id == 'qsm_variable_text'){ jQuery(".current_variable")[0].click();}
if(current_id == 'qsm_custom_label'){ jQuery("#postbox-container-1").css("display", "none");}
if(current_id == 'qsm_button_custom_class') {
jQuery("#postbox-container-1").css("display", "none");
if ( jQuery("#qsm_button_custom_class").find('.left-bar').length == 0 ) {
jQuery(".qsm-text-main-wrap #post-body-content").css("background", "transparent");
jQuery(".quiz_text_tab_content").css("border", "none");
}
}
jQuery('#' + current_id).show();
jQuery(document).trigger('qsm_quiz_text_tab_after', [current_id]);
});
Expand Down Expand Up @@ -1400,12 +1388,12 @@ function qsm_is_substring_in_array( text, array ) {
}
}
addTinyMceAutoSuggestion();

$( document ).on( 'click', '.qsm-extra-shortcode-popup', function( e ) {
e.preventDefault();
MicroModal.show('modal-extra-shortcodes');
} );

jQuery(document).on('qsm_after_add_result_block', function(event, conditions, page, redirect, total) {
let $matchingElement = $(`#results-page-${total}`);
let $button = $matchingElement.parents('.results-page-show').find('.qsm-result-editor-custom-button');
Expand Down
15 changes: 0 additions & 15 deletions php/admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1656,19 +1656,4 @@ function qsm_advanced_assessment_quiz_page_content() {
"addon_link" => qsm_get_plugin_link( 'downloads/advanced-assessment', 'quiz-documentation', 'plugin', 'advanced-assessment', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_content( $args, 'page' );
}
function qsm_ultimate_addon_upgrade_content() {
$args = array(
"id" => 'qsm-ultimate-upgrade',
"title" => __( 'QSM Ultimate Addon', 'quiz-master-next' ),
"description" => __( 'Enjoy features like adding "other" options, bulk answer input, question-based progress bars, automatic page navigation, and showing detailed results after collecting contact details. Customize buttons, progress bar placement, and colors schemes and more with QSM Ultimate addon', 'quiz-master-next' ),
"chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/ultimate_upgrade.png',
"warning" => __( 'Missing Feature - QSM Ultimate Add-on required', 'quiz-master-next' ),
"information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy QSM Ultimate Addon separately.', 'quiz-master-next' ),
"buy_btn_text" => __( 'Buy QSM Ultimate Addon', 'quiz-master-next' ),
"doc_link" => qsm_get_plugin_link( 'docs/add-ons/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_content( $args, 'page' );
}
6 changes: 3 additions & 3 deletions php/admin/options-page-questions-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
$show_limit_multiple_response = '';
$show_file_upload_type = '';
$show_file_upload_limit = '';
$placeholder_text = '';
$placeholder_text = '';
foreach ( $question_types as $type ) {
if ( isset( $type['options']['show_correct_answer_info'] ) && $type['options']['show_correct_answer_info'] ) {
$show_correct_answer_info .= ',' . $type['slug'];
Expand Down Expand Up @@ -495,7 +495,7 @@ class="save-page-button button button-primary"><?php esc_html_e( 'Save Questions
'type' => 'text',
'default' => '',
'priority' => '1',
'show' => '3, 5, 7' ,
'show' => '3, 5, 7' . $placeholder_text,
),
);
$advanced_question_option = apply_filters( 'qsm_question_advanced_option', $advanced_question_option );
Expand Down Expand Up @@ -1144,7 +1144,7 @@ function qsm_bulk_delete_question_from_database() {
"DELETE FROM {$wpdb->prefix}mlw_questions WHERE question_id IN (%s)",
implode( ', ', $placeholders )
);

// Prepare the query
$query = $wpdb->prepare( $query, $question_id );

Expand Down
8 changes: 0 additions & 8 deletions php/admin/options-page-style-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ function qsm_options_styling_tab_content() {
<li>
<a href="javascript:void(0)" data-id="qsm_themes" class="current quiz_style_tab"><?php esc_html_e( 'Themes', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="qsm-ultimate-default-menu" class="quiz_style_tab"><?php esc_html_e( 'Appearance', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="custom_css" class="quiz_style_tab"><?php esc_html_e( 'Custom CSS', 'quiz-master-next' ); ?></a>
</li>
Expand Down Expand Up @@ -242,11 +239,6 @@ function qsm_options_styling_tab_content() {
<button id="save_styles_button"
class="button-primary"><?php esc_html_e( 'Save Quiz Style', 'quiz-master-next' ); ?></button>
</div>
<?php if ( ! class_exists( 'QSM_Ultimate' ) ) : ?>
<div id="qsm-ultimate-default-menu" class="quiz_style_tab_content" style="display: none">
<?php qsm_ultimate_addon_upgrade_content(); ?>
</div>
<?php endif; ?>
<?php do_action( 'qsm_add_style_section_content' ); ?>
</form>
<div class="qsm-popup qsm-popup-slide qsm-theme-color-settings" id="qsm-theme-color-settings" aria-hidden="true">
Expand Down
8 changes: 0 additions & 8 deletions php/admin/options-page-text-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ function mlw_options_text_tab_content() {
<li>
<a href="javascript:void(0)" data-id="qsm_custom_label" class="quiz_text_tab"><?php esc_html_e( 'Labels', 'quiz-master-next' ); ?></a>
</li>
<li>
<a href="javascript:void(0)" data-id="qsm_button_custom_class" class="quiz_text_tab"><?php esc_html_e( 'Custom Classes', 'quiz-master-next' ); ?></a>
</li>
</ul>
</div>
<div class="qsm-text-main-wrap">
Expand Down Expand Up @@ -118,11 +115,6 @@ function mlw_options_text_tab_content() {
?>
</div>
</div>
<?php if ( ! class_exists( 'QSM_Ultimate' ) ) : ?>
<div class="quiz_text_tab_content" style="display:none;" id="qsm_button_custom_class" >
<?php qsm_ultimate_addon_upgrade_content(); ?>
</div>
<?php endif; ?>
<?php do_action( 'qsm_add_list_menu_content_text_tab_after', $text_text_arr ); ?>
<!-- Variable text -->
<div class="quiz_text_tab_content qsm_variable_text" style="display:none;" id="qsm_variable_text" >
Expand Down
16 changes: 8 additions & 8 deletions php/admin/quiz-options-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function qsm_generate_quiz_options() {
apply_filters('qsm_user_role_permission_page',true);
// Check user capability
if ( ! class_exists('QSM_Ultimate') ) {
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles, true ) ) {
$user_id = sanitize_text_field( $user->ID );
$quiz_id = isset( $_GET['quiz_id'] ) ? intval( $_GET['quiz_id'] ) : 0;
$quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user_id ) );
if ( ! $quiz_author_id ) {
wp_die( 'You are not allow to edit this quiz, You need higher permission!' );
$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles, true ) ) {
$user_id = sanitize_text_field( $user->ID );
$quiz_id = isset( $_GET['quiz_id'] ) ? intval( $_GET['quiz_id'] ) : 0;
$quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user_id ) );
if ( ! $quiz_author_id ) {
wp_die( 'You are not allow to edit this quiz, You need higher permission!' );
}
}
}
}

$quiz_name = '';

Expand Down
15 changes: 0 additions & 15 deletions php/classes/class-qsm-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,6 @@ public static function generate_section( $fields, $section ) {
<?php wp_nonce_field( 'save_settings','save_settings_nonce' );
$current_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
if ( 'options' === $current_tab ) :
if ( ! class_exists( 'QSM_Ultimate' ) ) {
$args = array(
"id" => 'qsm-ultimate-upgrade',
"title" => __( 'QSM Ultimate Addon', 'quiz-master-next' ),
"description" => __( 'Enjoy features like adding "other" options, bulk answer input, question-based progress bars, automatic page navigation, and showing detailed results after collecting contact details. Customize buttons, progress bar placement, and colors schemes and more with QSM Ultimate addon', 'quiz-master-next' ),
"chart_image" => plugins_url( '', dirname( __FILE__ ) ) . '/images/ultimate_upgrade.png',
"warning" => __( 'Missing Feature - QSM Ultimate Add-on required', 'quiz-master-next' ),
"information" => __( 'QSM Addon Bundle is the best way to get all our add-ons at a discount. Upgrade to save 95% today. OR you can buy QSM Ultimate Addon separately.', 'quiz-master-next' ),
"buy_btn_text" => __( 'Buy QSM Ultimate Addon', 'quiz-master-next' ),
"doc_link" => qsm_get_plugin_link( 'docs/add-ons/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"upgrade_link" => qsm_get_plugin_link( 'pricing', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
"addon_link" => qsm_get_plugin_link( 'downloads/ultimate', 'quiz-documentation', 'plugin', 'ultimate', 'qsm_plugin_upsell' ),
);
qsm_admin_upgrade_popup( $args );
}
?>
<div class="qsm-sub-tab-menu" style="display: inline-block;width: 100%;">
<ul class="subsubsub">
Expand Down
5 changes: 0 additions & 5 deletions php/classes/class-qsm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,6 @@ public function register_default_settings() {
'label' => __( "Progress bar based on number of pages", 'quiz-master-next' ),
'value' => 1,
),
array(
'label' => __( "Progress bar based on number of question responded <a id='qsm_ultimate_progress_bar'><b>(PRO)</b></a>", 'quiz-master-next' ),
'value' => 2,
'disable' => 1,
),
),
'default' => 0,
),
Expand Down
Binary file removed php/images/ultimate_upgrade.png
Binary file not shown.
6 changes: 1 addition & 5 deletions php/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,7 @@ function qsm_generate_fb_header_metadata() {
<?php
}
}
$quiz_id = $mlwQuizMasterNext->quizCreator->get_id();
$featured_image = get_option("quiz_featured_image_$quiz_id");
?>
<link rel="preload" href="<?php echo esc_url($featured_image); ?>" as="image">
<?php
$quiz_id = $mlwQuizMasterNext->quizCreator->get_id();
}

add_action( 'wp_head', 'qsm_generate_fb_header_metadata' );
Expand Down
2 changes: 1 addition & 1 deletion php/template-variables.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function qsm_get_options_of_contact_fields( $data, $label, $type ) {
if ( is_array( $data ) ) {
foreach ( $data as $item ) {
if ( $item['label'] === $label && $item['type'] === $type ) {
return $item['options'];
return $item['options'];
}
}
}
Expand Down

0 comments on commit 0d52cd3

Please sign in to comment.