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