MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mcsspform.class
Ir para a documentação deste ficheiro.
1<?php
2class MCSSPForm extends MForm
3{
4 var $height;
5 var $_top;
6 var $_left;
7
8 function __construct($title = '', $action = '')
9 {
10 global $page;
11
12 parent::__construct($title, $action);
13 $this->heigth = 50;
14 $this->_top = 0;
15 $this->_left = 0;
16 }
17
18 function SetFieldPos($name, $x, $y, $w = 0)
19 {
20 $field = &$this->$name;
21
22 if ($w)
23 $field->SetCSSPWidth($w);
24
25 $field->SetCSSPPosition($x, $y);
26 }
27
28 function SetHeight($value = null)
29 {
30 $this->height = $value;
31 }
32
33 function SetOrigin($top, $left)
34 {
35 $this->_top = $top;
36 $this->_left = $left;
37 }
38
39 function GenerateLayoutFields(&$hidden)
40 {
41 global $MIOLO;
42
43 if (!is_array($this->fields))
44 return;
45
46 $t = new SimpleTable('');
47 $t->attributes['table'] = "border=\"0\" height=\"{$this->height}\" width=\"100%\" cellpadding=\"0\" cellspacing=\"2\" class=\"formBody\" ";
48 $row = 0;
49
50 foreach ($this->fields as $f)
51 {
52 if (!$f->visible)
53 {
54 continue;
55 }
56
57 if ((($f->classname == 'textfield') && ($f->size == 0)) || ($f->classname == 'hiddenfield'))
58 {
59 $hidden[] = $f;
60 continue;
61 }
62
63 if (($f->readonly || $f->maintainstate))
64 {
65 $hidden[] = $f;
66 }
67
68 $t->cell[0][0][] = $f;
69 }
70
71 return $t;
72 }
73
74 function Generate()
75 {
76 if (!isset($this->buttons))
77 {
78 if ($this->defaultButton)
79 {
80 $this->buttons[] = new FormButton(FORM_SUBMIT_BTN_NAME, 'Enviar', 'SUBMIT');
81 }
82 }
83
84 $title = HtmlPainter::GenerateToString($this->GenerateTitle());
85 $body = HtmlPainter::GenerateToString($this->GenerateBody());
86 $footer = HtmlPainter::GenerateToString($this->GenerateFooter());
87
88 $style = "style=\"\{height:{$form->height}px; position:absolute}\"";
89 $b = new Div('', $body, 'formBox', $style);
90
91 if (($form->_top) && ($form->_left))
92 $style = "style=\"\{width:{$form->width}; top:{$form->_top}px; left:{$form->_left}px; position:absolute}\"";
93 else
94 $style = "style=\"\{width:{$form->width}; position:relative}\"";
95
96 $f = new Div('', array($title, $b, $footer), 'formContainer', $style);
97 HtmlPainter::GenerateElements($f);
98 }
99}
100?>
SetFieldPos($name, $x, $y, $w=0)
Definição mcsspform.class:18
GenerateLayoutFields(&$hidden)
Definição mcsspform.class:39
SetHeight($value=null)
Definição mcsspform.class:28
SetOrigin($top, $left)
Definição mcsspform.class:33
__construct($title='', $action='')
Definição mcsspform.class:8
Definição mform.class:9
$action
Definição mform.class:18
$footer
Definição mform.class:58
GenerateFooter()
Definição mform.class:1954
$title
Definição mform.class:13
GenerateBody()
Definição mform.class:1897
const FORM_SUBMIT_BTN_NAME
Definição mform.class:2