@@ -33,17 +33,17 @@ discard block |
||
| 33 | 33 | return $this->getHtmlCk()->attachEvents($events); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function getField(){ |
|
| 36 | + public function getField() { |
|
| 37 | 37 | return $this->content["field"]->getField(); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function getHtmlCk(){ |
|
| 40 | + public function getHtmlCk() { |
|
| 41 | 41 | return $this->content["field"]; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function getDataField(){ |
|
| 45 | - $field= $this->getField(); |
|
| 46 | - if($field instanceof AbstractCheckbox) |
|
| 44 | + public function getDataField() { |
|
| 45 | + $field=$this->getField(); |
|
| 46 | + if ($field instanceof AbstractCheckbox) |
|
| 47 | 47 | $field=$field->getField(); |
| 48 | 48 | return $field; |
| 49 | 49 | } |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | * @param boolean $value |
| 54 | 54 | * @return \Ajax\semantic\html\collections\form\traits\CheckboxTrait |
| 55 | 55 | */ |
| 56 | - public function setChecked($value=true){ |
|
| 57 | - if($value===true){ |
|
| 56 | + public function setChecked($value=true) { |
|
| 57 | + if ($value===true) { |
|
| 58 | 58 | $this->getDataField()->setProperty("checked", "checked"); |
| 59 | - }else{ |
|
| 59 | + } else { |
|
| 60 | 60 | $this->getDataField()->removeProperty("checked"); |
| 61 | 61 | } |
| 62 | 62 | return $this; |
@@ -43,8 +43,9 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | public function getDataField(){ |
| 45 | 45 | $field= $this->getField(); |
| 46 | - if($field instanceof AbstractCheckbox) |
|
| 47 | - $field=$field->getField(); |
|
| 46 | + if($field instanceof AbstractCheckbox) { |
|
| 47 | + $field=$field->getField(); |
|
| 48 | + } |
|
| 48 | 49 | return $field; |
| 49 | 50 | } |
| 50 | 51 | |
@@ -56,7 +57,7 @@ discard block |
||
| 56 | 57 | public function setChecked($value=true){ |
| 57 | 58 | if($value===true){ |
| 58 | 59 | $this->getDataField()->setProperty("checked", "checked"); |
| 59 | - }else{ |
|
| 60 | + } else{ |
|
| 60 | 61 | $this->getDataField()->removeProperty("checked"); |
| 61 | 62 | } |
| 62 | 63 | return $this; |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | use Ajax\semantic\html\base\constants\CheckboxType; |
| 7 | 7 | |
| 8 | 8 | abstract class AbstractCheckbox extends HtmlSemDoubleElement { |
| 9 | - protected $_params=array (); |
|
| 9 | + protected $_params=array(); |
|
| 10 | 10 | |
| 11 | 11 | public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $inputType="checkbox", $type="checkbox") { |
| 12 | 12 | parent::__construct("ck-".$identifier, "div", "ui ".$type); |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | $this->setLabel($label); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function setChecked($value=true){ |
|
| 21 | - if($value===true){ |
|
| 20 | + public function setChecked($value=true) { |
|
| 21 | + if ($value===true) { |
|
| 22 | 22 | $this->getField()->setProperty("checked", "checked"); |
| 23 | - }else{ |
|
| 23 | + } else { |
|
| 24 | 24 | $this->getField()->removeProperty("checked"); |
| 25 | 25 | } |
| 26 | 26 | return $this; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
| 83 | 83 | */ |
| 84 | 84 | public function attachEvent($selector, $action=NULL) { |
| 85 | - if (isset($action)!==false||\is_numeric($action)===true) { |
|
| 85 | + if (isset($action)!==false || \is_numeric($action)===true) { |
|
| 86 | 86 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");'; |
| 87 | 87 | } else { |
| 88 | 88 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'");'; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function attachEvents($events=array()) { |
| 100 | 100 | if (\is_array($events)) { |
| 101 | - foreach ( $events as $action => $selector ) { |
|
| 101 | + foreach ($events as $action => $selector) { |
|
| 102 | 102 | $this->attachEvent($selector, $action); |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -13,14 +13,15 @@ discard block |
||
| 13 | 13 | $field=new \Ajax\common\html\html5\HtmlInput($identifier, $inputType, $value); |
| 14 | 14 | $field->setProperty("name", $name); |
| 15 | 15 | $this->setField($field); |
| 16 | - if (isset($label)) |
|
| 17 | - $this->setLabel($label); |
|
| 16 | + if (isset($label)) { |
|
| 17 | + $this->setLabel($label); |
|
| 18 | + } |
|
| 18 | 19 | } |
| 19 | 20 | |
| 20 | 21 | public function setChecked($value=true){ |
| 21 | 22 | if($value===true){ |
| 22 | 23 | $this->getField()->setProperty("checked", "checked"); |
| 23 | - }else{ |
|
| 24 | + } else{ |
|
| 24 | 25 | $this->getField()->removeProperty("checked"); |
| 25 | 26 | } |
| 26 | 27 | return $this; |
@@ -49,8 +50,9 @@ discard block |
||
| 49 | 50 | * @return mixed |
| 50 | 51 | */ |
| 51 | 52 | public function getLabel() { |
| 52 | - if (\array_key_exists("label", $this->content)) |
|
| 53 | - return $this->content["label"]; |
|
| 53 | + if (\array_key_exists("label", $this->content)) { |
|
| 54 | + return $this->content["label"]; |
|
| 55 | + } |
|
| 54 | 56 | } |
| 55 | 57 | |
| 56 | 58 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function setFocusable($value=true) { |
| 58 | - if ($value === true) |
|
| 58 | + if ($value===true) |
|
| 59 | 59 | $this->setProperty("tabindex", "0"); |
| 60 | 60 | else { |
| 61 | 61 | $this->removeProperty("tabindex"); |
@@ -65,14 +65,14 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function setAnimated($content, $animation="") { |
| 67 | 67 | $this->setTagName("div"); |
| 68 | - $this->addToProperty("class", "animated " . $animation); |
|
| 69 | - $visible=new HtmlSemDoubleElement("visible-" . $this->identifier, "div"); |
|
| 68 | + $this->addToProperty("class", "animated ".$animation); |
|
| 69 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
| 70 | 70 | $visible->setClass("visible content"); |
| 71 | 71 | $visible->setContent($this->content); |
| 72 | - $hidden=new HtmlSemDoubleElement("hidden-" . $this->identifier, "div"); |
|
| 72 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
| 73 | 73 | $hidden->setClass("hidden content"); |
| 74 | 74 | $hidden->setContent($content); |
| 75 | - $this->content=array ($visible,$hidden ); |
|
| 75 | + $this->content=array($visible, $hidden); |
|
| 76 | 76 | return $hidden; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function asIcon($icon) { |
| 85 | 85 | $iconO=$icon; |
| 86 | 86 | if (\is_string($icon)) { |
| 87 | - $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); |
|
| 87 | + $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
|
| 88 | 88 | } |
| 89 | 89 | $this->addToProperty("class", "icon"); |
| 90 | 90 | $this->content=$iconO; |
@@ -106,9 +106,9 @@ discard block |
||
| 106 | 106 | public function addLabel($label, $before=false, $icon=NULL) { |
| 107 | 107 | $this->tagName="div"; |
| 108 | 108 | $this->addToProperty("class", "labeled"); |
| 109 | - $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
|
| 109 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
| 110 | 110 | $this->content->setTagName("div"); |
| 111 | - $label=new HtmlLabel("label-" . $this->identifier, $label, $icon,"a"); |
|
| 111 | + $label=new HtmlLabel("label-".$this->identifier, $label, $icon, "a"); |
|
| 112 | 112 | $label->setBasic(); |
| 113 | 113 | $this->addContent($label, $before); |
| 114 | 114 | return $label; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function fromArray($array) { |
| 122 | 122 | $array=parent::fromArray($array); |
| 123 | - foreach ( $array as $key => $value ) { |
|
| 123 | + foreach ($array as $key => $value) { |
|
| 124 | 124 | $this->setProperty($key, $value); |
| 125 | 125 | } |
| 126 | 126 | return $array; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | public static function social($identifier, $social, $value=NULL) { |
| 178 | - if ($value === NULL) |
|
| 178 | + if ($value===NULL) |
|
| 179 | 179 | $value=\ucfirst($social); |
| 180 | 180 | $return=new HtmlButton($identifier, $value); |
| 181 | 181 | $return->addIcon($social); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | public function asLink($href=NULL) { |
| 198 | - $lnk=new HtmlLink("lnk-".$this->identifier,$href,$this->content); |
|
| 198 | + $lnk=new HtmlLink("lnk-".$this->identifier, $href, $this->content); |
|
| 199 | 199 | $this->content=$lnk; |
| 200 | 200 | return $this; |
| 201 | 201 | } |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function setFocusable($value=true) { |
| 58 | - if ($value === true) |
|
| 59 | - $this->setProperty("tabindex", "0"); |
|
| 60 | - else { |
|
| 58 | + if ($value === true) { |
|
| 59 | + $this->setProperty("tabindex", "0"); |
|
| 60 | + } else { |
|
| 61 | 61 | $this->removeProperty("tabindex"); |
| 62 | 62 | } |
| 63 | 63 | return $this; |
@@ -175,8 +175,9 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | public static function social($identifier, $social, $value=NULL) { |
| 178 | - if ($value === NULL) |
|
| 179 | - $value=\ucfirst($social); |
|
| 178 | + if ($value === NULL) { |
|
| 179 | + $value=\ucfirst($social); |
|
| 180 | + } |
|
| 180 | 181 | $return=new HtmlButton($identifier, $value); |
| 181 | 182 | $return->addIcon($social); |
| 182 | 183 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |