Completed
Push — master ( fa0c00...66af5c )
by Jean-Christophe
03:37
created
Ajax/semantic/html/content/table/HtmlTD.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,42 +8,42 @@
 block discarded – undo
8 8
 	private $_container;
9 9
 	private $_row;
10 10
 	private $_col;
11
-	public function __construct($identifier,$content=NULL,$tagName="td") {
11
+	public function __construct($identifier, $content=NULL, $tagName="td") {
12 12
 		parent::__construct($identifier, $tagName, "", $content);
13 13
 	}
14 14
 
15
-	public function setContainer($container,$row,$col){
15
+	public function setContainer($container, $row, $col) {
16 16
 		$this->_container=$container;
17 17
 		$this->_row=$row;
18 18
 		$this->_col=$col;
19 19
 	}
20 20
 
21
-	public function setValue($value){
21
+	public function setValue($value) {
22 22
 		$this->content=$value;
23 23
 		return $this;
24 24
 	}
25 25
 
26
-	public function setRowspan($rowspan){
27
-		$to=min($this->_container->count(),$this->_row+$rowspan-1);
28
-		for($i=$to;$i>$this->_row;$i--){
29
-			$this->_container->delete($this->_row+1,$this->_col);
26
+	public function setRowspan($rowspan) {
27
+		$to=min($this->_container->count(), $this->_row+$rowspan-1);
28
+		for ($i=$to; $i>$this->_row; $i--) {
29
+			$this->_container->delete($this->_row+1, $this->_col);
30 30
 		}
31 31
 		$this->setProperty("rowspan", $rowspan);
32 32
 		return $this->_container;
33 33
 	}
34 34
 
35
-	public function rowMerge(){
35
+	public function rowMerge() {
36 36
 		return $this->setRowspan($this->_container->count());
37 37
 	}
38 38
 
39
-	public function colMerge(){
39
+	public function colMerge() {
40 40
 		return $this->setColspan($this->_container->getRow($this->_row)->count());
41 41
 	}
42 42
 
43
-	public function setColspan($colspan){
44
-		$to=min($this->_container->getRow($this->_row)->count(),$this->_col+$colspan-1);
45
-		for($i=$to;$i>$this->_col;$i--){
46
-			$this->_container->delete($this->_row,$this->_col+1);
43
+	public function setColspan($colspan) {
44
+		$to=min($this->_container->getRow($this->_row)->count(), $this->_col+$colspan-1);
45
+		for ($i=$to; $i>$this->_col; $i--) {
46
+			$this->_container->delete($this->_row, $this->_col+1);
47 47
 		}
48 48
 		$this->setProperty("colspan", $colspan);
49 49
 		return $this->_container;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 3 patches
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 	public function __construct( $identifier,$tagName="tbody",$rowCount=NULL,$colCount=NULL){
12 12
 		parent::__construct( $identifier, $tagName, "");
13
-		if(isset($rowCount) && isset($colCount))
14
-			$this->setRowCount($rowCount, $colCount);
13
+		if(isset($rowCount) && isset($colCount)) {
14
+					$this->setRowCount($rowCount, $colCount);
15
+		}
15 16
 	}
16 17
 
17 18
 	public function setRowCount($rowCount,$colCount){
@@ -79,8 +80,9 @@  discard block
 block discarded – undo
79 80
 
80 81
 	public function getColCount(){
81 82
 		$result=0;
82
-		if($this->count()>0)
83
-			$result=$this->getItem(0)->getColCount();
83
+		if($this->count()>0) {
84
+					$result=$this->getItem(0)->getColCount();
85
+		}
84 86
 		return $result;
85 87
 	}
86 88
 
@@ -90,7 +92,7 @@  discard block
 block discarded – undo
90 92
 			if(isset($row)===true){
91 93
 				$row->delete($colIndex);
92 94
 			}
93
-		}else{
95
+		} else{
94 96
 			$this->removeItem($rowIndex);
95 97
 		}
96 98
 		return $this;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
 
71 71
 	/**
72 72
 	 * @param int $index
73
-	 * @return \Ajax\semantic\html\content\HtmlTR
73
+	 * @return \Ajax\common\html\HtmlDoubleElement
74 74
 	 */
75 75
 	public function getRow($index){
76 76
 		return $this->getItem($index);
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @author jc
10 10
  *
11 11
  */
12
-class HtmlTableContent extends HtmlSemCollection{
12
+class HtmlTableContent extends HtmlSemCollection {
13 13
 
14
-	protected $_tdTagNames=["thead"=>"th","tbody"=>"td","tfoot"=>"th"];
14
+	protected $_tdTagNames=["thead"=>"th", "tbody"=>"td", "tfoot"=>"th"];
15 15
 
16 16
 	/**
17 17
 	 * @param string $identifier
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 	 * @param int $rowCount
20 20
 	 * @param int $colCount
21 21
 	 */
22
-	public function __construct( $identifier,$tagName="tbody",$rowCount=NULL,$colCount=NULL){
23
-		parent::__construct( $identifier, $tagName, "");
24
-		if(isset($rowCount) && isset($colCount))
22
+	public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) {
23
+		parent::__construct($identifier, $tagName, "");
24
+		if (isset($rowCount) && isset($colCount))
25 25
 			$this->setRowCount($rowCount, $colCount);
26 26
 	}
27 27
 
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 	 * @param int $colCount
31 31
 	 * @return \Ajax\semantic\html\content\table\HtmlTableContent
32 32
 	 */
33
-	public function setRowCount($rowCount,$colCount){
33
+	public function setRowCount($rowCount, $colCount) {
34 34
 		$count=$this->count();
35
-		for($i=$count;$i<$rowCount;$i++){
35
+		for ($i=$count; $i<$rowCount; $i++) {
36 36
 			$this->addItem($colCount);
37 37
 		}
38
-		for($i=0;$i<$rowCount;$i++){
38
+		for ($i=0; $i<$rowCount; $i++) {
39 39
 			$item=$this->content[$i];
40 40
 			$item->setTdTagName($this->_tdTagNames[$this->tagName]);
41 41
 			$this->content[$i]->setColCount($colCount);
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 	 * {@inheritDoc}
48 48
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
49 49
 	 */
50
-	protected function createItem($value){
50
+	protected function createItem($value) {
51 51
 		$count=$this->count();
52
-		$tr= new HtmlTR("", $value);
52
+		$tr=new HtmlTR("", $value);
53 53
 		$tr->setContainer($this, $count);
54 54
 		return $tr;
55 55
 	}
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 	 * @param int $col
61 61
 	 * @return \Ajax\semantic\html\content\HtmlTD
62 62
 	 */
63
-	public function getCell($row,$col){
63
+	public function getCell($row, $col) {
64 64
 		$row=$this->getItem($row);
65
-		if(isset($row)){
65
+		if (isset($row)) {
66 66
 			$col=$row->getItem($col);
67 67
 		}
68 68
 		return $col;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * @param int $index
73 73
 	 * @return \Ajax\semantic\html\content\HtmlTR
74 74
 	 */
75
-	public function getRow($index){
75
+	public function getRow($index) {
76 76
 		return $this->getItem($index);
77 77
 	}
78 78
 
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
 	 * @param mixed $value
83 83
 	 * @return \Ajax\semantic\html\content\table\HtmlTableContent
84 84
 	 */
85
-	public function setCellValue($row,$col,$value=""){
85
+	public function setCellValue($row, $col, $value="") {
86 86
 		$cell=$this->getCell($row, $col);
87
-		if(isset($cell)===true){
87
+		if (isset($cell)===true) {
88 88
 			$cell->setValue($value);
89 89
 		}
90 90
 		return $this;
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
 	 * Sets the cells values
95 95
 	 * @param mixed $values
96 96
 	 */
97
-	public function setValues($values=array()){
97
+	public function setValues($values=array()) {
98 98
 		$count=$this->count();
99
-		if(\is_array($values)===false){
99
+		if (\is_array($values)===false) {
100 100
 			$values=\array_fill(0, $count, $values);
101 101
 		}
102
-		$count=\min(\sizeof($values),$count);
102
+		$count=\min(\sizeof($values), $count);
103 103
 
104
-		for ($i=0;$i<$count;$i++){
104
+		for ($i=0; $i<$count; $i++) {
105 105
 			$row=$this->content[$i];
106 106
 			$row->setValues($values[$i]);
107 107
 		}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * Returns the number of rows (TR)
112 112
 	 * @return int
113 113
 	 */
114
-	public function getRowCount(){
114
+	public function getRowCount() {
115 115
 		return $this->count();
116 116
 	}
117 117
 
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
 	 * Returns the number of columns (TD)
120 120
 	 * @return int
121 121
 	 */
122
-	public function getColCount(){
122
+	public function getColCount() {
123 123
 		$result=0;
124
-		if($this->count()>0)
124
+		if ($this->count()>0)
125 125
 			$result=$this->getItem(0)->getColCount();
126 126
 		return $result;
127 127
 	}
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 	 * @param int $colIndex
133 133
 	 * @return \Ajax\semantic\html\content\table\HtmlTableContent
134 134
 	 */
135
-	public function delete($rowIndex,$colIndex=NULL){
136
-		if(isset($colIndex)){
135
+	public function delete($rowIndex, $colIndex=NULL) {
136
+		if (isset($colIndex)) {
137 137
 			$row=$this->getItem($rowIndex);
138
-			if(isset($row)===true){
138
+			if (isset($row)===true) {
139 139
 				$row->delete($colIndex);
140 140
 			}
141
-		}else{
141
+		}else {
142 142
 			$this->removeItem($rowIndex);
143 143
 		}
144 144
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTR.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,19 +4,19 @@  discard block
 block discarded – undo
4 4
 
5 5
 use Ajax\semantic\html\base\HtmlSemCollection;
6 6
 
7
-class HtmlTR extends HtmlSemCollection{
7
+class HtmlTR extends HtmlSemCollection {
8 8
 
9 9
 	private $_tdTagName;
10 10
 	private $_container;
11 11
 	private $_row;
12 12
 
13
-	public function __construct( $identifier, $colCount){
14
-		parent::__construct( $identifier, "tr", "");
13
+	public function __construct($identifier, $colCount) {
14
+		parent::__construct($identifier, "tr", "");
15 15
 	}
16 16
 
17
-	public function setColCount($colCount){
17
+	public function setColCount($colCount) {
18 18
 		$count=$this->count();
19
-		for($i=$count;$i<$colCount;$i++){
19
+		for ($i=$count; $i<$colCount; $i++) {
20 20
 			$item=$this->addItem(NULL);
21 21
 			$item->setTagName($this->_tdTagName);
22 22
 		}
@@ -24,36 +24,36 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 
27
-	protected function createItem($value){
27
+	protected function createItem($value) {
28 28
 		$count=$this->count();
29
-		$td=new HtmlTD("",$this->_container,$value,$this->_tdTagName);
29
+		$td=new HtmlTD("", $this->_container, $value, $this->_tdTagName);
30 30
 		$td->setContainer($this->_container, $this->_row, $count);
31 31
 		return $td;
32 32
 	}
33 33
 
34
-	public function setTdTagName($tagName="td"){
34
+	public function setTdTagName($tagName="td") {
35 35
 		$this->_tdTagName=$tagName;
36 36
 	}
37 37
 
38
-	public function setContainer($container,$row){
38
+	public function setContainer($container, $row) {
39 39
 		$this->_container=$container;
40 40
 		$this->_row=$row;
41 41
 	}
42 42
 
43
-	public function setValues($values=array()){
43
+	public function setValues($values=array()) {
44 44
 		$count=$this->count();
45
-		if(\is_array($values)===false){
45
+		if (\is_array($values)===false) {
46 46
 			$values=\array_fill(0, $count, $values);
47 47
 		}
48
-		$count=\min(\sizeof($values),$count);
48
+		$count=\min(\sizeof($values), $count);
49 49
 
50
-		for ($i=0;$i<$count;$i++){
50
+		for ($i=0; $i<$count; $i++) {
51 51
 			$cell=$this->content[$i];
52 52
 			$cell->setValue($values[$i]);
53 53
 		}
54 54
 	}
55 55
 
56
-	public function delete($index){
56
+	public function delete($index) {
57 57
 		$this->removeItem($index);
58 58
 		return $this;
59 59
 	}
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@
 block discarded – undo
20 20
 	protected $_tabsType="tabs";
21 21
 	protected $stacked="";
22 22
 
23
+	/**
24
+	 * @param string $identifier
25
+	 */
23 26
 	public function __construct($identifier, $tagName="ul") {
24 27
 		parent::__construct($identifier, $tagName);
25 28
 		$this->_template="<%tagName% %properties%>%tabs%</%tagName%>%content%";
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticHtmlCollectionsTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 	 * @param mixed $value
18 18
 	 * @param CheckboxType $type
19 19
 	 */
20
-	public function htmlCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){
21
-		return $this->addHtmlComponent(new HtmlFormCheckbox($identifier,$label,$value,$type));
20
+	public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
21
+		return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type));
22 22
 	}
23 23
 
24 24
 	/**
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param int $rowCount
27 27
 	 * @param int $colCount
28 28
 	 */
29
-	public function htmlTable($identifier, $rowCount, $colCount){
29
+	public function htmlTable($identifier, $rowCount, $colCount) {
30 30
 		return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount));
31 31
 	}
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/Semantic.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 use Ajax\semantic\traits\SemanticHtmlCollectionsTrait;
23 23
 
24 24
 class Semantic extends BaseGui {
25
-	use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait;
25
+	use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait;
26 26
 	public function __construct($autoCompile=true) {
27 27
 		parent::__construct($autoCompile=true);
28 28
 	}
@@ -33,24 +33,24 @@  discard block
 block discarded – undo
33 33
 	 * @param array $items
34 34
 	 * @return Ajax\semantic\html\collections\HtmlMenu
35 35
 	 */
36
-	public function htmlMenu($identifier,$items=array()){
37
-		return $this->addHtmlComponent(new HtmlMenu($identifier,$items));
36
+	public function htmlMenu($identifier, $items=array()) {
37
+		return $this->addHtmlComponent(new HtmlMenu($identifier, $items));
38 38
 	}
39 39
 
40 40
 	/**Adds an icon menu
41 41
 	 * @param string $identifier
42 42
 	 * @param array $items icons
43 43
 	 */
44
-	public function htmlIconMenu($identifier,$items=array()){
45
-		return $this->addHtmlComponent(new HtmlIconMenu($identifier,$items));
44
+	public function htmlIconMenu($identifier, $items=array()) {
45
+		return $this->addHtmlComponent(new HtmlIconMenu($identifier, $items));
46 46
 	}
47 47
 
48 48
 	/**Adds an labeled icon menu
49 49
 	 * @param string $identifier
50 50
 	 * @param array $items icons
51 51
 	 */
52
-	public function htmlLabeledIconMenu($identifier,$items=array()){
53
-		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier,$items));
52
+	public function htmlLabeledIconMenu($identifier, $items=array()) {
53
+		return $this->addHtmlComponent(new HtmlLabeledIconMenu($identifier, $items));
54 54
 	}
55 55
 
56 56
 	/**
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 	 * @param string $value
59 59
 	 * @param array $items
60 60
 	 */
61
-	public function htmlDropdown($identifier, $value="", $items=array()){
62
-		return $this->addHtmlComponent(new HtmlDropdown($identifier,$value,$items));
61
+	public function htmlDropdown($identifier, $value="", $items=array()) {
62
+		return $this->addHtmlComponent(new HtmlDropdown($identifier, $value, $items));
63 63
 	}
64 64
 
65 65
 	/**
@@ -67,16 +67,16 @@  discard block
 block discarded – undo
67 67
 	 * @param string $identifier
68 68
 	 * @param string $content
69 69
 	 */
70
-	public function htmlMessage($identifier, $content=""){
71
-		return $this->addHtmlComponent(new HtmlMessage($identifier,$content));
70
+	public function htmlMessage($identifier, $content="") {
71
+		return $this->addHtmlComponent(new HtmlMessage($identifier, $content));
72 72
 	}
73 73
 
74 74
 	/**
75 75
 	 * @param string $identifier
76 76
 	 * @param mixed $content
77 77
 	 */
78
-	public function htmlPopup(BaseHtml $container,$identifier,$content){
79
-		return $this->addHtmlComponent(new HtmlPopup($container,$identifier,$content));
78
+	public function htmlPopup(BaseHtml $container, $identifier, $content) {
79
+		return $this->addHtmlComponent(new HtmlPopup($container, $identifier, $content));
80 80
 	}
81 81
 
82 82
 	/**
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @param boolean $createCols
87 87
 	 * @param boolean $implicitRows
88 88
 	 */
89
-	public function htmlGrid($identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
90
-		return $this->addHtmlComponent(new HtmlGrid($identifier,$numRows,$numCols,$createCols,$implicitRows));
89
+	public function htmlGrid($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
90
+		return $this->addHtmlComponent(new HtmlGrid($identifier, $numRows, $numCols, $createCols, $implicitRows));
91 91
 	}
92 92
 
93 93
 
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
101 101
 	 * @return HtmlBreadcrumb
102 102
 	 */
103
-	public function htmlBreadcrumb( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
104
-		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier,$items,$autoActive,$startIndex,$hrefFunction));
103
+	public function htmlBreadcrumb($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
104
+		return $this->addHtmlComponent(new HtmlBreadcrumb($identifier, $items, $autoActive, $startIndex, $hrefFunction));
105 105
 	}
106 106
 
107 107
 	/**
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 	 * @param string $identifier
119 119
 	 * @return HtmlAccordion
120 120
 	 */
121
-	public function htmlAccordionMenu($identifier,$items=array()) {
122
-		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier,$items));
121
+	public function htmlAccordionMenu($identifier, $items=array()) {
122
+		return $this->addHtmlComponent(new HtmlAccordionMenu($identifier, $items));
123 123
 	}
124 124
 
125 125
 	/**
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 * @param string $identifier
128 128
 	 * @param array $elements
129 129
 	 */
130
-	public function htmlForm($identifier,$elements=array()) {
131
-		return $this->addHtmlComponent(new HtmlForm($identifier,$elements));
130
+	public function htmlForm($identifier, $elements=array()) {
131
+		return $this->addHtmlComponent(new HtmlForm($identifier, $elements));
132 132
 	}
133 133
 
134
-	public function htmlSticky($identifier,$content=array()) {
135
-		return $this->addHtmlComponent(new HtmlSticky($identifier,$content));
134
+	public function htmlSticky($identifier, $content=array()) {
135
+		return $this->addHtmlComponent(new HtmlSticky($identifier, $content));
136 136
 	}
137 137
 }
138 138
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlLinkTrait.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -4,6 +4,9 @@
 block discarded – undo
4 4
 
5 5
 trait HtmlLinkTrait {
6 6
 
7
+	/**
8
+	 * @param string $value
9
+	 */
7 10
 	public function setHref($value) {
8 11
 		$this->setProperty("href", $value);
9 12
 	}
Please login to merge, or discard this patch.