breadcrumbs.php
4 years ago
copyright.php
4 years ago
current-time.php
4 years ago
logo.php
3 years ago
menu.php
3 years ago
modern-search.php
2 years ago
search.php
4 years ago
select.php
3 years ago
shopping-cart.php
4 years ago
site-title.php
3 years ago
copyright.php
273 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements\Theme_Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Typography; |
| 8 | use Elementor\Core\Schemes\Typography; |
| 9 | use Elementor\Group_Control_Text_Shadow; |
| 10 | |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; // Exit if accessed directly. |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Elementor 'Copyright' widget. |
| 18 | * |
| 19 | * Elementor widget that displays an 'Copyright'. |
| 20 | * |
| 21 | * @since 1.0.0 |
| 22 | */ |
| 23 | class Copyright extends Widget_Base { |
| 24 | |
| 25 | /** |
| 26 | * Get widget name. |
| 27 | * |
| 28 | * Retrieve 'Copyright' widget name. |
| 29 | * |
| 30 | * @since 1.0.0 |
| 31 | * @access public |
| 32 | * |
| 33 | * @return string Widget name. |
| 34 | */ |
| 35 | public function get_name() { |
| 36 | return 'aux_copyright'; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Get widget title. |
| 41 | * |
| 42 | * Retrieve 'Copyright' widget title. |
| 43 | * |
| 44 | * @since 1.0.0 |
| 45 | * @access public |
| 46 | * |
| 47 | * @return string Widget title. |
| 48 | */ |
| 49 | public function get_title() { |
| 50 | return __( 'Copyright', 'auxin-elements' ); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Get widget icon. |
| 55 | * |
| 56 | * Retrieve 'Copyright' widget icon. |
| 57 | * |
| 58 | * @since 1.0.0 |
| 59 | * @access public |
| 60 | * |
| 61 | * @return string Widget icon. |
| 62 | */ |
| 63 | public function get_icon() { |
| 64 | return 'eicon-t-letter auxin-badge'; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Get widget categories. |
| 69 | * |
| 70 | * Retrieve 'Copyright' widget icon. |
| 71 | * |
| 72 | * @since 1.0.0 |
| 73 | * @access public |
| 74 | * |
| 75 | * @return string Widget icon. |
| 76 | */ |
| 77 | public function get_categories() { |
| 78 | return array( 'auxin-core', 'auxin-theme-elements' ); |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Register 'Copyright' widget controls. |
| 83 | * |
| 84 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 85 | * |
| 86 | * @since 1.0.0 |
| 87 | * @access protected |
| 88 | */ |
| 89 | protected function register_controls() { |
| 90 | |
| 91 | $this->start_controls_section( |
| 92 | 'general', |
| 93 | array( |
| 94 | 'label' => __( 'General', 'auxin-elements' ), |
| 95 | ) |
| 96 | ); |
| 97 | |
| 98 | $this->add_control( |
| 99 | 'copyright_text', |
| 100 | array( |
| 101 | 'type' => Controls_Manager::TEXT, |
| 102 | 'label' => __( 'Copyright Text', 'auxin-elements' ), |
| 103 | 'label_block' => true, |
| 104 | 'default' => sprintf( __( '© %s. All rights reserved.', 'auxin-elements' ), '{{Y}} {{sitename}}' ), |
| 105 | 'separator' => 'after', |
| 106 | ) |
| 107 | ); |
| 108 | |
| 109 | $this->add_control( |
| 110 | 'attribution', |
| 111 | array( |
| 112 | 'label' => __( 'Show Theme Attribution', 'auxin-elements' ), |
| 113 | 'description' => __( 'Show the "Powered By" text with link to theme homepage in footer.', 'auxin-elements' ), |
| 114 | 'type' => Controls_Manager::SWITCHER, |
| 115 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 116 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 117 | 'return_value' => 'yes', |
| 118 | 'default' => 'no' |
| 119 | ) |
| 120 | ); |
| 121 | |
| 122 | $this->add_control( |
| 123 | 'show_privacy_policy', |
| 124 | array( |
| 125 | 'label' => __( 'Show Privacy Policy', 'auxin-elements' ), |
| 126 | 'description' => __( 'Show a link to privacy policy page in the footer.', 'auxin-elements' ), |
| 127 | 'type' => Controls_Manager::SWITCHER, |
| 128 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 129 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 130 | 'return_value' => 'yes', |
| 131 | 'default' => 'no' |
| 132 | ) |
| 133 | ); |
| 134 | |
| 135 | $this->add_responsive_control( |
| 136 | 'align', |
| 137 | array( |
| 138 | 'label' => __( 'Alignment', 'auxin-elements' ), |
| 139 | 'type' => Controls_Manager::CHOOSE, |
| 140 | 'options' => array( |
| 141 | 'left' => array( |
| 142 | 'title' => __( 'Left', 'auxin-elements' ), |
| 143 | 'icon' => 'eicon-text-align-left', |
| 144 | ), |
| 145 | 'center' => array( |
| 146 | 'title' => __( 'Center', 'auxin-elements' ), |
| 147 | 'icon' => 'eicon-text-align-center', |
| 148 | ), |
| 149 | 'right' => array( |
| 150 | 'title' => __( 'Right', 'auxin-elements' ), |
| 151 | 'icon' => 'eicon-text-align-right', |
| 152 | ), |
| 153 | ), |
| 154 | 'selectors' => array( |
| 155 | '{{WRAPPER}}' => 'text-align: {{VALUE}};', |
| 156 | ), |
| 157 | ) |
| 158 | ); |
| 159 | |
| 160 | $this->end_controls_section(); |
| 161 | |
| 162 | $this->start_controls_section( |
| 163 | 'section_style_copyright', |
| 164 | array( |
| 165 | 'label' => __( 'Copyright', 'auxin-elements' ), |
| 166 | 'tab' => Controls_Manager::TAB_STYLE, |
| 167 | ) |
| 168 | ); |
| 169 | |
| 170 | $this->start_controls_tabs( 'copyright_colors' ); |
| 171 | |
| 172 | $this->start_controls_tab( |
| 173 | 'copyright_color_normal', |
| 174 | array( |
| 175 | 'label' => __( 'Normal', 'auxin-elements' ), |
| 176 | ) |
| 177 | ); |
| 178 | |
| 179 | $this->add_control( |
| 180 | 'copyright_color', |
| 181 | array( |
| 182 | 'label' => __( 'Color', 'auxin-elements' ), |
| 183 | 'type' => Controls_Manager::COLOR, |
| 184 | 'selectors' => array( |
| 185 | '{{WRAPPER}} small' => 'color: {{VALUE}};', |
| 186 | ), |
| 187 | ) |
| 188 | ); |
| 189 | |
| 190 | $this->add_group_control( |
| 191 | Group_Control_Typography::get_type(), |
| 192 | array( |
| 193 | 'name' => 'copyright_typo', |
| 194 | 'scheme' => Typography::TYPOGRAPHY_1, |
| 195 | 'selector' => '{{WRAPPER}} small', |
| 196 | ) |
| 197 | ); |
| 198 | |
| 199 | $this->add_group_control( |
| 200 | Group_Control_Text_Shadow::get_type(), |
| 201 | array( |
| 202 | 'name' => 'copyright_text_shadow', |
| 203 | 'selector' => '{{WRAPPER}} small', |
| 204 | ) |
| 205 | ); |
| 206 | |
| 207 | $this->end_controls_tab(); |
| 208 | |
| 209 | $this->start_controls_tab( |
| 210 | 'copyright_color_hover', |
| 211 | array( |
| 212 | 'label' => __( 'Hover', 'auxin-elements' ), |
| 213 | ) |
| 214 | ); |
| 215 | |
| 216 | $this->add_control( |
| 217 | 'copyright_hover_color', |
| 218 | array( |
| 219 | 'label' => __( 'Color', 'auxin-elements' ), |
| 220 | 'type' => Controls_Manager::COLOR, |
| 221 | 'selectors' => array( |
| 222 | '{{WRAPPER}} small:hover' => 'color: {{VALUE}} !important;', |
| 223 | ), |
| 224 | ) |
| 225 | ); |
| 226 | |
| 227 | $this->add_group_control( |
| 228 | Group_Control_Typography::get_type(), |
| 229 | array( |
| 230 | 'name' => 'copyright_typo_hover', |
| 231 | 'scheme' => Typography::TYPOGRAPHY_1, |
| 232 | 'selector' => '{{WRAPPER}} small:hover', |
| 233 | ) |
| 234 | ); |
| 235 | |
| 236 | $this->add_group_control( |
| 237 | Group_Control_Text_Shadow::get_type(), |
| 238 | array( |
| 239 | 'name' => 'copyright_text_shadow_hover', |
| 240 | 'selector' => '{{WRAPPER}} small:hover', |
| 241 | ) |
| 242 | ); |
| 243 | |
| 244 | $this->end_controls_tab(); |
| 245 | |
| 246 | $this->end_controls_tabs(); |
| 247 | |
| 248 | $this->end_controls_section(); |
| 249 | |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Render image box widget output on the frontend. |
| 254 | * |
| 255 | * Written in PHP and used to generate the final HTML. |
| 256 | * |
| 257 | * @since 1.0.0 |
| 258 | * @access protected |
| 259 | */ |
| 260 | protected function render() { |
| 261 | $settings = $this->get_settings_for_display(); |
| 262 | |
| 263 | $args = [ |
| 264 | 'copyright_text' => $settings['copyright_text'], |
| 265 | 'attribution' => $settings['attribution'], |
| 266 | 'show_privacy_policy' => $settings['show_privacy_policy'] |
| 267 | ]; |
| 268 | |
| 269 | auxin_footer_copyright_markup( true, $args ); |
| 270 | } |
| 271 | |
| 272 | } |
| 273 |