Completed
Push — master ( 19a73f...703022 )
by Jean-Christophe
04:09
created

SemanticHtmlModulesTrait::htmlDropdown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 4
1
<?php
2
3
namespace Ajax\semantic\traits;
4
5
use Ajax\semantic\html\base\constants\CheckboxType;
6
use Ajax\semantic\html\modules\HtmlRating;
7
use Ajax\semantic\html\modules\HtmlProgress;
8
use Ajax\semantic\html\modules\HtmlSearch;
9
use Ajax\semantic\html\modules\HtmlDimmer;
10
use Ajax\semantic\html\modules\HtmlModal;
11
use Ajax\semantic\html\modules\checkbox\HtmlCheckbox;
12
use Ajax\semantic\html\modules\HtmlTab;
13
use Ajax\semantic\html\modules\HtmlShape;
14
use Ajax\semantic\html\modules\HtmlPopup;
15
use Ajax\semantic\html\modules\HtmlDropdown;
16
use Ajax\common\html\BaseHtml;
17
use Ajax\semantic\html\modules\HtmlAccordion;
18
use Ajax\semantic\html\collections\menus\HtmlAccordionMenu;
19
use Ajax\semantic\html\modules\HtmlSticky;
20
21
trait SemanticHtmlModulesTrait {
22
23
	public abstract function addHtmlComponent($htmlComponent);
24
25
	/**
26
	 * Module checkbox
27
	 * @param string $identifier
28
	 * @param string $label
29
	 * @param mixed $value
30
	 * @param CheckboxType $type
31
	 * @return HtmlCheckbox
32
	 */
33
	public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
34
		return $this->addHtmlComponent(new HtmlCheckbox($identifier, $label, $value, $type));
35
	}
36
37
	/**
38
	 *
39
	 * @param string $identifier
40
	 * @param int $rowCount
0 ignored issues
show
Bug introduced by
There is no parameter named $rowCount. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
41
	 * @param int $colCount
0 ignored issues
show
Bug introduced by
There is no parameter named $colCount. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
42
	 * @return HtmlRating
43
	 */
44
	public function htmlRating($identifier, $value, $max, $icon="") {
45
		return $this->addHtmlComponent(new HtmlRating($identifier, $value, $max, $icon));
46
	}
47
48
	/**
49
	 *
50
	 * @param string $identifier
51
	 * @param int $value
52
	 * @param string $label
53
	 * @return HtmlProgress
54
	 */
55
	public function htmlProgress($identifier, $value=0, $label=NULL) {
56
		return $this->addHtmlComponent(new HtmlProgress($identifier, $value, $label));
57
	}
58
59
	/**
60
	 *
61
	 * @param string $identifier
62
	 * @param string $placeholder
63
	 * @return HtmlSearch
64
	 */
65
	public function htmlSearch($identifier, $placeholder=NULL, $icon=NULL) {
66
		return $this->addHtmlComponent(new HtmlSearch($identifier, $placeholder, $icon));
67
	}
68
69
	/**
70
	 *
71
	 * @param string $identifier
72
	 * @param mixed $content
73
	 * @return HtmlDimmer
74
	 */
75
	public function htmlDimmer($identifier, $content=NULL) {
76
		return $this->addHtmlComponent(new HtmlDimmer($identifier, $content));
77
	}
78
79
80
	/**
81
	 * Returns a new semantic modal dialog
82
	 * @param string $identifier
83
	 * @param string $header
84
	 * @param string $content
85
	 * @param array $actions
86
	 * @return HtmlModal
87
	 */
88
	public function htmlModal($identifier, $header="", $content="", $actions=array()) {
89
		return $this->addHtmlComponent(new HtmlModal($identifier, $header,$content,$actions));
90
	}
91
92
	/**
93
	 * Returns a new Semantic Tab
94
	 * @see http://semantic-ui.com/modules/tab.html
95
	 * @param array $tabs
96
	 * @return HtmlTab
97
	 */
98
	public function htmlTab($identifier, $tabs=array()) {
99
		return $this->addHtmlComponent(new HtmlTab($identifier, $tabs));
100
	}
101
102
	/**
103
	 * Returns a new Semantic Shape
104
	 * @see http://semantic-ui.com/modules/shape.html
105
	 * @param array $slides
106
	 * @return HtmlShape
107
	 */
108
	public function htmlShape($identifier, $slides=array()) {
109
		return $this->addHtmlComponent(new HtmlShape($identifier, $slides));
110
	}
111
112
	/**
113
	 *
114
	 * @param string $identifier
115
	 * @param string $value
116
	 * @param array $items
117
	 * @param boolean $associative
118
	 * @return HtmlDropdown
119
	 */
120
	public function htmlDropdown($identifier, $value="", $items=array(),$associative=true) {
121
		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items,$associative));
122
	}
123
124
	/**
125
	 *
126
	 * @param string $identifier
127
	 * @param mixed $content
128
	 * @return HtmlPopup
129
	 */
130
	public function htmlPopup(BaseHtml $container, $identifier, $content) {
131
		return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content));
132
	}
133
134
	/**
135
	 * Returns a new Semantic Accordion
136
	 * @param string $identifier
137
	 * @return HtmlAccordion
138
	 */
139
	public function htmlAccordion($identifier) {
140
		return $this->addHtmlComponent(new HtmlAccordion($identifier));
141
	}
142
143
	/**
144
	 * Return a new Semantic Menu Accordion
145
	 * @param string $identifier
146
	 * @return HtmlAccordionMenu
147
	 */
148
	public function htmlAccordionMenu($identifier, $items=array()) {
149
		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items));
150
	}
151
152
153
	/**
154
	 * Returns a new Semantic Sticky
155
	 * @param string $identifier
156
	 * @param array $content
157
	 * @return HtmlSticky
158
	 */
159
	public function htmlSticky($identifier, $content=array()) {
160
		return $this->addHtmlComponent(new HtmlSticky($identifier, $content));
161
	}
162
}