| 1 |
<?php |
| 2 |
/** |
| 3 |
* Images dropdown option view |
| 4 |
* |
| 5 |
* @since 5.0.04 |
| 6 |
* |
| 7 |
* @package Formidable |
| 8 |
* |
| 9 |
* @var array $args The arguments of images_dropdown() method. |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
die( 'You are not allowed to call this page directly.' ); |
| 14 |
} |
| 15 |
|
| 16 |
$component_options = array(); |
| 17 |
|
| 18 |
foreach ( $args['options'] as $key => $option ) { |
| 19 |
$option['key'] = $key; |
| 20 |
$image_details = FrmAppHelper::get_images_dropdown_atts( $option, $args ); |
| 21 |
|
| 22 |
$component_options[] = array( |
| 23 |
'label' => $option['text'], |
| 24 |
'value' => $key, |
| 25 |
'classes' => $image_details['classes'], |
| 26 |
'custom_attrs' => $image_details['custom_attrs'], |
| 27 |
); |
| 28 |
} |
| 29 |
|
| 30 |
new FrmTextToggleStyleComponent( |
| 31 |
$args['name'], |
| 32 |
$args['selected'] ?? 0, |
| 33 |
array( |
| 34 |
'classname' => $args['classes'], |
| 35 |
'options' => $component_options, |
| 36 |
'input_attrs_str' => $input_attrs_str, |
| 37 |
) |
| 38 |
); |
| 39 |
|