BuildFormBootstrap.php 2.38 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: 10:00 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 BuildFormBootstrap
 * @package qfq
 */
20
21
class BuildFormBootstrap 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
38
39
    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] = '';
    }

Carsten  Rose's avatar
Carsten Rose committed
40
41
42
    /**
     * @return string
     */
43
44
45
46
    public function getProcessFilter() {
        return FORM_ELEMENTS_NATIVE_SUBRECORD;
    }

Carsten  Rose's avatar
Carsten Rose committed
47
48
49
    /**
     * @return string
     */
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    public function doSubrecords() {
        return '';
    }

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

        $html .= $this->wrapItem(WRAP_SETUP_TITLE, $this->formSpec['title'], true);
        $html .= '<form action="?" method="post" target="_top" accept-charset="UTF-8">';

        return $html;
    }

Carsten  Rose's avatar
Carsten Rose committed
66
67
68
69
70
71
    /**
     * @param $htmlFormElementId
     * @param $formElement
     * @param $value
     * @return string
     */
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    public function wrapElement($htmlFormElementId, $formElement, $value) {
        $html = '';

        // Construct Marshaller Name
        $buildElementFunctionName = 'build' . $this->buildElementFunctionName[$formElement['type']];
        $html .= $this->wrapItem(WRAP_SETUP_TITLE, $this->formSpec['title'], true);
        $html .= '<form action="?" method="post" target="_top" accept-charset="UTF-8">';


        return $html;
    }

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

        $sip = $this->store->getVar(CLIENT_SIP, STORE_CLIENT);
        $sipName = CLIENT_SIP;
        $html .= $this->buildHidden(array(), $sipName, $sip);

        // TODO: bootstrap. See BuildFormTable.tail()

        return $html;
    }

}