@@ -14,10 +14,12 @@ discard block |
||
| 14 | 14 | parent::__construct($identifier, "div"); |
| 15 | 15 | $this->setClass("item"); |
| 16 | 16 | $this->setContent($content); |
| 17 | - if($value!==NULL) |
|
| 18 | - $this->setData($value); |
|
| 19 | - if($image!==NULL) |
|
| 20 | - $this->asMiniAvatar($image); |
|
| 17 | + if($value!==NULL) { |
|
| 18 | + $this->setData($value); |
|
| 19 | + } |
|
| 20 | + if($image!==NULL) { |
|
| 21 | + $this->asMiniAvatar($image); |
|
| 22 | + } |
|
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | public function setDescription($description){ |
@@ -33,8 +35,9 @@ discard block |
||
| 33 | 35 | |
| 34 | 36 | public function asOption(){ |
| 35 | 37 | $this->tagName="option"; |
| 36 | - if($this->getProperty("data-value")!==null) |
|
| 37 | - $this->setProperty("value", $this->getProperty("data-value")); |
|
| 38 | + if($this->getProperty("data-value")!==null) { |
|
| 39 | + $this->setProperty("value", $this->getProperty("data-value")); |
|
| 40 | + } |
|
| 38 | 41 | } |
| 39 | 42 | |
| 40 | 43 | /** |
@@ -52,22 +55,25 @@ discard block |
||
| 52 | 55 | public function asSearchInput($placeholder=NULL,$icon=NULL){ |
| 53 | 56 | $this->setClass("ui icon search input"); |
| 54 | 57 | $input=new HtmlInput("search-".$this->identifier); |
| 55 | - if(isset($placeholder)) |
|
| 56 | - $input->setProperty("placeholder", $placeholder); |
|
| 58 | + if(isset($placeholder)) { |
|
| 59 | + $input->setProperty("placeholder", $placeholder); |
|
| 60 | + } |
|
| 57 | 61 | $this->content=$input; |
| 58 | - if(isset($icon)) |
|
| 59 | - $this->addIcon($icon); |
|
| 62 | + if(isset($icon)) { |
|
| 63 | + $this->addIcon($icon); |
|
| 64 | + } |
|
| 60 | 65 | return $this; |
| 61 | 66 | } |
| 62 | 67 | |
| 63 | 68 | public function setContent($content){ |
| 64 | 69 | if($content==="-"){ |
| 65 | 70 | $this->asDivider(); |
| 66 | - }elseif($content==="-search-"){ |
|
| 71 | + } elseif($content==="-search-"){ |
|
| 67 | 72 | $values=\explode(",",$content,-1); |
| 68 | 73 | $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
| 69 | - }else |
|
| 70 | - parent::setContent($content); |
|
| 74 | + } else { |
|
| 75 | + parent::setContent($content); |
|
| 76 | + } |
|
| 71 | 77 | return $this; |
| 72 | 78 | } |
| 73 | 79 | |
@@ -79,8 +85,9 @@ discard block |
||
| 79 | 85 | public function asHeader($caption=NULL,$icon=NULL){ |
| 80 | 86 | $this->setClass("header"); |
| 81 | 87 | $this->content=$caption; |
| 82 | - if(isset($icon)) |
|
| 83 | - $this->addIcon($icon,true); |
|
| 88 | + if(isset($icon)) { |
|
| 89 | + $this->addIcon($icon,true); |
|
| 90 | + } |
|
| 84 | 91 | return $this; |
| 85 | 92 | } |
| 86 | 93 | |
@@ -55,10 +55,11 @@ |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function setDismissable($dismiss=true){ |
| 58 | - if($dismiss===true) |
|
| 59 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 60 | - else |
|
| 61 | - $this->close=NULL; |
|
| 58 | + if($dismiss===true) { |
|
| 59 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 60 | + } else { |
|
| 61 | + $this->close=NULL; |
|
| 62 | + } |
|
| 62 | 63 | return $this; |
| 63 | 64 | } |
| 64 | 65 | |
@@ -9,8 +9,9 @@ |
||
| 9 | 9 | public function __construct($identifier,$width){ |
| 10 | 10 | parent::__construct($identifier,"div"); |
| 11 | 11 | $this->setClass("column"); |
| 12 | - if(isset($width)) |
|
| 13 | - $this->setWidth($width); |
|
| 12 | + if(isset($width)) { |
|
| 13 | + $this->setWidth($width); |
|
| 14 | + } |
|
| 14 | 15 | } |
| 15 | 16 | |
| 16 | 17 | public function setWidth($width){ |
@@ -14,10 +14,11 @@ |
||
| 14 | 14 | if(isset($numCols)){ |
| 15 | 15 | $numCols=min(16,$numCols); |
| 16 | 16 | $numCols=max(1,$numCols); |
| 17 | - if($colSizing) |
|
| 18 | - $width=(int)(16/$numCols); |
|
| 19 | - else |
|
| 20 | - $this->_colSize=16/$numCols; |
|
| 17 | + if($colSizing) { |
|
| 18 | + $width=(int)(16/$numCols); |
|
| 19 | + } else { |
|
| 20 | + $this->_colSize=16/$numCols; |
|
| 21 | + } |
|
| 21 | 22 | for ($i=0;$i<$numCols;$i++){ |
| 22 | 23 | $this->addItem($width); |
| 23 | 24 | } |
@@ -101,8 +101,9 @@ discard block |
||
| 101 | 101 | * @return \Ajax\semantic\html\collections\HtmlGrid |
| 102 | 102 | */ |
| 103 | 103 | public function setPadded($value=NULL){ |
| 104 | - if(isset($value)) |
|
| 105 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
| 104 | + if(isset($value)) { |
|
| 105 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
| 106 | + } |
|
| 106 | 107 | return $this->addToProperty("class", "padded"); |
| 107 | 108 | } |
| 108 | 109 | |
@@ -124,8 +125,9 @@ discard block |
||
| 124 | 125 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 125 | 126 | */ |
| 126 | 127 | protected function createItem($value){ |
| 127 | - if($this->_createCols===false) |
|
| 128 | - $value=null; |
|
| 128 | + if($this->_createCols===false) { |
|
| 129 | + $value=null; |
|
| 130 | + } |
|
| 129 | 131 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
| 130 | 132 | return $item; |
| 131 | 133 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | foreach ($items as $k=>$v){ |
| 18 | 18 | $this->addItem([$k,$v]); |
| 19 | 19 | } |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | foreach ($items as $item){ |
| 22 | 22 | $this->addItem($item); |
| 23 | 23 | } |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * @return \Ajax\common\html\HtmlDoubleElement |
| 54 | 54 | */ |
| 55 | 55 | public function getItem($index) { |
| 56 | - if (is_int($index)) |
|
| 57 | - return $this->content[$index]; |
|
| 58 | - else { |
|
| 56 | + if (is_int($index)) { |
|
| 57 | + return $this->content[$index]; |
|
| 58 | + } else { |
|
| 59 | 59 | $elm=$this->getElementById($index, $this->content); |
| 60 | 60 | return $elm; |
| 61 | 61 | } |
@@ -15,8 +15,9 @@ discard block |
||
| 15 | 15 | if(isset($type)){ |
| 16 | 16 | if($type=="page"){ |
| 17 | 17 | $this->asPageHeader($niveau); |
| 18 | - }else |
|
| 19 | - $this->asContentHeader($niveau); |
|
| 18 | + } else { |
|
| 19 | + $this->asContentHeader($niveau); |
|
| 20 | + } |
|
| 20 | 21 | } |
| 21 | 22 | $this->content=$content; |
| 22 | 23 | } |
@@ -48,7 +49,7 @@ discard block |
||
| 48 | 49 | if(!\is_object($title)){ |
| 49 | 50 | $this->content=new HtmlDoubleElement("content-".$this->identifier,"div"); |
| 50 | 51 | $this->content->setContent($title); |
| 51 | - }else{ |
|
| 52 | + } else{ |
|
| 52 | 53 | $this->content=$title; |
| 53 | 54 | } |
| 54 | 55 | $this->content->setClass("content"); |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function getConstantValues($postFix=""){ |
| 27 | - if($postFix!=="") |
|
| 28 | - return \array_values(self::getConstants()); |
|
| 29 | - else{ |
|
| 27 | + if($postFix!=="") { |
|
| 28 | + return \array_values(self::getConstants()); |
|
| 29 | + } else{ |
|
| 30 | 30 | return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants())); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -19,8 +19,9 @@ |
||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public function asAvatar($caption=NULL){ |
| 22 | - if(isset($caption)) |
|
| 23 | - $this->wrap("",$caption); |
|
| 22 | + if(isset($caption)) { |
|
| 23 | + $this->wrap("",$caption); |
|
| 24 | + } |
|
| 24 | 25 | return $this->addToProperty("class", "avatar"); |
| 25 | 26 | } |
| 26 | 27 | } |
| 27 | 28 | \ No newline at end of file |