← All changes
|
admin/partials/settings/survey-maker-settings.php
+82
-45
5.2.3.3
→
5.2.4.1
View file →
| @@ -169,8 +169,21 @@ | ||
| 169 | 169 | // Disable Submissions menu item notification |
| 170 | 170 | $options['survey_disable_submission_menu_notification'] = isset($options['survey_disable_submission_menu_notification']) ? esc_attr( $options['survey_disable_submission_menu_notification'] ) : 'off'; |
| 171 | 171 | $survey_disable_submission_menu_notification = (isset($options['survey_disable_submission_menu_notification']) && esc_attr( $options['survey_disable_submission_menu_notification'] ) == "on") ? true : false; |
| 172 | 172 | |
| 173 | + $survey_menu_badge_style_options = array( | |
| 174 | + 'classic' => array( | |
| 175 | + 'background' => '#ca4a1f', | |
| 176 | + 'label' => __( 'Default', 'survey-maker' ), | |
| 177 | + ), | |
| 178 | + 'wp_default' => array( | |
| 179 | + 'background' => '#3858e9', | |
| 180 | + 'label' => __( 'WordPress default', 'survey-maker' ), | |
| 181 | + ), | |
| 182 | + ); | |
| 183 | + $options['survey_menu_badge_style'] = isset($options['survey_menu_badge_style']) ? sanitize_key( $options['survey_menu_badge_style'] ) : 'classic'; | |
| 184 | + $survey_menu_badge_style = array_key_exists( $options['survey_menu_badge_style'], $survey_menu_badge_style_options ) ? $options['survey_menu_badge_style'] : 'classic'; | |
| 185 | + | |
| 173 | 186 | // Textarea height (public) |
| 174 | 187 | $survey_textarea_height = (isset($options['survey_textarea_height']) && $options['survey_textarea_height'] != '' && $options['survey_textarea_height'] != 0) ? absint( sanitize_text_field($options['survey_textarea_height']) ) : 100; |
| 175 | 188 | |
| 176 | 189 | // WP Editor height |
| @@ -226,57 +239,59 @@ | ||
| 226 | 239 | |
| 227 | 240 | // Add message varibales here |
| 228 | 241 | $message_variables = array( |
| 229 | 242 | 'general_message_variables' => array( |
| 230 | - 'current_date' => __('The date of the submission survey.' , "survey-maker"), | |
| 231 | - 'current_time' => __('The time of the submission survey.' , "survey-maker"), | |
| 232 | - 'current_day' => __('The day of the submission survey.' , "survey-maker"), | |
| 233 | - 'current_month' => __('The month of the submission survey.' , "survey-maker"), | |
| 234 | - 'unique_code' => __('Use to identify the uniqueness of each attempt.' , "survey-maker"), | |
| 235 | - 'post_id' => __('The ID of the current post.' , "survey-maker"), | |
| 236 | - 'home_page_url' => __('The URL of the home page.' , "survey-maker"), | |
| 237 | - 'post_author_email' => __('The Email of the author of the post.' , "survey-maker"), | |
| 238 | - 'post_title' => __('The Post title of the current post.' , "survey-maker"), | |
| 239 | - 'post_author_nickname' => __('The Nickname of the author of the post.' , "survey-maker"), | |
| 240 | - 'post_author_display_name' => __('The Display name of the author of the post.' , "survey-maker"), | |
| 241 | - 'post_author_first_name' => __('The First Name of the author of the post.' , "survey-maker"), | |
| 242 | - 'post_author_last_name' => __('The Last Name of the author of the post.' , "survey-maker"), | |
| 243 | - 'post_author_website_url' => __('The website url of the author of the post.' , "survey-maker"), | |
| 244 | - 'post_author_roles' => __('The role(s) of the author of the post when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 245 | - 'site_title' => __('The title of the website.' , "survey-maker"), | |
| 246 | - 'site_description' => __('The description of the website.' , "survey-maker"), | |
| 243 | + 'current_date' => __('The date of the submission survey.' , "survey-maker"), | |
| 244 | + 'current_time' => __('The time of the submission survey.' , "survey-maker"), | |
| 245 | + 'current_day' => __('The day of the submission survey.' , "survey-maker"), | |
| 246 | + 'current_month' => __('The month of the submission survey.' , "survey-maker"), | |
| 247 | + 'unique_code' => __('Use to identify the uniqueness of each attempt.' , "survey-maker"), | |
| 248 | + 'post_id' => __('The ID of the current post.' , "survey-maker"), | |
| 249 | + 'home_page_url' => __('The URL of the home page.' , "survey-maker"), | |
| 250 | + 'post_author_email' => __('The Email of the author of the post.' , "survey-maker"), | |
| 251 | + 'post_title' => __('The Post title of the current post.' , "survey-maker"), | |
| 252 | + 'post_author_nickname' => __('The Nickname of the author of the post.' , "survey-maker"), | |
| 253 | + 'post_author_display_name' => __('The Display name of the author of the post.' , "survey-maker"), | |
| 254 | + 'post_author_first_name' => __('The First Name of the author of the post.' , "survey-maker"), | |
| 255 | + 'post_author_last_name' => __('The Last Name of the author of the post.' , "survey-maker"), | |
| 256 | + 'post_author_website_url' => __('The website url of the author of the post.' , "survey-maker"), | |
| 257 | + 'post_author_roles' => __('The role(s) of the author of the post when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 258 | + 'site_title' => __('The title of the website.' , "survey-maker"), | |
| 259 | + 'site_description' => __('The description of the website.' , "survey-maker"), | |
| 247 | 260 | ), |
| 248 | 261 | 'user_message_variables' => array( |
| 249 | - 'user_name' => __('The name the user entered into the survey form. It will work only if the name field exists in the form.' , "survey-maker"), | |
| 250 | - 'user_email' => __('The E-mail the user entered into the survey form. It will work only if the email field exists in the form.' , "survey-maker"), | |
| 251 | - 'user_wordpress_email' => __('The E-mail that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 252 | - 'user_id' => __('The ID of the current user.' , "survey-maker"), | |
| 253 | - 'user_registered' => __('The user\'s registration date when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 254 | - 'users_count' => __('The number of the passed users count of the given survey.' , "survey-maker"), | |
| 255 | - 'users_first_name' => __('The user\'s first name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 256 | - 'users_last_name' => __('The user\'s last name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 257 | - 'users_nick_name' => __('The user\'s nick name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 258 | - 'user_wordpress_roles' => __('The user\'s role(s) when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 259 | - 'user_website_url' => __('The user\'s website url that was filled in their WordPress profile.' , "survey-maker"), | |
| 260 | - 'users_display_name' => __('The user\'s display name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 261 | - 'users_ip_address' => __('The user\'s ip address.' , "survey-maker"), | |
| 262 | - 'admin_email' => __('Shows the admin\'s email that was filled in their WordPress profile.' , "survey-maker"), | |
| 262 | + 'user_name' => __('The name the user entered into the survey form. It will work only if the name field exists in the form.' , "survey-maker"), | |
| 263 | + 'user_email' => __('The E-mail the user entered into the survey form. It will work only if the email field exists in the form.' , "survey-maker"), | |
| 264 | + 'user_wordpress_email' => __('The E-mail that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 265 | + 'user_id' => __('The ID of the current user.' , "survey-maker"), | |
| 266 | + 'user_registered' => __('The user\'s registration date when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 267 | + 'users_count' => __('The number of the passed users count of the given survey.' , "survey-maker"), | |
| 268 | + 'users_first_name' => __('The user\'s first name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 269 | + 'users_last_name' => __('The user\'s last name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 270 | + 'users_nick_name' => __('The user\'s nick name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 271 | + 'user_wordpress_roles' => __('The user\'s role(s) when logged-in. In case the user is not logged-in, the field will be empty.' , "survey-maker"), | |
| 272 | + 'user_website_url' => __('The user\'s website url that was filled in their WordPress profile.' , "survey-maker"), | |
| 273 | + 'users_display_name' => __('The user\'s display name that was filled in their WordPress site during registration.' , "survey-maker"), | |
| 274 | + 'users_ip_address' => __('The user\'s ip address.' , "survey-maker"), | |
| 275 | + 'admin_email' => __('Shows the admin\'s email that was filled in their WordPress profile.' , "survey-maker"), | |
| 263 | 276 | ), |
| 264 | 277 | 'survey_message_variables' => array( |
| 265 | - 'survey_title' => __('The title of the survey.' , "survey-maker"), | |
| 266 | - 'survey_id' => __('The ID of the survey.' , "survey-maker"), | |
| 267 | - 'current_survey_author' => __('It will show the author of the current survey.' , "survey-maker"), | |
| 268 | - 'current_survey_author_email' => __('It will show the author email of the current survey.' , "survey-maker"), | |
| 269 | - 'current_survey_author_nickname' => __('It will show the author nickname of the current survey.' , "survey-maker"), | |
| 270 | - 'current_survey_author_display_name' => __('It will show the author display name of the current survey.' , "survey-maker"), | |
| 271 | - 'current_survey_author_website_url' => __('It will show the author Website URL of the current survey.' , "survey-maker"), | |
| 272 | - 'current_survey_author_registered' => __('It will show the author registration date of the current survey.' , "survey-maker"), | |
| 273 | - 'current_survey_page_link' => __('Prints the webpage link where the current survey is posted.' , "survey-maker"), | |
| 274 | - 'questions_count' => __('The number of the questions of the given survey.' , "survey-maker"), | |
| 275 | - 'sections_count' => __('The number of the sections of the given survey.' , "survey-maker"), | |
| 276 | - 'submission_count' => __('Shows the submission count of a particular survey.' , "survey-maker"), | |
| 277 | - 'creation_date' => __('The creation date of the survey.' , "survey-maker"), | |
| 278 | - 'modified_date' => __('The last modified date of the survey.' , "survey-maker"), | |
| 278 | + 'survey_title' => __('The title of the survey.' , "survey-maker"), | |
| 279 | + 'survey_category_title' => __('The title of the survey category.' , "survey-maker"), | |
| 280 | + 'survey_id' => __('The ID of the survey.' , "survey-maker"), | |
| 281 | + 'current_survey_author' => __('It will show the author of the current survey.' , "survey-maker"), | |
| 282 | + 'current_survey_author_email' => __('It will show the author email of the current survey.' , "survey-maker"), | |
| 283 | + 'current_survey_author_nickname' => __('It will show the author nickname of the current survey.' , "survey-maker"), | |
| 284 | + 'current_survey_author_display_name' => __('It will show the author display name of the current survey.' , "survey-maker"), | |
| 285 | + 'current_survey_author_website_url' => __('It will show the author Website URL of the current survey.' , "survey-maker"), | |
| 286 | + 'current_survey_author_registered' => __('It will show the author registration date of the current survey.' , "survey-maker"), | |
| 287 | + 'current_survey_page_link' => __('Prints the webpage link where the current survey is posted.' , "survey-maker"), | |
| 288 | + 'current_survey_page_title' => __('Prints the webpage title where the current survey is posted.' , "survey-maker"), | |
| 289 | + 'questions_count' => __('The number of the questions of the given survey.' , "survey-maker"), | |
| 290 | + 'sections_count' => __('The number of the sections of the given survey.' , "survey-maker"), | |
| 291 | + 'submission_count' => __('Shows the submission count of a particular survey.' , "survey-maker"), | |
| 292 | + 'creation_date' => __('The creation date of the survey.' , "survey-maker"), | |
| 293 | + 'modified_date' => __('The last modified date of the survey.' , "survey-maker"), | |
| 279 | 294 | ) |
| 280 | 295 | ); |
| 281 | 296 | ?> |
| 282 | 297 | <div class="wrap" style="position:relative;"> |
| @@ -614,8 +629,30 @@ | ||
| 614 | 629 | </label> |
| 615 | 630 | </div> |
| 616 | 631 | <div class="col-sm-8"> |
| 617 | 632 | <input type="checkbox" name="ays_survey_disable_submission_menu_notification" id="ays_survey_disable_submission_menu_notification" value="on" <?php echo $survey_disable_submission_menu_notification ? 'checked' : ''; ?>> |
| 633 | + </div> | |
| 634 | + </div> | |
| 635 | + <hr> | |
| 636 | + <div class="form-group row"> | |
| 637 | + <div class="col-sm-4"> | |
| 638 | + <label> | |
| 639 | + <?php echo esc_html__( "Menu badge style", 'survey-maker' ); ?> | |
| 640 | + <a class="ays_help" data-toggle="tooltip" title="<?php echo esc_attr( __('Choose the style of the notification badges displayed in the WordPress admin menu.','survey-maker') ); ?>"> | |
| 641 | + <i class="ays_fa ays_fa_info_circle"></i> | |
| 642 | + </a> | |
| 643 | + </label> | |
| 644 | + </div> | |
| 645 | + <div class="col-sm-8"> | |
| 646 | + <div class="ays-survey-menu-badge-style-options" style="display:flex; gap:10px; flex-wrap:wrap;"> | |
| 647 | + <?php foreach ( $survey_menu_badge_style_options as $style_key => $style_data ) : ?> | |
| 648 | + <label for="ays_survey_menu_badge_style_<?php echo esc_attr( $style_key ); ?>" style="display:flex; align-items:center; gap:12px; padding:14px 20px; border:1px solid #c3c4c7; border-radius:4px; background:#f6f7f7; cursor:pointer;"> | |
| 649 | + <input type="radio" name="ays_survey_menu_badge_style" id="ays_survey_menu_badge_style_<?php echo esc_attr( $style_key ); ?>" value="<?php echo esc_attr( $style_key ); ?>" <?php checked( $survey_menu_badge_style, $style_key ); ?>> | |
| 650 | + <span class="ays-survey-menu-badge" style="margin-left:0; background:<?php echo esc_attr( $style_data['background'] ); ?>;">2</span> | |
| 651 | + <span class="screen-reader-text"><?php echo esc_html( $style_data['label'] ); ?></span> | |
| 652 | + </label> | |
| 653 | + <?php endforeach; ?> | |
| 654 | + </div> | |
| 618 | 655 | </div> |
| 619 | 656 | </div> |
| 620 | 657 | </fieldset> <!-- Menu notifications --> |
| 621 | 658 | <hr> |