bit-form
/
includes
/
Frontend
/
Form
/
View
/
Conversational
/
Fields
/
ConversationalFieldHelpers.php
ConversationalFieldHelpers.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.10.0, at includes/Frontend/Form/View/Conversational/Fields/ConversationalFieldHelpers.php
| 1 | <?php |
| 2 | |
| 3 | namespace BitCode\BitForm\Frontend\Form\View\Conversational\Fields; |
| 4 | |
| 5 | use BitCode\BitForm\Frontend\Form\View\FieldHelpers; |
| 6 | |
| 7 | class ConversationalFieldHelpers extends FieldHelpers |
| 8 | { |
| 9 | private $_formId; |
| 10 | |
| 11 | public function __construct($formId, $field, $fk, $form_atomic_Cls_map = null) |
| 12 | { |
| 13 | parent::__construct($field, $fk, $form_atomic_Cls_map); |
| 14 | $this->_formId = $formId; |
| 15 | } |
| 16 | |
| 17 | public function getClassWithFieldKey($element) |
| 18 | { |
| 19 | $formId = $this->getFormId(); |
| 20 | $formId = !empty($formId) ? $formId : ''; |
| 21 | return "{$this->getFk()}-{$element}"; |
| 22 | } |
| 23 | |
| 24 | public function getConversationalCls($element) |
| 25 | { |
| 26 | $formId = $this->getFormId(); |
| 27 | $formId = !empty($formId) ? $formId : ''; |
| 28 | return "bc{$formId}-{$element}"; |
| 29 | } |
| 30 | |
| 31 | public function getConversationalMultiCls($element) |
| 32 | { |
| 33 | $conversationalCls = $this->getConversationalCls($element); |
| 34 | $clsWithFieldKey = $this->getClassWithFieldKey($element); |
| 35 | return "$conversationalCls $clsWithFieldKey"; |
| 36 | } |
| 37 | |
| 38 | // getter & setter function for $_formId |
| 39 | public function getFormId() |
| 40 | { |
| 41 | return $this->_formId; |
| 42 | } |
| 43 | |
| 44 | public function setFormId($formId) |
| 45 | { |
| 46 | $this->_formId = $formId; |
| 47 | } |
| 48 | } |
| 49 |