1 | <?php |
||
21 | class FieldSettings extends AbstractFormzConfiguration |
||
22 | { |
||
23 | use ParentsTrait; |
||
24 | |||
25 | const FIELD_MARKER = '#FIELD#'; |
||
26 | |||
27 | /** |
||
28 | * CSS selector to get the container of the field. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $fieldContainerSelector; |
||
33 | |||
34 | /** |
||
35 | * CSS selector to get the error container of the parent field. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $messageContainerSelector; |
||
40 | |||
41 | /** |
||
42 | * CSS selector to get the block element which will contain all the |
||
43 | * messages. It must be a child element of `$messageContainerSelector`. If |
||
44 | * the value is empty, then `$messageContainerSelector` is considered to be |
||
45 | * both the container and the block element. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $messageListSelector; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $messageTemplate; |
||
55 | |||
56 | /** |
||
57 | * @return string |
||
58 | */ |
||
59 | public function getFieldContainerSelector() |
||
63 | |||
64 | /** |
||
65 | * @param string $selector |
||
66 | */ |
||
67 | public function setFieldContainerSelector($selector) |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getMessageContainerSelector() |
||
79 | |||
80 | /** |
||
81 | * @param string $selector |
||
82 | */ |
||
83 | public function setMessageContainerSelector($selector) |
||
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getMessageListSelector() |
||
95 | |||
96 | /** |
||
97 | * @param string $messageListSelector |
||
98 | */ |
||
99 | public function setMessageListSelector($messageListSelector) |
||
103 | |||
104 | /** |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getMessageTemplate() |
||
111 | |||
112 | /** |
||
113 | * @param string $messageTemplate |
||
114 | */ |
||
115 | public function setMessageTemplate($messageTemplate) |
||
119 | |||
120 | /** |
||
121 | * @param string $selector |
||
122 | * @return string |
||
123 | */ |
||
124 | protected function formatSelector($selector) |
||
134 | |||
135 | /** |
||
136 | * This function will do the following: first, it will check if the wanted |
||
137 | * property is set in this class instance (not null), then it returns it. If |
||
138 | * the value is null, it will fetch the global FormZ configuration settings, |
||
139 | * and return the default value for the asked property. |
||
140 | * |
||
141 | * Example: |
||
142 | * config.tx_formz.forms.My\Custom\Form.fields.myField.settings.fieldContainerSelector is null, then |
||
143 | * config.tx_formz.settings.defaultFieldSettings.fieldContainerSelector is returned |
||
144 | * |
||
145 | * @param string $propertyName Name of the wanted class property. |
||
146 | * @return mixed|null |
||
147 | */ |
||
148 | private function getSettingsProperty($propertyName) |
||
166 | |||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | private function getFieldName() |
||
179 | } |
||
180 |