Advertisement
Konark

Untitled

Apr 18th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 13.81 KB | None | 0 0
  1.  
  2. add_filter( 'gform_field_input', 'tracker', 10, 5 );
  3. function tracker( $input, $field, $value, $lead_id, $form_id ) {
  4.     // because this will fire for every form/field, only do it when it is the specific form and field
  5.     if ( $form_id == 1 && $field->id == 1 ) {
  6.         $input = '<ul class="gfield_radio" id="input_1_1"><li class="gchoice_1_1_0"><input name="input_1" type="radio" value="G образная форма" id="choice_1_1_0" tabindex="1"><label for="choice_1_1_0" id="label_1_1_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1.png"> <div>G образная форма</div></label></li><li class="gchoice_1_1_1"><input name="input_1" type="radio" value="L образная форма" id="choice_1_1_1" tabindex="2"><label for="choice_1_1_1" id="label_1_1_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2.png"> <div>L образная форма</div></label></li><li class="gchoice_1_1_2"><input name="input_1" type="radio" value="Линейная форма" id="choice_1_1_2" tabindex="3"><label for="choice_1_1_2" id="label_1_1_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3.png"> <div>Линейная форма</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_1_3"><input name="input_1" type="radio" value="Форма островного типа" id="choice_1_1_3" tabindex="4"><label for="choice_1_1_3" id="label_1_1_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/4.png"> <div>Форма островного типа</div></label></li><li class="gchoice_1_1_4"><input name="input_1" type="radio" value="Параллельная форма" id="choice_1_1_4" tabindex="5"><label for="choice_1_1_4" id="label_1_1_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5.png"> <div>Паралельная форма</div></label></li><li class="gchoice_1_1_5"><input name="input_1" type="radio" value="U образная форма" id="choice_1_1_5" tabindex="6"><label for="choice_1_1_5" id="label_1_1_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/6.png"> <div>U образная форма</div></label></li></ul><style>#input_1_1 label:not(:first-child) {
  7.     position: relative;
  8.     border-bottom: 1px solid #ccc;
  9. }
  10.  
  11. #input_1_1 label > div {
  12.     position: absolute;
  13.    bottom: 20px;
  14.    left: 0;
  15.    right: 0;
  16.     text-align: center;
  17. }
  18.  
  19. #gform_fields_1 label > div {
  20.     text-align: center;
  21. }
  22.  
  23. #input_1_3 label,
  24. #input_1_4 label,
  25. #input_1_5 label {
  26.     max-width: 172px;
  27. }
  28.  
  29. #input_1_3 label {
  30.     min-height: 279px;
  31. }
  32.  
  33. #input_1_4 label {
  34.     min-height: 258px;
  35. }
  36.  
  37. #input_1_5 label {
  38.     min-height: 216px;
  39. }
  40.  
  41. #field_1_9,
  42. #field_1_10,
  43. #field_1_11,
  44. #field_1_12 {
  45.     max-width: 259px;
  46.     padding: 0 !important;
  47. }
  48.  
  49. #field_1_9 input,
  50. #field_1_10 input,
  51. #field_1_12 input {
  52.     width: 100%;
  53. }
  54.  
  55. #field_1_4 {
  56.     padding-top: 0 !important;
  57. }
  58.  
  59. #gform_submit_button_1 {
  60.     background-color: #373d4d;
  61.    color: #fff;
  62.     transition: opacity 0.3s ease;
  63. }
  64.  
  65. #gform_submit_button_1:hover {
  66.     opacity: 0.8;
  67. }
  68.  
  69. #input_1_1 li,
  70. #input_1_2 li,
  71. #input_1_3 li,
  72. #input_1_4 li,
  73. #input_1_5 li
  74. {
  75.     display: inline-block;
  76.     margin-right: 40px;
  77. }
  78.  
  79. @media only screen and (max-width: 1024px) {
  80. #input_1_1 .gravity_wrap_input,
  81. #input_1_2 .gravity_wrap_input,
  82. #input_1_3 .gravity_wrap_input,
  83. #input_1_4 .gravity_wrap_input,
  84. #input_1_5 .gravity_wrap_input {
  85.     display: inline-block;
  86. }
  87. }
  88.  
  89. @media only screen and (max-width: 760px) {
  90. #input_1_3 label {
  91.     min-height: 279px;
  92. }
  93.  
  94. #input_1_4 label {
  95.     min-height: 258px;
  96. }
  97.  
  98. #input_1_5 label {
  99.     min-height: 216px;
  100. }
  101.  
  102. #field_1_9,
  103. #field_1_10,
  104. #field_1_11 {
  105.     max-width: 100%;
  106. }
  107. }
  108.  
  109. .gform_wrapper .gfield_radio li label {
  110.     max-width: 100%;
  111. }
  112.  
  113. body .gform_wrapper ul li.gfield {
  114.     padding-top: 40px;
  115. }
  116. </style>';
  117.     }
  118.    
  119.      if ( $form_id == 1 && $field->id == 2 ) {
  120.         $input = '<ul class="gfield_radio" id="input_1_2"><li class="gchoice_1_2_0"><input name="input_2" type="radio" value="Классический" id="choice_1_2_0" tabindex="1"><label for="choice_1_2_0" id="label_1_2_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/classic.jpg"> <div>Классический</div></label></li><li class="gchoice_1_2_1"><input name="input_2" type="radio" value="Арт Деко" id="choice_1_2_1" tabindex="2"><label for="choice_1_2_1" id="label_1_2_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/art-deco.jpg"> <div>Арт Деко</div></label></li><li class="gchoice_1_2_2"><input name="input_2" type="radio" value="Модерн" id="choice_1_2_2" tabindex="3"><label for="choice_1_2_2" id="label_1_2_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/modern.jpg"> <div>Модерн</div></label></li><li class="gchoice_1_2_3"><input name="input_2" type="radio" value="Современная классика" id="choice_1_2_3" tabindex="4"><label for="choice_1_2_3" id="label_1_2_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/sovr-classic.jpg"> <div>Современная классика</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_2_4"><input name="input_2" type="radio" value="Прованс" id="choice_1_2_4" tabindex="5"><label for="choice_1_2_4" id="label_1_2_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/provans.jpg"> <div>Прованс</div></label></li><li class="gchoice_1_2_5"><input name="input_2" type="radio" value="Винтаж" id="choice_1_2_5" tabindex="6"><label for="choice_1_2_5" id="label_1_2_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/vintage.jpg"> <div>Винтаж</div></label></li><li class="gchoice_1_2_6"><input name="input_2" type="radio" value="Урбан/Индастриал" id="choice_1_2_6" tabindex="7"><label for="choice_1_2_6" id="label_1_2_6"><img src="http://canticucine.ru/wp-content/uploads/2018/04/Urban.jpg"> <div>Урбан/Индастриал</div></label></li><li class="gchoice_1_2_7"><input name="input_2" type="radio" value="Еще не знаю" id="choice_1_2_7" tabindex="8"><label for="choice_1_2_7" id="label_1_2_7"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
  121.      }
  122.    
  123.     if ( $form_id == 1 && $field->id == 3 ) {
  124.         $input = '<ul class="gfield_radio" id="input_1_3"><li class="gchoice_1_3_0"><input name="input_3" type="radio" value="Шпон дерева. Покрытие тонким слоем натурального дерева ценных пород." id="choice_1_3_0" tabindex="1"><label for="choice_1_3_0" id="label_1_3_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1.jpg"> <div>Шпон дерева. Покрытие тонким слоем натурального дерева ценных пород.</div></label></li><li class="gchoice_1_3_1"><input name="input_3" type="radio" value="Массив дерева. Эксклюзивно и экологично" id="choice_1_3_1" tabindex="2"><label for="choice_1_3_1" id="label_1_3_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2.jpg"> <div>Массив дерева. Эксклюзивно и экологично</div></label></li><li class="gchoice_1_3_2"><input name="input_3" type="radio" value="Шпон натурального камня." id="choice_1_3_2" tabindex="3"><label for="choice_1_3_2" id="label_1_3_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3.jpg"> <div>Шпон натурального камня.</div></label></li><li class="gchoice_1_3_3"><input name="input_3" type="radio" value="Металлизированная краска." id="choice_1_3_3" tabindex="4"><label for="choice_1_3_3" id="label_1_3_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/4.jpg"> <div>Металлизированная краска.</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_3_4"><input name="input_3" type="radio" value="Нержавейка. Экологично, практично, брутально." id="choice_1_3_4" tabindex="5"><label for="choice_1_3_4" id="label_1_3_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5.jpg"> <div>Нержавейка. Экологично, практично, брутально.</div></label></li><li class="gchoice_1_3_5"><input name="input_3" type="radio" value="Экошпон, акрилы, нано-пластики. Иновационные износостойкие материалы." id="choice_1_3_5" tabindex="6"><label for="choice_1_3_5" id="label_1_3_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/6.jpg"> <div>Экошпон, акрилы, нано-пластики. Иновационные износостойкие материалы.</div></label></li><li class="gchoice_1_3_6"><input name="input_3" type="radio" value="Мдф покрытое эмалью. Несколько слоёв краски +несколько слоёв лака-автомобильная технология." id="choice_1_3_6" tabindex="7"><label for="choice_1_3_6" id="label_1_3_6"><img src="http://canticucine.ru/wp-content/uploads/2018/04/7.jpg"> <div>Мдф покрытое эмалью. Несколько слоёв краски +несколько слоёв лака-автомобильная технология.</div></label></li><li class="gchoice_1_3_7"><input name="input_3" type="radio" value="Мдф в пленке. Демократичная цена. Различный дизайн." id="choice_1_3_7" tabindex="8"><label for="choice_1_3_7" id="label_1_3_7"><img src="http://canticucine.ru/wp-content/uploads/2018/04/8.jpg"> <div>Мдф в пленке. Демократичная цена. Различный дизайн.</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_3_8"><input name="input_3" type="radio" value="Еще не знаю" id="choice_1_3_8" tabindex="9"><label for="choice_1_3_8" id="label_1_3_8"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
  125.      }
  126.    
  127.     if ( $form_id == 1 && $field->id == 4 ) {
  128.         $input = '<ul class="gfield_radio" id="input_1_4"><li class="gchoice_1_4_0"><input name="input_4" type="radio" value="ДСП пластик - влагостойкая, огромный выбор, самое популярное" id="choice_1_4_0" tabindex="1"><label for="choice_1_4_0" id="label_1_4_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1-1.jpg"> <div>ДСП пластик - влагостойкая, огромный выбор, самое популярное</div></label></li><li class="gchoice_1_4_1"><input name="input_4" type="radio" value="Дерево с пропиткой - требовательно к обслуживанию" id="choice_1_4_1" tabindex="2"><label for="choice_1_4_1" id="label_1_4_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2-1.jpg"> <div>Дерево с пропиткой - требовательно к обслуживанию</div></label></li><li class="gchoice_1_4_2"><input name="input_4" type="radio" value="Искусственный камень (средняя стоимость и дорого) - долговечно и огромный выбор цветов" id="choice_1_4_2" tabindex="3"><label for="choice_1_4_2" id="label_1_4_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3-1.jpg"> <div>Искусственный камень (средняя стоимость и дорого) - долговечно и огромный выбор цветов</div></label></li><div class="gravity_wrap_input"></div><li class="gchoice_1_4_3"><input name="input_4" type="radio" value="Кварцит. Наиболее прочный и долговечный. На наш взгляд лучший материал для столешниц" id="choice_1_4_3" tabindex="4"><label for="choice_1_4_3" id="label_1_4_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/9.jpg"> <div>Кварцит. Наиболее прочный и долговечный. На наш взгляд лучший материал для столешниц</div></label></li><li class="gchoice_1_4_4"><input name="input_4" type="radio" value="Нержавейка" id="choice_1_4_4" tabindex="5"><label for="choice_1_4_4" id="label_1_4_4"><img src="http://canticucine.ru/wp-content/uploads/2018/04/5-1.jpg"> <div>Нержавейка</div></label></li><li class="gchoice_1_4_5"><input name="input_4" type="radio" value="Еще не знаю" id="choice_1_4_5" tabindex="6"><label for="choice_1_4_5" id="label_1_4_5"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
  129.      }
  130.    
  131.     if ( $form_id == 1 && $field->id == 5 ) {
  132.         $input = '<ul class="gfield_radio" id="input_1_5"><li class="gchoice_1_5_0"><input name="input_5" type="radio" value="Без панели" id="choice_1_5_0" tabindex="1"><label for="choice_1_5_0" id="label_1_5_0"><img src="http://canticucine.ru/wp-content/uploads/2018/04/1-2.jpg"> <div>Без панели</div></label></li><li class="gchoice_1_5_1"><input name="input_5" type="radio" value="Фотопечать" id="choice_1_5_1" tabindex="2"><label for="choice_1_5_1" id="label_1_5_1"><img src="http://canticucine.ru/wp-content/uploads/2018/04/2-2.jpg"> <div>Фотопечать</div></label></li><li class="gchoice_1_5_2"><input name="input_5" type="radio" value="Из материала столещницы" id="choice_1_5_2" tabindex="3"><label for="choice_1_5_2" id="label_1_5_2"><img src="http://canticucine.ru/wp-content/uploads/2018/04/3-2.jpg"> <div>Из материала столещницы</div></label></li><li class="gchoice_1_5_3"><input name="input_5" type="radio" value="Еще не знаю" id="choice_1_5_3" tabindex="4"><label for="choice_1_5_3" id="label_1_5_3"><img src="http://canticucine.ru/wp-content/uploads/2018/04/none-1.jpg"> <div>Еще не знаю</div></label></li></ul>';
  133.      }
  134.    
  135.     return $input;
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement