BuildFormPlain.php 3.28 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
29
30
31
32
33
34
35
36
37
    public function fillWrap() {
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_START] = '<h3>';
        $this->wrap[WRAP_SETUP_TITLE][WRAP_SETUP_END] = '</h3>';

        $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] = '';
38
39
40
41

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

42
43
    }

44
45
46
    public function fillWrapLabelInputNote($label, $input, $note) {

    }
Carsten  Rose's avatar
Carsten Rose committed
47

Carsten  Rose's avatar
Carsten Rose committed
48
49
50
    /**
     * @return string
     */
51
52
53
54
    public function getProcessFilter() {
        return FORM_ELEMENTS_NATIVE;
    }

Carsten  Rose's avatar
Carsten Rose committed
55
56
57
    /**
     * @return string
     */
58
    public function doSubrecords() {
Carsten  Rose's avatar
Carsten Rose committed
59
60
61
        $json = array();
        //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);
62
63
    }

Carsten  Rose's avatar
Carsten Rose committed
64
65
66
67
68
69
    /**
     * @param $htmlFormElementId
     * @param $formElement
     * @param $value
     * @return string
     */
70
    public function buildRowNative(array $formElement, $htmlElement, $htmlFormElementId) {
71
72
73
        $html = '';

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

76
77
78

        if($formElement['nestedInFieldSet']==='no')
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START];
79
        $html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement[FE_LABEL]);
80
        $html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
81
        $html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE]);
82
83
        if($formElement['nestedInFieldSet']==='no')
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END];
84
85
86
87
88
89
90
91
92
93

        return $html;
    }

    /**
     * @return string
     */
    public function tail() {
        $html = '';

94
//        $html .= $this->buildNewSip();
95
96
97
98

        $html .= $this->wrapItem(WRAP_SETUP_INPUT, '<input type="submit" value="Submit">');
        $html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
        $html .= '</form>';
99
        $html .= '</div>'; // main <div class=...> around everything
100
101
102
103

        return $html;
    }

104

105
    public function buildRowPill(array $formElement, $elementHtml) {
106
107
108
        // TODO: Implement buildRowPill() method.
    }

109
    public function buildRowFieldset(array $formElement, $elementHtml) {
110
111
112
        // TODO: Implement buildRowFieldset() method.
    }

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