| @@ -7,9 +7,9 @@ | ||
| 7 | 7 | use ComponentInitTrait; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * The unique name of the component. |
| 11 | - * | |
| 11 | + * | |
| 12 | 12 | * @return string |
| 13 | 13 | */ |
| 14 | 14 | abstract public function name(); |
| 15 | 15 | |
| @@ -14,9 +14,9 @@ | ||
| 14 | 14 | abstract public function name(); |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * The label of the component. |
| 18 | - * | |
| 18 | + * | |
| 19 | 19 | * @return string |
| 20 | 20 | */ |
| 21 | 21 | abstract public function label(); |
| 22 | 22 | |
| @@ -22,17 +22,17 @@ | ||
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * The element type of the component from already |
| 25 | 25 | * available elements (input_text, textarea e.t.c). |
| 26 | - * | |
| 26 | + * | |
| 27 | 27 | * @return string |
| 28 | 28 | */ |
| 29 | 29 | abstract public function element(); |
| 30 | - | |
| 30 | + | |
| 31 | 31 | /** |
| 32 | 32 | * The template type of the component to display preview in editor dropzone from |
| 33 | 33 | * already available templates (inputText, selectCountry, addressFields e.t.c). |
| 34 | - * | |
| 34 | + * | |
| 35 | 35 | * @return string |
| 36 | 36 | */ |
| 37 | 37 | abstract public function template(); |
| 38 | 38 | |
| @@ -37,12 +37,12 @@ | ||
| 37 | 37 | abstract public function template(); |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Render the element on frontend form. |
| 41 | - * | |
| 42 | - * @param array $component Element Config | |
| 43 | - * @param object $form The Form Object | |
| 44 | - * | |
| 41 | + * | |
| 42 | + * @param array $component Element Config | |
| 43 | + * @param object $form The Form Object | |
| 44 | + * | |
| 45 | 45 | * @return void |
| 46 | 46 | */ |
| 47 | 47 | abstract public function render($component, $form); |
| 48 | 48 | |
| @@ -47,13 +47,13 @@ | ||
| 47 | 47 | abstract public function render($component, $form); |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Form submission callback. |
| 51 | - * | |
| 52 | - * @param array $formData Submitted form data | |
| 53 | - * @param int $formId Submitted form id | |
| 54 | - * @param array $config Form elements config | |
| 55 | - * | |
| 51 | + * | |
| 52 | + * @param array $formData Submitted form data | |
| 53 | + * @param int $formId Submitted form id | |
| 54 | + * @param array $config Form elements config | |
| 55 | + * | |
| 56 | 56 | * @return array $formData |
| 57 | 57 | */ |
| 58 | 58 | abstract public function onSubmit($formData, $formId, $config); |
| 59 | 59 | |
| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | /** |
| 61 | 61 | * Component position in editor. If null is returned then |
| 62 | 62 | * the element will be pushed at last but the derived class |
| 63 | 63 | * will override this method if any customization is needed. |
| 64 | - * | |
| 64 | + * | |
| 65 | 65 | * @return int|null |
| 66 | 66 | */ |
| 67 | 67 | public function index() |
| 68 | 68 | { |
| @@ -72,9 +72,9 @@ | ||
| 72 | 72 | /** |
| 73 | 73 | * The group, where the component should be added. By default, |
| 74 | 74 | * the element will be added in "general" group and the derived |
| 75 | 75 | * class will override this method if any customization is needed. |
| 76 | - * | |
| 76 | + * | |
| 77 | 77 | * @return string general|advanced|container |
| 78 | 78 | */ |
| 79 | 79 | public function group() |
| 80 | 80 | { |
| @@ -83,9 +83,9 @@ | ||
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * The element icon class for the component to display in the button in |
| 86 | 86 | * the editor element list which is mapped to editor_options.icon_class. |
| 87 | - * | |
| 87 | + * | |
| 88 | 88 | * @return string |
| 89 | 89 | */ |
| 90 | 90 | public function elementIconClass() |
| 91 | 91 | { |
| @@ -95,9 +95,10 @@ | ||
| 95 | 95 | /** |
| 96 | 96 | * Element editor/form attributes and the derived class will |
| 97 | 97 | * override this method if any customization is needed. |
| 98 | 98 | * |
| 99 | - * @param array $dafault | |
| 99 | + * @param array $dafault | |
| 100 | + * | |
| 100 | 101 | * @return array $default |
| 101 | 102 | */ |
| 102 | 103 | public function attributes($default) |
| 103 | 104 | { |
| @@ -106,10 +107,11 @@ | ||
| 106 | 107 | |
| 107 | 108 | /** |
| 108 | 109 | * Element editor settings and the derived class will |
| 109 | 110 | * override this method if any customization is needed. |
| 110 | - * | |
| 111 | - * @param array $dafault | |
| 111 | + * | |
| 112 | + * @param array $dafault | |
| 113 | + * | |
| 112 | 114 | * @return array $default |
| 113 | 115 | */ |
| 114 | 116 | public function settings($default) |
| 115 | 117 | { |
| @@ -114,14 +116,15 @@ | ||
| 114 | 116 | public function settings($default) |
| 115 | 117 | { |
| 116 | 118 | return $default; |
| 117 | 119 | } |
| 118 | - | |
| 120 | + | |
| 119 | 121 | /** |
| 120 | 122 | * Element editor options and the derived class will |
| 121 | 123 | * override this method if any customization is needed. |
| 122 | - * | |
| 123 | - * @param array $dafault | |
| 124 | + * | |
| 125 | + * @param array $dafault | |
| 126 | + * | |
| 124 | 127 | * @return array $default |
| 125 | 128 | */ |
| 126 | 129 | public function options($default) |
| 127 | 130 | { |
| @@ -126,13 +129,13 @@ | ||
| 126 | 129 | public function options($default) |
| 127 | 130 | { |
| 128 | 131 | return $default; |
| 129 | 132 | } |
| 130 | - | |
| 133 | + | |
| 131 | 134 | /** |
| 132 | 135 | * Element's form submission validation rules and the derived |
| 133 | 136 | * class will override this method if needed any customization. |
| 134 | - * | |
| 137 | + * | |
| 135 | 138 | * @return array |
| 136 | 139 | */ |
| 137 | 140 | public function validationRules() |
| 138 | 141 | { |
| @@ -137,14 +140,15 @@ | ||
| 137 | 140 | public function validationRules() |
| 138 | 141 | { |
| 139 | 142 | return []; |
| 140 | 143 | } |
| 141 | - | |
| 144 | + | |
| 142 | 145 | /** |
| 143 | 146 | * Element editor placement settings and the derived class |
| 144 | 147 | * will override this method if any customization is needed. |
| 145 | - * | |
| 148 | + * | |
| 146 | 149 | * @param array $placemenSettings |
| 150 | + * | |
| 147 | 151 | * @return array $placemenSettings |
| 148 | 152 | */ |
| 149 | 153 | public function placementSettings($placemenSettings) |
| 150 | 154 | { |
| @@ -153,10 +157,11 @@ | ||
| 153 | 157 | |
| 154 | 158 | /** |
| 155 | 159 | * The customization for the component and derived class can |
| 156 | 160 | * override this method if any customization is needed. |
| 157 | - * | |
| 158 | - * @param array $customizationSettings | |
| 161 | + * | |
| 162 | + * @param array $customizationSettings | |
| 163 | + * | |
| 159 | 164 | * @return array $customizationSettings |
| 160 | 165 | */ |
| 161 | 166 | public function customizationSettings($customizationSettings) |
| 162 | 167 | { |
| @@ -166,16 +171,17 @@ | ||
| 166 | 171 | /** |
| 167 | 172 | * Add the component type in fluentform field types to |
| 168 | 173 | * be available in FormFieldParser and derived class can |
| 169 | 174 | * override this method if any customization is needed. |
| 170 | - * | |
| 171 | - * @param array $types | |
| 175 | + * | |
| 176 | + * @param array $types | |
| 177 | + * | |
| 172 | 178 | * @return array $types |
| 173 | 179 | */ |
| 174 | 180 | public function addType($types) |
| 175 | 181 | { |
| 176 | 182 | $types[] = $this->name(); |
| 177 | - | |
| 183 | + | |
| 178 | 184 | return $types; |
| 179 | 185 | } |
| 180 | 186 | |
| 181 | 187 | /** |
| @@ -180,9 +186,9 @@ | ||
| 180 | 186 | |
| 181 | 187 | /** |
| 182 | 188 | * The keywords to search the element in the editor and |
| 183 | 189 | * the derived class will override this method if needed. |
| 184 | - * | |
| 190 | + * | |
| 185 | 191 | * @return array |
| 186 | 192 | */ |
| 187 | 193 | public function searchBy() |
| 188 | 194 | { |
| @@ -190,17 +196,18 @@ | ||
| 190 | 196 | } |
| 191 | 197 | |
| 192 | 198 | /** |
| 193 | 199 | * Transform the element's submitted value saved in database |
| 194 | - * to show it properly/formatted in entry page if needed and | |
| 200 | + * to show it properly/formatted in entry page if needed and | |
| 195 | 201 | * this method implementation optional so a default method is |
| 196 | 202 | * implemented here and original value is returned. In any case |
| 197 | 203 | * if any customization of the value is needed then the derived |
| 198 | 204 | * class will override it and will format and return the the value. |
| 199 | - * | |
| 200 | - * @param mixed $value [description] | |
| 201 | - * @param string $field | |
| 202 | - * @param int $formId | |
| 205 | + * | |
| 206 | + * @param mixed $value [description] | |
| 207 | + * @param string $field | |
| 208 | + * @param int $formId | |
| 209 | + * | |
| 203 | 210 | * @return mixed $value |
| 204 | 211 | */ |
| 205 | 212 | public function formatEntryValue($value, $field, $formId) |
| 206 | 213 | { |