File: /home/carrerup/.trash/techland/vc_templates/vc_column.php
<?php
if (! defined('ABSPATH')) {
die('-1');
}
/**
* Shortcode attributes
* @var $atts
* @var $el_class
* @var $width
* @var $css
* @var $offset
* @var $content - shortcode content
* @var $css_animation
* Shortcode class
* @var $this WPBakeryShortCode_VC_Column
*/
$el_class = $el_id = $width = $parallax_speed_bg = $parallax_speed_video = $parallax = $parallax_image = $video_bg = $video_bg_url = $video_bg_parallax = $css = $offset = $css_animation = '';
$techland_parallax_speed = $techland_bg_pos = $techland_row_overflow = $techland_parallax_bg_opacity = $techland_mobile_parallax = '';
$techland_bg_size = $techland_custom_bg_size = '';
$techland_lg_bgpos = $techland_md_bgpos = $techland_sm_bgpos = $techland_xs_bgpos = '';
$techland_custom_bg_pos = $techland_lg_custom_bgpos = $techland_md_custom_bgpos = $techland_sm_custom_bgpos = $techland_xs_custom_bgpos = '';
$techland_md_hidebg = $techland_sm_hidebg = $techland_xs_hidebg = '';
$techland_md_css = $techland_sm_css = $techland_xs_css = '';
$ex_gradient_toggle = $techland_row_grad1 = $techland_row_grad2 = '';
// colummn spacing
$techland_premartop = $techland_premarbot = $techland_prepadtop = $techland_prepadbot = '';
// colummn width display
$techland_disable_column = '';
// colummn content text alignment
$techland_alignment = $techland_lg_alignment = $techland_md_alignment = $techland_sm_alignment = $techland_xs_alignment = '';
// display flex
$techland_column_flex = '';
//extra column att
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
$width = wpb_translateColumnWidthToSpan($width);
$width = vc_column_offset_class_merge($offset, $width);
//extra code
$width = $techland_disable_column == 'yes' ? '' : $width;
$css_classes = array(
$this->getExtraClass($el_class) . $this->getCSSAnimation($css_animation),
'nt-column',
$width,
$techland_column_flex,
$techland_alignment,
$techland_lg_alignment,
$techland_md_alignment,
$techland_sm_alignment,
$techland_xs_alignment,
$techland_prepadtop,
$techland_prepadbot,
$techland_premartop,
$techland_premarbot,
);
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 (vc_shortcode_custom_css_has_property($css, array(
'border',
'background',
))) {
$css_classes[] = 'nt-col-has-fill';
}
//craete uniq class for row data css
//add to custom css function
$unique_class = 'nt_column_1'.mt_rand(5, 1000);
$parallax_class = '';
$wrapper_attributes = array();
$css_class = preg_replace('/\s+/', ' ', apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, implode(' ', array_filter($css_classes)), $this->settings['base'], $atts));
if (! empty($parallax)) {
$parallax_class = 'section--bg-img jarallax jarallax-bg jarallax-' . $parallax;
}
$wrapper_attributes[] = 'class="' . esc_attr( trim( $css_class.$parallax_class ) ) . esc_attr( $parallax_class ) . '"';
if ( ! empty( $el_id ) ) {
$wrapper_attributes[] = 'id="' . esc_attr( $el_id ) . '"';
}
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' ? $techland_custom_bg_pos : $techland_bg_pos;
$techland_bgsize = $techland_bg_size == 'custom' ? $techland_custom_bg_size : $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[] = 'data-mobile-parallax="'.esc_attr($techland_mobile_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) . ');"';
}
}
$inner_attributes = array();
$res_css = '';
$techland_extra = array();
$techland_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%);}' : '';
if (function_exists('techland_vc_extra_css')) {
$res_css = techland_vc_extra_css( $atts, $unique_class, $techland_extra, $bg_options=true );
$unique_class = false != $res_css ? ' '.$unique_class : '';
if (vc_shortcode_custom_css_class($css) || $res_css) {
$inner_attributes[] = 'class="nt-shortcode-wrapper '. esc_attr(trim(vc_shortcode_custom_css_class($css)).$unique_class ) .'"';
$inner_attributes[] = $res_css;
}
}
if ($techland_disable_column != 'yes') { ?>
<div <?php echo implode(' ', $wrapper_attributes); ?>>
<?php
}
if (vc_shortcode_custom_css_class($css) || $res_css) { ?>
<div <?php echo implode(' ', $inner_attributes); ?>>
<?php
}
echo wpb_js_remove_wpautop($content); // shortcode content
if (vc_shortcode_custom_css_class($css) || $res_css) { ?>
</div>
<?php
}
if ($techland_disable_column != 'yes') { ?>
</div>
<?php
}