Advertisement
Guest User

vc_row.php

a guest
Apr 19th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.34 KB | None | 0 0
  1. <?php
  2. $output = $clsss_css_animation = $parallax_background_cover = $text_align_style = $el_class = $padding = $margin_bottom = $css = $parallax_css = $parallax_height_data = $video_height = $video_height_data = $data_attr = $video_html = $video_overlay_html = $parallax_overlay_html = $parallax_class = $video_class = '';
  3. extract(shortcode_atts(array(
  4.     'el_class'        => '',
  5.     'bg_image'        => '',
  6.     'bg_color'        => '',
  7.     'bg_image_repeat' => '',
  8.     'parallax' => '',
  9.     'parallax_height' => '',
  10.     'parallax_overlay' => '',
  11.     'row_type' => 'row',
  12.     'type' => '',
  13.     'video' => '',
  14.     'video_overlay' => '',
  15.     'video_webm' => '',
  16.     'video_mp4' => '',
  17.     'video_ogv' => '',
  18.     'video_image' => '',
  19.     'video_height' => '',
  20.     'video_overlay_bg_color' => '',
  21.     'parallax_overlay_bg_color' => '',
  22.     'css' => ''
  23. ), $atts));
  24.  
  25. wp_enqueue_script( 'wpb_composer_front_js' );
  26.  
  27. //Parallax options
  28. if($parallax == "use_parallax"){
  29.  
  30.     $parallax_class = ' parallax-container';
  31.  
  32.     if($parallax_height != ""){
  33.         $data_attr .= ' parallax-data-height="'.$parallax_height.'"';
  34.     }
  35.  
  36.     if($parallax_overlay == "use_parallax_overlay"){
  37.         $parallax_overlay_html = '<div class="gg-parallax-overlay" style="background: '.$parallax_overlay_bg_color.';"></div>';
  38.     }
  39. }
  40.  
  41.  
  42. //Video options
  43. if($video == "use_video"){
  44.     //Enqueue script
  45.     wp_enqueue_script('videobackground');
  46.     //Create html
  47.  
  48.     $video_class = ' video-container';
  49.  
  50.     if($video_height != ""){
  51.         $data_attr .= ' video-data-height="'.$video_height.'"';
  52.     }
  53.  
  54.     if($video_mp4 != ""){
  55.         $data_attr .= ' video-data-mp4="'.$video_mp4.'"';
  56.     }
  57.  
  58.     if($video_webm != ""){
  59.         $data_attr .= ' video-data-webm="'.$video_webm.'"';
  60.     }
  61.  
  62.     if($video_ogv != ""){
  63.         $data_attr .= ' video-data-ogv="'.$video_ogv.'"';
  64.     }
  65.    
  66.     if($video_overlay == "use_video_overlay"){
  67.         $video_overlay_html = '<div class="gg-video-overlay" style="background: '.$video_overlay_bg_color.';"></div>';
  68.     }
  69.  
  70. }
  71.  
  72. $el_class = $this->getExtraClass($el_class);
  73. $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'row vc_row vc_row-fluid '. ( $this->settings('base')==='vc_row_inner' ? 'vc_inner ' : '' ) . $el_class . $parallax_class . $video_class . vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );
  74. $style = $this->buildStyle($bg_image, $bg_color, $bg_image_repeat, $padding, $margin_bottom, $text_align_style);
  75.  
  76. //Row type = row
  77. if($row_type == "row") {
  78.    
  79.     $output .= '<div '.$data_attr.' class=" in_row ' . $css_class . '" '.$style.' >';
  80.     $output .= $video_overlay_html.$parallax_overlay_html;
  81.  
  82. //Row type = section
  83. } elseif ($row_type == "section") {
  84.    
  85.     if($type != "fullwidth"){
  86.         $css_class_type =  " in_container_section";
  87.     } else {
  88.         $css_class_type =  " fullwidth_section";
  89.     }
  90.  
  91.     $output .= '<section '.$data_attr.' class="section '. $css_class . $css_class_type . '">';
  92.  
  93.     $output .= $video_overlay_html.$parallax_overlay_html;
  94.  
  95.     if($type != "fullwidth"){
  96.         $output .= '<div class="container clearfix">';
  97.     } else {
  98.         $output .= '<div class="container-fluid clearfix">';
  99.  
  100.     }
  101.  
  102. }
  103.  
  104.     $output .= wpb_js_remove_wpautop($content);
  105.  
  106. //Row type = row
  107. if($row_type == "row") {
  108.     $output .= '</div>'.$this->endBlockComment('row');
  109. //Row type = section
  110. } elseif($row_type == "section") {
  111.     $output .= '</div></section>';
  112.     //$output .= '</div>'.$this->endBlockComment('row');
  113. }
  114.  
  115. echo $output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement