@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | class HtmlLink extends HtmlSemDoubleElement { |
11 | 11 | use HtmlLinkTrait; |
12 | 12 | |
13 | - public function __construct($identifier, $href="#", $content="Link",$target=NULL) { |
|
13 | + public function __construct($identifier, $href="#", $content="Link", $target=NULL) { |
|
14 | 14 | parent::__construct($identifier, "a", ""); |
15 | 15 | $this->setHref($href); |
16 | - if(isset($target)) |
|
16 | + if (isset($target)) |
|
17 | 17 | $this->setTarget($target); |
18 | 18 | $this->content=$content; |
19 | 19 | } |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() |
24 | 24 | */ |
25 | 25 | public function run(JsUtils $js) { |
26 | - $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); |
|
26 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
27 | 27 | $this->addEventsOnRun($js); |
28 | 28 | return $this->_bsComponent; |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function addIcon($icon, $before=true) { |
32 | - return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before); |
|
32 | + return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public static function icon($identifier, $icon, $href="#", $label=NULL) { |
@@ -13,8 +13,9 @@ |
||
13 | 13 | public function __construct($identifier, $href="#", $content="Link",$target=NULL) { |
14 | 14 | parent::__construct($identifier, "a", ""); |
15 | 15 | $this->setHref($href); |
16 | - if(isset($target)) |
|
17 | - $this->setTarget($target); |
|
16 | + if(isset($target)) { |
|
17 | + $this->setTarget($target); |
|
18 | + } |
|
18 | 19 | $this->content=$content; |
19 | 20 | } |
20 | 21 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | use BaseTrait; |
23 | 23 | protected $_popup=NULL; |
24 | 24 | protected $_dimmer=NULL; |
25 | - protected $_params=array (); |
|
25 | + protected $_params=array(); |
|
26 | 26 | |
27 | 27 | |
28 | 28 | public function __construct($identifier, $tagName="p", $baseClass="ui", $content=NULL) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | public function addDimmer($params=array(), $content=NULL) { |
55 | - $dimmer=new HtmlDimmer("dimmer-" . $this->identifier, $content); |
|
55 | + $dimmer=new HtmlDimmer("dimmer-".$this->identifier, $content); |
|
56 | 56 | $dimmer->setParams($params); |
57 | 57 | $dimmer->setContainer($this); |
58 | 58 | $this->addContent($dimmer); |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | |
62 | 62 | public function addLabel($label, $before=false, $icon=NULL) { |
63 | 63 | $labelO=$label; |
64 | - if (\is_object($label) === false) { |
|
65 | - $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
|
64 | + if (\is_object($label)===false) { |
|
65 | + $labelO=new HtmlLabel("label-".$this->identifier, $label); |
|
66 | 66 | if (isset($icon)) |
67 | 67 | $labelO->addIcon($icon); |
68 | 68 | } else { |
69 | - $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
|
69 | + $labelO->addToPropertyCtrl("class", "label", array("label")); |
|
70 | 70 | } |
71 | 71 | $this->addContent($labelO, $before); |
72 | 72 | return $labelO; |
73 | 73 | } |
74 | 74 | |
75 | - public function attachLabel($label,$side=Side::TOP,$direction=Direction::NONE,$icon=NULL){ |
|
76 | - $label=$this->addLabel($label,true,$icon); |
|
77 | - $label->setAttached($side,$direction); |
|
75 | + public function attachLabel($label, $side=Side::TOP, $direction=Direction::NONE, $icon=NULL) { |
|
76 | + $label=$this->addLabel($label, true, $icon); |
|
77 | + $label->setAttached($side, $direction); |
|
78 | 78 | return $this; |
79 | 79 | } |
80 | 80 | |
@@ -82,19 +82,19 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
84 | 84 | */ |
85 | - public function asLink($href=NULL,$target=NULL) { |
|
85 | + public function asLink($href=NULL, $target=NULL) { |
|
86 | 86 | if (isset($href)) |
87 | 87 | $this->setProperty("href", $href); |
88 | - if(isset($target)) |
|
88 | + if (isset($target)) |
|
89 | 89 | $this->setProperty("target", $target); |
90 | 90 | return $this->setTagName("a"); |
91 | 91 | } |
92 | 92 | |
93 | 93 | public function jsShowDimmer($show=true) { |
94 | 94 | $status="hide"; |
95 | - if ($show === true) |
|
95 | + if ($show===true) |
|
96 | 96 | $status="show"; |
97 | - return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
|
97 | + return '$("#.'.$this->identifier.').dimmer("'.$status.'");'; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | public function run(JsUtils $js) { |
107 | - $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); |
|
107 | + $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); |
|
108 | 108 | parent::run($js); |
109 | 109 | $this->addEventsOnRun($js); |
110 | 110 | if (isset($this->_popup)) { |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
38 | - if (isset($this->_popup)) |
|
39 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
38 | + if (isset($this->_popup)) { |
|
39 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
40 | + } |
|
40 | 41 | } |
41 | 42 | |
42 | 43 | public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
@@ -63,8 +64,9 @@ discard block |
||
63 | 64 | $labelO=$label; |
64 | 65 | if (\is_object($label) === false) { |
65 | 66 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
66 | - if (isset($icon)) |
|
67 | - $labelO->addIcon($icon); |
|
67 | + if (isset($icon)) { |
|
68 | + $labelO->addIcon($icon); |
|
69 | + } |
|
68 | 70 | } else { |
69 | 71 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
70 | 72 | } |
@@ -83,23 +85,27 @@ discard block |
||
83 | 85 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
84 | 86 | */ |
85 | 87 | public function asLink($href=NULL,$target=NULL) { |
86 | - if (isset($href)) |
|
87 | - $this->setProperty("href", $href); |
|
88 | - if(isset($target)) |
|
89 | - $this->setProperty("target", $target); |
|
88 | + if (isset($href)) { |
|
89 | + $this->setProperty("href", $href); |
|
90 | + } |
|
91 | + if(isset($target)) { |
|
92 | + $this->setProperty("target", $target); |
|
93 | + } |
|
90 | 94 | return $this->setTagName("a"); |
91 | 95 | } |
92 | 96 | |
93 | 97 | public function jsShowDimmer($show=true) { |
94 | 98 | $status="hide"; |
95 | - if ($show === true) |
|
96 | - $status="show"; |
|
99 | + if ($show === true) { |
|
100 | + $status="show"; |
|
101 | + } |
|
97 | 102 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
98 | 103 | } |
99 | 104 | |
100 | 105 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
101 | - if (isset($this->_popup)) |
|
102 | - $this->_popup->compile($js); |
|
106 | + if (isset($this->_popup)) { |
|
107 | + $this->_popup->compile($js); |
|
108 | + } |
|
103 | 109 | return parent::compile($js, $view); |
104 | 110 | } |
105 | 111 |