Passed
Push — master ( 81b8d1...d2596c )
by Jean-Christophe
01:51
created
Ajax/bootstrap/html/HtmlModal.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 class HtmlModal extends BaseHtml {
15 15
 	protected $title="Titre de ma boîte";
16 16
 	protected $content="";
17
-	protected $buttons=array ();
17
+	protected $buttons=array();
18 18
 	protected $showOnStartup=false;
19 19
 	protected $draggable=false;
20 20
 	protected $validCondition=NULL;
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 	public function __construct($identifier, $title="", $content="", $buttonCaptions=array()) {
28 28
 		parent::__construct($identifier);
29 29
 		$this->_template=include 'templates/tplModal.php';
30
-		$this->buttons=array ();
30
+		$this->buttons=array();
31 31
 		$this->title=$title;
32 32
 		$this->content=$content;
33
-		foreach ( $buttonCaptions as $button ) {
33
+		foreach ($buttonCaptions as $button) {
34 34
 			$this->addButton($button);
35 35
 		}
36 36
 	}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @param string $value
66 66
 	 * @return HtmlButton
67 67
 	 */
68
-	public function addOkayButton($value="Okay",$jsCode="") {
68
+	public function addOkayButton($value="Okay", $jsCode="") {
69 69
 		$btn=$this->addButton($value, "btn-primary");
70 70
 		$btn->onClick("if(".$this->getValidCondition()."){ ".$jsCode."$('#".$this->identifier."').modal('hide');}");
71 71
 		return $btn;
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 	 * @param string $viewName
115 115
 	 * @param array $params The parameters to pass to the view
116 116
 	 */
117
-	public function renderView(JsUtils $js,$initialController,$viewName, $params=array()) {
118
-		$this->content=$js->renderContent($initialController, $viewName,$params);
117
+	public function renderView(JsUtils $js, $initialController, $viewName, $params=array()) {
118
+		$this->content=$js->renderContent($initialController, $viewName, $params);
119 119
 	}
120 120
 
121 121
 	/**
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 	 * @param string $actionName the action name
127 127
 	 * @param array $params
128 128
 	 */
129
-	public function forward(JsUtils $js,$initialControllerInstance,$controllerName,$actionName,$params=NULL){
130
-		$this->content=$js->forward($initialControllerInstance, $controllerName, $actionName,$params);
129
+	public function forward(JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL) {
130
+		$this->content=$js->forward($initialControllerInstance, $controllerName, $actionName, $params);
131 131
 	}
132 132
 
133 133
 	/*
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 	 * @see BaseHtml::run()
136 136
 	 */
137 137
 	public function run(JsUtils $js) {
138
-		if($this->content instanceof BaseHtml){
138
+		if ($this->content instanceof BaseHtml) {
139 139
 			$this->content->run($js);
140 140
 		}
141
-		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array (
141
+		$this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array(
142 142
 				"show" => $this->showOnStartup
143 143
 		));
144 144
 		if ($this->draggable)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlGridsystem.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 class HtmlGridSystem extends HtmlBsDoubleElement {
17 17
 	private $rows;
18 18
 	
19
-	public function __construct($identifier,$numRows=1,$numCols=NULL){
20
-		parent::__construct($identifier,"div");
19
+	public function __construct($identifier, $numRows=1, $numCols=NULL) {
20
+		parent::__construct($identifier, "div");
21 21
 		$this->setProperty("class", "container-fluid");
22 22
 		$this->rows=array();
23
-		$this->setNumRows($numRows,$numCols);
23
+		$this->setNumRows($numRows, $numCols);
24 24
 	}
25 25
 	
26 26
 	/**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param int $numCols 
29 29
 	 * @return \Ajax\bootstrap\html\content\HtmlGridRow
30 30
 	 */
31
-	public function addRow($numCols=NULL){
32
-		$row=new HtmlGridRow($this->identifier."-row-".(sizeof($this->rows)+1),$numCols);
31
+	public function addRow($numCols=NULL) {
32
+		$row=new HtmlGridRow($this->identifier."-row-".(sizeof($this->rows)+1), $numCols);
33 33
 		$this->rows[]=$row;
34 34
 		return $row;
35 35
 	}
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	 * @param boolean $force add the row at $index if true
41 41
 	 * @return \Ajax\bootstrap\html\content\HtmlGridRow
42 42
 	 */
43
-	public function getRow($index,$force=true){
44
-		if($index<sizeof($this->rows)){
43
+	public function getRow($index, $force=true) {
44
+		if ($index<sizeof($this->rows)) {
45 45
 			$result=$this->rows[$index-1];
46
-		}else if ($force){
46
+		} else if ($force) {
47 47
 			$this->setNumRows($index);
48 48
 			$result=$this->rows[$index-1];
49 49
 		}
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 * @param int $numCols
57 57
 	 * @return \Ajax\bootstrap\html\HtmlGridSystem
58 58
 	 */
59
-	public function setNumRows($numRows,$numCols=NULL){
60
-		for($i=sizeof($this->rows);$i<$numRows;$i++){
59
+	public function setNumRows($numRows, $numCols=NULL) {
60
+		for ($i=sizeof($this->rows); $i<$numRows; $i++) {
61 61
 			$this->addRow($numCols);
62 62
 		}
63 63
 		return $this;
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 	 * @param boolean $force add the cell at $row,$col if true
70 70
 	 * @return HtmlGridCol
71 71
 	 */
72
-	public function getCell($row,$col,$force=true){
73
-		$row=$this->getRow($row,$force);
74
-		if(isset($row)){
75
-			$col=$row->getCol($col,$force);
72
+	public function getCell($row, $col, $force=true) {
73
+		$row=$this->getRow($row, $force);
74
+		if (isset($row)) {
75
+			$col=$row->getCol($col, $force);
76 76
 		}
77 77
 		return $col;
78 78
 	}
@@ -82,22 +82,22 @@  discard block
 block discarded – undo
82 82
 	 * @param int $col
83 83
 	 * @return HtmlGridCol
84 84
 	 */
85
-	public function getCellAt($row,$col,$force=true){
86
-		$row=$this->getRow($row,$force);
87
-		if(isset($row)){
88
-			$col=$row->getColAt($col,$force);
85
+	public function getCellAt($row, $col, $force=true) {
86
+		$row=$this->getRow($row, $force);
87
+		if (isset($row)) {
88
+			$col=$row->getColAt($col, $force);
89 89
 		}
90 90
 		return $col;
91 91
 	}
92 92
 	
93 93
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
94
-		foreach ($this->rows as $row){
94
+		foreach ($this->rows as $row) {
95 95
 			$this->addContent($row);
96 96
 		}
97
-		return parent::compile($js,$view);
97
+		return parent::compile($js, $view);
98 98
 	}
99
-	public function setContentForAll($content){
100
-		foreach ($this->rows as $row){
99
+	public function setContentForAll($content) {
100
+		foreach ($this->rows as $row) {
101 101
 			$row->setContentForAll($content);
102 102
 		}
103 103
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlTabs.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 use Ajax\bootstrap\html\content\HtmlTabContent;
16 16
 
17 17
 class HtmlTabs extends HtmlBsDoubleElement {
18
-	protected $tabs=array ();
18
+	protected $tabs=array();
19 19
 	protected $_tabsType="tabs";
20 20
 	protected $stacked="";
21 21
 
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 	}
27 27
 
28 28
 	protected function addTab_($tab, $index=null) {
29
-		if($tab instanceof HtmlDropdown){
29
+		if ($tab instanceof HtmlDropdown) {
30 30
 			$tab->setMTagName("li");
31 31
 		}
32 32
 		if (isset($index)) {
33
-			$inserted=array (
33
+			$inserted=array(
34 34
 					$tab
35 35
 			);
36 36
 			array_splice($this->tabs, $index, 0, $inserted);
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 			$this->tabs []=$tab;
39 39
 	}
40 40
 
41
-	public function setActive($index){
41
+	public function setActive($index) {
42 42
 		$size=\sizeof($this->tabs);
43
-		for ($i=0;$i<$size;$i++){
43
+		for ($i=0; $i<$size; $i++) {
44 44
 			$this->tabs[$i]->setActive($i==$index);
45 45
 		}
46 46
 	}
47 47
 
48
-	public function disable($index){
48
+	public function disable($index) {
49 49
 		$this->tabs[$index]->disable();
50 50
 	}
51 51
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	public function addTabs($tabs) {
79
-		foreach ( $tabs as $tab ) {
79
+		foreach ($tabs as $tab) {
80 80
 			$this->addTab($tab);
81 81
 		}
82 82
 		return $this;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 */
107 107
 	public function run(JsUtils $js) {
108 108
 		$this->_bsComponent=new Tabs($js);
109
-		foreach ( $this->tabs as $tab ) {
109
+		foreach ($this->tabs as $tab) {
110 110
 			$this->_bsComponent->addTab($tab->run($js));
111 111
 		}
112 112
 		$this->addEventsOnRun($js);
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
 
116 116
 	public function createTabContents() {
117 117
 		$tabContent=new HtmlTabContent("tabcontent-".$this->identifier);
118
-		foreach ( $this->tabs as $tab ) {
118
+		foreach ($this->tabs as $tab) {
119 119
 			if ($tab instanceof HtmlTabItem)
120 120
 				$tabContent->addTabItem($tab->getHref());
121 121
 			elseif ($tab instanceof HtmlDropdown) {
122
-				foreach ( $tab->getItems() as $dropdownItem ) {
122
+				foreach ($tab->getItems() as $dropdownItem) {
123 123
 					$tabContent->addTabItem($dropdownItem->getHref());
124 124
 				}
125 125
 			}
@@ -154,21 +154,21 @@  discard block
 block discarded – undo
154 154
 		if (sizeof($this->content->getTabItems())>0) {
155 155
 			$this->content->getTabItem(0)->addToProperty("class", "fade in");
156 156
 			$size=sizeof($this->tabs);
157
-			for($index=0; $index<$size; $index++) {
157
+			for ($index=0; $index<$size; $index++) {
158 158
 				$this->content->getTabItem($index)->addToProperty("class", "fade");
159 159
 			}
160 160
 		}
161 161
 	}
162 162
 
163
-	public function on($event, $jsCode,$stopPropagation=false,$preventDefault=false){
164
-		foreach ($this->tabs as $tab){
165
-			$tab->on($event,$jsCode,$stopPropagation,$preventDefault);
163
+	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
164
+		foreach ($this->tabs as $tab) {
165
+			$tab->on($event, $jsCode, $stopPropagation, $preventDefault);
166 166
 		}
167 167
 		return $this;
168 168
 	}
169 169
 
170
-	public function setStacked($stacked=true){
171
-		if($stacked)
170
+	public function setStacked($stacked=true) {
171
+		if ($stacked)
172 172
 			$this->stacked="nav-stacked";
173 173
 		else $this->stacked="";
174 174
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -45,70 +45,70 @@  discard block
 block discarded – undo
45 45
 	/**
46 46
 	 * @param string $identifier
47 47
 	 */
48
-	public function __construct($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
49
-		parent::__construct($identifier,"ul");
48
+	public function __construct($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
49
+		parent::__construct($identifier, "ul");
50 50
 		$this->setProperty("class", "pagination");
51 51
 		$this->active=$active;
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
55
+		if (!isset($countVisible))
56 56
 			$this->countVisible=$to-$from+1;
57 57
 		else
58 58
 			$this->countVisible=$countVisible;
59 59
 		$this->createContent();
60 60
 	}
61 61
 
62
-	private function createElement($num,$content,$disabled=false,$current=false){
62
+	private function createElement($num, $content, $disabled=false, $current=false) {
63 63
 		$count=sizeof($this->content)+1;
64
-		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count,"li");
65
-		if($disabled){
64
+		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count, "li");
65
+		if ($disabled) {
66 66
 			$elem->setProperty("class", "disabled");
67 67
 		}
68
-		if($current){
68
+		if ($current) {
69 69
 			$content.="<span class='sr-only'>(current)</span>";
70 70
 			$elem->setProperty("class", "active");
71 71
 		}
72
-		if(!$disabled){
72
+		if (!$disabled) {
73 73
 			$url=$this->getUrl($num);
74
-			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
74
+			$href=new HtmlLink("a-".$this->identifier."-".$count, $url, $content);
75 75
 			$href->setProperty($this->attr, $url);
76 76
 			$elem->setContent($href);
77
-		}else{
77
+		} else {
78 78
 			$elem->setContent($content);
79 79
 		}
80 80
 		$this->content[]=$elem;
81 81
 		return $this;
82 82
 	}
83 83
 
84
-	protected function createContent(){
84
+	protected function createContent() {
85 85
 		$this->content=array();
86
-		$this->createElement($this->active-1,"<span aria-hidden='true'>&laquo;</span>",$this->active===1);
86
+		$this->createElement($this->active-1, "<span aria-hidden='true'>&laquo;</span>", $this->active===1);
87 87
 		$start=$this->getStart();
88
-		$end=min($start+$this->countVisible-1,$this->to);
89
-		for($index=$start;$index<=$end;$index++){
90
-			$this->createElement($index,$index,false,$index===$this->active);
88
+		$end=min($start+$this->countVisible-1, $this->to);
89
+		for ($index=$start; $index<=$end; $index++) {
90
+			$this->createElement($index, $index, false, $index===$this->active);
91 91
 		}
92
-		$this->createElement($this->active+1,"<span aria-hidden='true'>&raquo;</span>",$this->active===$this->to);
92
+		$this->createElement($this->active+1, "<span aria-hidden='true'>&raquo;</span>", $this->active===$this->to);
93 93
 	}
94 94
 
95
-	protected function half(){
95
+	protected function half() {
96 96
 		return (int)($this->countVisible/2);
97 97
 	}
98 98
 
99
-	protected function getStart(){
99
+	protected function getStart() {
100 100
 		$result=1;
101
-		if($this->countVisible!==$this->to-$this->from+1){
102
-			$result=max($this->active-$this->half(),$result);
101
+		if ($this->countVisible!==$this->to-$this->from+1) {
102
+			$result=max($this->active-$this->half(), $result);
103 103
 		}
104 104
 		return $result;
105 105
 	}
106 106
 
107 107
 	public function _addEvent($event, $jsCode) {
108
-		foreach ($this->content as $li){
108
+		foreach ($this->content as $li) {
109 109
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
110
+			if ($content instanceof BaseHtml)
111
+				$content->_addEvent($event, $jsCode);
112 112
 		}
113 113
 	}
114 114
 	/**
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 	 * @param object $dispatcher the request dispatcher
118 118
 	 * @return \Ajax\bootstrap\html\HtmlPagination
119 119
 	 */
120
-	public function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0){
120
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
121 121
 		$items=$js->fromDispatcher($dispatcher);
122 122
 		$url=implode("/", $items);
123
-		if($this->urlMask==="%page%"){
123
+		if ($this->urlMask==="%page%") {
124 124
 			$this->urlMask=preg_replace("/[0-9]/", "%page%", $url);
125 125
 		}
126
-		for($index=$this->from;$index<=$this->to;$index++){
127
-			if($this->getUrl($index)==$url){
126
+		for ($index=$this->from; $index<=$this->to; $index++) {
127
+			if ($this->getUrl($index)==$url) {
128 128
 				$this->setActive($index);
129 129
 				break;
130 130
 			}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		return $this;
133 133
 	}
134 134
 
135
-	public function getUrl($index){
135
+	public function getUrl($index) {
136 136
 		return str_ireplace("%page%", $index, $this->urlMask);
137 137
 	}
138 138
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		if (is_int($size)) {
147 147
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 148
 		}
149
-		if(!JString::startsWith($size, "pagination-") && $size!=="")
149
+		if (!JString::startsWith($size, "pagination-") && $size!=="")
150 150
 			$size="pagination-".$size;
151 151
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 152
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		return $this->from;
156 156
 	}
157 157
 	public function setFrom($from) {
158
-		$this->from = $from;
158
+		$this->from=$from;
159 159
 		$this->createContent();
160 160
 		return $this;
161 161
 	}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		return $this->to;
164 164
 	}
165 165
 	public function setTo($to) {
166
-		$this->to = $to;
166
+		$this->to=$to;
167 167
 		$this->createContent();
168 168
 		return $this;
169 169
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		return $this->active;
172 172
 	}
173 173
 	public function setActive($active) {
174
-		$this->active = $active;
174
+		$this->active=$active;
175 175
 		$this->createContent();
176 176
 		return $this;
177 177
 	}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		return $this->urlMask;
180 180
 	}
181 181
 	public function setUrlMask($urlMask) {
182
-		$this->urlMask = $urlMask;
182
+		$this->urlMask=$urlMask;
183 183
 		$this->createContent();
184 184
 		return $this;
185 185
 	}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		return $this->countVisible;
188 188
 	}
189 189
 	public function setCountVisible($countVisible) {
190
-		$this->countVisible = $countVisible;
190
+		$this->countVisible=$countVisible;
191 191
 		$this->createContent();
192 192
 		return $this;
193 193
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlAccordion.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$this->setClass("panel-group");
20 20
 		$this->setRole("tablist");
21 21
 		$this->setProperty("aria-multiselectable", "true");
22
-		$this->content=array ();
22
+		$this->content=array();
23 23
 	}
24 24
 
25 25
 	public function addPanel($title, $content) {
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
 	 * @param string $viewName
46 46
 	 * @param array $params The parameters to pass to the view
47 47
 	 */
48
-	public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
49
-		return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
48
+	public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
49
+		return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params));
50 50
 	}
51 51
 
52 52
 		/**
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 	 * @param string $action a Phalcon action
59 59
 	 * @param array $params
60 60
 	 */
61
-	public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
62
-		return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
61
+	public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
62
+		return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params));
63 63
 	}
64 64
 
65 65
 	public function run(JsUtils $js) {
66
-		foreach ( $this->content as $content ) {
66
+		foreach ($this->content as $content) {
67 67
 			$content->run($js);
68 68
 		}
69 69
 	}
Please login to merge, or discard this patch.
Ajax/service/AjaxCall.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
 		$this->parameters["immediatly"]=false;
24 24
 		extract($this->parameters);
25 25
 		$result=$this->_eventPreparing($preventDefault, $stopPropagation);
26
-		switch($this->method) {
26
+		switch ($this->method) {
27 27
 			case "get":
28 28
 				$result.=$js->getDeferred($url, $responseElement, $this->parameters);
29 29
 				break;
30 30
 			case "post":
31
-				$result.=$js->postDeferred($url, $params,$responseElement, $this->parameters);
31
+				$result.=$js->postDeferred($url, $params, $responseElement, $this->parameters);
32 32
 				break;
33 33
 			case "postForm":
34 34
 				$result.=$js->postFormDeferred($url, $form, $responseElement, $this->parameters);
35 35
 				break;
36 36
 			case "json":
37
-				$result.=$js->jsonDeferred($url,$method,$this->parameters);
37
+				$result.=$js->jsonDeferred($url, $method, $this->parameters);
38 38
 				break;
39 39
 			case "jsonArray":
40
-				$result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$this->parameters);
40
+				$result.=$js->jsonArrayDeferred($modelSelector, $url, $method, $this->parameters);
41 41
 				break;
42 42
 			default:
43 43
 				break;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		return $result;
46 46
 	}
47 47
 
48
-	protected function _eventPreparing($preventDefault,$stopPropagation){
48
+	protected function _eventPreparing($preventDefault, $stopPropagation) {
49 49
 		$result="";
50 50
 		if ($preventDefault===true) {
51 51
 			$result.=Javascript::$preventDefault;
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlUtils.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@
 block discarded – undo
3 3
 namespace Ajax\common\html\html5;
4 4
 
5 5
 class HtmlUtils {
6
-	public static function javascriptInclude($url){
6
+	public static function javascriptInclude($url) {
7 7
 		return '<script src="'.$url.'"></script>';
8 8
 	}
9 9
 	
10
-	public static function stylesheetInclude($url){
10
+	public static function stylesheetInclude($url) {
11 11
 		return '<link rel="stylesheet" type="text/css" href="'.$url.'">';
12 12
 	}
13 13
 }
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlNavbar.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	public function __construct($identifier, $brand="Brand", $brandHref="#") {
33 33
 		parent::__construct($identifier);
34 34
 		$this->_template=include 'templates/tplNavbar.php';
35
-		$this->navZones=array ();
35
+		$this->navZones=array();
36 36
 		$this->class="navbar-default";
37 37
 		$this->brand=$brand;
38 38
 		$this->brandHref=$brandHref;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	public function setBrandImage($imageSrc) {
63
-		$this->brandImage=new HtmlImg("brand-img-".$this->_identifier,$imageSrc,$this->brand);
63
+		$this->brandImage=new HtmlImg("brand-img-".$this->_identifier, $imageSrc, $this->brand);
64 64
 		$this->brand="";
65 65
 		return $this;
66 66
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function setNavZones($navZones) {
106 106
 		if (\is_array($navZones)) {
107
-			foreach ( $navZones as $zoneType => $zoneArray ) {
107
+			foreach ($navZones as $zoneType => $zoneArray) {
108 108
 				if (is_string($zoneType)) {
109 109
 					$zone=$this->addZone($zoneType);
110 110
 					$zone->fromArray($zoneArray);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 			if ($index<$nb)
145 145
 				$zone=$this->navZones [$index];
146 146
 		} else {
147
-			for($i=0; $i<$nb; $i++) {
147
+			for ($i=0; $i<$nb; $i++) {
148 148
 				if ($this->navZones [$i]->getIdentifier()===$index) {
149 149
 					$zone=$this->navZones [$i];
150 150
 					break;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	}
156 156
 
157 157
 	public function run(JsUtils $js) {
158
-		foreach ( $this->navZones as $zone ) {
158
+		foreach ($this->navZones as $zone) {
159 159
 			$zone->run($js);
160 160
 		}
161 161
 		if ($this->hasScrollspy) {
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 	}
178 178
 
179 179
 	public function setFluid($fluid) {
180
-		if($fluid===true){
180
+		if ($fluid===true) {
181 181
 			$this->fluid="container-fluid";
182
-		}else{
182
+		} else {
183 183
 			$this->fluid="container";
184 184
 		}
185 185
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$this->startIndex=$startIndex;
53 53
 		$this->autoActive=$autoActive;
54 54
 		$this->_contentSeparator="<div class='divider'> / </div>";
55
-		$this->_hrefFunction=function (HtmlSemDoubleElement $e) {
55
+		$this->_hrefFunction=function(HtmlSemDoubleElement $e) {
56 56
 			return $e->getContent();
57 57
 		};
58 58
 		if (isset($hrefFunction)) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return HtmlBreadcrumb
69 69
 	 */
70 70
 	public function autoGetOnClick($targetSelector) {
71
-		return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr ));
71
+		return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr));
72 72
 	}
73 73
 
74 74
 	public function contentAsString() {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	public function setActive($index=null) {
85 85
 		if (!isset($index)) {
86
-			$index=sizeof($this->content) - 1;
86
+			$index=sizeof($this->content)-1;
87 87
 		}
88 88
 		$activeItem=$this->content[$index];
89 89
 		$activeItem->addToProperty("class", "active");
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 * @param object $dispatcher the request dispatcher
97 97
 	 * @return HtmlBreadcrumb
98 98
 	 */
99
-	public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) {
99
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
100 100
 		$this->startIndex=$startIndex;
101 101
 		return $this->addItems($js->fromDispatcher($dispatcher));
102 102
 	}
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		if (!isset($index)) {
112 112
 			$index=sizeof($this->content);
113 113
 		}
114
-		if ($this->absolutePaths === true) {
114
+		if ($this->absolutePaths===true) {
115 115
 			return $this->_hrefFunction($this->content[$index]);
116 116
 		} else {
117
-			return $this->root . implode($separator, array_slice(array_map(function ($e) {
117
+			return $this->root.implode($separator, array_slice(array_map(function($e) {
118 118
 				return $this->_hrefFunction($e);
119
-			}, $this->content), $this->startIndex, $index + 1));
119
+			}, $this->content), $this->startIndex, $index+1));
120 120
 		}
121 121
 	}
122 122
 
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
 			$this->setActive();
151 151
 		}
152 152
 		$count=$this->count();
153
-		for($i=1; $i < $count; $i++) {
154
-			$this->content[$i]->wrap($this->getContentDivider($i - 1));
153
+		for ($i=1; $i<$count; $i++) {
154
+			$this->content[$i]->wrap($this->getContentDivider($i-1));
155 155
 		}
156 156
 		return parent::compile($js, $view);
157 157
 	}
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
162 162
 	 */
163 163
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
164
-		foreach ( $this->content as $element ) {
164
+		foreach ($this->content as $element) {
165 165
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
166 166
 		}
167 167
 		return $this;
168 168
 	}
169 169
 
170 170
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
171
-		foreach ( $this->content as $element ) {
172
-			if ($element->getProperty($this->attr) != NULL){
171
+		foreach ($this->content as $element) {
172
+			if ($element->getProperty($this->attr)!=NULL) {
173 173
 				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
174 174
 			}
175 175
 		}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	protected function createItem($value) {
186 186
 		$count=$this->count();
187
-		$itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section");
187
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
188 188
 		if (\is_array($value))
189 189
 			$itemO->fromArray($value);
190 190
 		else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	public function addIconAt($icon, $index) {
197 197
 		$item=$this->getItem($index);
198 198
 		if (isset($item)) {
199
-			$icon=new HtmlIcon("icon-" . $this->identifier, $icon);
199
+			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
200 200
 			$item->wrapContent($icon);
201 201
 		}
202 202
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	public function addItem($item) {
205 205
 		$count=$this->count();
206 206
 		$itemO=parent::addItem($item);
207
-		$this->addToPropertyCtrl("class", "section", array ("section" ));
207
+		$this->addToPropertyCtrl("class", "section", array("section"));
208 208
 		$itemO->setProperty($this->attr, $this->getHref($count));
209 209
 		return $itemO;
210 210
 	}
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	public function setAbsolutePaths($absolutePaths) {
221 221
 		$this->absolutePaths=$absolutePaths;
222 222
 		$size=\sizeof($this->content);
223
-		for($i=0;$i<$size;$i++){
223
+		for ($i=0; $i<$size; $i++) {
224 224
 			$this->content[$i]->setProperty($this->attr, $this->getHref($i));
225 225
 		}
226 226
 		return $this;
Please login to merge, or discard this patch.