@@ -7,18 +7,18 @@ |
||
7 | 7 | |
8 | 8 | public function __construct(JsUtils $js) { |
9 | 9 | parent::__construct($js); |
10 | - $this->uiName = "dimmer"; |
|
10 | + $this->uiName="dimmer"; |
|
11 | 11 | } |
12 | 12 | |
13 | - public function setOn($value = false) { |
|
14 | - $this->params["on"] = $value; |
|
13 | + public function setOn($value=false) { |
|
14 | + $this->params["on"]=$value; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function setOpacity($value) { |
18 | - $this->params["opacity"] = $value; |
|
18 | + $this->params["opacity"]=$value; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function setClosable($value) { |
22 | - $this->params["closable"] = $value; |
|
22 | + $this->params["closable"]=$value; |
|
23 | 23 | } |
24 | 24 | } |
@@ -12,21 +12,21 @@ discard block |
||
12 | 12 | |
13 | 13 | private $_inverted; |
14 | 14 | |
15 | - public function __construct($identifier, $content = NULL) { |
|
15 | + public function __construct($identifier, $content=NULL) { |
|
16 | 16 | parent::__construct($identifier, "div", "ui dimmer"); |
17 | 17 | $this->setContent($content); |
18 | - $this->_inverted = false; |
|
18 | + $this->_inverted=false; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function setContent($content) { |
22 | - $this->content = new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
22 | + $this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | - public function asIcon($icon, $title, $subHeader = NULL) { |
|
27 | - $header = new HtmlHeader("header-" . $this->identifier); |
|
26 | + public function asIcon($icon, $title, $subHeader=NULL) { |
|
27 | + $header=new HtmlHeader("header-".$this->identifier); |
|
28 | 28 | $header->asIcon($icon, $title, $subHeader); |
29 | - if ($this->_inverted === false) |
|
29 | + if ($this->_inverted===false) |
|
30 | 30 | $header->setInverted(); |
31 | 31 | return $this->setContent($header); |
32 | 32 | } |
@@ -35,24 +35,24 @@ discard block |
||
35 | 35 | return $this->addToProperty("class", "page"); |
36 | 36 | } |
37 | 37 | |
38 | - public function setInverted($recursive = true) { |
|
38 | + public function setInverted($recursive=true) { |
|
39 | 39 | parent::setInverted($recursive); |
40 | - $this->_inverted = true; |
|
40 | + $this->_inverted=true; |
|
41 | 41 | return $this; |
42 | 42 | } |
43 | 43 | |
44 | 44 | public function run(JsUtils $js) { |
45 | 45 | if ($this->_container instanceof HtmlSingleElement) { |
46 | - $this->_bsComponent = $js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
46 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params); |
|
47 | 47 | } else { |
48 | - $this->_bsComponent = $js->semantic()->dimmer("#" . $this->identifier, $this->_params); |
|
48 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->identifier, $this->_params); |
|
49 | 49 | } |
50 | 50 | return parent::run($js); |
51 | 51 | } |
52 | 52 | |
53 | 53 | public function jsShow() { |
54 | 54 | if (isset($this->_container)) |
55 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
55 | + return '$("#.'.$this->_container->getIdentifier().').dimmer("show");'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function setBlurring() { |
@@ -60,17 +60,17 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function setParams($_params) { |
63 | - $this->_params = $_params; |
|
63 | + $this->_params=$_params; |
|
64 | 64 | return $this; |
65 | 65 | } |
66 | 66 | |
67 | 67 | public function setContainer($_container) { |
68 | - $this->_container = $_container; |
|
68 | + $this->_container=$_container; |
|
69 | 69 | return $this; |
70 | 70 | } |
71 | 71 | |
72 | 72 | public function setClosable($closable) { |
73 | - $this->_params['closable'] = $closable; |
|
73 | + $this->_params['closable']=$closable; |
|
74 | 74 | return $this; |
75 | 75 | } |
76 | 76 | } |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | public function asIcon($icon, $title, $subHeader = NULL) { |
27 | 27 | $header = new HtmlHeader("header-" . $this->identifier); |
28 | 28 | $header->asIcon($icon, $title, $subHeader); |
29 | - if ($this->_inverted === false) |
|
30 | - $header->setInverted(); |
|
29 | + if ($this->_inverted === false) { |
|
30 | + $header->setInverted(); |
|
31 | + } |
|
31 | 32 | return $this->setContent($header); |
32 | 33 | } |
33 | 34 | |
@@ -51,8 +52,9 @@ discard block |
||
51 | 52 | } |
52 | 53 | |
53 | 54 | public function jsShow() { |
54 | - if (isset($this->_container)) |
|
55 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
55 | + if (isset($this->_container)) { |
|
56 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
57 | + } |
|
56 | 58 | } |
57 | 59 | |
58 | 60 | public function setBlurring() { |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | */ |
30 | 30 | protected $js; |
31 | 31 | |
32 | - public function __construct($autoCompile = true) { |
|
33 | - $this->autoCompile = $autoCompile; |
|
34 | - $this->components = array(); |
|
35 | - $this->htmlComponents = array(); |
|
32 | + public function __construct($autoCompile=true) { |
|
33 | + $this->autoCompile=$autoCompile; |
|
34 | + $this->components=array(); |
|
35 | + $this->htmlComponents=array(); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function isAutoCompile() { |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | public function setAutoCompile($autoCompile) { |
43 | - $this->autoCompile = $autoCompile; |
|
43 | + $this->autoCompile=$autoCompile; |
|
44 | 44 | return $this; |
45 | 45 | } |
46 | 46 | |
47 | - public function compile($internal = false) { |
|
48 | - if ($internal === false && $this->autoCompile === true) |
|
47 | + public function compile($internal=false) { |
|
48 | + if ($internal===false && $this->autoCompile===true) |
|
49 | 49 | throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
50 | 50 | foreach ($this->components as $component) { |
51 | 51 | $component->compile(); |
@@ -53,20 +53,20 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | public function setJs(JsUtils $js) { |
56 | - $this->js = $js; |
|
56 | + $this->js=$js; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | public function addComponent(SimpleComponent $component, $attachTo, $params) { |
60 | 60 | if ($this->autoCompile) { |
61 | - if ($attachTo != null) { |
|
62 | - if (! isset($this->components[$attachTo])) { |
|
63 | - $this->components[$attachTo] = $component; |
|
61 | + if ($attachTo!=null) { |
|
62 | + if (!isset($this->components[$attachTo])) { |
|
63 | + $this->components[$attachTo]=$component; |
|
64 | 64 | } else { |
65 | - $this->components[] = $component; |
|
65 | + $this->components[]=$component; |
|
66 | 66 | } |
67 | 67 | $component->attach($attachTo); |
68 | 68 | } else { |
69 | - $this->components[] = $component; |
|
69 | + $this->components[]=$component; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | if (isset($params)) |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | public function addHtmlComponent(BaseHtml $htmlComponent) { |
79 | - $this->htmlComponents[$htmlComponent->getIdentifier()] = $htmlComponent; |
|
79 | + $this->htmlComponents[$htmlComponent->getIdentifier()]=$htmlComponent; |
|
80 | 80 | return $htmlComponent; |
81 | 81 | } |
82 | 82 | |
83 | - public function compileHtml(JsUtils $js = NULL, &$view = NULL) { |
|
83 | + public function compileHtml(JsUtils $js=NULL, &$view=NULL) { |
|
84 | 84 | foreach ($this->htmlComponents as $htmlComponent) { |
85 | 85 | $htmlComponent->compile($js, $view); |
86 | 86 | } |
@@ -45,8 +45,9 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | public function compile($internal = false) { |
48 | - if ($internal === false && $this->autoCompile === true) |
|
49 | - throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
48 | + if ($internal === false && $this->autoCompile === true) { |
|
49 | + throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
50 | + } |
|
50 | 51 | foreach ($this->components as $component) { |
51 | 52 | $component->compile(); |
52 | 53 | } |
@@ -69,9 +70,10 @@ discard block |
||
69 | 70 | $this->components[] = $component; |
70 | 71 | } |
71 | 72 | } |
72 | - if (isset($params)) |
|
73 | - if (\is_array($params)) |
|
73 | + if (isset($params)) { |
|
74 | + if (\is_array($params)) |
|
74 | 75 | $component->setParams($params); |
76 | + } |
|
75 | 77 | return $component; |
76 | 78 | } |
77 | 79 |