Completed
Push — master ( b88904...b77ba2 )
by Jean-Christophe
03:19
created
Ajax/common/html/html5/HtmlLinkTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 trait HtmlLinkTrait {
6 6
 
7
-	abstract public function setProperty($name,$value);
7
+	abstract public function setProperty($name, $value);
8 8
 	abstract public function getProperty($name);
9 9
 
10 10
 	public function setHref($value) {
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/LabeledIconTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 trait LabeledIconTrait {
14 14
 
15 15
 	abstract public function addToProperty($name, $value, $separator=" ");
16
-	abstract public function addContent($content,$before=false);
16
+	abstract public function addContent($content, $before=false);
17 17
 
18 18
 	/**
19 19
 	 * Adds an icon before or after
@@ -22,17 +22,17 @@  discard block
 block discarded – undo
22 22
 	 * @param boolean $labeled
23 23
 	 * @return \Ajax\semantic\html\elements\HtmlIcon
24 24
 	 */
25
-	public function addIcon($icon,$before=true,$labeled=false){
25
+	public function addIcon($icon, $before=true, $labeled=false) {
26 26
 		$iconO=$icon;
27
-		if(\is_string($icon)){
27
+		if (\is_string($icon)) {
28 28
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
29 29
 		}
30
-		if($labeled!==false){
31
-			$direction=($before===true)?Direction::LEFT:Direction::RIGHT;
30
+		if ($labeled!==false) {
31
+			$direction=($before===true) ? Direction::LEFT : Direction::RIGHT;
32 32
 			$this->addToProperty("class", $direction." labeled icon");
33 33
 			$this->tagName="div";
34 34
 		}
35
-		$this->addContent($iconO,$before);
35
+		$this->addContent($iconO, $before);
36 36
 		return $iconO;
37 37
 	}
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlGridRow.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -14,89 +14,89 @@
 block discarded – undo
14 14
  */
15 15
 class HtmlGridRow extends HtmlBsDoubleElement {
16 16
 	private $cols;
17
-	public function __construct($identifier,$numCols=NULL){
18
-		parent::__construct($identifier,"div");
17
+	public function __construct($identifier, $numCols=NULL) {
18
+		parent::__construct($identifier, "div");
19 19
 		$this->setProperty("class", "row");
20 20
 		$this->cols=array();
21
-		if(isset($numCols)){
22
-			$numCols=min(12,$numCols);
23
-			$numCols=max(1,$numCols);
21
+		if (isset($numCols)) {
22
+			$numCols=min(12, $numCols);
23
+			$numCols=max(1, $numCols);
24 24
 			$width=12/$numCols;
25
-			for ($i=0;$i<$numCols;$i++){
26
-				$this->addCol(CssSize::SIZE_MD,$width);
25
+			for ($i=0; $i<$numCols; $i++) {
26
+				$this->addCol(CssSize::SIZE_MD, $width);
27 27
 			}
28 28
 		}
29 29
 	}
30 30
 
31
-	public function addCol($size=CssSize::SIZE_MD,$width=1){
32
-		$col=new HtmlGridCol($this->identifier."-col-".(sizeof($this->cols)+1),$size,$width);
31
+	public function addCol($size=CssSize::SIZE_MD, $width=1) {
32
+		$col=new HtmlGridCol($this->identifier."-col-".(sizeof($this->cols)+1), $size, $width);
33 33
 		$this->cols[]=$col;
34 34
 		return $col;
35 35
 	}
36 36
 
37
-	public function addColAt($size=CssSize::SIZE_MD,$width=1,$offset=1){
38
-		$col=$this->addCol($size,$width);
39
-		return $col->setOffset($size, max($offset,sizeof($this->cols)+1));
37
+	public function addColAt($size=CssSize::SIZE_MD, $width=1, $offset=1) {
38
+		$col=$this->addCol($size, $width);
39
+		return $col->setOffset($size, max($offset, sizeof($this->cols)+1));
40 40
 	}
41 41
 
42
-	public function getCol($index,$force=true){
42
+	public function getCol($index, $force=true) {
43 43
 		$result=null;
44
-		if($index<sizeof($this->cols)+1){
44
+		if ($index<sizeof($this->cols)+1) {
45 45
 			$result=$this->cols[$index-1];
46
-		}else if ($force){
47
-			$result=$this->addColAt(CssSize::SIZE_MD,1,$index);
46
+		} else if ($force) {
47
+			$result=$this->addColAt(CssSize::SIZE_MD, 1, $index);
48 48
 		}
49 49
 		return $result;
50 50
 	}
51 51
 
52
-	public function getColAt($offset,$force=true){
52
+	public function getColAt($offset, $force=true) {
53 53
 		$result=null;
54
-		foreach ($this->cols as $col){
54
+		foreach ($this->cols as $col) {
55 55
 			$offsets=$col->getOffsets();
56
-			if($result=array_search($offset, $offsets)){
56
+			if ($result=array_search($offset, $offsets)) {
57 57
 				break;
58 58
 			}
59 59
 		}
60
-		if(!$result || isset($result)===false){
61
-			$result=$this->getCol($offset,$force);
60
+		if (!$result || isset($result)===false) {
61
+			$result=$this->getCol($offset, $force);
62 62
 		}
63 63
 		return $result;
64 64
 	}
65 65
 
66 66
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
67 67
 
68
-		foreach ($this->cols as $col){
68
+		foreach ($this->cols as $col) {
69 69
 			$this->addContent($col);
70 70
 		}
71
-		return parent::compile($js,$view);
71
+		return parent::compile($js, $view);
72 72
 	}
73 73
 	public function getCols() {
74 74
 		return $this->cols;
75 75
 	}
76 76
 
77
-	public function setContentForAll($content){
78
-		foreach ($this->cols as $col){
77
+	public function setContentForAll($content) {
78
+		foreach ($this->cols as $col) {
79 79
 			$col->setContent($content);
80 80
 		}
81 81
 	}
82
-	public function merge($size=CssSize::SIZE_MD,$start,$width){
83
-		$col=$this->getColAt($start,false);
84
-		if(isset($col)){
85
-			$col->setWidth($size,$width+1);
86
-			$this->delete($size,$start+1, $width);
82
+	public function merge($size=CssSize::SIZE_MD, $start, $width) {
83
+		$col=$this->getColAt($start, false);
84
+		if (isset($col)) {
85
+			$col->setWidth($size, $width+1);
86
+			$this->delete($size, $start+1, $width);
87 87
 		}
88 88
 	}
89
-	public function delete($size=CssSize::SIZE_MD,$start,$width){
90
-		while($start<sizeof($this->cols)+1 && $width>0){
91
-			$col=$this->getColAt($start,false);
92
-			if(isset($col)){
89
+	public function delete($size=CssSize::SIZE_MD, $start, $width) {
90
+		while ($start<sizeof($this->cols)+1 && $width>0) {
91
+			$col=$this->getColAt($start, false);
92
+			if (isset($col)) {
93 93
 				$widthCol=$col->getWidth($size);
94
-				if($widthCol<=$width){
94
+				if ($widthCol<=$width) {
95 95
 					unset($this->cols[$start-1]);
96
-					$this->cols = array_values($this->cols);
96
+					$this->cols=array_values($this->cols);
97 97
 					$width=$width-$widthCol;
98 98
 				}
99
-			}else{
99
+			} else {
100 100
 				$width=0;
101 101
 			}
102 102
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlDimmer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 	}
19 19
 
20 20
 	public function setContent($content) {
21
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
21
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
22 22
 		return $this;
23 23
 	}
24 24
 
25 25
 	public function asIcon($icon, $title, $subHeader=NULL) {
26
-		$header=new HtmlHeader("header-" . $this->identifier);
26
+		$header=new HtmlHeader("header-".$this->identifier);
27 27
 		$header->asIcon($icon, $title, $subHeader);
28
-		if ($this->_inverted === false)
28
+		if ($this->_inverted===false)
29 29
 			$header->setInverted();
30 30
 		return $this->setContent($header);
31 31
 	}
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function run(JsUtils $js) {
44 44
 		if ($this->_container instanceof HtmlSingleElement)
45
-			$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
45
+			$this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params);
46 46
 		return parent::run($js);
47 47
 	}
48 48
 
49 49
 	public function jsShow() {
50 50
 		if (isset($this->_container))
51
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
51
+			return '$("#.'.$this->_container->getIdentifier().').dimmer("show");';
52 52
 	}
53 53
 
54 54
 	public function setBlurring() {
Please login to merge, or discard this patch.
Ajax/common/traits/JqueryEventsTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 trait JqueryEventsTrait {
13
-	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
13
+	abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
14 14
 
15 15
 	/**
16 16
 	 * Blur
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	public function _click($element='this', $js=array(), $ret_false=TRUE) {
54 54
 		if (!is_array($js)) {
55
-			$js=array (
55
+			$js=array(
56 56
 					$js
57 57
 			);
58 58
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/IconTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,18 +15,18 @@  discard block
 block discarded – undo
15 15
 	private $_hasIcon=false;
16 16
 
17 17
 	abstract protected function addToPropertyCtrl($name, $value, $typeCtrl);
18
-	abstract public function addContent($content,$before=false);
18
+	abstract public function addContent($content, $before=false);
19 19
 
20
-	public function addIcon($icon,$direction=Direction::LEFT){
21
-		if($this->_hasIcon===false){
20
+	public function addIcon($icon, $direction=Direction::LEFT) {
21
+		if ($this->_hasIcon===false) {
22 22
 			$iconO=$icon;
23
-			if(\is_string($icon)){
23
+			if (\is_string($icon)) {
24 24
 				$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
25 25
 			}
26 26
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
27
-			$this->addContent($iconO,$direction===Direction::LEFT);
27
+			$this->addContent($iconO, $direction===Direction::LEFT);
28 28
 			$this->_hasIcon=true;
29
-		}else{
29
+		} else {
30 30
 			$iconO=$this->getIcon();
31 31
 			$iconO->setIcon($icon);
32 32
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 		return $iconO;
35 35
 	}
36 36
 
37
-	public function getIcon(){
38
-		if(\is_array($this->content)){
39
-			foreach ($this->content as $item){
40
-				if($item instanceof HtmlIcon)
37
+	public function getIcon() {
38
+		if (\is_array($this->content)) {
39
+			foreach ($this->content as $item) {
40
+				if ($item instanceof HtmlIcon)
41 41
 					return $item;
42 42
 			}
43 43
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,46 +15,46 @@  discard block
 block discarded – undo
15 15
  * @property string $identifier
16 16
  */
17 17
 trait FieldsTrait {
18
-	abstract public function addFields($fields=NULL,$label=NULL);
18
+	abstract public function addFields($fields=NULL, $label=NULL);
19 19
 	abstract public function addItem($item);
20 20
 
21
-	protected function createItem($value){
22
-		if(\is_array($value)){
23
-			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
21
+	protected function createItem($value) {
22
+		if (\is_array($value)) {
23
+			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id", ""), JArray::getDefaultValue($value, "label", null), JArray::getDefaultValue($value, "type", "text"), JArray::getDefaultValue($value, "value", ""), JArray::getDefaultValue($value, "placeholder", JArray::getDefaultValue($value, "label", null)));
24 24
 			return $itemO;
25
-		}elseif(\is_object($value)){
25
+		}elseif (\is_object($value)) {
26 26
 			$itemO=new HtmlFormField("field-".$this->identifier, $value);
27 27
 			return $itemO;
28
-		}else
28
+		} else
29 29
 			return new HtmlFormInput($value);
30 30
 	}
31 31
 
32
-	protected function createCondition($value){
32
+	protected function createCondition($value) {
33 33
 		return \is_object($value)===false || $value instanceof \Ajax\semantic\html\elements\HtmlInput;
34 34
 	}
35 35
 
36
-	public function addInputs($inputs,$fieldslabel=null){
36
+	public function addInputs($inputs, $fieldslabel=null) {
37 37
 		$fields=array();
38
-		foreach ($inputs as $input){
38
+		foreach ($inputs as $input) {
39 39
 			\extract($input);
40
-			$f=new HtmlFormInput("","");
40
+			$f=new HtmlFormInput("", "");
41 41
 			$f->fromArray($input);
42 42
 			$fields[]=$f;
43 43
 		}
44
-		return $this->addFields($fields,$fieldslabel);
44
+		return $this->addFields($fields, $fieldslabel);
45 45
 	}
46 46
 
47
-	public function addFieldRule($index,$type,$prompt=NULL,$value=NULL){
47
+	public function addFieldRule($index, $type, $prompt=NULL, $value=NULL) {
48 48
 		$field=$this->getItem($index);
49
-		if(isset($field)){
50
-			$field->addRule($type,$prompt,$value);
49
+		if (isset($field)) {
50
+			$field->addRule($type, $prompt, $value);
51 51
 		}
52 52
 		return $this;
53 53
 	}
54 54
 
55
-	public function addFieldRules($index,$rules){
55
+	public function addFieldRules($index, $rules) {
56 56
 		$field=$this->getItem($index);
57
-		if(isset($field)){
57
+		if (isset($field)) {
58 58
 			$field->addRules($rules);
59 59
 		}
60 60
 		return $this;
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 * @param boolean $multiple
69 69
 	 * @return \Ajax\common\html\HtmlDoubleElement
70 70
 	 */
71
-	public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){
72
-		return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple));
71
+	public function addDropdown($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) {
72
+		return $this->addItem(new HtmlFormDropdown($identifier, $items, $label, $value, $multiple));
73 73
 	}
74 74
 
75 75
 	/**
@@ -80,23 +80,23 @@  discard block
 block discarded – undo
80 80
 	 * @param string $placeholder
81 81
 	 * @return HtmlFormInput
82 82
 	 */
83
-	public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){
84
-		return $this->addItem(new HtmlFormInput($identifier,$label,$type,$value,$placeholder));
83
+	public function addInput($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
84
+		return $this->addItem(new HtmlFormInput($identifier, $label, $type, $value, $placeholder));
85 85
 	}
86 86
 
87
-	public function addPassword($identifier, $label=NULL){
88
-		return $this->addItem(new HtmlFormInput($identifier,$label,"password","",""));
87
+	public function addPassword($identifier, $label=NULL) {
88
+		return $this->addItem(new HtmlFormInput($identifier, $label, "password", "", ""));
89 89
 	}
90 90
 
91
-	public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){
92
-		return $this->addItem(new HtmlButton($identifier,$value,$cssStyle,$onClick));
91
+	public function addButton($identifier, $value, $cssStyle=NULL, $onClick=NULL) {
92
+		return $this->addItem(new HtmlButton($identifier, $value, $cssStyle, $onClick));
93 93
 	}
94 94
 
95
-	public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){
96
-		return $this->addItem(new HtmlFormCheckbox($identifier,$label,$value,$type));
95
+	public function addCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
96
+		return $this->addItem(new HtmlFormCheckbox($identifier, $label, $value, $type));
97 97
 	}
98 98
 
99
-	public function addRadio($identifier, $name,$label=NULL,$value=NULL){
100
-		return $this->addItem(new HtmlFormRadio($identifier,$name,$label,$value));
99
+	public function addRadio($identifier, $name, $label=NULL, $value=NULL) {
100
+		return $this->addItem(new HtmlFormRadio($identifier, $name, $label, $value));
101 101
 	}
102 102
 }
103 103
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/TableElementTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	}
26 26
 
27 27
 	public function setDisabled($disable=true) {
28
-		if($disable)
28
+		if ($disable)
29 29
 			$this->addState(State::DISABLED);
30 30
 		return $this;
31 31
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 	protected $image;
10 10
 
11 11
 	public function __construct($identifier, $content=NULL) {
12
-		parent::__construct($identifier,"item",$content);
12
+		parent::__construct($identifier, "item", $content);
13 13
 	}
14
-	protected function initContent($content){
15
-		if(\is_array($content)){
16
-			if(JArray::isAssociative($content)===false){
14
+	protected function initContent($content) {
15
+		if (\is_array($content)) {
16
+			if (JArray::isAssociative($content)===false) {
17 17
 				$icon=@$content[0];
18 18
 				$title=@$content[1];
19 19
 				$desc=@$content[2];
20
-			}else{
20
+			} else {
21 21
 				$icon=@$content["icon"];
22 22
 				$image=@$content["image"];
23 23
 				$title=@$content["title"];
@@ -25,21 +25,21 @@  discard block
 block discarded – undo
25 25
 				$desc=@$content["description"];
26 26
 				$items=@$content["items"];
27 27
 			}
28
-			if(isset($icon)){
28
+			if (isset($icon)) {
29 29
 				$this->setIcon($icon);
30 30
 			}
31
-			if(isset($image)){
31
+			if (isset($image)) {
32 32
 				$this->setImage($image);
33 33
 			}
34
-			if(isset($title)){
35
-				$this->setTitle($title,$desc);
36
-			}elseif (isset($header)){
37
-				$this->setTitle($header,$desc,"header");
34
+			if (isset($title)) {
35
+				$this->setTitle($title, $desc);
36
+			}elseif (isset($header)) {
37
+				$this->setTitle($header, $desc, "header");
38 38
 			}
39
-			if(isset($items)){
39
+			if (isset($items)) {
40 40
 				$this->addList($items);
41 41
 			}
42
-		}else{
42
+		} else {
43 43
 			$this->setContent($content);
44 44
 		}
45 45
 	}
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		return $list;
51 51
 	}
52 52
 
53
-	public function getList(){
53
+	public function getList() {
54 54
 		return $this->content["list"];
55 55
 	}
56 56
 
57
-	public function getItem($index){
57
+	public function getItem($index) {
58 58
 		return $this->getList()->getItem($index);
59 59
 	}
60 60
 }
61 61
\ No newline at end of file
Please login to merge, or discard this patch.