MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
panelcontrols.class
Ir para a documentação deste ficheiro.
1<?php
2
3class MBasePanel extends MContainer
4{
5 var $box;
6
7 function __construct($name = '', $caption = '', $controls = NULL, $close = '', $icon = '')
8 {
9 parent::__construct($name, $controls, 'horizontal');
10 $this->box = new MBox($caption, $close, $icon);
11 $this->setClass('m-panel-body');
12 }
13
14
15 public function setTitle($title)
16 {
17 $this->box->setCaption($title);
18 }
19
20
21 public function addControl($control, $width = '', $float = 'left')
22 {
23 if ( is_array($control) )
24 {
25 foreach ($control as $c)
26 {
27 $this->addControl($c, $width, $float);
28 }
29 }
30 else
31 {
32 if ($width == '100%')
33 {
34 $width = '';
35 }
36
37 $control->width = MUtil::NVL( $control->width , $width );
38
39 if ($float == 'clear')
40 {
41 $control->clear = 'both';
42 }
43 else
44 {
45 $control->float = MUtil::NVL( $control->float, $float );
46 }
47
48 $control->setBoxClass('m-panelcontrol-box');
49
50 parent::addControl($control);
51 }
52 }
53
54
55 public function insertControl($pos, $control = null, $width = '', $float = 'left')
56 {
57 if ( $width == '100%' )
58 {
59 $width = '';
60 }
61
62 $control->width = MUtil::NVL( $control->width, $width );
63
64 if ( $float == 'clear' )
65 {
66 $control->clear = 'both';
67 }
68 else
69 {
70 $control->float = MUtil::NVL( $control->float, $float );
71 }
72
73 $control->SetBoxClass('m-panelcontrol-box');
74 parent::InsertControl( $control, $pos );
75 }
76
77
78 public function generate()
79 {
80 parent::addControl( new MSpacer() );
81 $body = new MDiv( $this->name, $this->getControls(), 'm-panel-body' );
82 $this->box->setControls( array($body) );
83 return $this->box->generate();
84 }
85
86}
87
88
89class MPanel extends MBasePanel {}
90
91?>
setTitle($title)
__construct($name='', $caption='', $controls=NULL, $close='', $icon='')
insertControl($pos, $control=null, $width='', $float='left')
addControl($control, $width='', $float='left')
setClass($cssClass, $add=true)
static NVL($value1, $value2)
Definição mutil.class:38
$title
Definição base.php:3