Completed
Push — master ( eb7f5d...c7a943 )
by Jean-Christophe
03:07
created
Ajax/semantic/html/elements/HtmlList.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 
20 20
 	protected function createItem($value) {
21 21
 		$count=$this->count();
22
-		$item=new HtmlListItem("item-" . $this->identifier . "-" . $count, $value);
22
+		$item=new HtmlListItem("item-".$this->identifier."-".$count, $value);
23 23
 		return $item;
24 24
 	}
25 25
 
26 26
 	public function addHeader($niveau, $content) {
27
-		$header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page");
27
+		$header=new HtmlHeader("header-".$this->identifier, $niveau, $content, "page");
28 28
 		$this->wrap($header);
29 29
 		return $header;
30 30
 	}
31 31
 
32
-	public function getItemPart($index,$partName="header"){
32
+	public function getItemPart($index, $partName="header") {
33 33
 		return $this->getItem($index)->getPart($partName);
34 34
 	}
35 35
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public function asLink() {
41
-		$this->addToPropertyCtrl("class", "link", array ("link" ));
41
+		$this->addToPropertyCtrl("class", "link", array("link"));
42 42
 		return $this->contentAs("a");
43 43
 	}
44 44
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 		return $this->addItem($list);
49 49
 	}
50 50
 
51
-	protected function getItemToAdd($item){
51
+	protected function getItemToAdd($item) {
52 52
 		$itemO=parent::getItemToAdd($item);
53
-		if($itemO instanceof AbstractCheckbox)
53
+		if ($itemO instanceof AbstractCheckbox)
54 54
 			$itemO->addClass("item");
55 55
 		return $itemO;
56 56
 	}
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 	}
69 69
 
70 70
 	public function run(JsUtils $js) {
71
-		if ($this->_hasCheckedList === true) {
72
-			$jsCode=include dirname(__FILE__) . '/../../components/jsTemplates/tplCheckedList.php';
73
-			$jsCode=\str_replace("%identifier%", "#" . $this->identifier, $jsCode);
71
+		if ($this->_hasCheckedList===true) {
72
+			$jsCode=include dirname(__FILE__).'/../../components/jsTemplates/tplCheckedList.php';
73
+			$jsCode=\str_replace("%identifier%", "#".$this->identifier, $jsCode);
74 74
 			$this->executeOnRun($jsCode);
75 75
 		}
76 76
 		return parent::run($js);
@@ -100,38 +100,38 @@  discard block
 block discarded – undo
100 100
 	 * @param string $notAllChecked
101 101
 	 * @return HtmlList
102 102
 	 */
103
-	public function addCheckedList($items=array(), $masterItem=NULL, $values=array(),$notAllChecked=false) {
103
+	public function addCheckedList($items=array(), $masterItem=NULL, $values=array(), $notAllChecked=false) {
104 104
 		$count=$this->count();
105
-		$identifier=$this->identifier . "-" . $count;
105
+		$identifier=$this->identifier."-".$count;
106 106
 		if (isset($masterItem)) {
107
-			if(\is_array($masterItem)){
108
-				$masterO=new HtmlFormCheckbox("master-" . $identifier, @$masterItem[0],@$masterItem[1]);
109
-				if(isset($masterItem[1])){
110
-					if(\array_search($masterItem[1], $values)!==false){
107
+			if (\is_array($masterItem)) {
108
+				$masterO=new HtmlFormCheckbox("master-".$identifier, @$masterItem[0], @$masterItem[1]);
109
+				if (isset($masterItem[1])) {
110
+					if (\array_search($masterItem[1], $values)!==false) {
111 111
 						$masterO->getDataField()->setProperty("checked", "");
112 112
 					}
113 113
 				}
114
-			}else{
115
-				$masterO=new HtmlFormCheckbox("master-" . $identifier, $masterItem);
114
+			} else {
115
+				$masterO=new HtmlFormCheckbox("master-".$identifier, $masterItem);
116 116
 			}
117
-			if($notAllChecked){
117
+			if ($notAllChecked) {
118 118
 				$masterO->getDataField()->addClass("_notAllChecked");
119 119
 			}
120 120
 			$masterO->getHtmlCk()->addToProperty("class", "master");
121 121
 			$masterO->setClass("item");
122 122
 			$this->addItem($masterO);
123 123
 		}
124
-		$fields=array ();
124
+		$fields=array();
125 125
 		$i=0;
126
-		foreach ( $items as $val => $caption ) {
127
-			$itemO=new HtmlFormCheckbox($identifier . "-" . $i++, $caption, $val, "child");
128
-			if (\array_search($val, $values) !== false) {
126
+		foreach ($items as $val => $caption) {
127
+			$itemO=new HtmlFormCheckbox($identifier."-".$i++, $caption, $val, "child");
128
+			if (\array_search($val, $values)!==false) {
129 129
 				$itemO->getDataField()->setProperty("checked", "");
130 130
 			}
131 131
 			$itemO->setClass("item");
132 132
 			$fields[]=$itemO;
133 133
 		}
134
-		if (isset($masterO) === true) {
134
+		if (isset($masterO)===true) {
135 135
 			$list=new HtmlList("", $fields);
136 136
 			$list->setClass("list");
137 137
 			$masterO->addContent($list);
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 		return $this;
143 143
 	}
144 144
 
145
-	public function setIcons($icons){
146
-		if(!\is_array($icons)){
145
+	public function setIcons($icons) {
146
+		if (!\is_array($icons)) {
147 147
 			$icons=\array_fill(0, \sizeof($this->content), $icons);
148 148
 		}
149
-		$max=\min(\sizeof($icons),\sizeof($this->content));
150
-		for($i=0;$i<$max;$i++){
149
+		$max=\min(\sizeof($icons), \sizeof($this->content));
150
+		for ($i=0; $i<$max; $i++) {
151 151
 			$this->content[$i]->addIcon($icons[$i]);
152 152
 		}
153 153
 		return $this;
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
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 class HtmlPopup extends HtmlSemDoubleElement {
13 13
 	private $_container;
14
-	public function __construct(BaseHtml $container,$identifier, $content="") {
14
+	public function __construct(BaseHtml $container, $identifier, $content="") {
15 15
 		parent::__construct($identifier, "div");
16 16
 		$this->_container=$container;
17 17
 		$this->setClass("ui popup");
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::addList()
25 25
 	 */
26
-	public function addList($items=array(),$header=NULL){
27
-		if(!$this->content instanceof HtmlGrid){
28
-			$this->content=new HtmlGrid("Grid-".$this->identifier,0);
26
+	public function addList($items=array(), $header=NULL) {
27
+		if (!$this->content instanceof HtmlGrid) {
28
+			$this->content=new HtmlGrid("Grid-".$this->identifier, 0);
29 29
 		}
30 30
 		$grid=$this->content;
31 31
 
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 		$colCount++;
34 34
 		$grid->setColsCount($colCount);
35 35
 
36
-		$list=new HtmlList("",$items);
36
+		$list=new HtmlList("", $items);
37 37
 		$list->asLink();
38
-		if(isset($header)){
39
-			$list->addHeader(4,$header);
38
+		if (isset($header)) {
39
+			$list->addHeader(4, $header);
40 40
 		}
41
-		$grid->getCell(0,$colCount-1)->setContent($list);
41
+		$grid->getCell(0, $colCount-1)->setContent($list);
42 42
 		$grid->setDivided()->setRelaxed(true);
43 43
 		return $list;
44 44
 	}
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 	/**
47 47
 	 * A popup can have no maximum width and continue to flow to fit its content
48 48
 	 */
49
-	public function setFlowing(){
49
+	public function setFlowing() {
50 50
 		return $this->addToProperty("class", "flowing");
51 51
 	}
52 52
 
53 53
 	/**
54 54
 	 * A popup can provide more basic formatting
55 55
 	 */
56
-	public function setBasic(){
56
+	public function setBasic() {
57 57
 		return $this->addToProperty("class", "basic");
58 58
 	}
59 59
 
@@ -61,23 +61,23 @@  discard block
 block discarded – undo
61 61
 	 * {@inheritDoc}
62 62
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
63 63
 	 */
64
-	public function run(JsUtils $js){
64
+	public function run(JsUtils $js) {
65 65
 		parent::run($js);
66 66
 		$this->_params["popup"]="#".$this->identifier;
67
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params);
67
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params);
68 68
 	}
69 69
 
70
-	public function setOn($event="click"){
70
+	public function setOn($event="click") {
71 71
 		$this->_params["on"]=$event;
72 72
 		return $this;
73 73
 	}
74 74
 
75
-	public function setInline($value=true){
75
+	public function setInline($value=true) {
76 76
 		$this->_params["inline"]=$value;
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setPosition($position){
80
+	public function setPosition($position) {
81 81
 		$this->_params["position"]=$position;
82 82
 		return $this;
83 83
 	}
Please login to merge, or discard this patch.