Elementor_Enhancer.php
3 years ago
EmbedPress_Core_Installer.php
6 years ago
EmbedPress_Notice.php
4 years ago
EmbedPress_Plugin_Usage_Tracker.php
2 years ago
Extend_CustomPlayer_Controls.php
3 years ago
Extend_Elementor_Controls.php
3 years ago
Feature_Enhancer.php
2 years ago
Helper.php
2 years ago
Extend_Elementor_Controls.php
236 lines
| 1 | <?php |
| 2 | |
| 3 | namespace EmbedPress\Includes\Classes; |
| 4 | use \Elementor\Controls_Manager; |
| 5 | |
| 6 | class Extend_Elementor_Controls { |
| 7 | |
| 8 | public function __construct () { |
| 9 | add_action( 'extend_elementor_controls', [$this, 'extend_elementor_share_and_lock_controls'], 10, 4 ); |
| 10 | } |
| 11 | |
| 12 | public function extend_elementor_share_and_lock_controls($that, $infix = '', $pro_text = '', $pro_class = ''){ |
| 13 | $that->start_controls_section( |
| 14 | 'embedpress_content_protection_settings', |
| 15 | [ |
| 16 | 'label' => esc_html__('EP Content Protection', 'embedpress'), |
| 17 | ] |
| 18 | ); |
| 19 | |
| 20 | $that->add_control( |
| 21 | 'embedpress'.$infix.'lock_content', |
| 22 | [ |
| 23 | 'label' => sprintf(__('Enable Content Protection %s', 'embedpress'), $pro_text), |
| 24 | 'type' => Controls_Manager::SWITCHER, |
| 25 | 'label_block' => false, |
| 26 | 'return_value' => 'yes', |
| 27 | 'default' => '', |
| 28 | 'classes' => $pro_class, |
| 29 | ] |
| 30 | ); |
| 31 | |
| 32 | $that->add_control( |
| 33 | 'embedpress'.$infix.'lock_content_password', |
| 34 | [ |
| 35 | 'label' => __('Set Password', 'embedpress'), |
| 36 | 'type' => Controls_Manager::TEXT, |
| 37 | 'default' => '', |
| 38 | 'placeholder' => '••••••', |
| 39 | 'label_block' => false, |
| 40 | 'condition' => [ |
| 41 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 42 | ] |
| 43 | ] |
| 44 | ); |
| 45 | |
| 46 | |
| 47 | $that->add_control( |
| 48 | 'embedpress'.$infix.'lock_content_error_message', |
| 49 | [ |
| 50 | 'label' => __('Error Message', 'embedpress'), |
| 51 | 'type' => Controls_Manager::TEXTAREA, |
| 52 | 'default' => 'Oops, that wasn\'t the right password. Try again.', |
| 53 | 'placeholder' => __('Oops, that wasn\'t the right password. Try again.', 'embedpress'), |
| 54 | 'label_block' => true, |
| 55 | 'condition' => [ |
| 56 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 57 | ] |
| 58 | ] |
| 59 | ); |
| 60 | $that->add_control( |
| 61 | 'embedpress'.$infix.'password_placeholder', |
| 62 | [ |
| 63 | 'label' => __('Placeholder', 'embedpress'), |
| 64 | 'type' => Controls_Manager::TEXT, |
| 65 | 'default' => 'Password', |
| 66 | 'placeholder' => __('Password', 'embedpress'), |
| 67 | 'label_block' => false, |
| 68 | 'condition' => [ |
| 69 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 70 | ] |
| 71 | ] |
| 72 | ); |
| 73 | $that->add_control( |
| 74 | 'embedpress'.$infix.'submit_button_text', |
| 75 | [ |
| 76 | 'label' => __('Button Text', 'embedpress'), |
| 77 | 'type' => Controls_Manager::TEXT, |
| 78 | 'default' => 'Unlock', |
| 79 | 'placeholder' => __('Unlock', 'embedpress'), |
| 80 | 'label_block' => false, |
| 81 | 'condition' => [ |
| 82 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 83 | ] |
| 84 | ] |
| 85 | ); |
| 86 | $that->add_control( |
| 87 | 'embedpress'.$infix.'submit_Unlocking_text', |
| 88 | [ |
| 89 | 'label' => __('Loader Text', 'embedpress'), |
| 90 | 'type' => Controls_Manager::TEXT, |
| 91 | 'default' => 'Unlocking...', |
| 92 | 'placeholder' => __('Unlocking...', 'embedpress'), |
| 93 | 'label_block' => false, |
| 94 | 'condition' => [ |
| 95 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 96 | ] |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $that->add_control( |
| 101 | 'embedpress'.$infix.'lock_content_heading', |
| 102 | [ |
| 103 | 'label' => __('Header', 'embedpress'), |
| 104 | 'type' => Controls_Manager::TEXT, |
| 105 | 'default' => 'Content Locked', |
| 106 | 'placeholder' => __('Content Locked', 'embedpress'), |
| 107 | 'label_block' => false, |
| 108 | 'condition' => [ |
| 109 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 110 | ] |
| 111 | ] |
| 112 | ); |
| 113 | |
| 114 | $that->add_control( |
| 115 | 'embedpress'.$infix.'lock_content_sub_heading', |
| 116 | [ |
| 117 | 'label' => __('Description', 'embedpress'), |
| 118 | 'type' => Controls_Manager::TEXTAREA, |
| 119 | 'default' => 'Content is locked and requires password to access it.', |
| 120 | 'placeholder' => __('Content is locked and requires password to access it.', 'embedpress'), |
| 121 | 'label_block' => true, |
| 122 | 'condition' => [ |
| 123 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 124 | ] |
| 125 | ] |
| 126 | ); |
| 127 | |
| 128 | |
| 129 | $that->add_control( |
| 130 | 'embedpress'.$infix.'enable_footer_message', |
| 131 | [ |
| 132 | 'label' => __('Footer Text', 'embedpress'), |
| 133 | 'type' => Controls_Manager::SWITCHER, |
| 134 | 'label_block' => false, |
| 135 | 'return_value' => 'yes', |
| 136 | 'default' => '', |
| 137 | 'condition' => [ |
| 138 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 139 | ], |
| 140 | |
| 141 | ] |
| 142 | ); |
| 143 | |
| 144 | $that->add_control( |
| 145 | 'embedpress'.$infix.'lock_content_footer_message', |
| 146 | [ |
| 147 | 'label' => __('Footer', 'embedpress'), |
| 148 | 'type' => Controls_Manager::TEXTAREA, |
| 149 | 'default' => 'In case you don\'t have the password, kindly reach out to content owner or administrator to request access.', |
| 150 | 'placeholder' => __('In case you don\'t have the password, kindly reach out to content owner or administrator to request access.', 'embedpress'), |
| 151 | 'label_block' => true, |
| 152 | 'condition' => [ |
| 153 | 'embedpress'.$infix.'enable_footer_message' => 'yes', |
| 154 | 'embedpress'.$infix.'lock_content' => 'yes' |
| 155 | ] |
| 156 | ] |
| 157 | ); |
| 158 | |
| 159 | $that->end_controls_section(); |
| 160 | |
| 161 | $that->start_controls_section( |
| 162 | 'embedpress_content_share_settings', |
| 163 | [ |
| 164 | 'label' => esc_html__('EP Social Share', 'embedpress'), |
| 165 | ] |
| 166 | ); |
| 167 | |
| 168 | $that->add_control( |
| 169 | 'embedpress'.$infix.'content_share', |
| 170 | [ |
| 171 | 'label' => __('Enable Social Share', 'embedpress'), |
| 172 | 'type' => Controls_Manager::SWITCHER, |
| 173 | 'label_block' => false, |
| 174 | 'return_value' => 'yes', |
| 175 | 'default' => '', |
| 176 | ] |
| 177 | ); |
| 178 | $that->add_control( |
| 179 | 'embedpress'.$infix.'content_share_position', |
| 180 | [ |
| 181 | 'label' => __('Position', 'embedpress'), |
| 182 | 'type' => Controls_Manager::SELECT, |
| 183 | 'default' => 'right', |
| 184 | 'options' => [ |
| 185 | 'top' => __('Top', 'embedpress'), |
| 186 | 'right' => __('Right', 'embedpress'), |
| 187 | 'bottom' => __('Bottom', 'embedpress'), |
| 188 | 'left' => __('Left', 'embedpress'), |
| 189 | ], |
| 190 | 'condition' => [ |
| 191 | 'embedpress'.$infix.'content_share' => 'yes' |
| 192 | ] |
| 193 | ] |
| 194 | ); |
| 195 | $that->add_control( |
| 196 | 'embedpress'.$infix.'content_title', |
| 197 | [ |
| 198 | 'label' => __('Title', 'embedpress'), |
| 199 | 'type' => Controls_Manager::TEXT, |
| 200 | 'placeholder' => __('Enter share title', 'embedpress'), |
| 201 | 'condition' => [ |
| 202 | 'embedpress'.$infix.'content_share' => 'yes' |
| 203 | ] |
| 204 | ] |
| 205 | ); |
| 206 | $that->add_control( |
| 207 | 'embedpress'.$infix.'content_descripiton', |
| 208 | [ |
| 209 | 'label' => __('Description', 'embedpress'), |
| 210 | 'type' => Controls_Manager::TEXTAREA, |
| 211 | 'placeholder' => __('Enter share description', 'embedpress'), |
| 212 | 'condition' => [ |
| 213 | 'embedpress'.$infix.'content_share' => 'yes' |
| 214 | ] |
| 215 | ] |
| 216 | ); |
| 217 | |
| 218 | $that->add_control( |
| 219 | 'embedpress'.$infix.'content_share_custom_thumbnail', |
| 220 | [ |
| 221 | 'label' => esc_html__( 'Thumbnail', 'textdomain' ), |
| 222 | 'type' => \Elementor\Controls_Manager::MEDIA, |
| 223 | 'default' => [ |
| 224 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 225 | ], |
| 226 | 'condition' => [ |
| 227 | 'embedpress'.$infix.'content_share' => 'yes' |
| 228 | ] |
| 229 | ] |
| 230 | ); |
| 231 | $that->end_controls_section(); |
| 232 | |
| 233 | } |
| 234 | |
| 235 | |
| 236 | } |