carousel.php
4 years ago
fancy-text.php
4 years ago
grid.php
4 years ago
icon-list.php
4 years ago
maps.php
4 years ago
person.php
4 years ago
pricing-table.php
4 years ago
progress-bar.php
4 years ago
vertical-scroll.php
4 years ago
maps.php
99 lines
| 1 | <?php |
| 2 | /** |
| 3 | * PA WPML Google Maps. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Compatibility\WPML\Widgets; |
| 7 | |
| 8 | use WPML_Elementor_Module_With_Items; |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; // No access of directly access. |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Fancy Text |
| 16 | * |
| 17 | * Registers translatable widget with items. |
| 18 | * |
| 19 | * @since 3.1.9 |
| 20 | */ |
| 21 | class Maps extends WPML_Elementor_Module_With_Items { |
| 22 | |
| 23 | /** |
| 24 | * Retrieve the field name. |
| 25 | * |
| 26 | * @since 3.1.9 |
| 27 | * @return string |
| 28 | */ |
| 29 | public function get_items_field() { |
| 30 | return 'premium_maps_map_pins'; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Retrieve the fields inside the repeater. |
| 35 | * |
| 36 | * @since 3.1.9 |
| 37 | * |
| 38 | * @return array |
| 39 | */ |
| 40 | public function get_fields() { |
| 41 | return array( |
| 42 | 'map_latitude', |
| 43 | 'map_longitude', |
| 44 | 'pin_title', |
| 45 | 'pin_desc', |
| 46 | ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Get the title for each repeater string |
| 51 | * |
| 52 | * @since 3.1.9 |
| 53 | * |
| 54 | * @param string $field control ID. |
| 55 | * |
| 56 | * @return string |
| 57 | */ |
| 58 | protected function get_title( $field ) { |
| 59 | |
| 60 | if ( 'map_latitude' === $field ) { |
| 61 | return __( 'Maps: Marker Latitude', 'premium-addons-for-elementor' ); |
| 62 | } |
| 63 | if ( 'map_longitude' === $field ) { |
| 64 | return __( 'Maps: Marker Longitude', 'premium-addons-for-elementor' ); |
| 65 | } |
| 66 | if ( 'pin_title' === $field ) { |
| 67 | return __( 'Maps: Marker Title', 'premium-addons-for-elementor' ); |
| 68 | } |
| 69 | if ( 'pin_desc' === $field ) { |
| 70 | return __( 'Maps: Marker Description', 'premium-addons-for-elementor' ); |
| 71 | } |
| 72 | |
| 73 | return ''; |
| 74 | |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Get `editor_type` for each repeater string |
| 79 | * |
| 80 | * @since 3.1.9 |
| 81 | * |
| 82 | * @param string $field control ID. |
| 83 | * |
| 84 | * @return string |
| 85 | */ |
| 86 | protected function get_editor_type( $field ) { |
| 87 | |
| 88 | if ( 'map_latitude' === $field || 'map_longitude' === $field || 'pin_title' === $field ) { |
| 89 | return 'LINE'; |
| 90 | } |
| 91 | if ( 'pin_desc' === $field ) { |
| 92 | return 'AREA'; |
| 93 | } |
| 94 | |
| 95 | return ''; |
| 96 | } |
| 97 | |
| 98 | } |
| 99 |