Completed
Push — master ( 79b035...e37d9a )
by Jean-Christophe
03:44
created

Semantic::htmlAccordionMenu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 2
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
22
class Semantic extends BaseGui {
23
	use SemanticComponentsTrait,SemanticHtmlElementsTrait;
24
	public function __construct($autoCompile=true) {
25
		parent::__construct($autoCompile=true);
26
	}
27
28
29
	/**
30
	 * @param string $identifier
31
	 * @param array $items
32
	 * @return Ajax\semantic\html\collections\HtmlMenu
33
	 */
34
	public function htmlMenu($identifier,$items=array()){
35
		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
36
	}
37
38
	/**Adds an icon menu
39
	 * @param string $identifier
40
	 * @param array $items icons
41
	 */
42
	public function htmlIconMenu($identifier,$items=array()){
43
		return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items));
44
	}
45
46
	/**Adds an labeled icon menu
47
	 * @param string $identifier
48
	 * @param array $items icons
49
	 */
50
	public function htmlLabeledIconMenu($identifier,$items=array()){
51
		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items));
52
	}
53
54
	/**
55
	 * @param string $identifier
56
	 * @param string $value
57
	 * @param array $items
58
	 */
59
	public function htmlDropdown($identifier, $value="", $items=array()){
60
		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
61
	}
62
63
	/**
64
	 * Adds a new message
65
	 * @param string $identifier
66
	 * @param string $content
67
	 */
68
	public function htmlMessage($identifier, $content=""){
69
		return $this->addHtmlComponent(new HtmlMessage($identifier,$content));
70
	}
71
72
	/**
73
	 * @param string $identifier
74
	 * @param mixed $content
75
	 */
76
	public function htmlPopup(BaseHtml $container,$identifier,$content){
77
		return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content));
78
	}
79
80
	/**
81
	 * @param string $identifier
82
	 * @param int $numRows
83
	 * @param int $numCols
84
	 * @param boolean $createCols
85
	 * @param boolean $implicitRows
86
	 */
87
	public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
88
		return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows));
89
	}
90
91
92
93
	/**
94
	 * Return a new Semantic Html Breadcrumb
95
	 * @param string $identifier
96
	 * @param array $elements
0 ignored issues
show
Bug introduced by
There is no parameter named $elements. 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...
97
	 * @param boolean $autoActive sets the last element's class to <b>active</b> if true. default : true
98
	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
99
	 * @return HtmlBreadcrumb
100
	 */
101
	public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
102
		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction));
103
	}
104
105
	/**
106
	 * Return a new Semantic Accordion
107
	 * @param string $identifier
108
	 * @return HtmlAccordion
109
	 */
110
	public function htmlAccordion($identifier) {
111
		return $this->addHtmlComponent(new HtmlAccordion($identifier));
112
	}
113
114
	/**
115
	 * Return a new Semantic Menu Accordion
116
	 * @param string $identifier
117
	 * @return HtmlAccordion
118
	 */
119
	public function htmlAccordionMenu($identifier,$items=array()) {
120
		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items));
121
	}
122
123
	/**
124
	 * Return a new Semantic Form
125
	 * @param string $identifier
126
	 * @param array $elements
127
	 */
128
	public function htmlForm($identifier,$elements=array()) {
129
		return $this->addHtmlComponent(new HtmlForm($identifier,$elements));
130
	}
131
}