Completed
Push — master ( 541276...03d1b2 )
by Jean-Christophe
03:16
created

HtmlPopup   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A setFlowing() 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
		$this->addToProperty("class", "flowing");
23
	}
24
25
	/**
26
	 * {@inheritDoc}
27
	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
28
	 */
29
	public function run(JsUtils $js){
30
		$this->params["popup"]="#".$this->identifier;
31
		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params);
32
	}
33
}