form-01--form-container.php
3 years ago
form-02--form-fields.php
3 years ago
form-03--input.php
3 years ago
form-04--select2.php
3 years ago
form-05--select2-dropdown.php
3 years ago
form-06--timepicker-dropdown.php
3 years ago
form-07--radio.php
3 years ago
form-08--checkbox.php
3 years ago
form-09--calendar.php
3 years ago
form-10--submit.php
3 years ago
form-11--options-container.php
3 years ago
form-12--options-title.php
3 years ago
form-13--gdpr.php
3 years ago
form-14--error-message.php
3 years ago
form-15--success-message.php
2 years ago
form-16--recaptcha.php
3 years ago
general-01--module-container.php
3 years ago
general-02--main-layout.php
3 years ago
general-03--layout-header.php
3 years ago
general-04--layout-content.php
3 years ago
general-05--layout-footer.php
3 years ago
general-06--image-size.php
3 years ago
general-07--image-fitting.php
3 years ago
general-08--image-position.php
3 years ago
general-09--content-wrapper.php
3 years ago
general-10--title.php
3 years ago
general-11--subtitle.php
3 years ago
general-12--content.php
9 months ago
general-13--cta-container.php
3 years ago
general-14--cta-button.php
3 years ago
general-15--cta-alignment.php
3 years ago
general-16--nsa-link.php
3 years ago
general-17--close-button.php
3 years ago
general-18--popup-mask.php
3 years ago
general-19--cta-helper-text.php
3 years ago
module-size-embed.php
3 years ago
module-size-popup.php
3 years ago
module-size-slidein.php
3 years ago
form-14--error-message.php
136 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Error message custom settings. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.3.0 |
| 7 | */ |
| 8 | |
| 9 | $component = '.hustle-layout .hustle-error-message'; |
| 10 | |
| 11 | // SETTINGS: Margin. |
| 12 | $margin_top = ( '' !== $advanced['error_message_margin_top'] ) ? $advanced['error_message_margin_top'] . $advanced['error_message_margin_unit'] : '0'; |
| 13 | $margin_right = ( '' !== $advanced['error_message_margin_right'] ) ? $advanced['error_message_margin_right'] . $advanced['error_message_margin_unit'] : '0'; |
| 14 | $margin_bottom = ( '' !== $advanced['error_message_margin_bottom'] ) ? $advanced['error_message_margin_bottom'] . $advanced['error_message_margin_unit'] : '0'; |
| 15 | $margin_left = ( '' !== $advanced['error_message_margin_left'] ) ? $advanced['error_message_margin_left'] . $advanced['error_message_margin_unit'] : '0'; |
| 16 | |
| 17 | $margin = $margin_top . ' ' . $margin_right . ' ' . $margin_bottom . ' ' . $margin_left; |
| 18 | |
| 19 | $mobile_margin_top = ( '' !== $advanced['error_message_margin_top_mobile'] ) ? $advanced['error_message_margin_top_mobile'] . $advanced['error_message_margin_unit_mobile'] : $margin_top; |
| 20 | $mobile_margin_right = ( '' !== $advanced['error_message_margin_right_mobile'] ) ? $advanced['error_message_margin_right_mobile'] . $advanced['error_message_margin_unit_mobile'] : $margin_right; |
| 21 | $mobile_margin_bottom = ( '' !== $advanced['error_message_margin_bottom_mobile'] ) ? $advanced['error_message_margin_bottom_mobile'] . $advanced['error_message_margin_unit_mobile'] : $margin_bottom; |
| 22 | $mobile_margin_left = ( '' !== $advanced['error_message_margin_left_mobile'] ) ? $advanced['error_message_margin_left_mobile'] . $advanced['error_message_margin_unit_mobile'] : $margin_left; |
| 23 | |
| 24 | $mobile_margin = $mobile_margin_top . ' ' . $mobile_margin_right . ' ' . $mobile_margin_bottom . ' ' . $mobile_margin_left; |
| 25 | $mobile_margin = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $margin : $mobile_margin; |
| 26 | |
| 27 | // SETTINGS: Colors. |
| 28 | $border_color = $colors['optin_error_text_border']; |
| 29 | $background_color = $colors['optin_error_text_bg']; |
| 30 | $font_color = $colors['optin_error_text_color']; |
| 31 | |
| 32 | // SETTINGS: Font settings. |
| 33 | $color = $colors['optin_error_text_color']; |
| 34 | $font_family = $typography['error_message_font_family']; |
| 35 | $font_size = $typography['error_message_font_size'] . $typography['error_message_font_size_unit']; |
| 36 | $font_weight = $typography['error_message_font_weight']; |
| 37 | $font_style = 'normal'; |
| 38 | $alignment = $typography['error_message_alignment']; |
| 39 | $line_height = $typography['error_message_line_height'] . $typography['error_message_line_height_unit']; |
| 40 | $letter_spacing = $typography['error_message_letter_spacing'] . $typography['error_message_letter_spacing_unit']; |
| 41 | $text_transform = $typography['error_message_text_transform']; |
| 42 | $text_decoration = $typography['error_message_text_decoration']; |
| 43 | |
| 44 | if ( 'custom' === $font_family ) { |
| 45 | $font_family = ( '' !== $typography['error_message_custom_font_family'] ) ? $typography['error_message_custom_font_family'] : 'inherit'; |
| 46 | } |
| 47 | |
| 48 | if ( 'regular' === $font_weight ) { |
| 49 | $font_weight = 'normal'; |
| 50 | } else { |
| 51 | |
| 52 | // Check if font weight is italic. |
| 53 | if ( preg_match( '/(italic)/', $font_weight ) ) { |
| 54 | $font_weight = str_replace( 'italic', '', $font_weight ); |
| 55 | $font_style = 'italic'; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | $mobile_font_size = ( '' !== $typography['error_message_font_size_mobile'] ) ? $typography['error_message_font_size_mobile'] . $typography['error_message_font_size_unit_mobile'] : $font_size; |
| 60 | $mobile_font_weight = $typography['error_message_font_weight_mobile']; |
| 61 | $mobile_font_style = 'normal'; |
| 62 | $mobile_alignment = $typography['error_message_alignment_mobile']; |
| 63 | $mobile_line_height = ( '' !== $typography['error_message_line_height_mobile'] ) ? $typography['error_message_line_height_mobile'] . $typography['error_message_line_height_unit_mobile'] : $line_height; |
| 64 | $mobile_letter_spacing = ( '' !== $typography['error_message_letter_spacing_mobile'] ) ? $typography['error_message_letter_spacing_mobile'] . $typography['error_message_letter_spacing_unit_mobile'] : $letter_spacing; |
| 65 | $mobile_text_transform = $typography['error_message_text_transform']; |
| 66 | $mobile_text_decoration = $typography['error_message_text_decoration_mobile']; |
| 67 | |
| 68 | if ( 'regular' === $mobile_font_weight ) { |
| 69 | $mobile_font_weight = 'normal'; |
| 70 | } else { |
| 71 | |
| 72 | // Check if font weight is italic. |
| 73 | if ( preg_match( '/(italic)/', $mobile_font_weight ) ) { |
| 74 | $mobile_font_weight = str_replace( 'italic', '', $mobile_font_weight ); |
| 75 | $mobile_font_style = 'italic'; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | if ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_typography ) ) { |
| 80 | $mobile_font_size = $font_size; |
| 81 | $mobile_font_weight = $font_weight; |
| 82 | $mobile_font_style = $font_style; |
| 83 | $mobile_alignment = $alignment; |
| 84 | $mobile_line_height = $line_height; |
| 85 | $mobile_letter_spacing = $letter_spacing; |
| 86 | $mobile_text_transform = $text_transform; |
| 87 | $mobile_text_decoration = $text_decoration; |
| 88 | } |
| 89 | |
| 90 | // ================================================== |
| 91 | // Check if is an opt-in module. |
| 92 | if ( $is_optin ) { |
| 93 | |
| 94 | $style .= ' '; |
| 95 | |
| 96 | // Mobile styles. |
| 97 | $style .= $prefix_mobile . $component . ' {'; |
| 98 | $style .= 'margin: ' . $mobile_margin . ';'; |
| 99 | $style .= ( ! $is_vanilla ) ? 'background-color: ' . $background_color . ';' : ''; |
| 100 | $style .= ( ! $is_vanilla ) ? 'box-shadow: inset 4px 0 0 0 ' . $border_color . ';' : ''; |
| 101 | $style .= ( ! $is_vanilla ) ? '-moz-box-shadow: inset 4px 0 0 0 ' . $border_color . ';' : ''; |
| 102 | $style .= ( ! $is_vanilla ) ? '-webkit-box-shadow: inset 4px 0 0 0 ' . $border_color . ';' : ''; |
| 103 | $style .= '}'; |
| 104 | |
| 105 | $style .= $prefix_mobile . $component . ' p {'; |
| 106 | $style .= ( ! $is_vanilla ) ? 'color: ' . $font_color . ';' : ''; |
| 107 | $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : ''; |
| 108 | $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : ''; |
| 109 | $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : ''; |
| 110 | $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : ''; |
| 111 | $style .= 'font-style: ' . $mobile_font_style . ';'; |
| 112 | $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';'; |
| 113 | $style .= 'text-transform: ' . $mobile_text_transform . ';'; |
| 114 | $style .= 'text-decoration: ' . $mobile_text_decoration . ';'; |
| 115 | $style .= 'text-align: ' . $mobile_alignment . ';'; |
| 116 | $style .= '}'; |
| 117 | |
| 118 | // Desktop styles. |
| 119 | $style .= $breakpoint . ' {'; |
| 120 | $style .= $prefix_desktop . $component . ' {'; |
| 121 | $style .= 'margin: ' . $margin . ';'; |
| 122 | $style .= '}'; |
| 123 | $style .= $prefix_desktop . $component . ' p {'; |
| 124 | $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : ''; |
| 125 | $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : ''; |
| 126 | $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : ''; |
| 127 | $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : ''; |
| 128 | $style .= 'font-style: ' . $font_style . ';'; |
| 129 | $style .= 'letter-spacing: ' . $letter_spacing . ';'; |
| 130 | $style .= 'text-transform: ' . $text_transform . ';'; |
| 131 | $style .= 'text-decoration: ' . $text_decoration . ';'; |
| 132 | $style .= 'text-align: ' . $alignment . ';'; |
| 133 | $style .= '}'; |
| 134 | $style .= '}'; |
| 135 | } |
| 136 |