1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ajax; |
4
|
|
|
|
5
|
|
|
use Ajax\common\BaseGui; |
6
|
|
|
use Ajax\semantic\html\collections\menus\HtmlMenu; |
7
|
|
|
use Ajax\semantic\html\modules\HtmlDropdown; |
8
|
|
|
use Ajax\semantic\html\collections\HtmlMessage; |
9
|
|
|
use Ajax\semantic\html\modules\HtmlPopup; |
10
|
|
|
use Ajax\common\html\BaseHtml; |
11
|
|
|
use Ajax\semantic\html\collections\HtmlGrid; |
12
|
|
|
use Ajax\semantic\html\collections\menus\HtmlIconMenu; |
13
|
|
|
use Ajax\semantic\html\collections\menus\HtmlLabeledIconMenu; |
14
|
|
|
use Ajax\semantic\html\collections\HtmlBreadcrumb; |
15
|
|
|
use Ajax\semantic\html\modules\HtmlAccordion; |
16
|
|
|
use Ajax\semantic\components\Accordion; |
17
|
|
|
use Ajax\semantic\html\collections\menus\HtmlAccordionMenu; |
18
|
|
|
use Ajax\semantic\html\collections\form\HtmlForm; |
19
|
|
|
use Ajax\semantic\traits\SemanticComponentsTrait; |
20
|
|
|
use Ajax\semantic\traits\SemanticHtmlElementsTrait; |
21
|
|
|
use Ajax\semantic\html\modules\HtmlSticky; |
22
|
|
|
use Ajax\semantic\traits\SemanticHtmlCollectionsTrait; |
23
|
|
|
use Ajax\semantic\traits\SemanticHtmlModulesTrait; |
24
|
|
|
use Ajax\semantic\traits\SemanticHtmlViewsTrait; |
25
|
|
|
|
26
|
|
|
class Semantic extends BaseGui { |
27
|
|
|
use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait, |
28
|
|
|
SemanticHtmlModulesTrait,SemanticHtmlViewsTrait; |
29
|
|
|
|
30
|
|
|
public function __construct($autoCompile=true) { |
31
|
|
|
parent::__construct($autoCompile=true); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* |
36
|
|
|
* @param string $identifier |
37
|
|
|
* @param array $items |
38
|
|
|
* @return Ajax\semantic\html\collections\HtmlMenu |
39
|
|
|
*/ |
40
|
|
|
public function htmlMenu($identifier, $items=array()) { |
41
|
|
|
return $this->addHtmlComponent(new HtmlMenu($identifier, $items)); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Adds an icon menu |
46
|
|
|
* @param string $identifier |
47
|
|
|
* @param array $items icons |
48
|
|
|
*/ |
49
|
|
|
public function htmlIconMenu($identifier, $items=array()) { |
50
|
|
|
return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items)); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Adds an labeled icon menu |
55
|
|
|
* @param string $identifier |
56
|
|
|
* @param array $items icons |
57
|
|
|
*/ |
58
|
|
|
public function htmlLabeledIconMenu($identifier, $items=array()) { |
59
|
|
|
return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items)); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* |
64
|
|
|
* @param string $identifier |
65
|
|
|
* @param string $value |
66
|
|
|
* @param array $items |
67
|
|
|
*/ |
68
|
|
|
public function htmlDropdown($identifier, $value="", $items=array()) { |
69
|
|
|
return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items)); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Adds a new message |
74
|
|
|
* @param string $identifier |
75
|
|
|
* @param string $content |
76
|
|
|
*/ |
77
|
|
|
public function htmlMessage($identifier, $content="") { |
78
|
|
|
return $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* |
83
|
|
|
* @param string $identifier |
84
|
|
|
* @param mixed $content |
85
|
|
|
*/ |
86
|
|
|
public function htmlPopup(BaseHtml $container, $identifier, $content) { |
87
|
|
|
return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content)); |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* |
92
|
|
|
* @param string $identifier |
93
|
|
|
* @param int $numRows |
94
|
|
|
* @param int $numCols |
95
|
|
|
* @param boolean $createCols |
96
|
|
|
* @param boolean $implicitRows |
97
|
|
|
*/ |
98
|
|
|
public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
99
|
|
|
return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows)); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* Returns a new Semantic Html Breadcrumb |
104
|
|
|
* @param string $identifier |
105
|
|
|
* @param array $items |
106
|
|
|
* @param boolean $autoActive sets the last element's class to <b>active</b> if true. default : true |
107
|
|
|
* @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
108
|
|
|
* @return HtmlBreadcrumb |
109
|
|
|
*/ |
110
|
|
|
public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) { |
111
|
|
|
return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction)); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Returns a new Semantic Accordion |
116
|
|
|
* @param string $identifier |
117
|
|
|
* @return HtmlAccordion |
118
|
|
|
*/ |
119
|
|
|
public function htmlAccordion($identifier) { |
120
|
|
|
return $this->addHtmlComponent(new HtmlAccordion($identifier)); |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* Return a new Semantic Menu Accordion |
125
|
|
|
* @param string $identifier |
126
|
|
|
* @return HtmlAccordion |
127
|
|
|
*/ |
128
|
|
|
public function htmlAccordionMenu($identifier, $items=array()) { |
129
|
|
|
return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items)); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* Returns a new Semantic Form |
134
|
|
|
* @param string $identifier |
135
|
|
|
* @param array $elements |
136
|
|
|
*/ |
137
|
|
|
public function htmlForm($identifier, $elements=array()) { |
138
|
|
|
return $this->addHtmlComponent(new HtmlForm($identifier, $elements)); |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function htmlSticky($identifier, $content=array()) { |
142
|
|
|
return $this->addHtmlComponent(new HtmlSticky($identifier, $content)); |
143
|
|
|
} |
144
|
|
|
} |