| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\App\Modules\Widgets; |
| 4 |
|
| 5 |
if ( ! class_exists('OxyEl')) { |
| 6 |
return; |
| 7 |
} |
| 8 |
|
| 9 |
class OxygenWidget |
| 10 |
{ |
| 11 |
public function __construct() |
| 12 |
{ |
| 13 |
if (version_compare(CT_VERSION, "3.2", "<")) { |
| 14 |
return; //minimum version requirement |
| 15 |
} |
| 16 |
add_action('plugins_loaded', array($this, 'initOxygenEl')); |
| 17 |
add_action('oxygen_add_plus_sections', array($this, 'addAccordionSection')); |
| 18 |
add_action('oxygen_add_plus_fluentform_section_content', array($this, 'registerAddPlusSubsections')); |
| 19 |
$this->initWidgets(); |
| 20 |
} |
| 21 |
|
| 22 |
public function initOxygenEl() |
| 23 |
{ |
| 24 |
if ( ! class_exists('OxyEl')) { |
| 25 |
return; |
| 26 |
} |
| 27 |
new OxygenEl(); |
| 28 |
} |
| 29 |
|
| 30 |
public function initWidgets() |
| 31 |
{ |
| 32 |
if (file_exists(FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/OxyFluentFormWidget.php')) { |
| 33 |
require_once FLUENTFORM_DIR_PATH . 'app/Modules/Widgets/OxyFluentFormWidget.php'; |
| 34 |
} |
| 35 |
} |
| 36 |
|
| 37 |
public function addAccordionSection() |
| 38 |
{ |
| 39 |
$brand_name = __('Fluent Forms', "fluentform"); |
| 40 |
\CT_Toolbar::oxygen_add_plus_accordion_section("fluentform", $brand_name); |
| 41 |
} |
| 42 |
|
| 43 |
public function registerAddPlusSubsections() |
| 44 |
{ |
| 45 |
do_action("oxygen_add_plus_fluentform_form"); |
| 46 |
} |
| 47 |
} |