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