File: /home/carrerup/.trash/techland/vc_templates/vc_row.php
<?php
if (! defined('ABSPATH')) {
die('-1');
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $full_width
* @var $full_height
* @var $equal_height
* @var $columns_placement
* @var $content_placement
* @var $parallax
* @var $parallax_image
* @var $css
* @var $el_id
* @var $video_bg
* @var $video_bg_url
* @var $video_bg_parallax
* @var $parallax_speed_bg
* @var $parallax_speed_video
* @var $content - shortcode content
* Shortcode class
* @var $this WPBakeryShortCode_VC_Row
*/
$el_class = $full_height = $parallax_speed_bg = $parallax_speed_video = $full_width = $equal_height = $flex_row =
$columns_placement = $content_placement = $parallax = $parallax_image = $css = $el_id = $video_bg = $video_bg_url = $video_bg_parallax = '';
// extra row atts
$techland_parallax_speed = $techland_bg_pos = $techland_row_overflow = $techland_parallax_bg_opacity = $techland_mobile_parallax = '';
$techland_lg_bgpos = $techland_md_bgpos = $techland_sm_bgpos = $techland_xs_bgpos = '';
$techland_lg_custom_bgpos = $techland_md_custom_bgpos = $techland_sm_custom_bgpos = $techland_xs_custom_bgpos = '';
$techland_bgsize = $techland_custom_bg_size = $techland_custom_bg_pos = $techland_bgrepeat = $techland_bg_attachment = '';
$techland_row_overlayclr = $techland_row_overlay_type = $techland_bg_zindex = '';
$techland_md_hidebg = $techland_sm_hidebg = $techland_xs_hidebg = '';
$techland_md_css = $techland_sm_css = $techland_xs_css = '';
$techland_premartop = $techland_premarbot = $techland_prepadtop = $techland_prepadbot = '';
$use_local_video = $local_video_format = '';
$divider = $divider_style = $divider_width = $divider_height = $divider_color = $divider_html = '';
$ex_gradient_toggle = $techland_row_grad1 = $techland_row_grad2 = '';
// extra row atts
$disable_element = '';
$output = $after_output = '';
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
wp_enqueue_script('wpb_composer_front_js');
$el_class = $this->getExtraClass($el_class);
$css_classes = array(
'nt-section',
$techland_prepadtop,
$techland_prepadbot,
$techland_premartop,
$techland_premarbot,
$el_class,
vc_shortcode_custom_css_class($css),
);
//bg custom class
$css_classes[] = $techland_row_overflow != '' ? 'overflow_'.$techland_row_overflow : '';
$css_classes[] = $techland_bg_zindex != '' ? 'zindex'.$techland_bg_zindex : '';
$css_classes[] = $techland_parallax_bg_opacity != '' ? 'parallax-bg-opacity-'.$techland_parallax_bg_opacity : '';
if ('yes' == $techland_md_hidebg) {
$css_classes[] = 'md-bg-image-hide';
}
if ('yes' == $techland_sm_hidebg) {
$css_classes[] = 'sm-bg-image-hide';
}
if ('yes' == $techland_xs_hidebg) {
$css_classes[] = 'xs-image-hide';
}
if ('yes' === $disable_element) {
if (vc_is_page_editable()) {
$css_classes[] = 'vc_hidden-lg vc_hidden-xs vc_hidden-sm vc_hidden-md';
} else {
return '';
}
}
if ('null' === $full_width) {
$css_classes[] = 'container-null';
}
if (vc_shortcode_custom_css_has_property($css, array(
'border',
'background',
)) || $video_bg || $parallax
) {
$css_classes[] = 'nt-has-fill';
}
if ( vc_shortcode_custom_css_has_property($css, array('background-image')) || $parallax ) {
$css_classes[] = 'section--bg-img';
}
// full-height wrapper
if (! empty($full_height)) {
$css_classes[] = 'vc_row-o-full-height';
if (! empty($columns_placement)) {
$flex_row = true;
$css_classes[] = 'columns-' . $columns_placement;
if ('stretch' === $columns_placement) {
$css_classes[] = 'vc_row-o-equal-height';
}
}
}
if (! empty($equal_height)) {
$css_classes[] = 'vc_row-o-equal-height';
}
$row_classes = array();
if (! empty($atts['rtl_reverse'])) {
$row_classes[] = $rtl_reverse ;
}
// flexbox content placement
if (! empty($content_placement)) {
$row_classes[] = $content_placement;
}
if (! empty($atts['content_lg_placement'])) {
$row_classes[] = $atts['content_lg_placement'];
}
if (! empty($atts['content_md_placement'])) {
$row_classes[] = $atts['content_md_placement'];
}
if (! empty($atts['content_sm_placement'])) {
$row_classes[] = $atts['content_sm_placement'];
}
// flexbox align items
if (! empty($atts['techland_align_items'])) {
$row_classes[] = $atts['techland_align_items'];
}
if (! empty($atts['techland_lg_align_items'])) {
$row_classes[] = $atts['techland_lg_align_items'];
}
if (! empty($atts['techland_md_align_items'])) {
$row_classes[] = $atts['techland_md_align_items'];
}
if (! empty($atts['techland_sm_align_items'])) {
$row_classes[] = $atts['techland_sm_align_items'];
}
if (! empty($atts['gap'])) {
$row_classes[] = 'column-gap-' . $atts['gap'];
}
$wrapper_attributes = array();
// build attributes for wrapper
if (! empty($el_id)) {
$wrapper_attributes[] = 'id="' . esc_attr($el_id) . '"';
}
//craete uniq class for row data css
$unique_class = 'nt_section_15'.mt_rand(5, 10000);
//add extra css to custom techland_vc_extra_css function
$techland_row_extra = array();
$techland_row_extra[] = $techland_row_overflow == 'visible' ? '.'.$unique_class.'{overflow:'.esc_attr($techland_row_overflow).'!important;}' : '';
$techland_row_extra[] = $techland_row_overflow == 'visible' && $techland_bg_zindex != '' ? '.'.$unique_class.'{z-index:'.esc_attr($techland_bg_zindex).'!important;}' : '';
$techland_row_extra[] = $techland_bg_attachment != '' ? '.'.$unique_class.'{background-attachment:'.esc_attr($techland_bg_attachment).'!important;}' : '';
$techland_row_extra[] = $techland_row_overlayclr != '' ? '.'.$unique_class.' .has-overlay{background:'.esc_attr($techland_row_overlayclr).'!important;}' : '';
$techland_row_extra[] = $ex_gradient_toggle == 'yes' && $techland_row_grad1 && $techland_row_grad2 ? '.'.$unique_class.'{background: linear-gradient(90deg, '.$techland_row_grad1.' 0%, '.$techland_row_grad2.' 100%);}' : '';
// row overlay color
$overlay_section = $techland_row_overlayclr != '' ? '<div class="has-overlay"></div>' : '';
// row svg shape divider
if ($divider == 'yes'){
$css_classes[] = 'nt-has-divider';
$divider_html = techland_vc_row_divider($atts, $divider_style, $divider_height, $divider_color, $dextra = false);
}
if (function_exists('techland_vc_extra_css')) {
$css_classes[] = techland_vc_extra_css( $atts, $unique_class, $techland_row_extra, $bg_options=true ) ? $unique_class : '';
$wrapper_attributes[] = techland_vc_extra_css( $atts, $unique_class, $techland_row_extra, $bg_options=true );
}
//CUSTOM PARALLAX CODE START
if (! empty($video_bg) && ! empty($video_bg_url)) {
$parallax = $video_bg_parallax;
$techland_parallax_speed = $parallax_speed_video;
}
if (! empty($parallax)) {
wp_enqueue_script('jarallax');
$techland_bgpos = $techland_bg_pos == 'custom' ? esc_attr($techland_custom_bg_pos) : esc_attr($techland_bg_pos);
$techland_bgsize = $techland_bg_size == 'custom' ? esc_attr($techland_custom_bg_size) : esc_attr($techland_bg_size);
$wrapper_attributes[] = 'data-jarallax';
$wrapper_attributes[] = 'data-type="'.esc_attr($parallax).'"';
$wrapper_attributes[] = 'data-speed="'.esc_attr($techland_parallax_speed).'"';
$wrapper_attributes[] = 'data-img-position="'.esc_attr($techland_bgpos).'"';
$wrapper_attributes[] = 'data-img-size="'.esc_attr($techland_bgsize).'"';
$wrapper_attributes[] = 'data-img-repeat="'.esc_attr($techland_bgrepeat).'"';
$wrapper_attributes[] = $techland_mobile_parallax ? 'data-mobile-parallax="'.esc_attr($techland_mobile_parallax).'"' : '';
$css_classes[] = 'jarallax jarallax-bg jarallax-' . $parallax;
if ($use_local_video == 'yes') {
if ($local_video_format == 'mp4') {
$wrapper_attributes[] = ! empty($video_bg) && ! empty($video_bg_url) ? 'data-jarallax-video="mp4:'.$video_bg_url.'"' : '';
}
if ($local_video_format == 'webm') {
$wrapper_attributes[] = ! empty($video_bg) && ! empty($video_bg_url) ? 'data-jarallax-video="webm:'.$video_bg_url.'"' : '';
}
if ($local_video_format == 'ogv') {
$wrapper_attributes[] = ! empty($video_bg) && ! empty($video_bg_url) ? 'data-jarallax-video="ogv:'.$video_bg_url.'"' : '';
}
} else {
$wrapper_attributes[] = ! empty($video_bg) && ! empty($video_bg_url) ? 'data-jarallax-video="'.$video_bg_url.'"' : '';
}
if (! empty($parallax_image)) {
$parallax_image_id = preg_replace('/[^\d]/', '', $parallax_image);
$parallax_image_src = wp_get_attachment_image_src($parallax_image_id, 'full');
if (! empty($parallax_image_src[0])) {
$parallax_image_src = $parallax_image_src[0];
}
$wrapper_attributes[] = 'style="background-image: url(' . esc_attr($parallax_image_src) . ');"';
}
}
$css_class = preg_replace('/\s+/', ' ', apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode(' ', array_filter(array_unique($css_classes))), $this->settings['base'], $atts));
$wrapper_attributes[] = 'class="' . esc_attr(trim($css_class)) . '"';
if ('fluid' === $full_width) { ?>
<div <?php echo implode(' ', $wrapper_attributes); ?>>
<?php echo wp_kses($overlay_section, techland_allowed_html()); ?>
<div class="container-fluid">
<div class="row <?php echo implode(' ', $row_classes); ?>">
<?php echo wpb_js_remove_wpautop($content);?>
</div>
</div>
<?php echo techland_vc_sanitize_data($divider_html);?>
</div>
<?php
} elseif ('fullwidth' === $full_width) { ?>
<div <?php echo implode(' ', $wrapper_attributes); ?>>
<?php echo wp_kses($overlay_section, techland_allowed_html()); ?>
<div class="container-fluid pl-0 pr-0">
<div class="row no-gutters <?php echo implode(' ', $row_classes); ?>">
<?php echo wpb_js_remove_wpautop($content);?>
</div>
</div>
<?php echo techland_vc_sanitize_data($divider_html);?>
</div>
<?php
} elseif ('stretch' === $full_width) { ?>
<div <?php echo implode(' ', $wrapper_attributes); ?>>
<?php echo wp_kses($overlay_section, techland_allowed_html()); ?>
<div class="container">
<div class="row <?php echo implode(' ', $row_classes); ?>">
<?php echo wpb_js_remove_wpautop($content);?>
</div>
</div>
<?php echo techland_vc_sanitize_data($divider_html);?>
</div>
<?php
} elseif ('null' === $full_width) { ?>
<div <?php echo implode(' ', $wrapper_attributes); ?>>
<?php echo wp_kses($overlay_section, techland_allowed_html()); ?>
<?php echo wpb_js_remove_wpautop($content);?>
</div>
<?php
} else { ?>
<div class="container">
<div <?php echo implode(' ', $wrapper_attributes);?>>
<?php echo wp_kses($overlay_section, techland_allowed_html()); ?>
<div class="row <?php echo implode(' ', $row_classes); ?>">
<?php echo wpb_js_remove_wpautop($content);?>
</div>
</div>
</div>
<?php
}