Completed
Push — master ( cd0fd2...97e05d )
by Jean-Christophe
03:14
created

HtmlPopup   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 1
cbo 4
dl 0
loc 28
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A setFlowing() 0 3 1
A setBasic() 0 3 1
A run() 0 4 1
1
<?php
2
3
namespace Ajax\semantic\html\modules;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
use Ajax\JsUtils;
7
use Ajax\common\html\BaseHtml;
8
9
10
class HtmlPopup extends HtmlSemDoubleElement {
11
	private $params;
12
	private $_container;
13
	public function __construct(BaseHtml $container,$identifier, $content="") {
14
		parent::__construct($identifier, "div");
15
		$this->_container=$container;
16
		$this->setClass("ui popup");
17
		$this->content=$content;
18
		$this->params=array("on"=>"click");
19
	}
20
21
	public function setFlowing(){
22
		return $this->addToProperty("class", "flowing");
23
	}
24
25
	public function setBasic(){
26
		return $this->addToProperty("class", "basic");
27
	}
28
29
	/**
30
	 * {@inheritDoc}
31
	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
32
	 */
33
	public function run(JsUtils $js){
34
		$this->params["popup"]="#".$this->identifier;
35
		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params);
36
	}
37
}