| @@ -35,8 +35,30 @@ | ||
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | + * Show readonly setting icon | |
| 40 | + * | |
| 41 | + * @since 6.33 | |
| 42 | + * | |
| 43 | + * @param bool $is_enabled Whether the setting is enabled. | |
| 44 | + * | |
| 45 | + * @return void | |
| 46 | + */ | |
| 47 | + public static function show_readonly_setting_icon( $is_enabled ) { | |
| 48 | + if ( $is_enabled ) { | |
| 49 | + echo '<span class="frm-success-icon">'; | |
| 50 | + FrmAppHelper::icon_by_class( 'frmfont frm_checkmark_icon', array( 'aria-hidden' => 'true' ) ); | |
| 51 | + echo '</span>'; | |
| 52 | + return; | |
| 53 | + } | |
| 54 | + | |
| 55 | + echo '<span class="frm-x-icon">'; | |
| 56 | + FrmAppHelper::icon_by_class( 'frmfont frm_x_icon', array( 'aria-hidden' => 'true' ) ); | |
| 57 | + echo '</span>'; | |
| 58 | + } | |
| 59 | + | |
| 60 | + /** | |
| 39 | 61 | * Echo a dropdown option. |
| 40 | 62 | * This is useful to avoid closing and opening PHP to echo <option> tags which leads to extra whitespace. |
| 41 | 63 | * Avoiding whitespace saves 5KB of HTML for an international address field with a country dropdown with 252 options. |
| 42 | 64 | * |