-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCM_OXY_INTEGRATION.php
51 lines (40 loc) · 1.71 KB
/
CM_OXY_INTEGRATION.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
class CM_OXY_INTEGRATION
{
/* we will need this later to show subsections */
public $section_slug = "my_section_slug";
/* we will need this later to attach an element to a specific subsection */
public $tab_slug = "my_tab" ;
/* slugs for different subsection (will be used later inside our elements) */
public $subsection_dynamic = "dynamic";
public $subsection_other = "other";
public function __construct()
{
/* show a section in +Add */
add_action('oxygen_add_plus_sections', [$this, 'add_plus_sections']);
/* global_settings_tab */
add_action('oxygen_vsb_global_styles_tabs', [$this, 'global_settings_tab']);
/* +Add subsections content */
/* oxygen_add_plus_{$id}_section_content */
add_action("oxygen_add_plus_" . $this->section_slug . "_section_content", [$this, 'add_plus_subsections_content']);
}
public function add_plus_sections()
{
/* show a section in +Add dropdown menu and name it "My Custom Elements" */
CT_Toolbar::oxygen_add_plus_accordion_section($this->section_slug, __("My Custom Elements"));
}
public function global_settings_tab()
{
global $oxygen_toolbar;
$oxygen_toolbar->settings_tab(__("Tab Label"), $this->tab_slug, "panelsection-icons/styles.svg");
}
public function add_plus_subsections_content()
{
echo "<h2>Dynamic Elements</h2>";
/* display elements in "dynamic" subsection */
do_action("oxygen_add_plus_" . $this->tab_slug . "_dynamic");
echo "<h2>Other</h2>";
/* display elements in "other" subsection */
do_action("oxygen_add_plus_" . $this->tab_slug . "_other");
}
}