芝麻web文件管理V1.00
编辑当前文件:/var/www/cognitio.in/wp-content/plugins/Ultimate_VC_Addons/modules/ultimate_google_maps.php
$map_key, ); $api = esc_url( add_query_arg( $arr_params, $api ) ); } wp_register_script( 'ultimate-vc-addons-googleapis', $api, null, null, false ); // PHPCS:ignore:WordPress.WP.EnqueuedResourceParameters.MissingVersion } /** * Function that initializes settings of Ultimate Google Maps Module. * * @method google_maps_init */ public function google_maps_init() { if ( function_exists( 'vc_map' ) ) { vc_map( array( 'name' => __( 'Google Map', 'ultimate_vc' ), 'base' => 'ultimate_google_map', 'class' => 'vc_google_map', 'controls' => 'full', 'show_settings_on_create' => true, 'icon' => 'vc_google_map', 'description' => __( 'Display Google Maps to indicate your location.', 'ultimate_vc' ), 'category' => 'Ultimate VC Addons', 'params' => array( array( 'type' => 'textfield', 'class' => '', 'heading' => __( 'Width (in %)', 'ultimate_vc' ), 'param_name' => 'width', 'admin_label' => true, 'value' => '100%', 'group' => 'General Settings', ), array( 'type' => 'textfield', 'class' => '', 'heading' => __( 'Height (in px)', 'ultimate_vc' ), 'param_name' => 'height', 'admin_label' => true, 'value' => '300px', 'group' => 'General Settings', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Map type', 'ultimate_vc' ), 'param_name' => 'map_type', 'admin_label' => true, 'value' => array( __( 'Roadmap', 'ultimate_vc' ) => 'ROADMAP', __( 'Satellite', 'ultimate_vc' ) => 'SATELLITE', __( 'Hybrid', 'ultimate_vc' ) => 'HYBRID', __( 'Terrain', 'ultimate_vc' ) => 'TERRAIN', ), 'group' => 'General Settings', ), array( 'type' => 'textfield', 'class' => '', 'heading' => __( 'Latitude', 'ultimate_vc' ), 'param_name' => 'lat', 'admin_label' => true, 'value' => '18.591212', 'description' => '
' . __( 'Here is a tool', 'ultimate_vc' ) . '
' . __( 'where you can find Latitude & Longitude of your location', 'ultimate_vc' ), 'group' => 'General Settings', ), array( 'type' => 'textfield', 'class' => '', 'heading' => __( 'Longitude', 'ultimate_vc' ), 'param_name' => 'lng', 'admin_label' => true, 'value' => '73.741261', 'description' => '
' . __( 'Here is a tool', 'ultimate_vc' ) . '
' . __( 'where you can find Latitude & Longitude of your location', 'ultimate_vc' ), 'group' => 'General Settings', ), array( 'type' => 'dropdown', 'heading' => __( 'Map Zoom', 'ultimate_vc' ), 'param_name' => 'zoom', 'value' => array( __( '18 - Default', 'ultimate_vc' ) => 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, ), 'group' => 'General Settings', ), array( 'type' => 'checkbox', 'heading' => '', 'param_name' => 'scrollwheel', 'value' => array( __( 'Disable map zoom on mouse wheel scroll', 'ultimate_vc' ) => 'disable', ), 'group' => 'General Settings', ), array( 'type' => 'textarea_html', 'class' => '', 'heading' => __( 'Info Window Text', 'ultimate_vc' ), 'param_name' => 'content', 'value' => '', 'group' => 'Info Window', 'edit_field_class' => 'ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param', ), array( 'type' => 'ult_switch', 'heading' => __( 'Open on Marker Click', 'ultimate_vc' ), 'param_name' => 'infowindow_open', 'options' => array( 'infowindow_open_value' => array( 'label' => '', 'on' => __( 'Yes', 'ultimate_vc' ), 'off' => __( 'No', 'ultimate_vc' ), ), ), 'value' => 'infowindow_open_value', 'default_set' => true, 'group' => 'Info Window', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Marker/Point icon', 'ultimate_vc' ), 'param_name' => 'marker_icon', 'value' => array( __( 'Use Google Default', 'ultimate_vc' ) => 'default', __( "Use Plugin's Default", 'ultimate_vc' ) => 'default_self', __( 'Upload Custom', 'ultimate_vc' ) => 'custom', ), 'group' => 'Marker', ), array( 'type' => 'ult_img_single', 'class' => '', 'heading' => __( 'Upload Image Icon:', 'ultimate_vc' ), 'param_name' => 'icon_img', 'admin_label' => true, 'value' => '', 'description' => __( 'Upload the custom image icon.', 'ultimate_vc' ), 'dependency' => array( 'element' => 'marker_icon', 'value' => array( 'custom' ), ), 'group' => 'Marker', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Marker Animation', 'ultimate_vc' ), 'param_name' => 'marker_animation', 'value' => array( __( 'Yes', 'ultimate_vc' ) => 'yes', __( 'No', 'ultimate_vc' ) => 'no', ), 'group' => 'Marker', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Street view control', 'ultimate_vc' ), 'param_name' => 'streetviewcontrol', 'value' => array( __( 'Disable', 'ultimate_vc' ) => 'false', __( 'Enable', 'ultimate_vc' ) => 'true', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Map type control', 'ultimate_vc' ), 'param_name' => 'maptypecontrol', 'value' => array( __( 'Disable', 'ultimate_vc' ) => 'false', __( 'Enable', 'ultimate_vc' ) => 'true', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Zoom control', 'ultimate_vc' ), 'param_name' => 'zoomcontrol', 'value' => array( __( 'Disable', 'ultimate_vc' ) => 'false', __( 'Enable', 'ultimate_vc' ) => 'true', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Zoom Control Position', 'ultimate_vc' ), 'param_name' => 'zoomcontrolposition', 'value' => array( __( 'Right Bottom', 'ultimate_vc' ) => 'RIGHT_BOTTOM', __( 'Right Top', 'ultimate_vc' ) => 'RIGHT_TOP', __( 'Right Center', 'ultimate_vc' ) => 'RIGHT_CENTER', __( 'Left Top', 'ultimate_vc' ) => 'LEFT_TOP', __( 'Left Center', 'ultimate_vc' ) => 'LEFT_CENTER', __( 'Left Bottom', 'ultimate_vc' ) => 'LEFT_BOTTOM', ), 'dependency' => array( 'element' => 'zoomcontrol', 'value' => 'true', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Dragging on Mobile', 'ultimate_vc' ), 'param_name' => 'dragging', 'value' => array( __( 'Enable', 'ultimate_vc' ) => 'true', __( 'Disable', 'ultimate_vc' ) => 'false', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Dragging on Desktop', 'ultimate_vc' ), 'param_name' => 'dragging_desktop', 'value' => array( __( 'Enable', 'ultimate_vc' ) => 'true', __( 'Disable', 'ultimate_vc' ) => 'false', ), 'group' => 'Advanced', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Top margin', 'ultimate_vc' ), 'param_name' => 'top_margin', 'value' => array( __( 'Page (small)', 'ultimate_vc' ) => 'page_margin_top', __( 'Section (large)', 'ultimate_vc' ) => 'page_margin_top_section', __( 'None', 'ultimate_vc' ) => 'none', ), 'group' => 'General Settings', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'Map Width Override', 'ultimate_vc' ), 'param_name' => 'map_override', 'value' => array( 'Default Width' => '0', "Apply 1st parent element's width" => '1', "Apply 2nd parent element's width" => '2', "Apply 3rd parent element's width" => '3', "Apply 4th parent element's width" => '4', "Apply 5th parent element's width" => '5', "Apply 6th parent element's width" => '6', "Apply 7th parent element's width" => '7', "Apply 8th parent element's width" => '8', "Apply 9th parent element's width" => '9', 'Full Width ' => 'full', 'Maximum Full Width' => 'ex-full', ), 'description' => __( "By default, the map will be given to the WPBakery Page Builder row. However, in some cases depending on your theme's CSS - it may not fit well to the container you are wishing it would. In that case you will have to select the appropriate value here that gets you desired output..", 'ultimate_vc' ), 'group' => 'General Settings', ), array( 'type' => 'textarea_raw_html', 'class' => '', 'heading' => __( 'Google Styled Map JSON', 'ultimate_vc' ), 'param_name' => 'map_style', 'value' => '', 'description' => "
" . __( 'Click here', 'ultimate_vc' ) . '
' . __( 'to get the style JSON code for styling your map.', 'ultimate_vc' ), 'group' => 'Styling', ), array( 'type' => 'textfield', 'heading' => __( 'Extra class name', 'ultimate_vc' ), 'param_name' => 'el_class', 'description' => __( 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'ultimate_vc' ), 'group' => 'General Settings', ), array( 'type' => 'ult_param_heading', 'text' => "
" . __( 'Watch Video Tutorial', 'ultimate_vc' ) . "
", 'param_name' => 'notification', 'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12', 'group' => 'General Settings', ), array( 'type' => 'dropdown', 'class' => '', 'heading' => __( 'MapBorder Style', 'ultimate_vc' ), 'param_name' => 'map_border_style', 'value' => array( 'None' => '', 'Solid' => 'solid', 'Dashed' => 'dashed', 'Dotted' => 'dotted', 'Double' => 'double', 'Inset' => 'inset', 'Outset' => 'outset', ), 'description' => '', 'group' => 'Border', ), array( 'type' => 'colorpicker', 'class' => '', 'heading' => __( 'Border Color', 'ultimate_vc' ), 'param_name' => 'map_color_border', 'value' => '', 'description' => '', 'dependency' => array( 'element' => 'map_border_style', 'not_empty' => true, ), 'group' => 'Border', ), array( 'type' => 'number', 'class' => '', 'heading' => __( 'Border Width', 'ultimate_vc' ), 'param_name' => 'map_border_size', 'value' => 1, 'min' => 1, 'max' => 10, 'suffix' => 'px', 'description' => '', 'dependency' => array( 'element' => 'map_border_style', 'not_empty' => true, ), 'group' => 'Border', ), array( 'type' => 'number', 'class' => '', 'heading' => __( 'Border Radius', 'ultimate_vc' ), 'param_name' => 'map_radius', 'value' => 3, 'min' => 0, 'max' => 500, 'suffix' => 'px', 'description' => '', 'dependency' => array( 'element' => 'map_border_style', 'not_empty' => true, ), 'group' => 'Border', ), array( 'type' => 'ultimate_spacing', 'heading' => ' Map Margin ', 'param_name' => 'gmap_margin', 'mode' => 'margin', 'unit' => 'px', 'positions' => array( 'Top' => '', 'Right' => '', 'Bottom' => '', 'Left' => '', ), 'group' => __( 'Styling', 'ultimate_vc' ), 'description' => __( 'Add spacing from outside to the map.', 'ultimate_vc' ), ), array( 'type' => 'ultimate_spacing', 'heading' => ' Map padding ', 'param_name' => 'gmap_padding', 'mode' => 'padding', 'unit' => 'px', 'positions' => array( 'Top' => '', 'Right' => '', 'Bottom' => '', 'Left' => '', ), 'group' => __( 'Styling', 'ultimate_vc' ), 'description' => __( 'Add spacing from outside to the map.', 'ultimate_vc' ), ), ), ) ); } } /** * Render function for Ultimate Google Maps Module. * * @param array $atts represts module attribuits. * @param string $content value has been set to null. * @access public */ public function display_ultimate_map( $atts, $content = null ) { $output = ''; $ult_google_settings = shortcode_atts( array( 'width' => '100%', 'height' => '300px', 'map_type' => 'ROADMAP', 'lat' => '18.591212', 'lng' => '73.741261', 'zoom' => '14', 'scrollwheel' => '', 'streetviewcontrol' => 'false', 'maptypecontrol' => 'false', 'pancontrol' => 'false', 'zoomcontrol' => 'false', 'zoomcontrolposition' => 'RIGHT_BOTTOM', 'dragging' => 'true', 'dragging_desktop' => 'true', 'marker_icon' => 'default', 'icon_img' => '', 'top_margin' => 'page_margin_top', 'map_override' => '0', 'map_style' => '', 'el_class' => '', 'infowindow_open' => 'infowindow_open_value', 'map_vc_template' => '', 'map_border_style' => '', 'map_color_border' => '', 'map_border_size' => '', 'map_radius' => '', 'gmap_margin' => '', 'gmap_padding' => '', 'marker_animation' => 'yes', ), $atts ); $vc_version = ( defined( 'WPB_VC_VERSION' ) ) ? WPB_VC_VERSION : 0; $is_vc_49_plus = ( version_compare( 4.9, $vc_version, '<=' ) ) ? 'ult-adjust-bottom-margin' : ''; $border_css = ''; $gmap_design_css = ''; $gmap_design_css = $ult_google_settings['gmap_margin']; $gmap_design_css .= $ult_google_settings['gmap_padding']; $marker_lat = $ult_google_settings['lat']; $marker_lng = $ult_google_settings['lng']; if ( 'default_self' == $ult_google_settings['marker_icon'] ) { $icon_url = UAVC_URL . 'assets/img/icon-marker-pink.png'; } elseif ( 'default' == $ult_google_settings['marker_icon'] ) { $icon_url = ''; } else { $icon_url = apply_filters( 'ult_get_img_single', $ult_google_settings['icon_img'], 'url' ); } $id = 'map_' . uniqid(); $wrap_id = 'wrap_' . $id; $ult_google_settings['map_type'] = strtoupper( $ult_google_settings['map_type'] ); $ult_google_settings['width'] = ( substr( $ult_google_settings['width'], -1 ) != '%' && substr( $ult_google_settings['width'], -2 ) != 'px' ? $ult_google_settings['width'] . 'px' : $ult_google_settings['width'] ); $map_height = ( substr( $ult_google_settings['height'], -1 ) != '%' && substr( $ult_google_settings['height'], -2 ) != 'px' ? $ult_google_settings['height'] . 'px' : $ult_google_settings['height'] ); $margin_css = ''; if ( 'none' != $ult_google_settings['top_margin'] ) { $margin_css = $ult_google_settings['top_margin']; } if ( '' != $ult_google_settings['map_border_style'] ) { $border_css .= 'border-style:' . $ult_google_settings['map_border_style'] . ';'; } if ( '' != $ult_google_settings['map_color_border'] ) { $border_css .= 'border-color:' . $ult_google_settings['map_color_border'] . ';'; } if ( '' != $ult_google_settings['map_border_size'] ) { $border_css .= 'border-width:' . $ult_google_settings['map_border_size'] . 'px;'; } if ( '' != $ult_google_settings['map_radius'] ) { $border_css .= 'border-radius:' . $ult_google_settings['map_radius'] . 'px;'; } if ( 'map_vc_template_value' == $ult_google_settings['map_vc_template'] ) { $ult_google_settings['el_class'] .= 'uvc-boxed-layout'; } $output .= "
'; if ( 'disable' == $ult_google_settings['scrollwheel'] ) { $ult_google_settings['scrollwheel'] = 'false'; } else { $ult_google_settings['scrollwheel'] = 'true'; } $output .= ""; $is_preset = false; // Retrieve preset Code. if ( isset( $_GET['preset'] ) ) { // PHPCS:ignore:WordPress.Security.NonceVerification.Recommended $is_preset = true; } if ( $is_preset ) { $text = 'array ( '; foreach ( $atts as $key => $att ) { $text .= '
\'' . $key . '\' => \'' . $att . '\','; } if ( '' != $content ) { $text .= '
\'content\' => \'' . $content . '\','; } $text .= '
)'; $output .= '
'; $output .= $text; $output .= '
'; // remove backslash once copied. } return $output; } } new Ultimate_VC_Addons_Google_Maps(); if ( class_exists( 'WPBakeryShortCode' ) && ! class_exists( 'WPBakeryShortCode_Ultimate_Google_Map' ) ) { /** * Function that checks if the class is exists or not. */ class WPBakeryShortCode_Ultimate_Google_Map extends WPBakeryShortCode { } } }