PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.40
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.40
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / FormBuilder / Components / TermsAndConditions.php

TermsAndConditions.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.6.40, at app/Services/FormBuilder/Components/TermsAndConditions.php

55 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Services\FormBuilder\Components;
4
5 class TermsAndConditions extends BaseComponent
6 {
7 /**
8 * Compile and echo the html element
9 * @param array $data [element data]
10 * @param stdClass $form [Form Object]
11 * @return viod
12 */
13 public function compile($data, $form)
14 {
15 $elementName = $data['element'];
16 $data = apply_filters('fluenform_rendering_field_data_' . $elementName, $data, $form);
17
18 $hasConditions = $this->hasConditions($data) ? 'has-conditions ' : '';
19
20 $cls = trim(
21 $this->getDefaultContainerClass()
22 . ' ' . @$data['settings']['container_class']
23 . ' ' . $hasConditions
24 .' ff-el-input--content'
25 );
26
27 $uniqueId = $this->getUniqueId($data['attributes']['name']);
28
29 $data['attributes']['id'] = $uniqueId;
30 $data['attributes']['class'] = trim(
31 'ff-el-form-check-input ' .
32 $data['attributes']['class']
33 );
34
35 if($tabIndex = \FluentForm\App\Helpers\Helper::getNextTabIndex()) {
36 $data['attributes']['tabindex'] = $tabIndex;
37 }
38
39 $atts = $this->buildAttributes($data['attributes']);
40 $checkbox = '';
41 if ($data['settings']['has_checkbox']) {
42 $checkbox = "<span class='ff_tc_checkbox'><input {$atts} value='on'></span>";
43 }
44
45 $html = "<div class='{$cls}'>";
46 $html .= "<div class='ff-el-form-check ff-el-tc'>";
47 $html .= "<label class='ff-el-form-check-label ff_tc_label' for={$uniqueId}>";
48 $html .= "{$checkbox} <div class='ff_t_c'>{$data['settings']['tnc_html']}</div>";
49 $html .= "</label>";
50 $html .= "</div>";
51 $html .= "</div>";
52 echo apply_filters('fluenform_rendering_field_html_'.$elementName, $html, $data, $form);
53 }
54 }
55