From fce290fe74c6ea2d82c8a547f4b2d772d38c8ff2 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Wed, 7 Feb 2024 14:51:01 +0200 Subject: [PATCH] - updated settings texts; --- includes/admin/core/class-admin-settings.php | 427 ++++++++++--------- 1 file changed, 234 insertions(+), 193 deletions(-) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 450b010a..ca210924 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -1639,206 +1639,247 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'title' => __( 'Appearance', 'ultimate-member' ), 'sections' => array( '' => array( - 'title' => __( 'Profile', 'ultimate-member' ), - 'fields' => array( - array( - 'id' => 'profile_template', - 'type' => 'select', - 'label' => __( 'Profile Default Template', 'ultimate-member' ), - 'description' => __( 'This will be the default template to output profile', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_template' ), - 'options' => UM()->shortcodes()->get_templates( 'profile' ), - 'size' => 'small', - ), - array( - 'id' => 'profile_max_width', - 'type' => 'text', - 'label' => __( 'Profile Maximum Width', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_max_width' ), - 'description' => __( 'The maximum width this shortcode can take from the page width', 'ultimate-member' ), - 'size' => 'small', - ), - array( - 'id' => 'profile_area_max_width', - 'type' => 'text', - 'label' => __( 'Profile Area Maximum Width', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_area_max_width' ), - 'description' => __( 'The maximum width of the profile area inside profile (below profile header)', 'ultimate-member' ), - 'size' => 'small', - ), - array( - 'id' => 'profile_icons', - 'type' => 'select', - 'label' => __( 'Profile Field Icons', 'ultimate-member' ), - 'description' => __( 'This is applicable for edit mode only', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_icons' ), - 'options' => array( - 'field' => __( 'Show inside text field', 'ultimate-member' ), - 'label' => __( 'Show with label', 'ultimate-member' ), - 'off' => __( 'Turn off', 'ultimate-member' ), - ), - 'size' => 'small', - ), - array( - 'id' => 'profile_primary_btn_word', - 'type' => 'text', - 'label' => __( 'Profile Primary Button Text', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_primary_btn_word' ), - 'description' => __( 'The text that is used for updating profile button', 'ultimate-member' ), - 'size' => 'medium', - ), - array( - 'id' => 'profile_secondary_btn', - 'type' => 'checkbox', - 'label' => __( 'Profile Secondary Button', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_secondary_btn' ), - 'description' => __( 'Switch on/off the secondary button display in the form', 'ultimate-member' ), - ), - array( - 'id' => 'profile_secondary_btn_word', - 'type' => 'text', - 'label' => __( 'Profile Secondary Button Text', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_secondary_btn_word' ), - 'description' => __( 'The text that is used for cancelling update profile button', 'ultimate-member' ), - 'conditional' => array( 'profile_secondary_btn', '=', 1 ), - 'size' => 'medium', - ), - array( - 'id' => 'default_avatar', - 'type' => 'media', - 'label' => __( 'Default Profile Photo', 'ultimate-member' ), - 'description' => __( 'You can change the default profile picture globally here. Please make sure that the photo is 300x300px.', 'ultimate-member' ), - 'upload_frame_title' => __( 'Select Default Profile Photo', 'ultimate-member' ), - 'default' => array( - 'url' => UM_URL . 'assets/img/default_avatar.jpg', + 'title' => __( 'Profile', 'ultimate-member' ), + 'form_sections' => array( + 'template' => array( + 'title' => __( 'Template', 'ultimate-member' ), + 'description' => __( 'This section allows you to customize the user profile template and size.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'profile_template', + 'type' => 'select', + 'label' => __( 'Profile Default Template', 'ultimate-member' ), + 'description' => __( 'This will be the default template to output profile', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_template' ), + 'options' => UM()->shortcodes()->get_templates( 'profile' ), + 'size' => 'small', + ), + array( + 'id' => 'profile_max_width', + 'type' => 'text', + 'label' => __( 'Profile Maximum Width', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_max_width' ), + 'description' => __( 'The maximum width this shortcode can take from the page width', 'ultimate-member' ), + 'size' => 'small', + ), + array( + 'id' => 'profile_area_max_width', + 'type' => 'text', + 'label' => __( 'Profile Area Maximum Width', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_area_max_width' ), + 'description' => __( 'The maximum width of the profile area inside profile (below profile header)', 'ultimate-member' ), + 'size' => 'small', + ), ), ), - array( - 'id' => 'default_cover', - 'type' => 'media', - 'url' => true, - 'preview' => false, - 'label' => __( 'Default Cover Photo', 'ultimate-member' ), - 'description' => __( 'You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member' ), - 'upload_frame_title' => __( 'Select Default Cover Photo', 'ultimate-member' ), - ), - array( - 'id' => 'disable_profile_photo_upload', - 'type' => 'checkbox', - 'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ), - 'description' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ), - 'default' => um_get_metadefault( 'disable_profile_photo_upload' ), - ), - array( - 'id' => 'profile_photosize', - 'type' => 'select', - 'label' => __( 'Profile Photo Size', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_photosize' ), - 'options' => UM()->files()->get_profile_photo_size( 'photo_thumb_sizes' ), - 'description' => __( 'The global default of profile photo size. This can be overridden by individual form settings', 'ultimate-member' ), - 'size' => 'small', - ), - array( - 'id' => 'profile_cover_enabled', - 'type' => 'checkbox', - 'label' => __( 'Profile Cover Photos', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_cover_enabled' ), - 'description' => __( 'Switch on/off the profile cover photos', 'ultimate-member' ), - ), - array( - 'id' => 'profile_coversize', - 'type' => 'select', - 'label' => __( 'Profile Cover Size', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_coversize' ), - 'options' => UM()->files()->get_profile_photo_size( 'cover_thumb_sizes' ), - 'description' => __( 'The global default width of cover photo size. This can be overridden by individual form settings', 'ultimate-member' ), - 'conditional' => array( 'profile_cover_enabled', '=', 1 ), - 'size' => 'small', - ), - array( - 'id' => 'profile_cover_ratio', - 'type' => 'select', - 'label' => __( 'Profile Cover Ratio', 'ultimate-member' ), - 'description' => __( 'Choose global ratio for cover photos of profiles', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_cover_ratio' ), - 'options' => array( - '1.6:1' => '1.6:1', - '2.7:1' => '2.7:1', - '2.2:1' => '2.2:1', - '3.2:1' => '3.2:1', + 'profile_photo' => array( + 'title' => __( 'Profile photo', 'ultimate-member' ), + 'description' => __( 'This section allows you to customize the profile photo component on the user profile.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'default_avatar', + 'type' => 'media', + 'label' => __( 'Default Profile Photo', 'ultimate-member' ), + 'description' => __( 'You can change the default profile picture globally here. Please make sure that the photo is 300x300px.', 'ultimate-member' ), + 'upload_frame_title' => __( 'Select Default Profile Photo', 'ultimate-member' ), + 'default' => array( + 'url' => UM_URL . 'assets/img/default_avatar.jpg', + ), + ), + array( + 'id' => 'disable_profile_photo_upload', + 'type' => 'checkbox', + 'label' => __( 'Profile Photo Upload', 'ultimate-member' ), + 'checkbox_label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ), + 'description' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ), + 'default' => um_get_metadefault( 'disable_profile_photo_upload' ), + ), + array( + 'id' => 'profile_photosize', + 'type' => 'select', + 'label' => __( 'Profile Photo Size', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_photosize' ), + 'options' => UM()->files()->get_profile_photo_size( 'photo_thumb_sizes' ), + 'description' => __( 'The global default of profile photo size. This can be overridden by individual form settings', 'ultimate-member' ), + 'size' => 'small', + ), ), - 'conditional' => array( 'profile_cover_enabled', '=', 1 ), - 'size' => 'small', ), - array( - 'id' => 'profile_show_metaicon', - 'type' => 'checkbox', - 'label' => __( 'Profile Header Meta Text Icon', 'ultimate-member' ), - 'default' => 0, - 'description' => __( 'Display field icons for related user meta fields in header or not', 'ultimate-member' ), - ), - array( - 'id' => 'profile_show_name', - 'type' => 'checkbox', - 'label' => __( 'Show display name in profile header', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_show_name' ), - 'description' => __( 'Switch on/off the user name on profile header', 'ultimate-member' ), - ), - array( - 'id' => 'profile_show_social_links', - 'type' => 'checkbox', - 'label' => __( 'Show social links in profile header', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_show_social_links' ), - 'description' => __( 'Switch on/off the social links on profile header', 'ultimate-member' ), - ), - array( - 'id' => 'profile_show_bio', - 'type' => 'checkbox', - 'label' => __( 'Show user description in header', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_show_bio' ), - 'description' => __( 'Switch on/off the user description on profile header', 'ultimate-member' ), - ), - array( - 'id' => 'profile_show_html_bio', - 'type' => 'checkbox', - 'label' => __( 'Enable HTML support for user description', 'ultimate-member' ), - 'description' => __( 'Switch on/off to enable/disable support for html tags on user description.', 'ultimate-member' ), - ), - array( - 'id' => 'profile_bio_maxchars', - 'type' => 'text', - 'label' => __( 'User description maximum chars', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_bio_maxchars' ), - 'description' => __( 'Maximum number of characters to allow in user description field in header.', 'ultimate-member' ), - 'conditional' => array( 'profile_show_bio', '=', 1 ), - 'size' => 'small', - ), - array( - 'id' => 'profile_header_menu', - 'type' => 'select', - 'label' => __( 'Profile Header Menu Position', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_header_menu' ), - 'description' => __( 'For incompatible themes, please make the menu open from left instead of bottom by default.', 'ultimate-member' ), - 'options' => array( - 'bc' => __( 'Bottom of Icon', 'ultimate-member' ), - 'lc' => __( 'Left of Icon (right for RTL)', 'ultimate-member' ), + 'cover_photo' => array( + 'title' => __( 'Cover photo', 'ultimate-member' ), + 'description' => __( 'This section allows you to customize the profile photo component on the user profile.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'default_cover', + 'type' => 'media', + 'url' => true, + 'preview' => false, + 'label' => __( 'Default Cover Photo', 'ultimate-member' ), + 'description' => __( 'You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member' ), + 'upload_frame_title' => __( 'Select Default Cover Photo', 'ultimate-member' ), + ), + + array( + 'id' => 'profile_cover_enabled', + 'type' => 'checkbox', + 'label' => __( 'Profile Cover Photos', 'ultimate-member' ), + 'checkbox_label' => __( 'Enable Cover Photos', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_cover_enabled' ), + 'description' => __( 'Switch on/off the profile cover photos', 'ultimate-member' ), + ), + array( + 'id' => 'profile_coversize', + 'type' => 'select', + 'label' => __( 'Profile Cover Size', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_coversize' ), + 'options' => UM()->files()->get_profile_photo_size( 'cover_thumb_sizes' ), + 'description' => __( 'The global default width of cover photo size. This can be overridden by individual form settings', 'ultimate-member' ), + 'conditional' => array( 'profile_cover_enabled', '=', 1 ), + 'size' => 'small', + ), + array( + 'id' => 'profile_cover_ratio', + 'type' => 'select', + 'label' => __( 'Profile Cover Ratio', 'ultimate-member' ), + 'description' => __( 'Choose global ratio for cover photos of profiles', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_cover_ratio' ), + 'options' => array( + '1.6:1' => '1.6:1', + '2.7:1' => '2.7:1', + '2.2:1' => '2.2:1', + '3.2:1' => '3.2:1', + ), + 'conditional' => array( 'profile_cover_enabled', '=', 1 ), + 'size' => 'small', + ), ), - 'size' => 'small', ), - array( - 'id' => 'profile_empty_text', - 'type' => 'checkbox', - 'label' => __( 'Show a custom message if profile is empty', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_empty_text' ), - 'description' => __( 'Switch on/off the custom message that appears when the profile is empty', 'ultimate-member' ), + 'header' => array( + 'title' => __( 'Header', 'ultimate-member' ), + 'description' => __( 'This section allows you to customize the user profile header component.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'profile_show_metaicon', + 'type' => 'checkbox', + 'label' => __( 'Profile Header Meta Text Icon', 'ultimate-member' ), + 'checkbox_label' => __( 'Show icons in Profile Header Meta', 'ultimate-member' ), + 'default' => 0, + 'description' => __( 'Display field icons for related user meta fields in header or not', 'ultimate-member' ), + ), + array( + 'id' => 'profile_show_name', + 'type' => 'checkbox', + 'label' => __( 'Display name in profile header', 'ultimate-member' ), + 'checkbox_label' => __( 'Show display name in profile header', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_show_name' ), + 'description' => __( 'Switch on/off the user name on profile header', 'ultimate-member' ), + ), + array( + 'id' => 'profile_show_social_links', + 'type' => 'checkbox', + 'label' => __( 'Social links in profile header', 'ultimate-member' ), + 'checkbox_label' => __( 'Show social links in profile header', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_show_social_links' ), + 'description' => __( 'Switch on/off the social links on profile header', 'ultimate-member' ), + ), + array( + 'id' => 'profile_show_bio', + 'type' => 'checkbox', + 'label' => __( 'User description in profile header', 'ultimate-member' ), + 'checkbox_label' => __( 'Show user description in profile header', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_show_bio' ), + 'description' => __( 'Switch on/off the user description on profile header', 'ultimate-member' ), + ), + array( + 'id' => 'profile_bio_maxchars', + 'type' => 'text', + 'label' => __( 'User description maximum chars', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_bio_maxchars' ), + 'description' => __( 'Maximum number of characters to allow in user description field in header.', 'ultimate-member' ), + 'conditional' => array( 'profile_show_bio', '=', 1 ), + 'size' => 'small', + ), + array( + 'id' => 'profile_show_html_bio', + 'type' => 'checkbox', + 'label' => __( 'HTML support for user description', 'ultimate-member' ), + 'checkbox_label' => __( 'Enable HTML support for user description', 'ultimate-member' ), + 'description' => __( 'Switch on/off to enable/disable support for HTML tags on user description.', 'ultimate-member' ), + ), + array( + 'id' => 'profile_header_menu', + 'type' => 'select', + 'label' => __( 'Profile Header Menu Position', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_header_menu' ), + 'description' => __( 'For incompatible themes, please make the menu open from left instead of bottom by default.', 'ultimate-member' ), + 'options' => array( + 'bc' => __( 'Bottom of Icon', 'ultimate-member' ), + 'lc' => __( 'Left of Icon (right for RTL)', 'ultimate-member' ), + ), + 'size' => 'small', + ), + ), ), - array( - 'id' => 'profile_empty_text_emo', - 'type' => 'checkbox', - 'label' => __( 'Show the emoticon', 'ultimate-member' ), - 'default' => um_get_metadefault( 'profile_empty_text_emo' ), - 'description' => __( 'Switch on/off the emoticon (sad face) that appears above the message', 'ultimate-member' ), - 'conditional' => array( 'profile_empty_text', '=', 1 ), + 'fields' => array( + 'title' => __( 'Buttons & Fields', 'ultimate-member' ), + 'description' => __( 'This section allows you to customize the user profile buttons and fields layout.', 'ultimate-member' ), + 'fields' => array( + array( + 'id' => 'profile_primary_btn_word', + 'type' => 'text', + 'label' => __( 'Profile Primary Button Text', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_primary_btn_word' ), + 'description' => __( 'The text that is used for updating profile button', 'ultimate-member' ), + 'size' => 'medium', + ), + array( + 'id' => 'profile_secondary_btn', + 'type' => 'checkbox', + 'label' => __( 'Profile Secondary Button', 'ultimate-member' ), + 'checkbox_label' => __( 'Show Profile Secondary Button', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_secondary_btn' ), + 'description' => __( 'Switch on/off the secondary button display in the form', 'ultimate-member' ), + ), + array( + 'id' => 'profile_secondary_btn_word', + 'type' => 'text', + 'label' => __( 'Profile Secondary Button Text', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_secondary_btn_word' ), + 'description' => __( 'The text that is used for cancelling update profile button', 'ultimate-member' ), + 'conditional' => array( 'profile_secondary_btn', '=', 1 ), + 'size' => 'medium', + ), + array( + 'id' => 'profile_icons', + 'type' => 'select', + 'label' => __( 'Profile Field Icons', 'ultimate-member' ), + 'description' => __( 'This is applicable for edit mode only', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_icons' ), + 'options' => array( + 'field' => __( 'Show inside text field', 'ultimate-member' ), + 'label' => __( 'Show with label', 'ultimate-member' ), + 'off' => __( 'Turn off', 'ultimate-member' ), + ), + 'size' => 'small', + ), + array( + 'id' => 'profile_empty_text', + 'type' => 'checkbox', + 'label' => __( 'Custom message on empty profile', 'ultimate-member' ), + 'checkbox_label' => __( 'Show a custom message if profile is empty', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_empty_text' ), + 'description' => __( 'Switch on/off the custom message that appears when the profile is empty', 'ultimate-member' ), + ), + array( + 'id' => 'profile_empty_text_emo', + 'type' => 'checkbox', + 'label' => __( 'Custom message emoticon', 'ultimate-member' ), + 'checkbox_label' => __( 'Show the emoticon', 'ultimate-member' ), + 'default' => um_get_metadefault( 'profile_empty_text_emo' ), + 'description' => __( 'Switch on/off the emoticon (sad face) that appears above the message', 'ultimate-member' ), + 'conditional' => array( 'profile_empty_text', '=', 1 ), + ), + ), ), ), ),