manager.php
62 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Settings\General; |
| 3 | |
| 4 | use Elementor\Controls_Manager; |
| 5 | use Auxin\Plugin\CoreElements\Elementor\Settings\Base\Manager as baseManager; |
| 6 | |
| 7 | |
| 8 | class Manager extends baseManager |
| 9 | { |
| 10 | |
| 11 | /** |
| 12 | * Register Document Controls |
| 13 | * |
| 14 | * Add New Controls to Elementor Page Options |
| 15 | * @param $document |
| 16 | */ |
| 17 | public function register_controls ( $document ) { |
| 18 | |
| 19 | $document->start_controls_section( |
| 20 | 'page_logo_section', [ |
| 21 | 'label' => __('Logo', 'auxin-elements' ), |
| 22 | 'tab' => Controls_Manager::TAB_SETTINGS, |
| 23 | ] |
| 24 | ); |
| 25 | |
| 26 | $document->add_control( |
| 27 | 'aux_custom_logo', [ |
| 28 | 'label' => __('Page Logo', 'auxin-elements' ), |
| 29 | 'type' => Controls_Manager::MEDIA, |
| 30 | 'show_label' => false, |
| 31 | ] |
| 32 | ); |
| 33 | |
| 34 | $document->add_control( |
| 35 | 'page_secondary_logo_max_height', [ |
| 36 | 'label' => __( 'Footer Brand Height', 'auxin-elements' ), |
| 37 | 'type' => Controls_Manager::SLIDER, |
| 38 | 'size_units' => array('px'), |
| 39 | 'default' => [ |
| 40 | 'size' => $document->get_main_meta( 'page_secondary_logo_max_height' ), // get default value, |
| 41 | ], |
| 42 | 'range' => [ |
| 43 | 'px' => [ |
| 44 | 'min' => 0, |
| 45 | 'max' => 500, |
| 46 | 'step' => 1 |
| 47 | ] |
| 48 | ] |
| 49 | ] |
| 50 | ); |
| 51 | |
| 52 | $document->end_controls_section(); |
| 53 | } |
| 54 | |
| 55 | protected function save_settings( array $settings, $document, $data = null ){ |
| 56 | /** |
| 57 | // TODO save the control values as page meta fields by looping through $settings array |
| 58 | // $document->update_main_meta( $meta_key, $value ); |
| 59 | */ |
| 60 | } |
| 61 | } |
| 62 |