| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Core\Kits\Documents\Tabs; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly |
| 9 |
} |
| 10 |
|
| 11 |
class Settings_Lightbox extends Tab_Base { |
| 12 |
|
| 13 |
public function get_id() { |
| 14 |
return 'settings-lightbox'; |
| 15 |
} |
| 16 |
|
| 17 |
public function get_title() { |
| 18 |
return esc_html__( 'Lightbox', 'elementor' ); |
| 19 |
} |
| 20 |
|
| 21 |
public function get_group() { |
| 22 |
return 'settings'; |
| 23 |
} |
| 24 |
|
| 25 |
public function get_icon() { |
| 26 |
return 'eicon-lightbox-expand'; |
| 27 |
} |
| 28 |
|
| 29 |
public function get_help_url() { |
| 30 |
return 'https://go.elementor.com/global-lightbox/'; |
| 31 |
} |
| 32 |
|
| 33 |
protected function register_tab_controls() { |
| 34 |
$this->start_controls_section( |
| 35 |
'section_' . $this->get_id(), |
| 36 |
[ |
| 37 |
'label' => $this->get_title(), |
| 38 |
'tab' => $this->get_id(), |
| 39 |
] |
| 40 |
); |
| 41 |
|
| 42 |
$this->add_control( |
| 43 |
'global_image_lightbox', |
| 44 |
[ |
| 45 |
'label' => esc_html__( 'Image Lightbox', 'elementor' ), |
| 46 |
'type' => Controls_Manager::SWITCHER, |
| 47 |
'default' => 'yes', |
| 48 |
'description' => esc_html__( 'Open all image links in a lightbox popup window. The lightbox will automatically work on any link that leads to an image file.', 'elementor' ), |
| 49 |
'frontend_available' => true, |
| 50 |
] |
| 51 |
); |
| 52 |
|
| 53 |
$this->add_control( |
| 54 |
'lightbox_enable_counter', |
| 55 |
[ |
| 56 |
'label' => esc_html__( 'Counter', 'elementor' ), |
| 57 |
'type' => Controls_Manager::SWITCHER, |
| 58 |
'default' => 'yes', |
| 59 |
'frontend_available' => true, |
| 60 |
] |
| 61 |
); |
| 62 |
|
| 63 |
$this->add_control( |
| 64 |
'lightbox_enable_fullscreen', |
| 65 |
[ |
| 66 |
'label' => esc_html__( 'Fullscreen', 'elementor' ), |
| 67 |
'type' => Controls_Manager::SWITCHER, |
| 68 |
'default' => 'yes', |
| 69 |
'frontend_available' => true, |
| 70 |
] |
| 71 |
); |
| 72 |
|
| 73 |
$this->add_control( |
| 74 |
'lightbox_enable_zoom', |
| 75 |
[ |
| 76 |
'label' => esc_html__( 'Zoom', 'elementor' ), |
| 77 |
'type' => Controls_Manager::SWITCHER, |
| 78 |
'default' => 'yes', |
| 79 |
'frontend_available' => true, |
| 80 |
] |
| 81 |
); |
| 82 |
|
| 83 |
$this->add_control( |
| 84 |
'lightbox_enable_share', |
| 85 |
[ |
| 86 |
'label' => esc_html__( 'Share', 'elementor' ), |
| 87 |
'type' => Controls_Manager::SWITCHER, |
| 88 |
'default' => 'yes', |
| 89 |
'frontend_available' => true, |
| 90 |
] |
| 91 |
); |
| 92 |
|
| 93 |
$this->add_control( |
| 94 |
'lightbox_title_src', |
| 95 |
[ |
| 96 |
'label' => esc_html__( 'Title', 'elementor' ), |
| 97 |
'type' => Controls_Manager::SELECT, |
| 98 |
'options' => [ |
| 99 |
'' => esc_html__( 'None', 'elementor' ), |
| 100 |
'title' => esc_html__( 'Title', 'elementor' ), |
| 101 |
'caption' => esc_html__( 'Caption', 'elementor' ), |
| 102 |
'alt' => esc_html__( 'Alt', 'elementor' ), |
| 103 |
'description' => esc_html__( 'Description', 'elementor' ), |
| 104 |
], |
| 105 |
'default' => 'title', |
| 106 |
'frontend_available' => true, |
| 107 |
] |
| 108 |
); |
| 109 |
|
| 110 |
$this->add_control( |
| 111 |
'lightbox_description_src', |
| 112 |
[ |
| 113 |
'label' => esc_html__( 'Description', 'elementor' ), |
| 114 |
'type' => Controls_Manager::SELECT, |
| 115 |
'options' => [ |
| 116 |
'' => esc_html__( 'None', 'elementor' ), |
| 117 |
'title' => esc_html__( 'Title', 'elementor' ), |
| 118 |
'caption' => esc_html__( 'Caption', 'elementor' ), |
| 119 |
'alt' => esc_html__( 'Alt', 'elementor' ), |
| 120 |
'description' => esc_html__( 'Description', 'elementor' ), |
| 121 |
], |
| 122 |
'default' => 'description', |
| 123 |
'frontend_available' => true, |
| 124 |
] |
| 125 |
); |
| 126 |
|
| 127 |
$this->add_control( |
| 128 |
'lightbox_color', |
| 129 |
[ |
| 130 |
'label' => esc_html__( 'Background Color', 'elementor' ), |
| 131 |
'type' => Controls_Manager::COLOR, |
| 132 |
'selectors' => [ |
| 133 |
'.elementor-lightbox' => 'background-color: {{VALUE}}', |
| 134 |
], |
| 135 |
] |
| 136 |
); |
| 137 |
|
| 138 |
$this->add_control( |
| 139 |
'lightbox_ui_color', |
| 140 |
[ |
| 141 |
'label' => esc_html__( 'UI Color', 'elementor' ), |
| 142 |
'type' => Controls_Manager::COLOR, |
| 143 |
'selectors' => [ |
| 144 |
'.elementor-lightbox' => '--lightbox-ui-color: {{VALUE}}', |
| 145 |
], |
| 146 |
] |
| 147 |
); |
| 148 |
|
| 149 |
$this->add_control( |
| 150 |
'lightbox_ui_color_hover', |
| 151 |
[ |
| 152 |
'label' => esc_html__( 'UI Hover Color', 'elementor' ), |
| 153 |
'type' => Controls_Manager::COLOR, |
| 154 |
'selectors' => [ |
| 155 |
'.elementor-lightbox' => '--lightbox-ui-color-hover: {{VALUE}}', |
| 156 |
], |
| 157 |
] |
| 158 |
); |
| 159 |
|
| 160 |
$this->add_control( |
| 161 |
'lightbox_text_color', |
| 162 |
[ |
| 163 |
'label' => esc_html__( 'Text Color', 'elementor' ), |
| 164 |
'type' => Controls_Manager::COLOR, |
| 165 |
'selectors' => [ |
| 166 |
'.elementor-lightbox' => '--lightbox-text-color: {{VALUE}}', |
| 167 |
], |
| 168 |
] |
| 169 |
); |
| 170 |
|
| 171 |
$this->add_control( |
| 172 |
'lightbox_icons_size', |
| 173 |
[ |
| 174 |
'label' => esc_html__( 'Toolbar Icons Size', 'elementor' ), |
| 175 |
'type' => Controls_Manager::SLIDER, |
| 176 |
'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], |
| 177 |
'selectors' => [ |
| 178 |
'.elementor-lightbox' => '--lightbox-header-icons-size: {{SIZE}}{{UNIT}}', |
| 179 |
], |
| 180 |
'separator' => 'before', |
| 181 |
] |
| 182 |
); |
| 183 |
|
| 184 |
$this->add_control( |
| 185 |
'lightbox_slider_icons_size', |
| 186 |
[ |
| 187 |
'label' => esc_html__( 'Navigation Icons Size', 'elementor' ), |
| 188 |
'type' => Controls_Manager::SLIDER, |
| 189 |
'size_units' => [ 'px', 'em', 'rem', 'vw', 'custom' ], |
| 190 |
'selectors' => [ |
| 191 |
'.elementor-lightbox' => '--lightbox-navigation-icons-size: {{SIZE}}{{UNIT}}', |
| 192 |
], |
| 193 |
'separator' => 'before', |
| 194 |
] |
| 195 |
); |
| 196 |
|
| 197 |
$this->end_controls_section(); |
| 198 |
} |
| 199 |
} |
| 200 |
|