colorpicker.class.php
8 years ago
iconpicker.class.php
9 years ago
select2-multiple.class.php
8 years ago
visualselect.class.php
8 years ago
iconpicker.class.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class Auxin_SiteOrigin_Field_Iconpicker |
| 5 | */ |
| 6 | class Auxin_SiteOrigin_Field_Iconpicker extends SiteOrigin_Widget_Field_Base { |
| 7 | |
| 8 | protected function render_field( $value, $instance ) { |
| 9 | |
| 10 | $font_icons = Auxin()->Font_Icons->get_icons_list('fontastic'); |
| 11 | $output = '<div class="aux-element-field aux-iconpicker">'; |
| 12 | $output .= sprintf( '<select name="%1$s" id="%1$s" class="aux-fonticonpicker aux-select" >', $this->element_name ); |
| 13 | $output .= '<option value="">' . __('Choose ..', 'auxin-elements') . '</option>'; |
| 14 | |
| 15 | if( is_array( $font_icons ) ){ |
| 16 | foreach ( $font_icons as $icon ) { |
| 17 | $icon_id = trim( $icon->classname, '.' ); |
| 18 | $output .= '<option value="'. $icon_id .'" '. selected( $value, $icon_id, false ) .' >'. $icon->name . '</option>'; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | $output .= '</select>'; |
| 23 | $output .= '</div>'; |
| 24 | |
| 25 | echo $output; |
| 26 | } |
| 27 | |
| 28 | protected function sanitize_field_input( $value, $instance ) { |
| 29 | return $value; |
| 30 | } |
| 31 | } |
| 32 |