PATH:
home
/
fengshp
/
www
/
wp-content
/
themes
/
themify-ultra
/
themify
/
themify-builder
/
modules
<?php defined( 'ABSPATH' ) || exit; /** * Module Name: Map * Description: Display Map */ class TB_Map_Module extends Themify_Builder_Component_Module { public static function get_module_name():string{ add_filter( 'themify_builder_active_vars', array(__CLASS__, 'check_map_api')); return __('Map', 'themify'); } public static function get_module_icon():string{ return 'map-alt'; } /** * Handles Ajax request to check map api * * @since 4.5.0 */ public static function check_map_api($values) { $googleAPI = themify_builder_get( 'setting-google_map_key', 'builder_settings_google_map_key' ); $values['google_api'] = !empty($googleAPI); $url = themify_is_themify_theme() ? admin_url( 'admin.php?page=themify#setting-integration-api' ) : admin_url( 'admin.php?page=themify-builder&tab=builder_settings' ); if(!$values['google_api']) { $values['google_api_err'] = sprintf( __('Please enter the required <a href="%s" target="_blank">Google Maps API key</a>.','themify'), $url ); } $bingAPI = themify_builder_get( 'setting-bing_map_key', 'builder_settings_bing_map_key' ); $values['bing_api'] = !empty($bingAPI); if(!$values['bing_api']) { $values['bing_api_err'] = sprintf( __('Please enter the required <a href="%s" target="_blank">Bing Maps API key</a>.','themify'), $url ); } $azure_key = themify_builder_get( 'setting-azure_map_key', 'builder_settings_azure_map_key' ); $values['azure_api'] = !empty( $azure_key ); if ( ! $values['azure_api'] ) { $values['azure_api_err'] = sprintf( __('Please enter the required <a href="%s" target="_blank">Azure subscription key</a>.','themify'), $url ); } return $values; } /** * Render plain content */ public static function get_static_content(array $module):string { $mod_settings = $module['mod_settings']+array( 'mod_title_map' => '', 'address_map' => 'Toronto', 'zoom_map' => 15 ); if (!empty($mod_settings['address_map'])) { $mod_settings['address_map'] = preg_replace('/\s+/', ' ', trim($mod_settings['address_map'])); } $text = sprintf('<h3>%s</h3>', $mod_settings['mod_title_map']); $text .= sprintf( '<iframe frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=%s&t=m&z=%d&output=embed&iwloc=near"></iframe>', urlencode($mod_settings['address_map']), absint($mod_settings['zoom_map']) ); return $text; } public static function get_translatable_text_fields( $module ) : array { return [ 'mod_title_map', 'latlong_map' ]; } public static function get_translatable_textarea_fields( $module ) : array { return [ 'address_map', 'info_window_map' ]; } }
[+]
..
[-] module-page-break.php
[edit]
[-] module-lottie.php
[edit]
[-] module-menu.php
[edit]
[-] module-service-menu.php
[edit]
[-] module-text.php
[edit]
[-] module-post.php
[edit]
[-] module-social-share.php
[edit]
[-] module-login.php
[edit]
[-] module-callout.php
[edit]
[-] module-layout-part.php
[edit]
[-] module-slider.php
[edit]
[-] module-buttons.php
[edit]
[-] module-overlay-content.php
[edit]
[-] module-map.php
[edit]
[-] module-link-block.php
[edit]
[-] module-code.php
[edit]
[-] module-testimonial.php
[edit]
[-] module-star.php
[edit]
[-] module-alert.php
[edit]
[-] module-tab.php
[edit]
[-] module-highlight.php
[edit]
[-] module-widgetized.php
[edit]
[-] module-video.php
[edit]
[-] module-accordion.php
[edit]
[-] module-gallery.php
[edit]
[-] module-feature.php
[edit]
[-] module-divider.php
[edit]
[-] module-box.php
[edit]
[-] module-copyright.php
[edit]
[-] module-fancy-heading.php
[edit]
[-] module-plain-text.php
[edit]
[-] module-signup-form.php
[edit]
[-] module-widget.php
[edit]
[-] module-testimonial-slider.php
[edit]
[-] module-toc.php
[edit]
[-] module-icon.php
[edit]
[-] module-image.php
[edit]
[-] module-portfolio.php
[edit]
[-] module-optin.php
[edit]