1+ <?php
2+
3+ namespace Ajax ;
4+
5+ use Ajax \common \BaseGui ;
6+ use Ajax \bootstrap \components \Modal ;
7+ use Ajax \bootstrap \components \Dropdown ;
8+ use Ajax \bootstrap \components \Carousel ;
9+ use Ajax \bootstrap \html \HtmlButton ;
10+ use Ajax \bootstrap \html \HtmlButtongroups ;
11+ use Ajax \bootstrap \html \HtmlGlyphButton ;
12+ use Ajax \bootstrap \html \HtmlDropdown ;
13+ use Ajax \bootstrap \components \Splitbutton ;
14+ use Ajax \bootstrap \html \HtmlButtontoolbar ;
15+ use Ajax \bootstrap \html \HtmlNavbar ;
16+ use Ajax \bootstrap \html \HtmlProgressbar ;
17+ use Ajax \bootstrap \html \HtmlPanel ;
18+ use Ajax \bootstrap \html \HtmlAlert ;
19+ use Ajax \bootstrap \html \HtmlAccordion ;
20+ use Ajax \bootstrap \html \HtmlCarousel ;
21+ use Ajax \bootstrap \html \HtmlTabs ;
22+ use Ajax \bootstrap \html \HtmlModal ;
23+ use Ajax \bootstrap \html \HtmlSplitbutton ;
24+ use Ajax \bootstrap \html \HtmlInputgroup ;
25+ use Ajax \bootstrap \html \HtmlListgroup ;
26+ use Ajax \bootstrap \html \HtmlBreadcrumbs ;
27+ use Ajax \bootstrap \html \HtmlPagination ;
28+ use Ajax \bootstrap \html \HtmlGridSystem ;
29+ use Ajax \bootstrap \traits \BootstrapComponentsTrait ;
30+
31+ class Bootstrap extends BaseGui {
32+ use BootstrapComponentsTrait;
33+ public function __construct ($ autoCompile =true ) {
34+ parent ::__construct ($ autoCompile );
35+ }
36+
37+
38+ /**
39+ * Return a new Bootstrap Html Button
40+ * @param string $identifier
41+ * @param string $value
42+ * @param string $cssStyle
43+ * @param string $onClick
44+ * @return HtmlButton
45+ */
46+ public function htmlButton ($ identifier , $ value ="" , $ cssStyle =null , $ onClick =null ) {
47+ return $ this ->addHtmlComponent (new HtmlButton ($ identifier , $ value , $ cssStyle , $ onClick ));
48+ }
49+
50+ /**
51+ * Return a new Bootstrap Html Glyphbutton
52+ * @param string $identifier
53+ * @param mixed $glyphIcon
54+ * @param string $value
55+ * @param string $cssStyle
56+ * @param string $onClick
57+ * @return HtmlGlyphButton
58+ */
59+ public function htmlGlyphButton ($ identifier , $ glyphIcon =0 , $ value ="" , $ cssStyle =NULL , $ onClick =NULL ) {
60+ return $ this ->addHtmlComponent (new HtmlGlyphButton ($ identifier , $ glyphIcon , $ value , $ cssStyle , $ onClick ));
61+ }
62+
63+ /**
64+ * Return a new Bootstrap Html Buttongroups
65+ * @param string $identifier
66+ * @param array $values
67+ * @param string $cssStyle
68+ * @param string $size
69+ * @return HtmlButtongroups
70+ */
71+ public function htmlButtongroups ($ identifier , $ values =array (), $ cssStyle =NULL , $ size =NULL ) {
72+ return $ this ->addHtmlComponent (new HtmlButtongroups ($ identifier , $ values , $ cssStyle , $ size ));
73+ }
74+
75+ /**
76+ * Return a new Bootstrap Html Dropdown
77+ * @param string $identifier
78+ * @param array $items
79+ * @param string $cssStyle
80+ * @param string $size
81+ * @return HtmlDropdown
82+ */
83+ public function htmlDropdown ($ identifier , $ value ="" , $ items =array (), $ cssStyle =NULL , $ size =NULL ) {
84+ return $ this ->addHtmlComponent (new HtmlDropdown ($ identifier , $ value , $ items , $ cssStyle , $ size ));
85+ }
86+
87+ /**
88+ * Return a new Bootstrap Html Dropdown
89+ * @param string $identifier
90+ * @param array $elements
91+ * @param string $cssStyle
92+ * @param string $size
93+ * @return HtmlButtontoolbar
94+ */
95+ public function htmlButtontoolbar ($ identifier , $ elements =array (), $ cssStyle =NULL , $ size =NULL ) {
96+ return $ this ->addHtmlComponent (new HtmlButtontoolbar ($ identifier , $ elements , $ cssStyle , $ size ));
97+ }
98+
99+ /**
100+ * Return a new Bootstrap Html Navbar
101+ * @param string $identifier
102+ * @param string $brand
103+ * @param string $brandHref
104+ * @return HtmlNavbar
105+ */
106+ public function htmlNavbar ($ identifier , $ brand ="Brand " , $ brandHref ="# " ) {
107+ return $ this ->addHtmlComponent (new HtmlNavbar ($ identifier , $ brand , $ brandHref ));
108+ }
109+
110+ /**
111+ * Return a new Bootstrap Html Progressbar
112+ * @param string $identifier
113+ * @param string $value
114+ * @param string $max
115+ * @param string $min
116+ * @return HtmlProgressbar
117+ */
118+ public function htmlProgressbar ($ identifier , $ style ="info " , $ value =0 , $ max =100 , $ min =0 ) {
119+ return $ this ->addHtmlComponent (new HtmlProgressbar ($ identifier , $ style , $ value , $ max , $ min ));
120+ }
121+
122+ /**
123+ * Return a new Bootstrap Html Panel
124+ * @param string $identifier the Html identifier of the element
125+ * @param mixed $content the panel content (string or HtmlComponent)
126+ * @param string $header the header
127+ * @param string $footer the footer
128+ * @return HtmlPanel
129+ */
130+ public function htmlPanel ($ identifier , $ content =NULL , $ header =NULL , $ footer =NULL ) {
131+ return $ this ->addHtmlComponent (new HtmlPanel ($ identifier , $ content , $ header , $ footer ));
132+ }
133+
134+ /**
135+ * Return a new Bootstrap Html Alert
136+ * @param string $identifier
137+ * @param string $message
138+ * @param string $cssStyle
139+ * @return HtmlAlert
140+ */
141+ public function htmlAlert ($ identifier , $ message =NULL , $ cssStyle ="alert-warning " ) {
142+ return $ this ->addHtmlComponent (new HtmlAlert ($ identifier , $ message , $ cssStyle ));
143+ }
144+
145+ /**
146+ * Return a new Bootstrap Accordion
147+ * @param string $identifier
148+ * @return HtmlAccordion
149+ */
150+ public function htmlAccordion ($ identifier ) {
151+ return $ this ->addHtmlComponent (new HtmlAccordion ($ identifier ));
152+ }
153+
154+ /**
155+ * Return a new Bootstrap Html Carousel
156+ * @param string $identifier
157+ * @param array $images [(src=>"",alt=>"",caption=>"",description=>""),...]
158+ * @return HtmlCarousel
159+ */
160+ public function htmlCarousel ($ identifier , $ images =NULL ) {
161+ return $ this ->addHtmlComponent (new HtmlCarousel ($ identifier , $ images ));
162+ }
163+
164+ /**
165+ * Return a new Bootstrap Html tabs
166+ * @param string $identifier
167+ * @return HtmlTabs
168+ */
169+ public function htmlTabs ($ identifier ) {
170+ return $ this ->addHtmlComponent (new HtmlTabs ($ identifier ));
171+ }
172+ /**
173+ * Return a new Bootstrap Html listGroup
174+ * @param string $identifier
175+ * @param array $items array of items to add
176+ * @param string $tagName container tagName
177+ * @return HtmlListgroup
178+ */
179+ public function htmlListgroup ($ identifier ,$ items =array (),$ tagName ="ul " ){
180+ $ listGroup =new HtmlListgroup ($ identifier ,$ tagName );
181+ $ listGroup ->addItems ($ items );
182+ return $ this ->addHtmlComponent ($ listGroup );
183+ }
184+ /**
185+ * Return a new Bootstrap Html modal dialog
186+ * @param string $identifier
187+ * @param string $title
188+ * @param string $content
189+ * @param array $buttonCaptions
190+ * @return HtmlModal
191+ */
192+ public function htmlModal ($ identifier , $ title ="" , $ content ="" , $ buttonCaptions =array ()) {
193+ return $ this ->addHtmlComponent (new HtmlModal ($ identifier , $ title , $ content , $ buttonCaptions ));
194+ }
195+
196+ /**
197+ * Return a new Bootstrap Html SplitButton
198+ * @param string $identifier
199+ * @param string $value
200+ * @param array $items
201+ * @param string $cssStyle
202+ * @param string $onClick
203+ * @return HtmlSplitbutton
204+ */
205+ public function htmlSplitbutton ($ identifier ,$ value ="" , $ items =array (), $ cssStyle ="btn-default " , $ onClick =NULL ) {
206+ return $ this ->addHtmlComponent (new HtmlSplitbutton ($ identifier , $ value , $ items , $ cssStyle ,$ onClick ));
207+ }
208+
209+ /**
210+ * Return a new Bootstrap Html InputGroup
211+ * @param string $identifier
212+ * @return HtmlInputgroup
213+ */
214+ public function htmlInputgroup ($ identifier ){
215+ return $ this ->addHtmlComponent (new HtmlInputgroup ($ identifier ));
216+ }
217+
218+ /**
219+ * Return a new Bootstrap Html Breadcrumbs
220+ * @param string $identifier
221+ * @param array $elements
222+ * @param boolean $autoActive sets the last element's class to <b>active</b> if true. default : true
223+ * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
224+ * @return HtmlBreadcrumbs
225+ */
226+ public function htmlBreadcrumbs ($ identifier ,$ elements =array (),$ autoActive =true ,$ startIndex =0 ,$ hrefFunction =NULL ){
227+ return $ this ->addHtmlComponent (new HtmlBreadcrumbs ($ identifier ,$ elements ,$ autoActive ,$ startIndex ,$ hrefFunction ));
228+ }
229+
230+ /**
231+ * Return a new Bootstrap Html Pagination
232+ * @see http://getbootstrap.com/components/#pagination
233+ * @param string $identifier
234+ * @param int $from default : 1
235+ * @param int $to default : 1
236+ * @param int $active The active page
237+ * @return HtmlPagination
238+ */
239+ public function htmlPagination ($ identifier ,$ from =1 ,$ to =1 ,$ active =NULL ,$ countVisible =NULL ){
240+ return $ this ->addHtmlComponent (new HtmlPagination ($ identifier ,$ from ,$ to ,$ active ,$ countVisible ));
241+ }
242+
243+ /**
244+ * Return a new Bootstrap Html Grid system
245+ * @see http://getbootstrap.com/css/#grid
246+ * @param string $identifier
247+ * @param int $numRows
248+ * @param int $numCols
249+ * @return HtmlGridSystem
250+ */
251+ public function htmlGridSystem ($ identifier ,$ numRows =1 ,$ numCols =NULL ){
252+ return $ this ->addHtmlComponent (new HtmlGridSystem ($ identifier ,$ numRows ,$ numCols ));
253+ }
254+ }
0 commit comments