Completed
Push — master ( b9a8b8...3e8704 )
by Jean-Christophe
03:43
created

Semantic   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 5
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A htmlButton() 0 3 1
A htmlIcon() 0 3 1
A htmlGroupIcons() 0 13 4
1
<?php
2
3
namespace Ajax;
4
5
use Ajax\common\BaseGui;
6
use Ajax\semantic\html\HtmlButton;
7
use Ajax\semantic\html\HtmlIcon;
8
use Ajax\semantic\html\HtmlGroupIcons;
9
use Ajax\service\JArray;
10
11
class Semantic extends BaseGui {
12
13
	public function __construct($autoCompile=true) {
14
		parent::__construct($autoCompile=true);
15
	}
16
17
	/**
18
	 * Return a new Semantic Html Button
19
	 * @param string $identifier
20
	 * @param string $value
21
	 * @param string $cssStyle
22
	 * @param string $onClick
23
	 * @return HtmlButton
24
	 */
25
	public function htmlButton($identifier, $value="", $cssStyle=null, $onClick=null) {
26
		return $this->addHtmlComponent(new HtmlButton($identifier, $value, $cssStyle, $onClick));
27
	}
28
29
	public function htmlIcon($identifier,$icon){
30
		return $this->addHtmlComponent(new HtmlIcon($identifier, $icon));
31
	}
32
33
	public function htmlGroupIcons($identifier,$size="",$icons=array()){
34
		$group=new HtmlGroupIcons($identifier,$size);
35
		if(JArray::isAssociative($icons)){
36
			foreach ($icons as $icon=>$size){
37
				$group->addIcon($icon,$size);
38
			}
39
		}else{
40
			foreach ($icons as $icon){
41
				$group->addIcon($icon);
42
			}
43
		}
44
		return $this->addHtmlComponent($group);
45
	}
46
}