| 1 |
<?php |
| 2 |
|
| 3 |
class WPVR_OXY_INTEGRATION |
| 4 |
{ |
| 5 |
/* we will need this later to show subsections */ |
| 6 |
public $section_slug = "wpvr"; |
| 7 |
|
| 8 |
/* we will need this later to attach an element to a specific subsection */ |
| 9 |
public $tab_slug = "wpvr" ; |
| 10 |
|
| 11 |
/* slugs for different subsection (will be used later inside our elements) */ |
| 12 |
public $subsection_dynamic = "dynamic"; |
| 13 |
public $subsection_other = "other"; |
| 14 |
|
| 15 |
public function __construct() |
| 16 |
{ |
| 17 |
/* show a section in +Add */ |
| 18 |
add_action('oxygen_add_plus_sections', [$this, 'add_plus_sections']); |
| 19 |
|
| 20 |
/* global_settings_tab */ |
| 21 |
add_action('oxygen_vsb_global_styles_tabs', [$this, 'global_settings_tab']); |
| 22 |
|
| 23 |
/* +Add subsections content */ |
| 24 |
/* oxygen_add_plus_{$id}_section_content */ |
| 25 |
add_action("oxygen_add_plus_" . $this->section_slug . "_section_content", [$this, 'add_plus_subsections_content']); |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
public function add_plus_sections() |
| 30 |
{ |
| 31 |
/* show a section in +Add dropdown menu and name it "My Custom Elements" */ |
| 32 |
CT_Toolbar::oxygen_add_plus_accordion_section($this->section_slug, __("Build with WP VR", 'wpvr')); |
| 33 |
} |
| 34 |
|
| 35 |
public function global_settings_tab() |
| 36 |
{ |
| 37 |
global $oxygen_toolbar; |
| 38 |
$oxygen_toolbar->settings_tab(__("WP VR", 'wpvr'), $this->tab_slug, "panelsection-icons/styles.svg"); |
| 39 |
} |
| 40 |
|
| 41 |
public function add_plus_subsections_content() |
| 42 |
{ |
| 43 |
do_action("oxygen_add_plus_" . $this->tab_slug . "_other"); |
| 44 |
} |
| 45 |
} |
| 46 |
|