| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Form; |
| 4 |
|
| 5 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 6 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 7 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; |
| 8 |
use Elementor\Modules\AtomicWidgets\Elements\Promotions\Preserves_Children_Subtree; |
| 9 |
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 10 |
use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 11 |
use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
class Atomic_Form_Promotion extends Atomic_Element_Base { |
| 18 |
use Has_Element_Template; |
| 19 |
use Preserves_Children_Subtree; |
| 20 |
|
| 21 |
const BASE_STYLE_KEY = 'base'; |
| 22 |
public function __construct( $data = [], $args = null ) { |
| 23 |
parent::__construct( $data, $args ); |
| 24 |
$this->meta( 'is_container', true ); |
| 25 |
$this->meta( 'is_pro_promotion', true ); |
| 26 |
} |
| 27 |
|
| 28 |
public static function get_type() { |
| 29 |
return 'e-form'; |
| 30 |
} |
| 31 |
|
| 32 |
public static function get_element_type(): string { |
| 33 |
return self::get_type(); |
| 34 |
} |
| 35 |
|
| 36 |
public function get_title() { |
| 37 |
return esc_html__( 'Atomic Form', 'elementor' ); |
| 38 |
} |
| 39 |
|
| 40 |
public function get_icon() { |
| 41 |
return 'eicon-atomic-form'; |
| 42 |
} |
| 43 |
|
| 44 |
public static function get_computed_html_tag( array $settings ): string { |
| 45 |
return Html_Tag_Computer::compute( $settings, 'div' ); |
| 46 |
} |
| 47 |
|
| 48 |
protected static function define_props_schema(): array { |
| 49 |
return Atomic_Form::get_base_props_schema(); |
| 50 |
} |
| 51 |
|
| 52 |
protected function define_atomic_controls(): array { |
| 53 |
return []; |
| 54 |
} |
| 55 |
|
| 56 |
protected function define_base_styles(): array { |
| 57 |
return [ |
| 58 |
static::BASE_STYLE_KEY => Style_Definition::make() |
| 59 |
->add_variant( |
| 60 |
Style_Variant::make() |
| 61 |
->add_prop( 'display', String_Prop_Type::generate( 'block' ) ) |
| 62 |
), |
| 63 |
]; |
| 64 |
} |
| 65 |
|
| 66 |
protected function should_show_in_panel() { |
| 67 |
return false; |
| 68 |
} |
| 69 |
|
| 70 |
protected function should_print_empty() { |
| 71 |
return false; |
| 72 |
} |
| 73 |
|
| 74 |
public function print_content() { |
| 75 |
} |
| 76 |
|
| 77 |
protected function get_templates(): array { |
| 78 |
return [ |
| 79 |
'elementor/elements/atomic-form-promotion' => __DIR__ . '/atomic-form-promotion.html.twig', |
| 80 |
]; |
| 81 |
} |
| 82 |
} |
| 83 |
|