MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
blockcontrols.class
Ir para a documentação deste ficheiro.
1<?php
2
3class MSpan extends MControl
4{
5 public function __construct( $name = NULL, $content = '&nbsp;', $class = NULL, $attributes = NULL )
6 {
7 parent::__construct( $name );
8
9 $this->setInner( $content );
10 $this->setClass( $class );
11 $this->setAttributes( $attributes );
12 }
13
14
15 public function generate()
16 {
17 return $this->getRender('span');
18 }
19}
20
21
22class MDiv extends MControl
23{
24 public function __construct( $name = NULL, $content = '', $class = NULL, $attributes = NULL )
25 {
26 parent::__construct( $name );
27
28 $this->addStyleFile('m_boxes.css');
29 $this->setInner($content);
30 $this->setBoxClass($class);
32 $this->setBoxId( $this->GetId() );
33 }
34}
35
36
37class MSpacer extends MDiv
38{
39 public function __construct($space = NULL)
40 {
41 parent::__construct('', '', 'm-spacer');
42
43 if ( ! is_null($space) )
44 {
45 $this->setInner('&nbsp;');
46 $this->addBoxStyle('line-height',$space);
47 }
48 }
49}
50
51
52class MHr extends MDiv
53{
54 public function __construct()
55 {
56 parent::__construct('', '', 'm-hr');
57 }
58}
59
60class MBadge extends MControl
61{
62 const COLOR_GREEN = 'label-success';
63 const COLOR_RED = 'label-danger';
64 const COLOR_YELLOW = 'label-warning';
65 const COLOR_BLUE = 'label-primary';
66 const COLOR_LIGHT_BLUE = 'label-info';
67 const COLOR_GRAY = 'label-default';
68
69 public function __construct($content = '', $color = self::COLOR_BLUE, $class = 'm-badge-bootstrap')
70 {
71 parent::__construct();
72
73 $this->setInner( $content );
74 $this->setClass($class . ' ' . $color);
75 }
76
77
78 public function generate()
79 {
80 $outerDiv = new MDiv('outerDiv'.rand(), $this->getRender('span'), 'm-div-badge-bootstrap');
81 return $outerDiv->generate();
82 }
83}
84
85?>
const COLOR_GREEN
const COLOR_RED
const COLOR_YELLOW
const COLOR_BLUE
const COLOR_LIGHT_BLUE
const COLOR_GRAY
__construct($content='', $color=self::COLOR_BLUE, $class='m-badge-bootstrap')
setBoxAttributes($attr)
Definição mcontrol.class:809
setAttributes($attr)
Definição mcontrol.class:462
setBoxId( $id)
Definição mcontrol.class:791
setClass( $cssClass, $add=true)
Definição mcontrol.class:398
setInner($inner)
Definição mcontrol.class:598
setBoxClass( $cssClass, $add=true)
Definição mcontrol.class:797
addStyleFile( $styleFile)
Definição mcontrol.class:412
addBoxStyle($name, $value='')
Definição mcontrol.class:819
getRender( $method)
Definição mcontrol.class:833
__construct( $name=NULL, $content='', $class=NULL, $attributes=NULL)
__construct()
__construct($space=NULL)
__construct( $name=NULL, $content='&nbsp;', $class=NULL, $attributes=NULL)