Пример #1
0
                } else {
                    echo "Please Enter Shortcode";
                }
            }
        }
    }
    /* Header Slider and Map Code start  */
    if (is_page()) {
        $page_element_header = 0;
        $cs_meta_page = cs_meta_page('cs_page_builder');
        if (!empty($cs_meta_page)) {
            echo '<div class="header_element">';
            foreach ($cs_meta_page->children() as $cs_node) {
                if ($cs_node->getName() == "map" and $cs_node->map_view == "header") {
                    $page_element_header++;
                    echo cs_map_page();
                } elseif ($cs_node->getName() == "slider" and $cs_node->slider_view == "header" and $cs_node->slider_type != "Custom Slider") {
                    get_template_part('page_slider', 'page');
                    $page_element_header++;
                    $cs_position = 'absolute';
                }
            }
            echo '</div>';
            if ($page_element_header >= 1) {
                echo '<div class="clear"></div>';
            }
        }
    }
    /* Header Slider and Map Code End  */
}
?>
Пример #2
0
function cs_shortcode_pb_map($atts, $content = "")
{
    global $cs_node, $cs_counter_node;
    $cs_counter_node++;
    if (!isset($atts['height'])) {
        $atts['height'] = '';
    }
    if (!isset($atts['latitude'])) {
        $atts['latitude'] = '';
    }
    if (!isset($atts['longitude'])) {
        $atts['longitude'] = '';
    }
    if (!isset($atts['zoom'])) {
        $atts['zoom'] = '';
    }
    if (!isset($atts['type'])) {
        $atts['type'] = '';
    }
    if (!isset($atts['info_text'])) {
        $atts['info_text'] = '';
    }
    if (!isset($atts['info_width'])) {
        $atts['info_width'] = '';
    }
    if (!isset($atts['info_height'])) {
        $atts['info_height'] = '';
    }
    if (!isset($atts['marker_icon_url'])) {
        $atts['marker_icon_url'] = '';
    }
    if (!isset($atts['marker'])) {
        $atts['marker'] = '';
    }
    if (!isset($atts['draggable'])) {
        $atts['draggable'] = '';
    }
    if (!isset($atts['disable_controls'])) {
        $atts['disable_controls'] = '';
    }
    if (!isset($atts['scrollwheel'])) {
        $atts['scrollwheel'] = '';
    }
    if (!isset($atts['map_view'])) {
        $atts['map_view'] = 'content';
    }
    $cs_node = new stdClass();
    $cs_node->map_title = '';
    $cs_node->map_element_size = '';
    $cs_node->map_height = $atts['height'];
    $cs_node->map_lat = $atts['latitude'];
    $cs_node->map_lon = $atts['longitude'];
    $cs_node->map_zoom = $atts['zoom'];
    $cs_node->map_type = $atts['type'];
    $cs_node->map_info = $atts['info_text'];
    $cs_node->map_info_width = $atts['info_width'];
    $cs_node->map_info_height = $atts['info_height'];
    $cs_node->map_marker_icon = $atts['marker_icon_url'];
    $cs_node->map_show_marker = $atts['marker'];
    $cs_node->map_draggable = $atts['draggable'];
    $cs_node->map_controls = $atts['disable_controls'];
    $cs_node->map_scrollwheel = $atts['scrollwheel'];
    $cs_node->map_view = $atts['map_view'];
    return cs_map_page();
}