BuildFormBootstrap.php 19.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 1/25/16
 * Time: 10:00 PM
 */

namespace qfq;

use qfq;
12
use qfq\UserFormException;
13
14

require_once(__DIR__ . '/../qfq/Constants.php');
15
require_once(__DIR__ . '/../qfq/helper/OnArray.php');
16
require_once(__DIR__ . '/../qfq/AbstractBuildForm.php');
17
require_once(__DIR__ . '/../qfq/exceptions/UserFormException.php');
18

Carsten  Rose's avatar
Carsten Rose committed
19
20
21
22
/**
 * Class BuildFormBootstrap
 * @package qfq
 */
23
24
class BuildFormBootstrap extends AbstractBuildForm {

25
26
27
28
29
30
31
32
33
34
    private $isFirstPill;

    /**
     * @param array $formSpec
     * @param array $feSpecAction
     * @param array $feSpecNative
     */
    public function __construct(array $formSpec, array $feSpecAction, array $feSpecNative) {
        parent::__construct($formSpec, $feSpecAction, $feSpecNative);
        $this->isFirstPill = true;
35
36

        // Set some defaults
37
38
39
//        if (!isset($this->formSpec['class'])) {
//            $this->formSpec['class'] = 'container';
//        }
Carsten  Rose's avatar
Carsten Rose committed
40

41
//        $this->formSpec['class'] = 'none';
42
43
    }

Carsten  Rose's avatar
Carsten Rose committed
44
45
46
    /**
     *
     */
47
    public function fillWrap() {
48
49
50
51

//        $this->wrap[WRAP_SETUP_OUTER][WRAP_SETUP_START] = '<div class="tab-content">';
//        $this->wrap[WRAP_SETUP_OUTER][WRAP_SETUP_END] = '</div>';

52
53
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_START] = "<div class='row hidden-xs'><div class='col-md-12'><h1>";
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_END] = "</h1></div></div>";
54

55
        // Element: Label + Input + Note
56
57
        $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START] = "<div class='form-group'>";
        $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END] = "</div>";
58

59
60
        $this->wrap[WRAP_SETUP_SUBRECORD][WRAP_SETUP_START] = "<div class='col-md-12'>";
        $this->wrap[WRAP_SETUP_SUBRECORD][WRAP_SETUP_END] = "</div>";
61

62
63
        $this->wrap[WRAP_SETUP_IN_FIELDSET][WRAP_SETUP_START] = "";
        $this->wrap[WRAP_SETUP_IN_FIELDSET][WRAP_SETUP_END] = "";
64

65
66
67
        $this->wrap[WRAP_SETUP_IN_TEMPLATE_GROUP][WRAP_SETUP_START] = "";
        $this->wrap[WRAP_SETUP_IN_TEMPLATE_GROUP][WRAP_SETUP_END] = "";

68
69
//        $this->feDivClass['radio'] = 'radio';
//        $this->feDivClass['checkbox'] = 'checkbox';
70
71
    }

72
73
74
75
76
77
    /**
     * @param $label
     * @param $input
     * @param $note
     */
    public function fillWrapLabelInputNote($label, $input, $note) {
78
        $this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_START] = "<div class='col-md-$label qfq-label'>";
79
80
81
82
83
84
85
86
        $this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_END] = "</div>";
        $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_START] = "<div class='col-md-$input'>";
        $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_END] = "</div>";
        $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_START] = "<div class='col-md-$note'>";
        $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_END] = "</div>";

    }

Carsten  Rose's avatar
Carsten Rose committed
87
88
89
    /**
     * @return string
     */
90
91
92
93
    public function getProcessFilter() {
        return FORM_ELEMENTS_NATIVE_SUBRECORD;
    }

Carsten  Rose's avatar
Carsten Rose committed
94
95
96
    /**
     * @return string
     */
97
98
99
100
101
102
103
104
    public function doSubrecords() {
        return '';
    }

    /**
     * @return string
     */
    public function head() {
105
        $html = '';
106

107
        $html .= '<div ' . Support::doAttribute('class', $this->formSpec[F_CLASS], TRUE) . '>'; // main <div class=...> around everything, Whole FORM; class="container" or class="container-fluid"
108

109
110
111
        $title = Support::wrapTag('<div class="hidden-xs col-sm-6 col-md-8">', Support::wrapTag('<h3>', $this->formSpec['title']));
        $button = Support::wrapTag('<div class="col-xs-12 col-sm-6 col-md-4">', $this->buildButtons());
        $html .= Support::wrapTag('<div class="row">', $title . $button);
112
113


114
115
        $pill = $this->buildPillNavigation(OnArray::filter($this->feSpecNative, 'type', 'pill'));
        $html .= Support::wrapTag('<div class="row">', $pill);
116

117
118
        $html .= $this->getFormTag();

119
120
121
        //TODO: Problem fuer Forms ohne Pils
        $html .= '<div class="tab-content ' . $this->formSpec[F_CLASS_BODY] . '">';
//        $html .= '<div class="col-md-12 ' . $this->formSpec[F_CLASS_BODY] . '">';
122
123
124
125

        return $html;
    }

126
    /**
127
     * Build Buttons panel on top right corner of form.
128
     * Simulate Submit Button: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
129
130
131
132
133
     *
     * @return string
     */
    private function buildButtons() {
        $buttonNew = '';
134
135
136
137
        $buttonDelete = '';
        $buttonClose = '';
        $buttonSave = '';
        $buttonEditForm = '';
Carsten  Rose's avatar
Carsten Rose committed
138
139
140
141
142
        $recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP);


        // Button: FormEdit
        if ($this->showDebugInfo) {
143
144
145
            $toolTip = "Edit form" . PHP_EOL . PHP_EOL . OnArray::toString($this->store->getStore(STORE_SIP), ' = ', PHP_EOL, "'");
            $url = $this->createFormEditUrl();

146
            $buttonEditForm = $this->buildButtonAnchor('form-edit-button', $url, $toolTip, GLYPH_ICON_TOOL);
147
148
149
        }

        // Button: Save
150
        if (Support::findInSet(FORM_BUTTON_SAVE, $this->formSpec['showButton']) && $this->formSpec[F_SUBMIT_BUTTON_TEXT] === '') {
151
152
153
            $toolTip = 'Save';

            if ($this->showDebugInfo) {
154
                $toolTip .= PHP_EOL . "table = '" . $this->formSpec[F_TABLE_NAME] . "'" . PHP_EOL . "r = '" . $recordId . "'";
155
156
            }

157
            $buttonSave = $this->buildButtonCode('save-button', $toolTip, GLYPH_ICON_CHECK, '', $this->formSpec[F_BUTTON_ON_CHANGE_CLASS]);
158
159
160
161
162
163
        }

        // Button: Close
        if (Support::findInSet(FORM_BUTTON_CLOSE, $this->formSpec['showButton'])) {
            $toolTip = 'Close';

164
            $buttonClose = $this->buildButtonCode('close-button', 'Close', GLYPH_ICON_CLOSE);
Carsten  Rose's avatar
Carsten Rose committed
165
        }
166

Carsten  Rose's avatar
Carsten Rose committed
167
        // Button: Delete
168
        if (Support::findInSet(FORM_BUTTON_DELETE, $this->formSpec['showButton'])) {
169
170
            $toolTip = 'Delete';

Carsten  Rose's avatar
Carsten Rose committed
171
            if ($this->showDebugInfo && $recordId > 0) {
172
                $toolTip .= PHP_EOL . "form = '" . $this->formSpec[F_FINAL_DELETE_FORM] . "'" . PHP_EOL . "r = '" . $recordId . "'";
Carsten  Rose's avatar
Carsten Rose committed
173
            }
174
            $disabled = ($recordId > 0) ? '' : 'disabled';
Carsten  Rose's avatar
Carsten Rose committed
175

176
            $buttonDelete = $this->buildButtonCode('delete-button', $toolTip, GLYPH_ICON_DELETE, $disabled);
177
178
        }

Carsten  Rose's avatar
Carsten Rose committed
179
        // Button: New
180
        if (Support::findInSet(FORM_BUTTON_NEW, $this->formSpec['showButton'])) {
181
182
            $toolTip = 'New';
            $url = $this->deriveNewRecordUrlFromExistingSip($toolTip);
Carsten  Rose's avatar
Carsten Rose committed
183

184
            $buttonNew = $this->buildButtonAnchor('form-new-button', $url, $toolTip, GLYPH_ICON_NEW);
185
186
        }

187
        // Arrangement: Edit Form / Save / Close / Delete / New
Carsten  Rose's avatar
Carsten Rose committed
188
        // Specified in reverse order cause 'pull-right' inverts the order. http://getbootstrap.com/css/#helper-classes-floats
189
190
191
192
193
        $html = '';
        $html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonNew);
        $html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonDelete);
        $html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonSave . $buttonClose);
        $html .= Support::wrapTag('<div class="btn-group pull-right" role="group">', $buttonEditForm);
194
195
196

        $html = Support::wrapTag('<div class="btn-toolbar" role="toolbar">', $html);

197
198
199
        return $html;
    }

200
201
202
203
204
205
206
207
208
    /**
     * @param $id
     * @param $url
     * @param $title
     * @param $icon
     * @param string $disabled
     * @return string
     */
    private function buildButtonAnchor($id, $url, $title, $icon, $disabled = '') {
209
        return "<a " . Support::doAttribute('href', $url) . " id='$id' class='btn btn-default navbar-btn $disabled' " . Support::doAttribute('title', $title) . "><span class='glyphicon $icon'></span></a>";
210
211
212
    }

    /**
213
214
     * Creates a button with the given attributes. If there is no $icon given, render the button without glyph.
     *
215
216
217
     * @param string $id
     * @param string $title
     * @param string $icon
218
219
220
     * @param string $disabled
     * @return string
     */
221
    private function buildButtonCode($id, $title, $icon, $disabled = '', $buttonOnChangeClass = '') {
222
223
224
225
226
227
228
229
230

        $element = "<span class='glyphicon $icon'></span>";
        $classAdd = "navbar-btn";

        if ($icon === '') {
            $element = $title;
            $classAdd = '';
        }

231
232
233
234
        $class = Support::doAttribute('class', ["btn btn-default", $classAdd]);
        $onChange = Support::doAttribute('data-class-on-change', $buttonOnChangeClass);
        $title = Support::doAttribute('title', $title);
        return "<button id='$id' type='button' $class $onChange $title $disabled>$element</button>";
235
236
    }

Carsten  Rose's avatar
Carsten Rose committed
237
    /**
238
     * @param $pillArray
Carsten  Rose's avatar
Carsten Rose committed
239
     * @return string
240
     * @throws UserFormException
Carsten  Rose's avatar
Carsten Rose committed
241
     */
242
243
244
    private function buildPillNavigation($pillArray) {
        $pillButton = '';
        $pillDropdown = '';
245
        $htmlDropdown = '';
246
247
248
249
250
251
252
253
254
255
256
257

        if ($pillArray == null)
            return '';

        $maxVisiblePill = (isset($this->formSpec['maxVisiblePill']) && $this->formSpec['maxVisiblePill'] !== '') ? $this->formSpec['maxVisiblePill'] : 1000;

        // Iterate over all 'pill'
        $ii = 0;
        $active = 'class="active"';
        foreach ($pillArray as $formElement) {
            $ii++;

258
            if ($formElement[FE_NAME] === '' || $formElement[FE_LABEL] === '') {
259
                $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($formElement), STORE_SYSTEM);
260
                $this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'name, label', STORE_SYSTEM);
261
                throw new UserFormException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
262
263
            }

264
            // Anker for pill navigation
265
            $a = '<a ' . Support::doAttribute('href', '#' . $this->createAnker($formElement['id'])) . ' data-toggle="tab">' . $formElement[FE_LABEL] . '</a>';
266

267
268
269
270
271
272
273
            if ($ii <= $maxVisiblePill) {
                $pillButton .= '<li role="presentation" ' . $active . '>' . $a . '</li>';
            } else {
                $pillDropdown .= '<li>' . $a . '</li>';
            }
            $active = '';
        }
274

275
276
        // Pill Dropdown necessary?
        if ($ii > $maxVisiblePill) {
277
            $htmlDropdown = Support::wrapTag('<ul class="dropdown-menu qfq-form-pill ' . $this->formSpec[F_CLASS_PILL] . '">', $pillDropdown, true);
278
            $htmlDropdown = '<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">more <span class="caret"></span></a>' . $htmlDropdown;
279
            $htmlDropdown = Support::wrapTag('<li role="presentation" class="dropdown">', $htmlDropdown, false);
280
        }
281

282
        $htmlDropdown = Support::wrapTag('<ul id="' . $this->getTabId() . '" class="nav nav-pills qfq-form-pill ' . $this->formSpec[F_CLASS_PILL] . '" role="tablist">', $pillButton . $htmlDropdown);
283
        $htmlDropdown = Support::wrapTag('<div class="col-md-12">', $htmlDropdown);
284

285
        return $htmlDropdown;
286
287
288
289
290
291
292
293
294
295
296
297
    }

    /**
     * Create an identifier for the pill navigation menu
     *
     * @param $id
     * @return string
     */
    private function createAnker($id) {
        return $this->formSpec['name'] . '_' . $id;
    }

Carsten  Rose's avatar
Carsten Rose committed
298
299
300
301
302
303
304
    /**
     * @return string
     */
    private function getTabId() {
        return 'qfqTabs';
    }

305
306
307
308
309
    /**
     * Builds the complete HTML '<form ...>'-tag
     *
     * @return string
     */
310
    public function getFormTag() {
311
312
313
314

        $attribute = $this->getFormTagAtrributes();

        $attribute['class'] = 'form-horizontal';
315
        $attribute['data-toggle'] = 'validator';
316
317
318
319

        return '<form ' . OnArray::toString($attribute, '=', ' ', "'") . '>';
    }

320
321
322
323
324
    /**
     * @return string
     */
    public function tail() {
        $html = '';
325
//        $html .= $this->buildNewSip();
Carsten  Rose's avatar
Carsten Rose committed
326
        $deleteUrl = '';
327

328
329
        $formId = $this->getFormId();

330
331
332
333
        // Button Save at bottom of form - only if there is a button text given.
        if ($this->formSpec[F_SUBMIT_BUTTON_TEXT] !== '') {
            $buttonText = $this->formSpec[F_SUBMIT_BUTTON_TEXT];

334
            $htmlElement = $this->buildButtonCode('save-button', $buttonText, '', '', $this->formSpec[F_BUTTON_ON_CHANGE_CLASS]);
335
336
337
338
339
340
341
342

            $html .= $this->wrapItem(WRAP_SETUP_LABEL, '');
            $html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
            $html .= $this->wrapItem(WRAP_SETUP_NOTE, '');

            $html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
        }

343
        $html .= '</div> <!--class="tab-content" -->';  //  <div class="tab-content">
344
//        $html .= '<input type="submit" value="Submit">';
345

Carsten  Rose's avatar
Carsten Rose committed
346
347
348
        $formId = $this->getFormId();
        $tabId = $this->getTabId();

Carsten  Rose's avatar
Carsten Rose committed
349
        if (0 < ($recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP))) {
350
            $deleteUrl = $this->createDeleteUrl($this->formSpec[F_FINAL_DELETE_FORM], '', $recordId);
Carsten  Rose's avatar
Carsten Rose committed
351
        }
352

353
354
355
        $actionUpload = FILE_ACTION . '=' . FILE_ACTION_UPLOAD;
        $actionDelete = FILE_ACTION . '=' . FILE_ACTION_DELETE;

356
357
358
        $apiDir = API_DIR;
        $apiDeletePhp = API_DIR . '/' . API_DELETE_PHP;

359
        $html .= '</form>';  //  <form class="form-horizontal" ...
360
361
362
363
364
365
        $html .= <<<EOF
        <script type="text/javascript">
            $(function () {
                'use strict';
                QfqNS.Log.level = 0;

Carsten  Rose's avatar
Carsten Rose committed
366
367
368
                var qfqPage = new QfqNS.QfqPage({
                    tabsId: '$tabId',
                    formId: '$formId',
369
                    submitTo: '$apiDir/save.php',
Carsten  Rose's avatar
Carsten Rose committed
370
                    deleteUrl: '$deleteUrl',
371
372
373
                    refreshUrl: '$apiDir/load.php',
                    fileUploadTo: '$apiDir/file.php?$actionUpload',
                    fileDeleteUrl: '$apiDir/file.php?$actionDelete'
Carsten  Rose's avatar
Carsten Rose committed
374
375
                });

376
                var qfqRecordList = new QfqNS.QfqRecordList('$apiDeletePhp');
Carsten  Rose's avatar
Carsten Rose committed
377
            })
378
379
         </script>
EOF;
380
        $html .= '</div>';  //  <div class="container-fluid"> === main <div class=...> around everything
381

382
383
384
385
386
387
388
389
390
        return $html;
    }

    /**
     * @param array $formElement
     * @param $htmlFormElementId
     * @param $value
     * @return mixed
     */
391
    public function buildPill(array $formElement, $htmlFormElementId, $value, array &$json) {
392
        $html = '';
393
394
395
396
        // save parent processed FE's
        $tmpStore = $this->feSpecNative;

        // child FE's
397
398
399
        $this->feSpecNative = $this->db->getNativeFormElements(SQL_FORM_ELEMENT_SPECIFIC_CONTAINER,
            ['yes', $this->formSpec["id"], 'native,container', $formElement['id']], $this->formSpec);

Carsten  Rose's avatar
Carsten Rose committed
400
        $html = $this->elements($this->store->getVar(SIP_RECORD_ID, STORE_SIP), FORM_ELEMENTS_NATIVE_SUBRECORD, 0, $json);
401
402
403
404

        // restore parent processed FE's
        $this->feSpecNative = $tmpStore;

405
406
407
        return $html;
    }

408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
    /**
     * @param array $formElement
     * @param string $htmlElement
     * @return string
     */
//    public function buildRowNative(array $formElement, $htmlElement, $htmlFormElementId) {
//        $html = '';
//
//        $htmlLabel = $this->buildLabel($htmlFormElementId, $formElement[FE_LABEL]);
//
//        $html .= $this->wrapItem(WRAP_SETUP_LABEL, $htmlLabel);
//        $html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
//        $html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE], true);
//
//        $html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
//
//        return $html;
//    }

427
    /**
428
429
     * @param array $formElement Complete FormElement, especially some FE_WRAP
     * @param string $htmlElement Content to wrap.
430
     * @param $htmlFormElementId
431
     * @return string               Wrapped $htmlElement
432
     * @throws \qfq\UserFormException
433
     */
434
    public function buildRowNative(array $formElement, $htmlElement, $htmlFormElementId) {
435
        $html = '';
436
        $htmlLabel = '';
437

438
439
        if ($formElement[FE_BS_LABEL_COLUMNS] > 0) {
            $htmlLabel = $this->buildLabel($htmlFormElementId, $formElement[FE_LABEL]);
440
        }
441

442
443
444
445
446
447
448
449
        $html .= $this->customWrap($formElement, $htmlLabel, FE_WRAP_LABEL, $formElement[FE_BS_LABEL_COLUMNS],
            [$this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_START], $this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_END]]);

        $html .= $this->customWrap($formElement, $htmlElement, FE_WRAP_INPUT, $formElement[FE_BS_INPUT_COLUMNS],
            [$this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_START], $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_END]]);

        $html .= $this->customWrap($formElement, $formElement[FE_NOTE], FE_WRAP_NOTE, $formElement[FE_BS_NOTE_COLUMNS],
            [$this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_START], $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_END]]);
450
451
452
453
454

        // ROW
        $openTag = (Support::findInSet('row', $formElement[FE_WRAP_ROW_LABEL_INPUT_NOW])) ? $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START] : '';
        $closeTag = (Support::findInSet('/row', $formElement[FE_WRAP_ROW_LABEL_INPUT_NOW])) ? $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END] : '';
        $html = $this->customWrap($formElement, $html, FE_WRAP_ROW, 99, [$openTag, $closeTag]);
455
456
457
458

        return $html;
    }

459
    /**
460
461
462
463
     *
     * @param array $formElement Complete FormElement, especially some FE_WRAP
     * @param string $htmlElement Content to wrap.
     * @param string $wrapName FE_WRAP_ROW, FE_WRAP_LABEL, FE_WRAP_INPUT, FE_WRAP_NOTE
464
     * @param int $bsColumns
465
     * @param array $wrapArray Systemwide Defaults: [ 'open wrap', 'close wrap' ]
466
     * @return string Wrapped $htmlElement
467
468
     * @throws \qfq\UserFormException
     */
469
470
471
472
473
474
    private function customWrap(array $formElement, $htmlElement, $wrapName, $bsColumns, array $wrapArray) {

        if ($bsColumns == 0) {
            $wrapArray[0] = '';
            $wrapArray[1] = '';
        }
475
476
477
478
479
480
481
482
483
484
485
486

        if (isset($formElement[$wrapName])) {
            $wrapArray = explode('|', $formElement[$wrapName], 2);
        }

        if (count($wrapArray) != 2) {
            throw new UserFormException("Need open & close wrap token for FormElement.parameter" . $wrapName . " - E.g.: <div ...>|</div>", ERROR_MISSING_VALUE);
        }

        return $wrapArray[0] . $htmlElement . $wrapArray[1];
    }

487
488
489
490
491
    /**
     * @param $formElement
     * @param $elementHtml
     * @return string
     */
492
    public function buildRowPill(array $formElement, $elementHtml) {
493
494
        $html = '';

495
        $html .= Support::wrapTag('<div class="col-md-12 qfq-form-body ' . $this->formSpec[F_CLASS_BODY] . '">', $elementHtml);
496
497
498

        $active = $this->isFirstPill ? ' active' : '';

499
        $html = Support::wrapTag('<div role="tabpanel" class="tab-pane' . $active . '" id="' . $this->createAnker($formElement['id']) . '">', $html);
500
501
502
503
504
505

        $this->isFirstPill = false;

        return $html;
    }

506
    /**
507
508
     * Builds a fieldset
     *
509
510
511
     * @param $formElement
     * @param $elementHtml
     */
512
    public function buildRowFieldset(array $formElement, $elementHtml) {
513
514
515
        $html = $elementHtml;

        return $html;
516
517
    }

518
519
520
521
522
523
524
525
526
527
528
529
    /**
     * Builds a templateGroup
     *
     * @param $formElement
     * @param $elementHtml
     */
    public function buildRowTemplateGroup(array $formElement, $elementHtml) {
        $html = $elementHtml;

        return $html;
    }

530
531
532
533
534
    /**
     * @param $formElement
     * @param $elementHtml
     * @return string
     */
535
    public function buildRowSubrecord(array $formElement, $elementHtml) {
536
        $html = '';
537
        $html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_LABEL]));
538
        $html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $elementHtml));
539
        $html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_NOTE]));
540
541
542

        return $html;
    }
543
}