Helper.php
1 year ago
OxygenBuilder.php
1 year ago
OxygenElement.php
1 year ago
OxygenFormWidget.php
2 months ago
OxygenBuilder.php
73 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Oxygen builder integration. |
| 4 | * |
| 5 | * @since 3.0.5 |
| 6 | * @package EverestForms\Addons\OxygenBuilder\OxygenBuilder |
| 7 | */ |
| 8 | namespace EverestForms\Addons\OxygenBuilder; |
| 9 | |
| 10 | use EverestForms\Traits\Singleton; |
| 11 | use EverestForms\Addons\OxygenBuilder\Helper; |
| 12 | |
| 13 | /** |
| 14 | * OxygenBuilder. |
| 15 | * |
| 16 | * @since 3.0.5 |
| 17 | */ |
| 18 | class OxygenBuilder { |
| 19 | |
| 20 | use Singleton; |
| 21 | |
| 22 | /** |
| 23 | * Constructor. |
| 24 | * |
| 25 | * @since 3.0.5 |
| 26 | */ |
| 27 | public function __construct() { |
| 28 | $this->setup(); |
| 29 | } |
| 30 | /** |
| 31 | * Init. |
| 32 | * |
| 33 | * @since 3.0.5 |
| 34 | */ |
| 35 | public function setup() { |
| 36 | |
| 37 | if ( ! Helper::is_oxygen_active() ) { |
| 38 | |
| 39 | Helper::print_admin_notice(); |
| 40 | |
| 41 | return; |
| 42 | } |
| 43 | |
| 44 | if ( ! class_exists( 'OxyEl' ) ) { |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | add_action( 'oxygen_add_plus_sections', array( $this, 'add_accordion_section' ) ); |
| 49 | add_action( 'oxygen_add_plus_everest-forms_section_content', array( $this, 'register_add_plus_subsections' ) ); |
| 50 | |
| 51 | new OxygenFormWidget(); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Add accordion section in the elements. |
| 56 | * |
| 57 | * @since 3.0.5 |
| 58 | */ |
| 59 | public function add_accordion_section() { |
| 60 | $brand_name = __( 'Everest Forms', 'everest-forms' ); |
| 61 | \CT_Toolbar::oxygen_add_plus_accordion_section( 'everest-forms', $brand_name ); |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Add subsection. |
| 66 | * |
| 67 | * @since 3.0.5 |
| 68 | */ |
| 69 | public function register_add_plus_subsections() { |
| 70 | do_action( 'oxygen_add_plus_everest-forms_form' ); |
| 71 | } |
| 72 | } |
| 73 |