HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
TbWidget.php
Go to the documentation of this file.
1
<?php
11
abstract
class
TbWidget
extends
CWidget {
12
13
const
CTX_DEFAULT
=
'default'
;
14
const
CTX_PRIMARY
=
'primary'
;
15
const
CTX_SUCCESS
=
'success'
;
16
const
CTX_INFO
=
'info'
;
17
const
CTX_WARNING
=
'warning'
;
18
const
CTX_DANGER
=
'danger'
;
19
20
const
CTX_DEFAULT_CLASS
=
'default'
;
21
const
CTX_PRIMARY_CLASS
=
'primary'
;
22
const
CTX_SUCCESS_CLASS
=
'success'
;
23
const
CTX_INFO_CLASS
=
'info'
;
24
const
CTX_WARNING_CLASS
=
'warning'
;
25
const
CTX_DANGER_CLASS
=
'danger'
;
26
31
public
$context
=
self::CTX_DEFAULT
;
32
39
protected
static
function
addCssClass
(&$htmlOptions,
$class
) {
40
41
if
(empty(
$class
))
42
return
;
43
44
if
(isset($htmlOptions[
'class'
]))
45
$htmlOptions[
'class'
] .=
' '
.
$class
;
46
else
47
$htmlOptions[
'class'
] =
$class
;
48
}
49
54
protected
function
isValidContext
($cotext =
false
) {
55
if
($cotext)
56
return
defined
(get_called_class().
'::CTX_'
.strtoupper(
$context
));
57
else
58
return
defined
(get_called_class().
'::CTX_'
.strtoupper($this->context));
59
}
60
65
protected
function
getContextClass
(
$context
=
false
) {
66
if
(
$context
)
67
return
constant(get_called_class().
'::CTX_'
.strtoupper(
$context
).
'_CLASS'
);
68
else
69
return
constant(get_called_class().
'::CTX_'
.strtoupper($this->context).
'_CLASS'
);
70
}
71
}
app
protected
extensions
booster
widgets
TbWidget.php
Generated on Tue Jun 30 2015 20:12:34 for HCE Project DC service web UI by
1.8.1.2