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

HtmlPopup::setBasic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}