3
* This file is part of Sylar.
5
* Sylar is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Lesser General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* Sylar is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with Sylar. If not, see <http://www.gnu.org/licenses/>.
18
* @copyright Copyright Sylar Development Team
19
* @license http://www.gnu.org/licenses/ GNU Public License V2.0
20
* @see https://launchpad.net/sylar/
21
* @see http://www.giano-solutions.com
26
import('sylar.presentation.html.Html');
32
* This object manage an HTML Form.
37
* @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
38
* @copyright Sylar Development Team
41
class Sylar_Form extends Sylar_Html{
42
// An array of Sylar_HtmlDiv
45
function __construct(){
46
// Inizialize the array
47
$this->aDivArchive = array();
49
function __destruct(){
50
// nothing to do at the moment
57
//__________________________________________________________________________
66
* @param Sylar_HtmlDiv $oDiv the object with Div information and content
68
public function addDiv(Sylar_HtmlDiv $oDiv){
70
$this->aDivArchive[] = $oDiv;
76
* return the Html source
77
* it return html code of entire object
81
public function getHtmlSource(){
82
return $this->render();
88
* it prints the object Html source on screen
92
public function show(){
100
//__________________________________________________________________________
104
* Design Html BODY tag
105
* it push all div in the body and prepare html code
109
protected function render(){
110
$sTagHtml = "\n<body>\n";
112
// Floating Style in the page <style> #classname: etc... </style>
113
foreach ($this->aDivArchive as $val) {
114
$sTagHtml .= "\n\t".$val->getHtmlSource();
117
$sTagHtml .= "\n\n</body>";
b'\\ No newline at end of file'