BuildFormPlain.php 3.68 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 1/25/16
 * Time: 9:46 PM
 */

namespace qfq;

use qfq;

require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/AbstractBuildForm.php');

Carsten  Rose's avatar
Carsten Rose committed
16
17
18
19
/**
 * Class BuildFormPlain
 * @package qfq
 */
20
21
class BuildFormPlain extends AbstractBuildForm {

Carsten  Rose's avatar
Carsten Rose committed
22
23
24
    /**
     *
     */
25
26
27
28
    public function fillWrap() {
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_START] = '<h3>';
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_END] = '</h3>';

29
        $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_CLASS] = '';
30
31
32
33
34
35
36
37
38
        $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START] = '<p>';
        $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END] = '</p>';

        $this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_START] = '';
        $this->wrap[WRAP_SETUP_LABEL][WRAP_SETUP_END] = '';
        $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_START] = '';
        $this->wrap[WRAP_SETUP_INPUT][WRAP_SETUP_END] = '';
        $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_START] = '';
        $this->wrap[WRAP_SETUP_NOTE][WRAP_SETUP_END] = '';
39
40
41
42

        $this->wrap[WRAP_SETUP_IN_FIELDSET][WRAP_SETUP_START] = '<p>';
        $this->wrap[WRAP_SETUP_IN_FIELDSET][WRAP_SETUP_END] = '</p>';

43
44
45
        $this->wrap[WRAP_SETUP_IN_TEMPLATE_GROUP][WRAP_SETUP_START] = "";
        $this->wrap[WRAP_SETUP_IN_TEMPLATE_GROUP][WRAP_SETUP_END] = "";

46
47
    }

48
49
50
    public function fillWrapLabelInputNote($label, $input, $note) {

    }
Carsten  Rose's avatar
Carsten Rose committed
51

Carsten  Rose's avatar
Carsten Rose committed
52
53
54
    /**
     * @return string
     */
55
56
57
58
    public function getProcessFilter() {
        return FORM_ELEMENTS_NATIVE;
    }

Carsten  Rose's avatar
Carsten Rose committed
59
60
61
    /**
     * @return string
     */
62
    public function doSubrecords() {
Carsten  Rose's avatar
Carsten Rose committed
63
        $json = array();
Carsten  Rose's avatar
Carsten Rose committed
64

Carsten  Rose's avatar
Carsten Rose committed
65
66
        //TODO: $json is not returned - which is wrong. In this case, dynamic update won't work for subrecords
        return $this->elements($this->store->getVar(SIP_RECORD_ID, STORE_SIP), FORM_ELEMENTS_SUBRECORD, $json);
67
68
    }

Carsten  Rose's avatar
Carsten Rose committed
69
    /**
70
     * @param $htmlFormElementName
Carsten  Rose's avatar
Carsten Rose committed
71
72
     * @param $formElement
     * @param $value
Carsten  Rose's avatar
Carsten Rose committed
73
     *
Carsten  Rose's avatar
Carsten Rose committed
74
75
     * @return string
     */
76
    public function buildRowNative(array $formElement, $htmlElement, $htmlFormElementName) {
77
78
79
        $html = '';

        // Construct Marshaller Name
80
//        $buildElementFunctionName = 'build' . $this->buildElementFunctionName[$formElement[FE_TYPE]];
81

82

Carsten  Rose's avatar
Carsten Rose committed
83
        if ($formElement['nestedInFieldSet'] === 'no') {
84
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START];
85
        }
86
        $html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement[FE_LABEL]);
87
        $html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
88
        $html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE]);
Carsten  Rose's avatar
Carsten Rose committed
89
        if ($formElement['nestedInFieldSet'] === 'no') {
90
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END];
91
        }
92
93
94
95
96
97
98

        return $html;
    }

    /**
     * @return string
     */
99
    public function tail($flagFabric = false) {
100
101
        $html = '';

102
//        $html .= $this->buildNewSip();
103
104
105
106

        $html .= $this->wrapItem(WRAP_SETUP_INPUT, '<input type="submit" value="Submit">');
        $html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
        $html .= '</form>';
107
        $html .= '</div>'; // main <div class=...> around everything
108
109
110
111

        return $html;
    }

112

113
    public function buildRowPill(array $formElement, $elementHtml) {
114
115
116
        // TODO: Implement buildRowPill() method.
    }

117
    public function buildRowFieldset(array $formElement, $elementHtml) {
118
119
120
        // TODO: Implement buildRowFieldset() method.
    }

121
122
123
124
    public function buildRowTemplateGroup(array $formElement, $elementHtml) {
        // TODO: Implement buildRowTemplate() method.
    }

125
    public function buildRowSubrecord(array $formElement, $elementHtml) {
126
127
        // TODO: Implement buildRowSubrecord() method.
    }
128
}