@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @param string $identifier |
| 60 | 60 | * @param string $icon |
| 61 | 61 | */ |
| 62 | - public function htmlIcon($identifier,$icon){ |
|
| 62 | + public function htmlIcon($identifier, $icon) { |
|
| 63 | 63 | return $this->addHtmlComponent(new HtmlIcon($identifier, $icon)); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -68,14 +68,14 @@ discard block |
||
| 68 | 68 | * @param string $size |
| 69 | 69 | * @param array $icons |
| 70 | 70 | */ |
| 71 | - public function htmlIconGroups($identifier,$size="",$icons=array()){ |
|
| 72 | - $group=new HtmlIconGroups($identifier,$size); |
|
| 73 | - if(JArray::isAssociative($icons)){ |
|
| 74 | - foreach ($icons as $icon=>$size){ |
|
| 75 | - $group->add($icon,$size); |
|
| 71 | + public function htmlIconGroups($identifier, $size="", $icons=array()) { |
|
| 72 | + $group=new HtmlIconGroups($identifier, $size); |
|
| 73 | + if (JArray::isAssociative($icons)) { |
|
| 74 | + foreach ($icons as $icon=>$size) { |
|
| 75 | + $group->add($icon, $size); |
|
| 76 | 76 | } |
| 77 | - }else{ |
|
| 78 | - foreach ($icons as $icon){ |
|
| 77 | + }else { |
|
| 78 | + foreach ($icons as $icon) { |
|
| 79 | 79 | $group->add($icon); |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * @param array $elements |
| 88 | 88 | * @param boolean $asIcons |
| 89 | 89 | */ |
| 90 | - public function htmlButtonGroups($identifier,$elements=array(),$asIcons=false){ |
|
| 91 | - return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements,$asIcons)); |
|
| 90 | + public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) { |
|
| 91 | + return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons)); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param string $identifier |
| 97 | 97 | * @param string $content |
| 98 | 98 | */ |
| 99 | - public function htmlContainer($identifier,$content=""){ |
|
| 99 | + public function htmlContainer($identifier, $content="") { |
|
| 100 | 100 | return $this->addHtmlComponent(new HtmlContainer($identifier, $content)); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | * @param string $identifier |
| 105 | 105 | * @param string $content |
| 106 | 106 | */ |
| 107 | - public function htmlDivider($identifier,$content="",$tagName="div"){ |
|
| 108 | - return $this->addHtmlComponent(new HtmlDivider($identifier, $content,$tagName)); |
|
| 107 | + public function htmlDivider($identifier, $content="", $tagName="div") { |
|
| 108 | + return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName)); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -113,16 +113,16 @@ discard block |
||
| 113 | 113 | * @param string $content |
| 114 | 114 | * @param string $tagName |
| 115 | 115 | */ |
| 116 | - public function htmlLabel($identifier,$content="",$tagName="div"){ |
|
| 117 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$tagName)); |
|
| 116 | + public function htmlLabel($identifier, $content="", $tagName="div") { |
|
| 117 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $tagName)); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | 121 | * @param string $identifier |
| 122 | 122 | * @param array $items |
| 123 | 123 | */ |
| 124 | - public function htmlMenu($identifier,$items=array()){ |
|
| 125 | - return $this->addHtmlComponent(new HtmlMenu($identifier,$items)); |
|
| 124 | + public function htmlMenu($identifier, $items=array()) { |
|
| 125 | + return $this->addHtmlComponent(new HtmlMenu($identifier, $items)); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -130,8 +130,8 @@ discard block |
||
| 130 | 130 | * @param string $value |
| 131 | 131 | * @param array $items |
| 132 | 132 | */ |
| 133 | - public function htmlDropdown($identifier, $value="", $items=array()){ |
|
| 134 | - return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items)); |
|
| 133 | + public function htmlDropdown($identifier, $value="", $items=array()) { |
|
| 134 | + return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items)); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | * @param string $identifier |
| 140 | 140 | * @param string $content |
| 141 | 141 | */ |
| 142 | - public function htmlMessage($identifier, $content=""){ |
|
| 143 | - return $this->addHtmlComponent(new HtmlMessage($identifier,$content)); |
|
| 142 | + public function htmlMessage($identifier, $content="") { |
|
| 143 | + return $this->addHtmlComponent(new HtmlMessage($identifier, $content)); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | * @param string $identifier |
| 149 | 149 | * @param string $content |
| 150 | 150 | */ |
| 151 | - public function htmlSegment($identifier, $content=""){ |
|
| 152 | - return $this->addHtmlComponent(new HtmlSegment($identifier,$content)); |
|
| 151 | + public function htmlSegment($identifier, $content="") { |
|
| 152 | + return $this->addHtmlComponent(new HtmlSegment($identifier, $content)); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -157,19 +157,19 @@ discard block |
||
| 157 | 157 | * @param string $identifier |
| 158 | 158 | * @param array $items the segments |
| 159 | 159 | */ |
| 160 | - public function htmlSegmentGroups($identifier, $items=array()){ |
|
| 161 | - return $this->addHtmlComponent(new HtmlSegmentGroups($identifier,$items)); |
|
| 160 | + public function htmlSegmentGroups($identifier, $items=array()) { |
|
| 161 | + return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items)); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | 165 | * @param string $identifier |
| 166 | 166 | * @param mixed $content |
| 167 | 167 | */ |
| 168 | - public function htmlPopup(BaseHtml $container,$identifier,$content){ |
|
| 169 | - return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content)); |
|
| 168 | + public function htmlPopup(BaseHtml $container, $identifier, $content) { |
|
| 169 | + return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content)); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - public function htmlGrid($identifier,$numRows=1,$numCols=NULL){ |
|
| 173 | - return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols)); |
|
| 172 | + public function htmlGrid($identifier, $numRows=1, $numCols=NULL) { |
|
| 173 | + return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols)); |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
| 2 | 2 | namespace Ajax\semantic\html\base; |
| 3 | 3 | use Ajax\common\BaseEnum; |
| 4 | 4 | abstract class Wide extends BaseEnum { |
| 5 | - const W1="one", W2="two", W3="three", W4="four",W5="five", W6="six", W7="seven", W8="eight",W9="nine",W10="ten",W11="eleven",W12="twelve",W13="thirteen",W14="fourteen",W15="fifteen",W16="sixteen"; |
|
| 5 | + const W1="one", W2="two", W3="three", W4="four", W5="five", W6="six", W7="seven", W8="eight", W9="nine", W10="ten", W11="eleven", W12="twelve", W13="thirteen", W14="fourteen", W15="fifteen", W16="sixteen"; |
|
| 6 | 6 | } |
| 7 | 7 | \ No newline at end of file |
@@ -6,22 +6,22 @@ discard block |
||
| 6 | 6 | use Ajax\semantic\html\content\HtmlGridRow; |
| 7 | 7 | use Ajax\semantic\html\base\Wide; |
| 8 | 8 | |
| 9 | -class HtmlGrid extends HtmlCollection{ |
|
| 9 | +class HtmlGrid extends HtmlCollection { |
|
| 10 | 10 | |
| 11 | 11 | private $_createCols; |
| 12 | 12 | private $_colSizing=true; |
| 13 | - public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true){ |
|
| 14 | - parent::__construct( $identifier, "div"); |
|
| 13 | + public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true) { |
|
| 14 | + parent::__construct($identifier, "div"); |
|
| 15 | 15 | $this->_createCols=$createCols; |
| 16 | - if(isset($numCols)){ |
|
| 17 | - if($this->_createCols){ |
|
| 16 | + if (isset($numCols)) { |
|
| 17 | + if ($this->_createCols) { |
|
| 18 | 18 | $this->_colSizing=false; |
| 19 | 19 | } |
| 20 | 20 | $cols=Wide::getConstants()["W".$numCols]; |
| 21 | 21 | $this->setClass($cols." column"); |
| 22 | 22 | } |
| 23 | - $this->addToProperty("class","ui grid"); |
|
| 24 | - $this->setNumRows($numRows,$numCols); |
|
| 23 | + $this->addToProperty("class", "ui grid"); |
|
| 24 | + $this->setNumRows($numRows, $numCols); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | * @param int $numCols |
| 31 | 31 | * @return \Ajax\semantic\html\collections\HtmlGrid |
| 32 | 32 | */ |
| 33 | - public function setNumRows($numRows,$numCols=NULL){ |
|
| 33 | + public function setNumRows($numRows, $numCols=NULL) { |
|
| 34 | 34 | $count=$this->count(); |
| 35 | - for($i=$count;$i<$numRows;$i++){ |
|
| 35 | + for ($i=$count; $i<$numRows; $i++) { |
|
| 36 | 36 | $this->addItem($numCols); |
| 37 | 37 | } |
| 38 | 38 | return $this; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * @param int $index |
| 44 | 44 | * @return \Ajax\semantic\html\collections\HtmlGridRow |
| 45 | 45 | */ |
| 46 | - public function getRow($index){ |
|
| 46 | + public function getRow($index) { |
|
| 47 | 47 | return $this->getItem($index); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | * @param int $col |
| 53 | 53 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
| 54 | 54 | */ |
| 55 | - public function getCell($row,$col){ |
|
| 55 | + public function getCell($row, $col) { |
|
| 56 | 56 | $row=$this->getItem($row); |
| 57 | - if(isset($row)){ |
|
| 57 | + if (isset($row)) { |
|
| 58 | 58 | $col=$row->getItem($col); |
| 59 | 59 | } |
| 60 | 60 | return $col; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - protected function createItem($value){ |
|
| 64 | - if($this->_createCols===false) |
|
| 63 | + protected function createItem($value) { |
|
| 64 | + if ($this->_createCols===false) |
|
| 65 | 65 | $value=null; |
| 66 | - $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
|
| 66 | + $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing); |
|
| 67 | 67 | return $item; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -5,19 +5,19 @@ |
||
| 5 | 5 | use Ajax\semantic\html\base\HtmlSemDoubleElement; |
| 6 | 6 | use Ajax\semantic\html\base\Wide; |
| 7 | 7 | |
| 8 | -class HtmlGridCol extends HtmlSemDoubleElement{ |
|
| 9 | - public function __construct($identifier,$width){ |
|
| 10 | - parent::__construct($identifier,"div"); |
|
| 8 | +class HtmlGridCol extends HtmlSemDoubleElement { |
|
| 9 | + public function __construct($identifier, $width) { |
|
| 10 | + parent::__construct($identifier, "div"); |
|
| 11 | 11 | $this->setClass("column"); |
| 12 | - if(isset($width)) |
|
| 12 | + if (isset($width)) |
|
| 13 | 13 | $this->setWidth($width); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - public function setWidth($width){ |
|
| 17 | - if(\is_int($width)){ |
|
| 16 | + public function setWidth($width) { |
|
| 17 | + if (\is_int($width)) { |
|
| 18 | 18 | $width=Wide::getConstants()["W".$width]; |
| 19 | 19 | } |
| 20 | 20 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
| 21 | - return $this->addToPropertyCtrl("class", "wide",array("wide")); |
|
| 21 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -4,21 +4,21 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Ajax\common\html\html5\HtmlCollection; |
| 6 | 6 | |
| 7 | -class HtmlGridRow extends HtmlCollection{ |
|
| 7 | +class HtmlGridRow extends HtmlCollection { |
|
| 8 | 8 | |
| 9 | 9 | private $_colSize; |
| 10 | - public function __construct( $identifier,$numCols=NULL,$colSizing=false){ |
|
| 11 | - parent::__construct( $identifier,"div"); |
|
| 10 | + public function __construct($identifier, $numCols=NULL, $colSizing=false) { |
|
| 11 | + parent::__construct($identifier, "div"); |
|
| 12 | 12 | $this->setClass("row"); |
| 13 | 13 | $width=null; |
| 14 | - if(isset($numCols)){ |
|
| 15 | - $numCols=min(16,$numCols); |
|
| 16 | - $numCols=max(1,$numCols); |
|
| 17 | - if($colSizing) |
|
| 18 | - $width=(int)(16/$numCols); |
|
| 14 | + if (isset($numCols)) { |
|
| 15 | + $numCols=min(16, $numCols); |
|
| 16 | + $numCols=max(1, $numCols); |
|
| 17 | + if ($colSizing) |
|
| 18 | + $width=(int) (16 / $numCols); |
|
| 19 | 19 | else |
| 20 | - $this->_colSize=16/$numCols; |
|
| 21 | - for ($i=0;$i<$numCols;$i++){ |
|
| 20 | + $this->_colSize=16 / $numCols; |
|
| 21 | + for ($i=0; $i<$numCols; $i++) { |
|
| 22 | 22 | $this->addItem($width); |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -29,12 +29,12 @@ discard block |
||
| 29 | 29 | * @param int $index |
| 30 | 30 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
| 31 | 31 | */ |
| 32 | - public function getCol($index){ |
|
| 32 | + public function getCol($index) { |
|
| 33 | 33 | return $this->getItem($index); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - protected function createItem($value){ |
|
| 37 | - $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value); |
|
| 36 | + protected function createItem($value) { |
|
| 37 | + $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value); |
|
| 38 | 38 | return $col; |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -6,23 +6,23 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | abstract class HtmlCollection extends HtmlDoubleElement { |
| 8 | 8 | |
| 9 | - public function __construct($identifier,$tagName="div"){ |
|
| 10 | - parent::__construct($identifier,$tagName); |
|
| 9 | + public function __construct($identifier, $tagName="div") { |
|
| 10 | + parent::__construct($identifier, $tagName); |
|
| 11 | 11 | $this->content=array(); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public function addItems($items){ |
|
| 15 | - foreach ($items as $item){ |
|
| 14 | + public function addItems($items) { |
|
| 15 | + foreach ($items as $item) { |
|
| 16 | 16 | $this->addItem($item); |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function setItems($items){ |
|
| 20 | + public function setItems($items) { |
|
| 21 | 21 | $this->content=$items; |
| 22 | 22 | return $this; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - public function getItems(){ |
|
| 25 | + public function getItems() { |
|
| 26 | 26 | return $this->content; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * @param HtmlDoubleElement|string $item |
| 32 | 32 | * @return \Ajax\common\html\HtmlDoubleElement |
| 33 | 33 | */ |
| 34 | - public function addItem($item){ |
|
| 34 | + public function addItem($item) { |
|
| 35 | 35 | $itemO=$item; |
| 36 | - if(\is_object($item)===false){ |
|
| 36 | + if (\is_object($item)===false) { |
|
| 37 | 37 | $itemO=$this->createItem($item); |
| 38 | 38 | } |
| 39 | 39 | $this->addContent($itemO); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return $this; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - public function count(){ |
|
| 62 | + public function count() { |
|
| 63 | 63 | return \sizeof($this->content); |
| 64 | 64 | } |
| 65 | 65 | |