Advertisement
Konark

Untitled

Apr 17th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.92 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 образная форма" checked="checked" 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"><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></div></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. max-width: 172px;
  24. }
  25.  
  26. #input_1_1 li,
  27. #input_1_2 li,
  28. #input_1_3 li
  29. {
  30. float: left;
  31. margin-right: 40px;
  32. }
  33.  
  34. #input_1_1 .gravity_wrap_input,
  35. #input_1_2 .gravity_wrap_input,
  36. #input_1_3 .gravity_wrap_input {
  37. clear: both;
  38. }
  39.  
  40. .gform_wrapper .gfield_radio li label {
  41. max-width: 100%;
  42. }
  43. </style>';
  44. }
  45.  
  46. if ( $form_id == 1 && $field->id == 2 ) {
  47. $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"><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></div><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>';
  48. }
  49.  
  50. if ( $form_id == 1 && $field->id == 3 ) {
  51. $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"><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><div class="gravity_wrap_input"><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></div></ul>';
  52. }
  53. return $input;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement