6
6
use Ajax \semantic \html \elements \HtmlButton ;
7
7
use Ajax \semantic \html \base \constants \Direction ;
8
8
use Ajax \semantic \html \base \constants \State ;
9
+ use Ajax \semantic \html \modules \checkbox \HtmlCheckbox ;
10
+ use Ajax \common \html \BaseHtml ;
11
+ use Ajax \semantic \html \elements \HtmlLabel ;
9
12
10
13
/**
11
14
* @author jc
@@ -31,17 +34,46 @@ public function addLoading() {
31
34
return $ this ->addToProperty ("class " , State::LOADING );
32
35
}
33
36
37
+ /**
38
+ * @param string|BaseHtml $label
39
+ * @param string $direction
40
+ * @param string $icon
41
+ * @return HtmlLabel
42
+ */
34
43
public function labeled ($ label , $ direction =Direction::LEFT , $ icon =NULL ) {
35
44
$ field =$ this ->getField ();
36
45
$ labelO =$ field ->addLabel ($ label ,$ direction ===Direction::LEFT ,$ icon );
37
46
$ field ->addToProperty ("class " , $ direction . " labeled " );
38
47
return $ labelO ;
39
48
}
40
49
50
+ /**
51
+ * @param string $direction
52
+ * @param string $caption
53
+ * @param string $value
54
+ * @param string $checkboxType
55
+ * @return HtmlLabel
56
+ */
57
+ public function labeledCheckbox ($ direction =Direction::LEFT ,$ caption ="" ,$ value =NULL ,$ checkboxType =NULL ){
58
+ return $ this ->labeled (new HtmlCheckbox ("lbl-ck- " .$ this ->getField ()->getIdentifier (),$ caption ,$ value ,$ checkboxType ),$ direction );
59
+ }
60
+
61
+ /**
62
+ * @param string $icon
63
+ * @param string $direction
64
+ * @return HtmlLabel
65
+ */
41
66
public function labeledToCorner ($ icon , $ direction =Direction::LEFT ) {
42
67
return $ this ->labeled ("" , $ direction . " corner " , $ icon )->toCorner ($ direction );
43
68
}
44
69
70
+ /**
71
+ * @param string $action
72
+ * @param string $direction
73
+ * @param string $icon
74
+ * @param string $labeled
75
+ * @return unknown|HtmlButton
76
+ */
45
77
public function addAction ($ action , $ direction =Direction::RIGHT , $ icon =NULL , $ labeled =false ) {
46
78
$ field =$ this ->getField ();
47
79
$ actionO =$ action ;
@@ -55,6 +87,12 @@ public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $lab
55
87
return $ actionO ;
56
88
}
57
89
90
+ /**
91
+ * @param string $label
92
+ * @param array $items
93
+ * @param string $direction
94
+ * @return HtmlLabel
95
+ */
58
96
public function addDropdown ($ label ="" , $ items =array (),$ direction =Direction::RIGHT ){
59
97
$ labelO =new HtmlDropdown ("dd- " .$ this ->identifier ,$ label ,$ items );
60
98
$ labelO ->asSelect ("select- " .$ this ->identifier ,false ,true );
0 commit comments