control-type-animation.php
4 years ago
control-type-background.php
2 years ago
control-type-border.php
2 years ago
control-type-box-shadow.php
4 years ago
control-type-choose.php
4 years ago
control-type-code.php
4 years ago
control-type-color.php
4 years ago
control-type-date-time.php
1 year ago
control-type-dimensions.php
4 years ago
control-type-font.php
4 years ago
control-type-gallery.php
4 years ago
control-type-hover.php
4 years ago
control-type-icons.php
4 years ago
control-type-image-dimensions.php
4 years ago
control-type-image-size.php
4 years ago
control-type-input.php
4 years ago
control-type-media.php
4 years ago
control-type-number.php
4 years ago
control-type-select.php
4 years ago
control-type-select2.php
4 years ago
control-type-slider.php
4 years ago
control-type-switch.php
4 years ago
control-type-text-area.php
4 years ago
control-type-text-shadow.php
4 years ago
control-type-typography.php
4 years ago
control-type-url.php
4 years ago
control-type-wys.php
4 years ago
ct-base.php
4 years ago
ct-contract.php
4 years ago
ct-factory.php
4 years ago
widget-writer.php
3 weeks ago
control-type-background.php
44 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Modules\Widget_Builder\Controls; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class Control_Type_Background extends CT_Base { |
| 8 | |
| 9 | public function start_writing_conf( $file_handler, $conf ) { |
| 10 | |
| 11 | $ret = ''; |
| 12 | |
| 13 | $ret .= "\t\t\t\t'fields_options' => ["; |
| 14 | $ret .= "\n\t\t\t\t\t'background' => ["; |
| 15 | $ret .= "\n\t\t\t\t\t\t'label' => '" . esc_html( $conf->label ) . "',"; |
| 16 | |
| 17 | if ( ! empty( $conf->description ) ) { |
| 18 | $ret .= "\n\t\t\t\t\t\t'description' => '" . esc_html( $conf->description ) . "',"; |
| 19 | } |
| 20 | |
| 21 | if ( isset( $conf->show_label ) ) { |
| 22 | $ret .= "\n\t\t\t\t\t\t'show_label' => " . ( $conf->show_label == 1 ? 'true' : 'false' ) . ','; |
| 23 | } |
| 24 | |
| 25 | if ( isset( $conf->label_block ) ) { |
| 26 | $ret .= "\n\t\t\t\t\t\t'label_block' => " . ( $conf->label_block == 1 ? 'true' : 'false' ) . ','; |
| 27 | } |
| 28 | |
| 29 | $ret .= "\n\t\t\t\t\t],"; |
| 30 | $ret .= "\n\t\t\t\t],\n"; |
| 31 | |
| 32 | if ( ! empty( $conf->separator ) ) { |
| 33 | $ret .= "\t\t\t\t" . '\'separator\' => \'' . esc_html( $conf->separator ) . '\',' . PHP_EOL; |
| 34 | } |
| 35 | |
| 36 | if ( ! empty( $conf->selector ) ) { |
| 37 | $selectorProperty = str_replace( ',', ', {{WRAPPER}} ', esc_html( $conf->selector ) ); |
| 38 | $ret .= "\t\t\t\t" . '\'selector\' => \'{{WRAPPER}} ' . $selectorProperty . '\',' . PHP_EOL; |
| 39 | } |
| 40 | |
| 41 | return $ret; |
| 42 | } |
| 43 | } |
| 44 |