Completed
Push — 17.1 ( 8c3b94...29ee37 )
by Ralf
20:39 queued 11:58
created
api/src/Etemplate/Widget/Transformer.php 1 patch
Braces   +16 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,7 +150,10 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	protected function action($attr, $action, array &$attrs)
152 152
 	{
153
-		if (self::DEBUG) error_log(__METHOD__."('$attr', ".array2string($action).')');
153
+		if (self::DEBUG)
154
+		{
155
+			error_log(__METHOD__."('$attr', ".array2string($action).')');
156
+		}
154 157
 		// action is an assignment
155 158
 		if (is_scalar($action) || is_null($action))
156 159
 		{
@@ -160,7 +163,10 @@  discard block
 block discarded – undo
160 163
 				$replace = array();
161 164
 				foreach($attrs as $a => $v)
162 165
 				{
163
-					if (is_scalar($v) || is_null($v)) $replace['@'.$a] = $v;
166
+					if (is_scalar($v) || is_null($v))
167
+					{
168
+						$replace['@'.$a] = $v;
169
+					}
164 170
 				}
165 171
 				$action = strtr($action, $replace);
166 172
 				// now replace with non-scalar value, eg. if values is an array: "@value", "@value[key] or "@value[@key]"
@@ -170,7 +176,10 @@  discard block
 block discarded – undo
170 176
 				}
171 177
 			}
172 178
 			$attrs[$attr] = $action;
173
-			if (self::DEBUG) error_log(__METHOD__."('$attr', ".array2string($action).") attrs['$attr'] = ".array2string($action).', attrs='.array2string($attrs));
179
+			if (self::DEBUG)
180
+			{
181
+				error_log(__METHOD__."('$attr', ".array2string($action).") attrs['$attr'] = ".array2string($action).', attrs='.array2string($attrs));
182
+			}
174 183
 		}
175 184
 		// action is a serverside callback
176 185
 		elseif(is_array($action) && isset($action['__callback__']))
@@ -218,7 +227,10 @@  discard block
 block discarded – undo
218 227
 					$attrs[$attr] = $actions;
219 228
 					$actions = array($attr => $actions);
220 229
 				}
221
-				if (self::DEBUG) error_log(__METHOD__."(attr='$attr', action=".array2string($action).") attrs['$attr']=='{$attrs[$attr]}' --> running actions");
230
+				if (self::DEBUG)
231
+				{
232
+					error_log(__METHOD__."(attr='$attr', action=".array2string($action).") attrs['$attr']=='{$attrs[$attr]}' --> running actions");
233
+				}
222 234
 				foreach($actions as $attr => $action)
223 235
 				{
224 236
 					$this->action($attr, $action, $attrs);
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/Contact.php 1 patch
Braces   +13 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,9 +148,15 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function get_contact($value, array $attrs)
150 150
 	{
151
-		if (is_array($value) && !(array_key_exists('app',$value) && array_key_exists('id', $value))) return $value;
151
+		if (is_array($value) && !(array_key_exists('app',$value) && array_key_exists('id', $value)))
152
+		{
153
+			return $value;
154
+		}
152 155
 
153
-		if(is_array($value) && array_key_exists('app', $value) && array_key_exists('id', $value)) $value = $value['id'];
156
+		if(is_array($value) && array_key_exists('app', $value) && array_key_exists('id', $value))
157
+		{
158
+			$value = $value['id'];
159
+		}
154 160
 		switch($attrs['type'])
155 161
 		{
156 162
 			case 'contact-account':
@@ -162,7 +168,11 @@  discard block
 block discarded – undo
162 168
 				// fall-through
163 169
 			case 'contact-value':
164 170
 			default:
165
-				if (substr($value,0,12) == 'addressbook:') $value = substr($value,12);	// link-entry syntax
171
+				if (substr($value,0,12) == 'addressbook:')
172
+				{
173
+					$value = substr($value,12);
174
+				}
175
+				// link-entry syntax
166 176
 				if (!($contact = $this->contacts->read($value)))
167 177
 				{
168 178
 					$contact = array();
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/Box.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,10 @@  discard block
 block discarded – undo
49 49
 		$old_cname = $params[0];
50 50
 		$old_expand = $params[1];
51 51
 
52
-		if ($this->id && $this->type != 'groupbox') $cname = self::form_name($cname, $this->id, $params[1]);
52
+		if ($this->id && $this->type != 'groupbox')
53
+		{
54
+			$cname = self::form_name($cname, $this->id, $params[1]);
55
+		}
53 56
 		if ($expand['cname'] !== $cname && $cname)
54 57
 		{
55 58
 			$expand['cont'] =& self::get_array(self::$request->content, $cname);
@@ -121,10 +124,13 @@  discard block
 block discarded – undo
121 124
 					// need to break if fname ends in [] as get_array() will ignore it and returns whole array
122 125
 					// for an id like "run[$row_cont[appname]]"
123 126
 					substr($fname, -2) != '[]' &&
124
-					($value = self::get_array(self::$request->content, $fname)) !== null)	// null = not found (can be false!)
127
+					($value = self::get_array(self::$request->content, $fname)) !== null)
128
+				{
129
+					// null = not found (can be false!)
125 130
 				{
126 131
 					//error_log(__METHOD__."($widget,$cname) $this autorepeating row $expand[row] because of $check_widget->id = '$fname' is ".array2string($value));
127 132
 					unset($value);
133
+				}
128 134
 					return true;
129 135
 				}
130 136
 			}
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/AjaxSelect.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,10 +29,13 @@
 block discarded – undo
29 29
 	public function beforeSendToClient($cname, array $expand=null)
30 30
 	{
31 31
 		$matches = null;
32
-		if ($cname == '$row')	// happens eg. with custom-fields: $cname='$row', this->id='#something'
32
+		if ($cname == '$row')
33
+		{
34
+			// happens eg. with custom-fields: $cname='$row', this->id='#something'
33 35
 		{
34 36
 			$form_name = $this->id;
35 37
 		}
38
+		}
36 39
 		// happens with fields in nm-header: $cname='nm', this->id='${row}[something]' or '{$row}[something]'
37 40
 		elseif (preg_match('/(\${row}|{\$row})\[([^]]+)\]$/', $this->id, $matches))
38 41
 		{
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/Button.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,10 +58,12 @@
 block discarded – undo
58 58
 				is_array($value) && count($value) == 1 ||
59 59
 				// check === true, as get_array() ignores a "[]" postfix and returns array() eg. for a not existing $row_cont[id] in "delete[$row_cont[id]]"
60 60
 				$value == true
61
-			)
62
-			{
61
+			) {
63 62
 				$valid =& self::get_array($validated, $form_name, true);
64
-				if (true) $valid = is_array($value) ? $value : 'pressed';
63
+				if (true)
64
+				{
65
+					$valid = is_array($value) ? $value : 'pressed';
66
+				}
65 67
 
66 68
 				// recorded pressed button globally, was in the template object before, put now as static on this object
67 69
 				if ($this->type == 'cancel' || $form_name == 'cancel' || substr($form_name,-10) == '[cancel]')
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/Grid.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,10 @@  discard block
 block discarded – undo
88 88
 			return false;	// return
89 89
 		}
90 90
 
91
-		if ($this->id) $cname = self::form_name($cname, $this->id, $expand);
91
+		if ($this->id)
92
+		{
93
+			$cname = self::form_name($cname, $this->id, $expand);
94
+		}
92 95
 		if ($expand['cname'] !== $cname && $cname)
93 96
 		{
94 97
 			$expand['cont'] =& self::get_array(self::$request->content, $cname);
@@ -202,10 +205,13 @@  discard block
 block discarded – undo
202 205
 						// need to break if fname ends in [] as get_array() will ignore it and returns whole array
203 206
 						// for an id like "run[$row_cont[appname]]"
204 207
 						substr($fname, -2) != '[]' &&
205
-						($value = self::get_array(self::$request->content,$fname)) !== null)	// null = not found (can be false!)
208
+						($value = self::get_array(self::$request->content,$fname)) !== null)
209
+					{
210
+						// null = not found (can be false!)
206 211
 					{
207 212
 						//error_log(__METHOD__."('$cname', ) $this autorepeating row $expand[row] because of $child->id = '$fname' is ".array2string($value));
208 213
 						unset($value);
214
+					}
209 215
 						return true;
210 216
 					}
211 217
 				}
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/HtmlArea.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,10 @@  discard block
 block discarded – undo
46 46
 		$font_span = '<span style="width: 100%; display: inline; '.
47 47
 			($font?'font-family:'.$font.'; ':'').($font_size?'font-size:'.$font_size.'; ':'').
48 48
 			'">&#8203;</span>';
49
-		if (empty($font) && empty($font_size)) $font_span = '';
49
+		if (empty($font) && empty($font_size))
50
+		{
51
+			$font_span = '';
52
+		}
50 53
 		if($font_span)
51 54
 		{
52 55
 			$config['preference_style'] = $font_span;
@@ -78,7 +81,10 @@  discard block
 block discarded – undo
78 81
 				$value = Api\Html\HtmLawed::purify($value, $this->attrs['validation_rules']);
79 82
 			}
80 83
 			$valid =& self::get_array($validated, $form_name, true);
81
-			if (true) $valid = $value;
84
+			if (true)
85
+			{
86
+				$valid = $value;
87
+			}
82 88
 		}
83 89
 	}
84 90
 }
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/ItemPicker.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct($xml = '')
33 33
 	{
34
-		if($xml) {
34
+		if($xml)
35
+		{
35 36
 			parent::__construct($xml);
36 37
 		}
37 38
 	}
Please login to merge, or discard this patch.
api/src/Etemplate/Widget/HistoryLog.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,10 @@  discard block
 block discarded – undo
60 60
 				{
61 61
 					// need to use self::form_name($form_name, $key) as index into sel_options see comment in header
62 62
 					$options =& self::get_array(self::$request->sel_options, self::form_name($form_name, $key), true);
63
-					if (!is_array($options)) $options = array();
63
+					if (!is_array($options))
64
+					{
65
+						$options = array();
66
+					}
64 67
 					$options += $type;
65 68
 				}
66 69
 
@@ -87,7 +90,10 @@  discard block
 block discarded – undo
87 90
 		$form_name = self::form_name($cname, $this->id, $expand);
88 91
 		$value = self::get_array($content, $form_name);
89 92
 		$valid =& self::get_array($validated, $form_name, true);
90
-		if (true) $valid = $value;
93
+		if (true)
94
+		{
95
+			$valid = $value;
96
+		}
91 97
 		return true;
92 98
 	}
93 99
 }
Please login to merge, or discard this patch.