Completed
Push — master ( 5df1fc...70601d )
by Jean-Christophe
03:41
created
Ajax/common/traits/JqueryActionsTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 namespace Ajax\common\traits;
4 4
 
5 5
 trait JqueryActionsTrait {
6
-	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true);
6
+	public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true);
7 7
 	public abstract function _prep_element($element);
8 8
 	public abstract function _prep_value($value);
9 9
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		if (isset($value)) {
20 20
 			$value=$this->_prep_value($value);
21 21
 			$str="$({$element}).attr(\"$attributeName\",{$value});";
22
-		} else
22
+		}else
23 23
 			$str="$({$element}).attr(\"$attributeName\");";
24 24
 			if ($immediatly)
25 25
 				$this->jquery_code_for_compile[]=$str;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param boolean $immediatly defers the execution if set to false
34 34
 	 * @return string
35 35
 	 */
36
-	public function after($element='this', $value='', $immediatly=false){
36
+	public function after($element='this', $value='', $immediatly=false) {
37 37
 		$element=$this->_prep_element($element);
38 38
 		$value=$this->_prep_value($value);
39 39
 		$str="$({$element}).after({$value});";
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 		$animations="\t\t\t";
60 60
 		if (is_array($params)) {
61
-			foreach ( $params as $param => $value ) {
61
+			foreach ($params as $param => $value) {
62 62
 				$animations.=$param.': \''.$value.'\', ';
63 63
 			}
64 64
 		}
@@ -351,8 +351,8 @@  discard block
 block discarded – undo
351 351
 	 * @param boolean $immediatly
352 352
 	 * @return string
353 353
 	 */
354
-	public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="",$immediatly=true) {
355
-		return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation,$immediatly);
354
+	public function _doJQueryOn($event, $element, $elementToModify, $jqueryCall, $param="", $preventDefault=false, $stopPropagation=false, $jsCallback="", $immediatly=true) {
355
+		return $this->_add_event($element, $this->_doJQuery($elementToModify, $jqueryCall, $param, $jsCallback), $event, $preventDefault, $stopPropagation, $immediatly);
356 356
 	}
357 357
 
358 358
 	/**
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 	 * @param boolean $immediatly
379 379
 	 * @return String
380 380
 	 */
381
-	public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false,$immediatly=true) {
382
-		return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation,$immediatly);
381
+	public function _execOn($element, $event, $js, $preventDefault=false, $stopPropagation=false, $immediatly=true) {
382
+		return $this->_add_event($element, $this->_exec($js), $event, $preventDefault, $stopPropagation, $immediatly);
383 383
 	}
384 384
 
385 385
 	/**
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
 	 * @return string
389 389
 	 */
390 390
 	private function _validate_speed($speed) {
391
-		if (in_array($speed, array (
392
-				'slow','normal','fast'
391
+		if (in_array($speed, array(
392
+				'slow', 'normal', 'fast'
393 393
 		))) {
394 394
 			$speed='"'.$speed.'"';
395 395
 		} elseif (preg_match("/[^0-9]/", $speed)) {
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
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
 	private $_hasIcon=false;
9 9
 
10 10
 	protected abstract function addToPropertyCtrl($name, $value, $typeCtrl);
11
-	public abstract function addContent($content,$before=false);
11
+	public abstract function addContent($content, $before=false);
12 12
 
13
-	public function addIcon($icon,$direction=Direction::LEFT){
14
-		if($this->_hasIcon===false){
13
+	public function addIcon($icon, $direction=Direction::LEFT) {
14
+		if ($this->_hasIcon===false) {
15 15
 			$iconO=$icon;
16
-			if(\is_string($icon)){
16
+			if (\is_string($icon)) {
17 17
 				$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
18 18
 			}
19 19
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
20
-			$this->addContent($iconO,false);
20
+			$this->addContent($iconO, false);
21 21
 			$this->_hasIcon=true;
22
-		}else{
22
+		}else {
23 23
 			$iconO=$this->getIcon();
24 24
 			$iconO->setIcon($icon);
25 25
 			$this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon"));
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 		return $iconO;
28 28
 	}
29 29
 
30
-	public function getIcon(){
31
-		if(\is_array($this->content)){
32
-			foreach ($this->content as $item){
33
-				if($item instanceof HtmlIcon)
30
+	public function getIcon() {
31
+		if (\is_array($this->content)) {
32
+			foreach ($this->content as $item) {
33
+				if ($item instanceof HtmlIcon)
34 34
 					return $item;
35 35
 			}
36 36
 		}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/FieldsTrait.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,26 +9,26 @@  discard block
 block discarded – undo
9 9
 use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
10 10
 use Ajax\semantic\html\collections\form\HtmlFormRadio;
11 11
 trait FieldsTrait {
12
-	public abstract function addFields($fields=NULL,$label=NULL);
12
+	public abstract function addFields($fields=NULL, $label=NULL);
13 13
 	public abstract function addItem($item);
14 14
 
15
-	protected function createItem($value){
16
-		if(\is_array($value)){
17
-			$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)));
15
+	protected function createItem($value) {
16
+		if (\is_array($value)) {
17
+			$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)));
18 18
 			return $itemO;
19 19
 		}else
20 20
 			return new HtmlFormInput($value);
21 21
 	}
22 22
 
23
-	public function addInputs($inputs,$fieldslabel=null){
23
+	public function addInputs($inputs, $fieldslabel=null) {
24 24
 		$fields=array();
25
-		foreach ($inputs as $input){
25
+		foreach ($inputs as $input) {
26 26
 			\extract($input);
27
-			$f=new HtmlFormInput("","");
27
+			$f=new HtmlFormInput("", "");
28 28
 			$f->fromArray($input);
29 29
 			$fields[]=$f;
30 30
 		}
31
-		return $this->addFields($fields,$fieldslabel);
31
+		return $this->addFields($fields, $fieldslabel);
32 32
 	}
33 33
 
34 34
 	/**
@@ -39,23 +39,23 @@  discard block
 block discarded – undo
39 39
 	 * @param boolean $multiple
40 40
 	 * @return \Ajax\common\html\HtmlDoubleElement
41 41
 	 */
42
-	public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){
43
-		return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple));
42
+	public function addDropdown($identifier, $items=array(), $label=NULL, $value=NULL, $multiple=false) {
43
+		return $this->addItem(new HtmlFormDropdown($identifier, $items, $label, $value, $multiple));
44 44
 	}
45 45
 
46
-	public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){
47
-		return $this->addItem(new HtmlFormInput($identifier,$label,$type,$value,$placeholder));
46
+	public function addInput($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
47
+		return $this->addItem(new HtmlFormInput($identifier, $label, $type, $value, $placeholder));
48 48
 	}
49 49
 
50
-	public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){
51
-		return $this->addItem(new HtmlButton($identifier,$value,$cssStyle,$onClick));
50
+	public function addButton($identifier, $value, $cssStyle=NULL, $onClick=NULL) {
51
+		return $this->addItem(new HtmlButton($identifier, $value, $cssStyle, $onClick));
52 52
 	}
53 53
 
54
-	public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){
55
-		return $this->addItem(new HtmlFormCheckbox($identifier,$label,$value,$type));
54
+	public function addCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
55
+		return $this->addItem(new HtmlFormCheckbox($identifier, $label, $value, $type));
56 56
 	}
57 57
 
58
-	public function addRadio($identifier, $name,$label=NULL,$value=NULL){
59
-		return $this->addItem(new HtmlFormRadio($identifier,$name,$label,$value));
58
+	public function addRadio($identifier, $name, $label=NULL, $value=NULL) {
59
+		return $this->addItem(new HtmlFormRadio($identifier, $name, $label, $value));
60 60
 	}
61 61
 }
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -8,26 +8,26 @@  discard block
 block discarded – undo
8 8
 
9 9
 class HtmlFormField extends HtmlSemDoubleElement {
10 10
 	protected $_container;
11
-	public function __construct($identifier, $field,$label=NULL) {
12
-		parent::__construct($identifier, "div","field");
11
+	public function __construct($identifier, $field, $label=NULL) {
12
+		parent::__construct($identifier, "div", "field");
13 13
 		$this->content=array();
14
-		$this->_states=[State::ERROR,State::DISABLED];
15
-		if(isset($label))
14
+		$this->_states=[State::ERROR, State::DISABLED];
15
+		if (isset($label))
16 16
 			$this->setLabel($label);
17 17
 		$this->setField($field);
18 18
 	}
19 19
 
20
-	public function setLabel($label){
20
+	public function setLabel($label) {
21 21
 		$labelO=$label;
22
-		if(\is_string($label)){
23
-			$labelO=new HtmlSemDoubleElement("","label");
22
+		if (\is_string($label)) {
23
+			$labelO=new HtmlSemDoubleElement("", "label");
24 24
 			$labelO->setContent($label);
25
-			$labelO->setProperty("for", \str_replace("field-", "",$this->identifier));
25
+			$labelO->setProperty("for", \str_replace("field-", "", $this->identifier));
26 26
 		}
27 27
 		$this->content["label"]=$labelO;
28 28
 	}
29 29
 
30
-	public function setField($field){
30
+	public function setField($field) {
31 31
 		$this->content["field"]=$field;
32 32
 	}
33 33
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 	 * Returns the label or null
36 36
 	 * @return mixed
37 37
 	 */
38
-	public function getLabel(){
39
-		if(\array_key_exists("label", $this->content))
38
+	public function getLabel() {
39
+		if (\array_key_exists("label", $this->content))
40 40
 			return $this->content["label"];
41 41
 	}
42 42
 
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 	 * Return the field
45 45
 	 * @return mixed
46 46
 	 */
47
-	public function getField(){
47
+	public function getField() {
48 48
 		return $this->content["field"];
49 49
 	}
50 50
 
51 51
 	/**
52 52
 	 * puts the label before or behind
53 53
 	 */
54
-	public function swapLabel(){
54
+	public function swapLabel() {
55 55
 		$label=$this->getLabel();
56 56
 		unset($this->content["label"]);
57 57
 		$this->content["label"]=$label;
@@ -62,27 +62,27 @@  discard block
 block discarded – undo
62 62
 	 * @param int $width
63 63
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
64 64
 	 */
65
-	public function setWidth($width){
66
-		if(\is_int($width)){
65
+	public function setWidth($width) {
66
+		if (\is_int($width)) {
67 67
 			$width=Wide::getConstants()["W".$width];
68 68
 		}
69 69
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
70
-		if(isset($this->_container)){
70
+		if (isset($this->_container)) {
71 71
 			$this->_container->setEqualWidth(false);
72 72
 		}
73
-		return $this->addToPropertyCtrl("class", "wide",array("wide"));
73
+		return $this->addToPropertyCtrl("class", "wide", array("wide"));
74 74
 	}
75 75
 
76 76
 	/**
77 77
 	 * Field displays an error state
78 78
 	 * @return \Ajax\semantic\html\collections\form\HtmlFormField
79 79
 	 */
80
-	public function setError(){
80
+	public function setError() {
81 81
 		return $this->addToProperty("class", "error");
82 82
 	}
83 83
 
84
-	public function jsState($state){
85
-		return $this->jsDoJquery("addClass",$state);
84
+	public function jsState($state) {
85
+		return $this->jsDoJquery("addClass", $state);
86 86
 	}
87 87
 
88 88
 	public function setContainer($_container) {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		return $this;
91 91
 	}
92 92
 
93
-	public function setReadonly(){
93
+	public function setReadonly() {
94 94
 		$this->getField()->setProperty("readonly", "");
95 95
 	}
96 96
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlGridRow.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@  discard block
 block discarded – undo
16 16
  * @author jc
17 17
  * @version 1.001
18 18
  */
19
-class HtmlGridRow extends HtmlSemCollection{
19
+class HtmlGridRow extends HtmlSemCollection {
20 20
 	use TextAlignmentTrait;
21 21
 
22 22
 	private $_colSize;
23 23
 	private $_implicite=false;
24
-	public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){
25
-		parent::__construct( $identifier,"div","row");
24
+	public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) {
25
+		parent::__construct($identifier, "div", "row");
26 26
 		$this->_implicite=$implicite;
27 27
 		$width=null;
28
-		if(isset($numCols)){
29
-			$numCols=min(16,$numCols);
30
-			$numCols=max(1,$numCols);
31
-			if($colSizing)
32
-				$width=(int)(16/$numCols);
28
+		if (isset($numCols)) {
29
+			$numCols=min(16, $numCols);
30
+			$numCols=max(1, $numCols);
31
+			if ($colSizing)
32
+				$width=(int) (16 / $numCols);
33 33
 			else
34
-				$this->_colSize=16/$numCols;
35
-			for ($i=0;$i<$numCols;$i++){
34
+				$this->_colSize=16 / $numCols;
35
+			for ($i=0; $i<$numCols; $i++) {
36 36
 				$this->addItem($width);
37 37
 			}
38 38
 		}
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 	 * @param int $width
44 44
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
45 45
 	 */
46
-	public function setWidth($width){
47
-		if(\is_int($width)){
46
+	public function setWidth($width) {
47
+		if (\is_int($width)) {
48 48
 			$width=Wide::getConstants()["W".$width];
49 49
 		}
50 50
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
51
-		return $this->addToPropertyCtrl("class", "column",array("column"));
51
+		return $this->addToPropertyCtrl("class", "column", array("column"));
52 52
 	}
53 53
 
54 54
 	/**
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 	 * @param int $index
57 57
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
58 58
 	 */
59
-	public function getCol($index){
59
+	public function getCol($index) {
60 60
 		return $this->getItem($index);
61 61
 	}
62 62
 
63
-	public function setNumCols($numCols){
63
+	public function setNumCols($numCols) {
64 64
 		$count=$this->count();
65
-		for($i=$count;$i<$numCols;$i++){
65
+		for ($i=$count; $i<$numCols; $i++) {
66 66
 			$this->addItem(null);
67 67
 		}
68 68
 		return $this;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 * stretch the row contents to take up the entire column height
73 73
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
74 74
 	 */
75
-	public function setStretched(){
75
+	public function setStretched() {
76 76
 		return $this->addToProperty("class", "stretched");
77 77
 	}
78 78
 
@@ -80,19 +80,19 @@  discard block
 block discarded – undo
80 80
 	 * @param string $color
81 81
 	 * @return \Ajax\semantic\html\content\HtmlGridRow
82 82
 	 */
83
-	public function setColor($color){
84
-		return $this->addToPropertyCtrl("class", $color,Color::getConstants());
83
+	public function setColor($color) {
84
+		return $this->addToPropertyCtrl("class", $color, Color::getConstants());
85 85
 	}
86 86
 
87
-	public function setValues($values,$force=false){
87
+	public function setValues($values, $force=false) {
88 88
 		$count=$this->count();
89
-		if($force===true){
90
-			for($i=$count;$i<\sizeof($values);$i++){
91
-				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null));
89
+		if ($force===true) {
90
+			for ($i=$count; $i<\sizeof($values); $i++) {
91
+				$this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null));
92 92
 			}
93 93
 		}
94
-		$count=\min(array($this->count(),\sizeof($values)));
95
-		for($i=0;$i<$count;$i++){
94
+		$count=\min(array($this->count(), \sizeof($values)));
95
+		for ($i=0; $i<$count; $i++) {
96 96
 			$this->content[$i]->setValue($values[$i]);
97 97
 		}
98 98
 	}
@@ -101,15 +101,15 @@  discard block
 block discarded – undo
101 101
 	 * {@inheritDoc}
102 102
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
103 103
 	 */
104
-	protected function createItem($value){
105
-		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value);
104
+	protected function createItem($value) {
105
+		$col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value);
106 106
 		return $col;
107 107
 	}
108 108
 
109
-	public function compile(JsUtils $js=NULL,View $view=NULL){
110
-		if($this->_implicite===true){
109
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
110
+		if ($this->_implicite===true) {
111 111
 			$this->_template="%wrapContentBefore%%content%%wrapContentAfter%";
112 112
 		}
113
-		return parent::compile($js,$view);
113
+		return parent::compile($js, $view);
114 114
 	}
115 115
 }
116 116
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlPopup.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $params;
14 14
 	private $_container;
15
-	public function __construct(BaseHtml $container,$identifier, $content="") {
15
+	public function __construct(BaseHtml $container, $identifier, $content="") {
16 16
 		parent::__construct($identifier, "div");
17 17
 		$this->_container=$container;
18 18
 		$this->setClass("ui popup");
@@ -20,21 +20,21 @@  discard block
 block discarded – undo
20 20
 		$this->params=array("on"=>"hover");
21 21
 	}
22 22
 
23
-	public function addList($items=array(),$header=NULL){
24
-		if(!$this->content instanceof HtmlGrid){
25
-			$this->content=new HtmlGrid("grid-".$this->identifier,1);
23
+	public function addList($items=array(), $header=NULL) {
24
+		if (!$this->content instanceof HtmlGrid) {
25
+			$this->content=new HtmlGrid("grid-".$this->identifier, 1);
26 26
 		}
27 27
 		$grid=$this->content;
28 28
 
29 29
 		$colCount=$grid->colCount();
30 30
 		$grid->setNumCols(++$colCount);
31 31
 
32
-		$list=new HtmlList("",$items);
32
+		$list=new HtmlList("", $items);
33 33
 		$list->asLink();
34
-		if(isset($header)){
35
-			$list->addHeader(4,$header);
34
+		if (isset($header)) {
35
+			$list->addHeader(4, $header);
36 36
 		}
37
-		$grid->getCell(0,$colCount-1)->setContent($list);
37
+		$grid->getCell(0, $colCount-1)->setContent($list);
38 38
 		$grid->setDivided();
39 39
 		return $list;
40 40
 	}
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * A popup can have no maximum width and continue to flow to fit its content
44 44
 	 */
45
-	public function setFlowing(){
45
+	public function setFlowing() {
46 46
 		return $this->addToProperty("class", "flowing");
47 47
 	}
48 48
 
49 49
 	/**
50 50
 	 * A popup can provide more basic formatting
51 51
 	 */
52
-	public function setBasic(){
52
+	public function setBasic() {
53 53
 		return $this->addToProperty("class", "basic");
54 54
 	}
55 55
 
@@ -57,22 +57,22 @@  discard block
 block discarded – undo
57 57
 	 * {@inheritDoc}
58 58
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
59 59
 	 */
60
-	public function run(JsUtils $js){
60
+	public function run(JsUtils $js) {
61 61
 		$this->params["popup"]="#".$this->identifier;
62
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params);
62
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->params);
63 63
 	}
64 64
 
65
-	public function setOn($event="click"){
65
+	public function setOn($event="click") {
66 66
 		$this->params["on"]=$event;
67 67
 		return $this;
68 68
 	}
69 69
 
70
-	public function setInline($value=true){
70
+	public function setInline($value=true) {
71 71
 		$this->params["inline"]=$value;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setPosition($position){
75
+	public function setPosition($position) {
76 76
 		$this->params["position"]=$position;
77 77
 		return $this;
78 78
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 	 * @param string $type one of text,item
35 35
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
36 36
 	 */
37
-	public function setType($type=""){
38
-		return $this->addToPropertyCtrl("class", $type, array("","item","text"));
37
+	public function setType($type="") {
38
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
39 39
 	}
40 40
 
41
-	public function setActiveItem($index){
41
+	public function setActiveItem($index) {
42 42
 		$item=$this->getItem($index);
43
-		if($item!==null){
43
+		if ($item!==null) {
44 44
 			$item->addToProperty("class", "active");
45 45
 		}
46 46
 		return $this;
@@ -50,26 +50,26 @@  discard block
 block discarded – undo
50 50
 	 * {@inheritDoc}
51 51
 	 * @see \Ajax\common\html\html5\HtmlCollection::addItem()
52 52
 	 */
53
-	public function addItem($item){
54
-		if($item instanceof HtmlInput || $item instanceof HtmlImg){
55
-			$itemO=new HtmlSemDoubleElement("item-".$this->identifier,"div","");
53
+	public function addItem($item) {
54
+		if ($item instanceof HtmlInput || $item instanceof HtmlImg) {
55
+			$itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div", "");
56 56
 			$itemO->setContent($item);
57 57
 			$item=$itemO;
58 58
 		}
59 59
 		$item=parent::addItem($item);
60
-		if(!$item instanceof HtmlMenu)
61
-			$item->addToPropertyCtrl("class", "item",array("item"));
62
-		else{
60
+		if (!$item instanceof HtmlMenu)
61
+			$item->addToPropertyCtrl("class", "item", array("item"));
62
+		else {
63 63
 			$this->setSecondary();
64 64
 		}
65 65
 		return $item;
66 66
 	}
67 67
 
68
-	public function generateMenuAsItem($menu,$header=null){
68
+	public function generateMenuAsItem($menu, $header=null) {
69 69
 		$count=$this->count();
70
-		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"div");
71
-		if(isset($header)){
72
-			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count,"div","header");
70
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
71
+		if (isset($header)) {
72
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
73 73
 			$headerItem->setContent($header);
74 74
 			$item->addContent($headerItem);
75 75
 		}
@@ -77,24 +77,24 @@  discard block
 block discarded – undo
77 77
 		$item->addContent($menu);
78 78
 		return $item;
79 79
 	}
80
-	public function addMenuAsItem($menu,$header=null){
81
-		return $this->addItem($this->generateMenuAsItem($menu,$header));
80
+	public function addMenuAsItem($menu, $header=null) {
81
+		return $this->addItem($this->generateMenuAsItem($menu, $header));
82 82
 	}
83 83
 
84
-	public function addPopupAsItem($value,$identifier, $content=""){
85
-		$value=new HtmlSemDoubleElement($identifier,"a","browse item",$value);
84
+	public function addPopupAsItem($value, $identifier, $content="") {
85
+		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
86 86
 		$value->addContent(new HtmlIcon("", "dropdown"));
87 87
 		$value=$this->addItem($value);
88
-		$popup=new HtmlPopup($value,"popup-".$this->identifier."-".$this->count(),$content);
88
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
89 89
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
90 90
 		$this->addContent($popup);
91 91
 		return $popup;
92 92
 	}
93 93
 
94
-	public function addDropdownAsItem($value,$items=NULL){
94
+	public function addDropdownAsItem($value, $items=NULL) {
95 95
 		$dd=$value;
96
-		if(\is_string($value)){
97
-			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(),$value,$items);
96
+		if (\is_string($value)) {
97
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
98 98
 		}
99 99
 		return $this->addItem($dd);
100 100
 	}
@@ -103,51 +103,51 @@  discard block
 block discarded – undo
103 103
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
104 104
 	 */
105 105
 	protected function createItem($value) {
106
-		$itemO=new HtmlLink("item-".\sizeof($this->content),"",$value);
106
+		$itemO=new HtmlLink("item-".\sizeof($this->content), "", $value);
107 107
 		return $itemO->setClass("item");
108 108
 	}
109 109
 
110
-	public function setInverted(){
110
+	public function setInverted() {
111 111
 		return $this->addToProperty("class", "inverted");
112 112
 	}
113 113
 
114
-	public function setSecondary(){
114
+	public function setSecondary() {
115 115
 		return $this->addToProperty("class", "secondary");
116 116
 	}
117 117
 
118
-	public function setVertical(){
119
-		return $this->addToPropertyCtrl("class", "vertical",array("vertical"));
118
+	public function setVertical() {
119
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
120 120
 	}
121 121
 
122
-	public function setPosition($value="right"){
123
-		return $this->addToPropertyCtrl("class", $value,array("right","left"));
122
+	public function setPosition($value="right") {
123
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
124 124
 	}
125 125
 
126
-	public function setPointing($value=Direction::NONE){
127
-		return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing"));
126
+	public function setPointing($value=Direction::NONE) {
127
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
128 128
 	}
129 129
 
130
-	public function asTab($vertical=false){
131
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
132
-		if($vertical===true)
130
+	public function asTab($vertical=false) {
131
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
132
+		if ($vertical===true)
133 133
 			$this->setVertical();
134 134
 		return $this->addToProperty("class", "tabular");
135 135
 	}
136 136
 
137
-	public function asPagination(){
138
-		$this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");});
137
+	public function asPagination() {
138
+		$this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); });
139 139
 			return $this->addToProperty("class", "pagination");
140 140
 	}
141 141
 
142
-	public function setFixed(){
142
+	public function setFixed() {
143 143
 		return $this->addToProperty("class", "fixed");
144 144
 	}
145 145
 
146
-	public function setFluid(){
146
+	public function setFluid() {
147 147
 		return $this->addToProperty("class", "fluid");
148 148
 	}
149 149
 
150
-	public function setCompact(){
150
+	public function setCompact() {
151 151
 		return $this->addToProperty("class", "compact");
152 152
 	}
153 153
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function fromDatabaseObject($object, $function) {
158 158
 		$return=$function($object);
159
-		if(\is_array($return))
159
+		if (\is_array($return))
160 160
 			$this->addItems($return);
161 161
 		else
162 162
 		$this->addItem($return);
@@ -167,15 +167,15 @@  discard block
 block discarded – undo
167 167
 	 * @param int $width
168 168
 	 * @return \Ajax\semantic\html\collections\menus\HtmlMenu
169 169
 	 */
170
-	public function setWidth($width){
171
-		if(\is_int($width)){
170
+	public function setWidth($width) {
171
+		if (\is_int($width)) {
172 172
 			$width=Wide::getConstants()["W".$width];
173 173
 		}
174 174
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
175
-		return $this->addToPropertyCtrl("class", "item",array("item"));
175
+		return $this->addToPropertyCtrl("class", "item", array("item"));
176 176
 	}
177 177
 
178
-	public function addImage($identifier, $src="", $alt=""){
179
-		return $this->addItem(new HtmlImg($identifier,$src,$alt));
178
+	public function addImage($identifier, $src="", $alt="") {
179
+		return $this->addItem(new HtmlImg($identifier, $src, $alt));
180 180
 	}
181 181
 }
182 182
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -15,28 +15,28 @@  discard block
 block discarded – undo
15 15
  * @author jc
16 16
  * @version 1.001
17 17
  */
18
-class HtmlGrid extends HtmlSemCollection{
18
+class HtmlGrid extends HtmlSemCollection {
19 19
 	use TextAlignmentTrait;
20 20
 	private $_createCols;
21 21
 	private $_colSizing=true;
22 22
 	private $_implicitRows=false;
23
-	public function __construct( $identifier,$numRows=1,$numCols=NULL,$createCols=true,$implicitRows=false){
24
-		parent::__construct( $identifier, "div","ui grid");
23
+	public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) {
24
+		parent::__construct($identifier, "div", "ui grid");
25 25
 		$this->_implicitRows=$implicitRows;
26 26
 		$this->_createCols=$createCols;
27
-		if(isset($numCols)){
27
+		if (isset($numCols)) {
28 28
 			//if($this->_createCols){
29 29
 				$this->_colSizing=false;
30 30
 			//}
31 31
 			$this->setWide($numCols);
32 32
 		}
33
-		$this->setNumRows($numRows,$numCols);
33
+		$this->setNumRows($numRows, $numCols);
34 34
 	}
35 35
 
36
-	public function setWide($wide){
36
+	public function setWide($wide) {
37 37
 		$wide=Wide::getConstants()["W".$wide];
38 38
 		$this->addToPropertyCtrl("class", $wide, Wide::getConstants());
39
-		return $this->addToPropertyCtrl("class","column",array("column"));
39
+		return $this->addToPropertyCtrl("class", "column", array("column"));
40 40
 	}
41 41
 
42 42
 	/**
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 	 * @param int $numCols
46 46
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
47 47
 	 */
48
-	public function setNumRows($numRows,$numCols=NULL){
48
+	public function setNumRows($numRows, $numCols=NULL) {
49 49
 		$count=$this->count();
50
-		for($i=$count;$i<$numRows;$i++){
50
+		for ($i=$count; $i<$numRows; $i++) {
51 51
 			$this->addItem($numCols);
52 52
 		}
53 53
 		return $this;
54 54
 	}
55 55
 
56
-	public function setNumCols($numCols){
56
+	public function setNumCols($numCols) {
57 57
 		$count=$this->count();
58
-		for($i=0;$i<$count;$i++){
58
+		for ($i=0; $i<$count; $i++) {
59 59
 			$this->getItem($i)->setNumCols($numCols);
60 60
 		}
61 61
 		//if($this->_colSizing===false)
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @param int $index
69 69
 	 * @return \Ajax\semantic\html\collections\HtmlGridRow
70 70
 	 */
71
-	public function getRow($index){
71
+	public function getRow($index) {
72 72
 		return $this->getItem($index);
73 73
 	}
74 74
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @param int $col
78 78
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
79 79
 	 */
80
-	public function getCell($row,$col){
80
+	public function getCell($row, $col) {
81 81
 		$row=$this->getItem($row);
82
-		if(isset($row)){
82
+		if (isset($row)) {
83 83
 			$col=$row->getItem($col);
84 84
 		}
85 85
 		return $col;
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	 * @param boolean $vertically
91 91
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
92 92
 	 */
93
-	public function setDivided($vertically=false){
94
-		$value=($vertically===true)?"vertically divided":"divided";
95
-		return $this->addToPropertyCtrl("class", $value,array("divided"));
93
+	public function setDivided($vertically=false) {
94
+		$value=($vertically===true) ? "vertically divided" : "divided";
95
+		return $this->addToPropertyCtrl("class", $value, array("divided"));
96 96
 	}
97 97
 
98 98
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 * @param boolean $internal true for internal cells
101 101
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
102 102
 	 */
103
-	public function setCelled($internal=false){
104
-		$value=($internal===true)?"internal celled":"celled";
103
+	public function setCelled($internal=false) {
104
+		$value=($internal===true) ? "internal celled" : "celled";
105 105
 		return $this->addToProperty("class", $value);
106 106
 	}
107 107
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 * automatically resize all elements to split the available width evenly
110 110
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
111 111
 	 */
112
-	public function setEqualWidth(){
112
+	public function setEqualWidth() {
113 113
 		return $this->addToProperty("class", "equal width");
114 114
 	}
115 115
 
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 	 * @param string $value
119 119
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
120 120
 	 */
121
-	public function setPadded($value=NULL){
122
-		if(isset($value))
123
-			$this->addToPropertyCtrl("class", $value,array("vertically","horizontally"));
121
+	public function setPadded($value=NULL) {
122
+		if (isset($value))
123
+			$this->addToPropertyCtrl("class", $value, array("vertically", "horizontally"));
124 124
 		return $this->addToProperty("class", "padded");
125 125
 	}
126 126
 
@@ -128,47 +128,47 @@  discard block
 block discarded – undo
128 128
 	 * @param boolean $very
129 129
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
130 130
 	 */
131
-	public function setRelaxed($very=false){
132
-		$value=($very===true)?"very relaxed":"relaxed";
131
+	public function setRelaxed($very=false) {
132
+		$value=($very===true) ? "very relaxed" : "relaxed";
133 133
 		return $this->addToProperty("class", $value);
134 134
 	}
135 135
 
136
-	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE){
137
-		return $this->addToPropertyCtrl("class", $value." aligned",VerticalAlignment::getConstantValues("aligned"));
136
+	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) {
137
+		return $this->addToPropertyCtrl("class", $value." aligned", VerticalAlignment::getConstantValues("aligned"));
138 138
 	}
139 139
 
140 140
 	/**
141 141
 	 * {@inheritDoc}
142 142
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
143 143
 	 */
144
-	protected function createItem($value){
145
-		if($this->_createCols===false)
144
+	protected function createItem($value) {
145
+		if ($this->_createCols===false)
146 146
 			$value=null;
147
-		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing,$this->_implicitRows);
147
+		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows);
148 148
 		return $item;
149 149
 	}
150 150
 
151
-	public function setValues($values){
151
+	public function setValues($values) {
152 152
 		$count=$this->count();
153
-		if($this->_createCols===false){
154
-			for($i=$count;$i<\sizeof($values);$i++){
153
+		if ($this->_createCols===false) {
154
+			for ($i=$count; $i<\sizeof($values); $i++) {
155 155
 				$colSize=\sizeof($values[$i]);
156
-				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1),$colSize,$this->_colSizing,$this->_implicitRows));
156
+				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows));
157 157
 			}
158 158
 		}
159
-		$count=\min(array($this->count(),\sizeof($values)));
160
-		for($i=0;$i<$count;$i++){
161
-			$this->content[$i]->setValues($values[$i],$this->_createCols===false);
159
+		$count=\min(array($this->count(), \sizeof($values)));
160
+		for ($i=0; $i<$count; $i++) {
161
+			$this->content[$i]->setValues($values[$i], $this->_createCols===false);
162 162
 		}
163 163
 	}
164 164
 
165
-	public function rowCount(){
165
+	public function rowCount() {
166 166
 		return $this->count();
167 167
 	}
168 168
 
169
-	public function colCount(){
169
+	public function colCount() {
170 170
 		$result=0;
171
-		if($this->count()>0){
171
+		if ($this->count()>0) {
172 172
 			$result=$this->content[0]->count();
173 173
 		}
174 174
 		return $result;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlList.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,34 +5,34 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemCollection;
6 6
 use Ajax\semantic\html\content\HtmlListItem;
7 7
 
8
-class HtmlList extends HtmlSemCollection{
8
+class HtmlList extends HtmlSemCollection {
9 9
 
10 10
 
11
-	public function __construct( $identifier, $items=array()){
12
-		parent::__construct( $identifier, "div", "ui list");
11
+	public function __construct($identifier, $items=array()) {
12
+		parent::__construct($identifier, "div", "ui list");
13 13
 		$this->addItems($items);
14 14
 	}
15 15
 
16 16
 
17
-	protected function createItem($value){
17
+	protected function createItem($value) {
18 18
 		$count=$this->count();
19
-		if(\is_array($value)){
19
+		if (\is_array($value)) {
20 20
 			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value[0]);
21 21
 			$item->addIcon($value[1]);
22 22
 		}else
23
-			$item= new HtmlListItem("item-".$this->identifier."-".$count, $value);
23
+			$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
24 24
 		return $item;
25 25
 	}
26 26
 
27
-	public function addHeader($niveau,$content){
28
-		return $this->insertItem(new HtmlHeader("header-".$this->identifier,$niveau,$content,"page"));
27
+	public function addHeader($niveau, $content) {
28
+		return $this->insertItem(new HtmlHeader("header-".$this->identifier, $niveau, $content, "page"));
29 29
 	}
30 30
 
31
-	public function itemsAs($tagName){
31
+	public function itemsAs($tagName) {
32 32
 		return $this->contentAs($tagName);
33 33
 	}
34 34
 
35
-	public function asLink(){
35
+	public function asLink() {
36 36
 		$this->addToPropertyCtrl("class", "link", array("link"));
37 37
 		return $this->contentAs("a");
38 38
 	}
Please login to merge, or discard this patch.