Advertisement
shirkit

Untitled

Jul 11th, 2015
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.42 KB | None | 0 0
  1. From 68700489c2690a446d3004a56ac4f22a12936f6a Mon Sep 17 00:00:00 2001
  2. From: Shirkit <[email protected]>
  3. Date: Sat, 11 Jul 2015 12:19:10 -0300
  4. Subject: [PATCH] new row
  5.  
  6. ---
  7. nectar/nectar-vc-addons/nectar-addons.php       | 11 +++++++++
  8.  nectar/nectar-vc-addons/vc_templates/vc_row.php | 33 +++++++++++++++++++++++--
  9.  2 files changed, 42 insertions(+), 2 deletions(-)
  10.  
  11. diff --git a/nectar/nectar-vc-addons/nectar-addons.php b/nectar/nectar-vc-addons/nectar-addons.php
  12. index a4eacf3..2ea78f1 100644
  13. --- a/nectar/nectar-vc-addons/nectar-addons.php
  14. +++ b/nectar/nectar-vc-addons/nectar-addons.php
  15. @@ -88,6 +88,7 @@ vc_remove_param("vc_row", "bg_color");
  16.  vc_remove_param("vc_row", "font_color");
  17.  vc_remove_param("vc_row", "margin_bottom");
  18.  vc_remove_param("vc_row", "bg_image");
  19. +vc_remove_param("vc_row", "bg_image2");
  20.  vc_remove_param("vc_row", "bg_image_repeat");
  21.  vc_remove_param("vc_row", "padding");
  22.  vc_remove_param("vc_row", "el_class");
  23. @@ -125,6 +126,16 @@ vc_add_param("vc_row", array(
  24.  ));
  25.  
  26.  vc_add_param("vc_row", array(
  27. +       "type" => "fws_image",
  28. +       "class" => "",
  29. +       "heading" => "Background Image Above",
  30. +       "param_name" => "bg_image2",
  31. +       "value" => "",
  32. +       "description" => "",
  33. +       "dependency" => Array('element' => "bg_image", 'not_empty' => true)
  34. +));
  35. +
  36. +vc_add_param("vc_row", array(
  37.     "type" => "checkbox",
  38.     "class" => "",
  39.     "heading" => "Background Image Mobile Hidden",
  40. diff --git a/nectar/nectar-vc-addons/vc_templates/vc_row.php b/nectar/nectar-vc-addons/vc_templates/vc_row.php
  41. index 767f511..475c99c 100644
  42. --- a/nectar/nectar-vc-addons/vc_templates/vc_row.php
  43. +++ b/nectar/nectar-vc-addons/vc_templates/vc_row.php
  44. @@ -2,7 +2,8 @@
  45.  
  46.     extract(shortcode_atts(array(
  47.       "type" => 'in_container',
  48. -     'bg_image'=> '',
  49. +     'bg_image'=> '',
  50. +     'bg_image2'=> '',
  51.       'background_image_mobile_hidden' => '',
  52.       'bg_position'=> '',
  53.       'bg_repeat' => '',
  54. @@ -53,11 +54,13 @@
  55.    
  56.      $style = null;
  57.      $bg_props = null;
  58. +    $bg_props2 = null;
  59.     $etxra_class = null;
  60.     $using_image_class = null;
  61.     $using_bg_color_class = null;
  62.     $using_custom_text_color = null;
  63.     if($this->shortcode == 'vc_row_inner') $text_color = null;
  64. +   $use_bg2 = !empty($bg_image2) && !empty($bg_image);
  65.    
  66.     if(!empty($bg_image)) {
  67.  
  68. @@ -65,21 +68,41 @@
  69.                
  70.             $bg_props .= 'background-image: url('. $bg_image . '); ';
  71.             $bg_props .= 'background-position: '. $bg_position .'; ';
  72. +          
  73. +           if ($use_bg2) {
  74. +               $bg_props2 .= 'background-image: url('. $bg_image2 . '); ';
  75. +               $bg_props2 .= 'background-position: '. $bg_position .'; ';
  76. +           }
  77.        
  78.         } else {
  79.             $bg_image_src = wp_get_attachment_image_src($bg_image, 'full');
  80.            
  81.             $bg_props .= 'background-image: url('. $bg_image_src[0]. '); ';
  82.             $bg_props .= 'background-position: '. $bg_position .'; ';
  83. +          
  84. +           if ($use_bg2) {
  85. +               $bg_image_src = wp_get_attachment_image_src($bg_image2, 'full');
  86. +                  
  87. +               $bg_props2 .= 'background-image: url('. $bg_image_src[0]. '); ';
  88. +               $bg_props2 .= 'background-position: '. $bg_position .'; ';
  89. +           }
  90.         }
  91.        
  92.         //for pattern bgs
  93.         if(strtolower($bg_repeat) == 'repeat'){
  94.             $bg_props .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
  95.             $etxra_class = 'no-cover';
  96. +          
  97. +           if ($use_bg2) {
  98. +               $bg_props2 .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
  99. +           }
  100.         } else {
  101.             $bg_props .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
  102.             $etxra_class = null;
  103. +          
  104. +           if ($use_bg2) {
  105. +               $bg_props2 .= 'background-repeat: '. strtolower($bg_repeat) .'; ';
  106. +           }
  107.         }
  108.  
  109.         $using_image_class = 'using-image';
  110. @@ -142,8 +165,14 @@
  111.     <div id="'.$row_id.'" data-bg-mobile-hidden="'.$background_image_mobile_hidden.'" class="wpb_row vc_row-fluid vc_row '. $main_class . $parallax_class . ' ' . $vertically_center_class . ' '. $class . ' " '.$using_custom_text_color.' style="'.$style.'">';
  112.    
  113.     //row bg
  114. -   echo '<div class="row-bg-wrap"> <div class="row-bg '.$using_image_class . ' ' . $using_bg_color_class . ' '. $etxra_class.'" style="'.$bg_props.'"></div> </div>';
  115. +   echo '<div class="row-bg-wrap"> <div class="row-bg '.$using_image_class . ' ' . $using_bg_color_class . ' '. $etxra_class.'" style="'.$bg_props.'"></div> ';
  116.  
  117. +   if ($use_bg2) {
  118. +       echo '<div class="row-bg '.$using_image_class . ' .above '. $etxra_class.'" style="'.$bg_props2.'"></div> ';
  119. +   }
  120. +  
  121. +   echo '</div>';
  122. +  
  123.     //mouse based parallax
  124.     if($mouse_based_parallax_bg == 'true') {
  125.  
  126. --
  127. 1.9.5.msysgit.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement