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-font.php
80 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ElementsKit_Lite\Modules\Widget_Builder\Controls; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class Control_Type_Font extends CT_Base { |
| 8 | |
| 9 | public function start_writing_conf( $file_handler, $conf ) { |
| 10 | |
| 11 | $ret = ''; |
| 12 | |
| 13 | if ( ! empty( $conf->description ) ) { |
| 14 | $ret .= "\t\t\t\t" . '\'description\' => esc_html( \'' . esc_html( $conf->description ) . '\' ),' . PHP_EOL; |
| 15 | } |
| 16 | |
| 17 | if ( ! empty( $conf->default ) ) { |
| 18 | $ret .= "\t\t\t\t" . '\'default\' => esc_html( \'' . esc_html( $conf->default ) . '\' ),' . PHP_EOL; |
| 19 | } |
| 20 | |
| 21 | if ( ! empty( $conf->separator ) ) { |
| 22 | $ret .= "\t\t\t\t" . '\'separator\' => \'' . esc_html( $conf->separator ) . '\' ,' . PHP_EOL; |
| 23 | } |
| 24 | |
| 25 | if ( ! empty( $conf->classes ) ) { |
| 26 | $ret .= "\t\t\t\t" . '\'classes\' => \'' . esc_html( $conf->classes ) . '\' ,' . PHP_EOL; |
| 27 | } |
| 28 | |
| 29 | if ( isset( $conf->show_label ) ) { |
| 30 | $ret .= "\t\t\t\t" . '\'show_label\' => ' . ( $conf->show_label == 1 ? 'true' : 'false' ) . ' ,' . PHP_EOL; |
| 31 | } |
| 32 | |
| 33 | if ( isset( $conf->label_block ) ) { |
| 34 | $ret .= "\t\t\t\t" . '\'label_block\' => ' . ( $conf->label_block == 1 ? 'true' : 'false' ) . ' ,' . PHP_EOL; |
| 35 | } |
| 36 | |
| 37 | if ( ! empty( $conf->options ) ) { |
| 38 | |
| 39 | $ret .= "\t\t\t\t" . '\'options\' => array(' . PHP_EOL; |
| 40 | |
| 41 | $realArray = (array) $conf->options; |
| 42 | |
| 43 | foreach ( $realArray as $val => $label ) { |
| 44 | |
| 45 | $ret .= "\t\t\t\t\t" . '\'' . esc_html( $label ) . '\' => \'' . esc_html( $val ) . '\',' . PHP_EOL; |
| 46 | } |
| 47 | |
| 48 | $ret .= "\t\t\t\t" . '),' . PHP_EOL; |
| 49 | } |
| 50 | |
| 51 | if ( ! empty( $conf->groups ) ) { |
| 52 | |
| 53 | $ret .= "\t\t\t\t" . '\'groups\' => array(' . PHP_EOL; |
| 54 | |
| 55 | $realArray = (array) $conf->groups; |
| 56 | |
| 57 | foreach ( $realArray as $val => $label ) { |
| 58 | |
| 59 | $ret .= "\t\t\t\t\t" . '\'' . esc_html( $val ) . '\' => \'' . esc_html( $label ) . '\',' . PHP_EOL; |
| 60 | } |
| 61 | |
| 62 | $ret .= "\t\t\t\t" . '),' . PHP_EOL; |
| 63 | } |
| 64 | |
| 65 | if ( ! empty( $conf->selectors ) ) { |
| 66 | $selectors = (array) $conf->selectors; |
| 67 | $ret .= "\t\t\t\t" . '\'selectors\' => array(' . PHP_EOL; |
| 68 | |
| 69 | foreach ( $selectors as $selectorName => $selectorValue ) { |
| 70 | $selectorProperty = str_replace( ',', ', {{WRAPPER}} ', $selectorName ); |
| 71 | $ret .= "\t\t\t\t\t" . '\'{{WRAPPER}} ' . $selectorProperty . '\' => \'' . esc_html( $selectorValue ) . '\',' . PHP_EOL; |
| 72 | } |
| 73 | |
| 74 | $ret .= "\t\t\t\t" . ')' . PHP_EOL; |
| 75 | } |
| 76 | |
| 77 | return $ret; |
| 78 | } |
| 79 | } |
| 80 |