Advertisement
Konark

Untitled

Apr 18th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.58 KB | None | 0 0
  1. add_filter( 'gform_field_input', 'tracker', 10, 5 );
  2. function tracker( $input, $field, $value, $lead_id, $form_id ) {
  3. // because this will fire for every form/field, only do it when it is the specific form and field
  4. if ( $form_id == 1 && $field->id == 1 ) {
  5. $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) {
  6. position: relative;
  7. border-bottom: 1px solid #ccc;
  8. }
  9.  
  10. #input_1_1 label > div {
  11. position: absolute;
  12. bottom: 20px;
  13. left: 0;
  14. right: 0;
  15. text-align: center;
  16. }
  17.  
  18. #gform_fields_1 label > div {
  19. text-align: center;
  20. }
  21.  
  22. #input_1_3 label,
  23. #input_1_4 label,
  24. #input_1_5 label {
  25. max-width: 172px;
  26. }
  27.  
  28. #input_1_3 label {
  29. min-height: 279px;
  30. }
  31.  
  32. #input_1_4 label {
  33. min-height: 258px;
  34. }
  35.  
  36. #input_1_5 label {
  37. min-height: 216px;
  38. }
  39.  
  40. #field_1_9,
  41. #field_1_10,
  42. #field_1_11 {
  43. max-width: 259px;
  44. padding: 0 !important;
  45. }
  46.  
  47. #field_1_9 input,
  48. #field_1_10 input{
  49. width: 100%;
  50. }
  51.  
  52. #field_1_4 {
  53. padding-top: 0 !important;
  54. }
  55.  
  56. #gform_submit_button_1 {
  57. background-color: #373d4d;
  58. color: #fff;
  59. transition: opacity 0.3s ease;
  60. }
  61.  
  62. #gform_submit_button_1:hover {
  63. opacity: 0.8;
  64. }
  65.  
  66. #input_1_1 li,
  67. #input_1_2 li,
  68. #input_1_3 li,
  69. #input_1_4 li,
  70. #input_1_5 li
  71. {
  72. display: inline-block;
  73. margin-right: 40px;
  74. }
  75.  
  76. @media only screen and (max-width: 1024px) {
  77. #input_1_1 .gravity_wrap_input,
  78. #input_1_2 .gravity_wrap_input,
  79. #input_1_3 .gravity_wrap_input,
  80. #input_1_4 .gravity_wrap_input,
  81. #input_1_5 .gravity_wrap_input {
  82. display: inline-block;
  83. }
  84. }
  85.  
  86. @media only screen and (max-width: 760px) {
  87. #input_1_3 label {
  88. min-height: 279px;
  89. }
  90.  
  91. #input_1_4 label {
  92. min-height: 258px;
  93. }
  94.  
  95. #input_1_5 label {
  96. min-height: 216px;
  97. }
  98.  
  99. #field_1_9,
  100. #field_1_10,
  101. #field_1_11 {
  102. max-width: 100%;
  103. }
  104. }
  105.  
  106. .gform_wrapper .gfield_radio li label {
  107. max-width: 100%;
  108. }
  109.  
  110. body .gform_wrapper ul li.gfield {
  111. padding-top: 40px;
  112. }
  113. </style>';
  114. }
  115.  
  116. if ( $form_id == 1 && $field->id == 2 ) {
  117. $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>';
  118. }
  119.  
  120. if ( $form_id == 1 && $field->id == 3 ) {
  121. $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>';
  122. }
  123.  
  124. if ( $form_id == 1 && $field->id == 4 ) {
  125. $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/4-1.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>';
  126. }
  127.  
  128. if ( $form_id == 1 && $field->id == 5 ) {
  129. $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>';
  130. }
  131.  
  132. return $input;
  133. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement