BuildFormPlain.php 2.95 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
    }

Carsten  Rose's avatar
Carsten Rose committed
44
45
46
    /**
     * @return string
     */
47
48
49
50
    public function getProcessFilter() {
        return FORM_ELEMENTS_NATIVE;
    }

Carsten  Rose's avatar
Carsten Rose committed
51
52
53
    /**
     * @return string
     */
54
55
56
57
    public function doSubrecords() {
        return $this->elements($this->store->getVar(SIP_RECORD_ID, STORE_SIP), FORM_ELEMENTS_SUBRECORD);
    }

Carsten  Rose's avatar
Carsten Rose committed
58
59
60
61
62
63
    /**
     * @param $htmlFormElementId
     * @param $formElement
     * @param $value
     * @return string
     */
64
    public function buildRowNative($formElement, $elementHtml) {
65
66
67
        $html = '';

        // Construct Marshaller Name
68
//        $buildElementFunctionName = 'build' . $this->buildElementFunctionName[$formElement['type']];
69

70
71
72

        if($formElement['nestedInFieldSet']==='no')
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START];
73
74
        $html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement['label']);
        $html .= $this->wrapItem(WRAP_SETUP_INPUT, $elementHtml);
75
        $html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement['note']);
76
77
        if($formElement['nestedInFieldSet']==='no')
            $html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END];
78
79
80
81
82
83
84
85
86
87

        return $html;
    }

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

88
        $html .= $this->builtNewSip();
89
90
91
92
93
94
95
96

        $html .= $this->wrapItem(WRAP_SETUP_INPUT, '<input type="submit" value="Submit">');
        $html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
        $html .= '</form>';

        return $html;
    }

97
98
99
100
101
102
103
104
105
106
107
108

    public function buildRowPill($formElement, $elementHtml) {
        // TODO: Implement buildRowPill() method.
    }

    public function buildRowFieldset($formElement, $elementHtml) {
        // TODO: Implement buildRowFieldset() method.
    }

    public function buildRowSubrecord($formElement, $elementHtml) {
        // TODO: Implement buildRowSubrecord() method.
    }
109
}