/** BEGIN - background construction **/
if (!empty($back_image) || $overlay_color !== '') {
    if ($parallax === 'yes') {
        $back_attachment = '';
        $back_size = 'cover';
        $uncell_classes[] = 'with-parallax';
    } else {
        if ($back_size === '') {
            $back_size = 'cover';
        }
    }
    if ($back_repeat === '') {
        $back_repeat = 'no-repeat';
    }
    $back_array = array('background-image' => $back_image, 'background-color' => $back_color, 'background-repeat' => $back_repeat, 'background-position' => $back_position, 'background-size' => $back_size, 'background-attachment' => $back_attachment);
    $back_result_array = uncode_get_back_html($back_array, $overlay_color, $overlay_alpha, '', 'column');
    $background_div = $back_result_array['back_html'];
}
/** END - background construction **/
/** BEGIN - shift construction **/
if ($zoom_width != '0' && $zoom_width != '' || $zoom_height != '0' && $zoom_height != '' || $shift_x != '0' && $shift_x != '' || $shift_y != '0' && $shift_y != '') {
    switch ($zoom_width) {
        case 1:
            $uncol_classes[] = 'zoom_width_half';
            break;
        case 2:
            $uncol_classes[] = 'zoom_width_single';
            break;
        case 3:
            $uncol_classes[] = 'zoom_width_double';
            break;
Пример #2
0
    function __construct($args, $page_title)
    {
        global $onepage;
        $poster_id = false;
        $limit_width = $limit_content_width = $content_html = $content_width = $header_title = $header_title_custom = $header_title_font = $header_title_size = $header_title_height = $header_title_spacing = $header_title_weight = $header_title_italic = $header_title_transform = $header_background = $header_container_background = $header_title = $header_parallax = $header_parallax_class = $height_style = $data_height = $header_background_video = $back_mime = $back_mime_css = $header_background_selfvideo = $header_overlay_color = $header_overlay_color_alpha = $header_overlay_pattern = $header_container_overlay_color = $header_container_overlay_color_alpha = $header_container_overlay_pattern = $header_align = $header_scroll_opacity = $header_scrolldown = '';
        $boxed = ot_get_option('_uncode_boxed');
        if ($boxed !== 'on') {
            if (isset($args['_uncode_header_full_width'][0]) && $args['_uncode_header_full_width'][0] !== '') {
                if ($args['_uncode_header_full_width'][0] === 'limit') {
                    $limit_width = ' limit-width';
                }
            } else {
                $header_width = ot_get_option('_uncode_header_full');
                if ($header_width === 'off') {
                    $limit_width = ' limit-width';
                }
            }
            if (isset($args['_uncode_header_content_width'][0]) && $args['_uncode_header_content_width'][0] !== 'on') {
                $limit_content_width = ' limit-width';
            }
            if (isset($args['_uncode_header_custom_width'][0])) {
                if ($args['_uncode_header_custom_width'][0] != '100') {
                    $content_width = ' style="max-width: ' . $args['_uncode_header_custom_width'][0] . '%;"';
                }
            }
        }
        if ($onepage) {
            if (isset($args['_uncode_scroll_header_name'][0]) && $args['_uncode_scroll_header_name'][0] !== '') {
                $onepage_header_name = esc_attr($args['_uncode_scroll_header_name'][0]);
                $onepage_header_name = ' data-label="' . $onepage_header_name . '" data-name="' . sanitize_title($onepage_header_name) . '"';
            } else {
                $onepage_header_name = '';
            }
        } else {
            $onepage_header_name = '';
        }
        /** style **/
        if (isset($args['_uncode_header_height'][0]) && $args['_uncode_header_height'][0] !== '') {
            $height = $args['_uncode_header_height'][0];
            if ($height[1] == '%') {
                $data_height = ' data-height="' . $height[0] . '"';
            }
            if ($height[1] == 'px') {
                $data_height = ' data-height="fixed"';
                $height_style .= 'height: ' . $height[0] . $height[1] . ';';
            }
        }
        if (isset($args['_uncode_header_min_height'][0]) && $args['_uncode_header_min_height'][0] !== '') {
            $min_height = intval(preg_replace('/[^0-9]+/', '', $args['_uncode_header_min_height'][0]), 10);
            $height_style .= 'min-height: ' . $min_height . 'px;';
        }
        if ($height_style !== '') {
            $height_style = ' style="' . $height_style . '"';
        }
        $header_style = isset($args['_uncode_header_style']) ? $args['_uncode_header_style'][0] : 'light';
        $header_align = isset($args['_uncode_header_align']) ? $args['_uncode_header_align'][0] : 'center';
        if (isset($args['_uncode_header_title'])) {
            $header_title = $args['_uncode_header_title'][0];
        }
        if (isset($args['_uncode_header_title_custom'])) {
            $header_title_custom = $args['_uncode_header_title_custom'][0];
        }
        if (isset($args['_uncode_header_title_font'])) {
            $header_title_font = $args['_uncode_header_title_font'][0];
        }
        if (isset($args['_uncode_header_title_size'])) {
            $header_title_size = $args['_uncode_header_title_size'][0];
        }
        if (isset($args['_uncode_header_title_height'])) {
            $header_title_height = $args['_uncode_header_title_height'][0];
        }
        if (isset($args['_uncode_header_title_spacing'])) {
            $header_title_spacing = $args['_uncode_header_title_spacing'][0];
        }
        if (isset($args['_uncode_header_title_weight'])) {
            $header_title_weight = $args['_uncode_header_title_weight'][0];
        }
        if (isset($args['_uncode_header_title_italic'])) {
            $header_title_italic = $args['_uncode_header_title_italic'][0];
        }
        if (isset($args['_uncode_header_title_transform'])) {
            $header_title_transform = $args['_uncode_header_title_transform'][0];
        }
        if (isset($args['_uncode_header_overlay_pattern'])) {
            $header_overlay_pattern = $args['_uncode_header_overlay_pattern'][0];
        }
        if (isset($args['_uncode_header_background'])) {
            $header_background = $args['_uncode_header_background'][0];
        }
        if (isset($args['_uncode_header_overlay_color'])) {
            $header_overlay_color = $args['_uncode_header_overlay_color'][0];
        }
        if (isset($args['_uncode_header_overlay_color_alpha'])) {
            $header_overlay_color_alpha = $args['_uncode_header_overlay_color_alpha'][0];
        }
        if (isset($args['_uncode_header_scroll_opacity'])) {
            $header_scroll_opacity = $args['_uncode_header_scroll_opacity'][0];
        }
        if (isset($args['_uncode_header_scrolldown'])) {
            $header_scrolldown = $args['_uncode_header_scrolldown'][0];
        }
        $item_style = ' style-' . $header_style;
        if ($header_scrolldown === 'on') {
            $header_scroll_html = '<div class="header-scrolldown' . $item_style . '"><i class="fa fa-angle-down"></i></div>';
        } else {
            $header_scroll_html = '';
        }
        $this->html = '';
        $header_type = isset($args['_uncode_header_type'][0]) ? $args['_uncode_header_type'][0] : 'none';
        switch ($header_type) {
            case 'header_basic':
                $div_data = array();
                $title_classes = array();
                $data_size = '';
                $header_parallax = isset($args['_uncode_header_parallax'][0]) && $args['_uncode_header_parallax'][0] == 'on' ? ' header-parallax' : '';
                $header_position = isset($args['_uncode_header_position'][0]) ? ' ' . $args['_uncode_header_position'][0] : '';
                $header_background_array = uncode_get_back_html($header_background, $header_overlay_color, $header_overlay_color_alpha, $header_overlay_pattern, $item_style, 'header');
                $this->poster_id = $header_background_array['poster_id'];
                $text_animation = isset($args['_uncode_header_text_animation'][0]) && $args['_uncode_header_text_animation'][0] != '' ? ' blocks-animation ' . $args['_uncode_header_text_animation'][0] : '';
                if (isset($args['_uncode_header_animation_speed'][0]) && $args['_uncode_header_animation_speed'][0] != '') {
                    $div_data['data-speed'] = $args['_uncode_header_animation_speed'][0];
                }
                if (isset($args['_uncode_header_animation_delay'][0]) && $args['_uncode_header_animation_delay'][0] != '') {
                    $div_data['data-delay'] = $args['_uncode_header_animation_delay'][0];
                }
                if ($header_title_font !== '') {
                    $title_classes[] = $header_title_font;
                }
                if ($header_title_size !== '') {
                    $title_classes[] = $header_title_size;
                }
                if ($header_title_height !== '') {
                    $title_classes[] = $header_title_height;
                }
                if ($header_title_spacing !== '') {
                    $title_classes[] = $header_title_spacing;
                }
                if ($header_title_weight !== '') {
                    $title_classes[] = 'font-weight-' . $header_title_weight;
                }
                if ($header_title_transform !== '') {
                    $title_classes[] = 'text-' . $header_title_transform;
                }
                $page_title = $header_title_italic === 'on' ? $page_title = '<i>' . $page_title . '</i>' : $page_title;
                if ($header_background_array['content_html'] === '') {
                    if ($header_title !== 'off') {
                        if ($header_title_custom !== 'on') {
                            $content_html .= '<h1 class="header-title ' . implode(' ', $title_classes) . '"' . $data_size . '><span>' . $page_title . '</span></h1>';
                        } else {
                            if (isset($args['_uncode_header_text'][0])) {
                                $content = '<h1 class="header-title ' . implode(' ', $title_classes) . '"' . $data_size . '><span>';
                                $title = trim($args['_uncode_header_text'][0]);
                                $title_lines = explode("\n", $title);
                                $lines_counter = count($title_lines);
                                if ($lines_counter > 1) {
                                    foreach ($title_lines as $key => $value) {
                                        $value = trim($value);
                                        $content .= $value;
                                        if ($value !== '' && $lines_counter - 1 !== $key) {
                                            $content .= '</span><span>';
                                        }
                                    }
                                } else {
                                    $content .= $title;
                                }
                                $content .= '</span></h1>';
                                $content_html .= do_shortcode($content);
                            }
                        }
                        $get_post_type = get_post_type();
                        if ($get_post_type === 'post' && is_single()) {
                            $content_html .= uncode_post_info();
                        }
                        if ($get_post_type === 'portfolio' && is_single()) {
                            $content_html .= uncode_portfolio_info();
                        }
                    }
                } else {
                    $this->show_title = 'yes';
                    $content_html .= $header_background_array['content_html'];
                }
                $this->html .= '<div class="header-basic' . $limit_width . $item_style . '">
												<div class="background-element header-wrapper' . ($header_scroll_opacity === 'on' ? ' header-scroll-opacity' : '') . ($onepage ? ' onepage-section' : '') . $header_parallax . $header_background_array['back_color'] . ($header_background_array['content_html'] === '' || $header_background_array['content_only_text'] ? ' header-only-text' : '') . '"' . $onepage_header_name . $data_height . $height_style . '>
												' . (isset($header_background_array['back_html']) ? $header_background_array['back_html'] : '');
                if ($content_html !== '') {
                    $this->html .= '<div class="header-main-container' . $limit_content_width . ($header_background_array['is_carousel'] ? ' header-carousel' : '') . '">
											<div class="header-content' . $header_position . ' header-align-' . $header_align . '">
												<div class="header-content-inner' . $text_animation . '"' . $content_width . ' ' . implode(' ', array_map(function ($v, $k) {
                        return $k . '="' . $v . '"';
                    }, $div_data, array_keys($div_data))) . '>
													' . $content_html . '
												</div>
											</div>
										</div>';
                }
                $this->html .= $header_scroll_html . '</div>
								</div>';
                break;
            case 'header_uncodeblock':
                $this->html .= '<div class="header-wrapper header-uncode-block' . ($header_scroll_opacity === 'on' ? ' header-scroll-opacity' : '') . '">
								' . (isset($header_background_array['back_html']) ? $header_background_array['back_html'] : '');
                $uncodeblock_id = isset($args['_uncode_blocks_list']) && $args['_uncode_blocks_list'][0] !== '' ? $args['_uncode_blocks_list'][0] : '';
                $uncode_block = $uncodeblock_id !== '' ? get_post_field('post_content', $uncodeblock_id) : '';
                $uncode_block = str_replace('[vc_row ', '[vc_row is_header="yes" ', $uncode_block);
                $this->html .= do_shortcode($uncode_block);
                $this->html .= $header_scroll_html;
                $this->html .= '</div>';
                break;
            case 'header_revslider':
                $this->html .= '<div class="header-wrapper header-revslider">
								' . (isset($header_background_array['back_html']) ? $header_background_array['back_html'] : '') . '
								<div class="header-main-container">';
                $revslider_id = isset($args['_uncode_revslider_list']) && $args['_uncode_revslider_list'][0] != '' ? $args['_uncode_revslider_list'][0] : '';
                $this->html .= do_shortcode('[rev_slider ' . $revslider_id . ']');
                $this->html .= '</div>';
                $this->html .= '</div>';
                break;
            case 'header_layerslider':
                $this->html .= '<div class="header-wrapper">
								' . (isset($header_background_array['back_html']) ? $header_background_array['back_html'] : '') . '
								<div class="header-main-container">';
                $layerslider_id = isset($args['_uncode_layerslider_list']) && $args['_uncode_layerslider_list'][0] != '' ? $args['_uncode_layerslider_list'][0] : '';
                $this->html .= do_shortcode('[layerslider id="' . $layerslider_id . '"]');
                $this->html .= '</div>';
                $this->html .= '</div>';
                break;
        }
    }
Пример #3
0
}
$boxed = ot_get_option('_uncode_boxed');
$fontsizes = ot_get_option('_uncode_heading_font_sizes');
$background = ot_get_option('_uncode_body_background');
$no_footer = strpos($menutype, 'vmenu') !== false ? true : false;
if (isset($metabox_data['_uncode_specific_body_background'])) {
    $specific_background = unserialize($metabox_data['_uncode_specific_body_background'][0]);
    if ($specific_background['background-color'] != '' || $specific_background['background-image'] != '') {
        $background = $specific_background;
    }
}
if (!empty($background) && ($background['background-color'] != '' || $background['background-image'] != '')) {
    if ($background['background-color'] !== '') {
        $background_color_css = ' style-' . $background['background-color'] . '-bg';
    }
    $back_result_array = uncode_get_back_html($background, '', '', '', 'div');
    if (strpos($back_result_array['mime'], 'image') !== false) {
        $background_style .= strpos($back_result_array['back_url'], 'background-image') !== false ? $back_result_array['back_url'] : 'background-image: url(' . $back_result_array['back_url'] . ');';
        if ($background['background-repeat'] !== '') {
            $background_style .= 'background-repeat: ' . $background['background-repeat'] . ';';
        }
        if ($background['background-position'] !== '') {
            $background_style .= 'background-position: ' . $background['background-position'] . ';';
        }
        if ($background['background-size'] !== '') {
            $background_style .= 'background-size: ' . ($background['background-attachment'] === 'fixed' ? 'cover' : $background['background-size']) . ';';
        }
        if ($background['background-attachment'] !== '') {
            $background_style .= 'background-attachment: ' . $background['background-attachment'] . ';';
        }
    } else {