Completed
Push — 16.1 ( b5bda6...d590ad )
by Nathan
30:38 queued 15:41
created
admin/inc/class.admin_ui.inc.php 1 patch
Braces   +81 added lines, -20 removed lines patch added patch discarded remove patch
@@ -48,7 +48,10 @@  discard block
 block discarded – undo
48 48
 		}
49 49
 		$tpl = new Etemplate('admin.index');
50 50
 
51
-		if (!is_array($content)) $content = array();
51
+		if (!is_array($content))
52
+		{
53
+			$content = array();
54
+		}
52 55
 		$content['nm'] = array(
53 56
 			'get_rows' => 'admin_ui::get_users',
54 57
 			'no_cat' => true,
@@ -176,7 +179,10 @@  discard block
 block discarded – undo
176 179
 			{
177 180
 				$GLOBALS['menuData'] = $data = array();
178 181
 				$data = Api\Hooks::single('edit_user', $app);
179
-				if (!is_array($data)) $data = $GLOBALS['menuData'];
182
+				if (!is_array($data))
183
+				{
184
+					$data = $GLOBALS['menuData'];
185
+				}
180 186
 				foreach($data as $item)
181 187
 				{
182 188
 					// allow hook to return "real" actions, but still support legacy: description, url, extradata, options
@@ -194,15 +200,30 @@  discard block
 block discarded – undo
194 200
 						if ($item['options'] && preg_match('/(egw_openWindowCentered2?|window.open)\([^)]+,(\d+),(\d+).*(title="([^"]+)")?/', $item['options'], $matches))
195 201
 						{
196 202
 							$item['popup'] = $matches[2].'x'.$matches[3];
197
-							if (isset($matches[5])) $item['tooltip'] = $matches[5];
203
+							if (isset($matches[5]))
204
+							{
205
+								$item['tooltip'] = $matches[5];
206
+							}
198 207
 							unset($item['options']);
199 208
 						}
200 209
 					}
201
-					if (empty($item['icon'])) $item['icon'] = $app.'/navbar';
202
-					if (empty($item['group'])) $item['group'] = $group;
203
-					if (empty($item['onExecute'])) $item['onExecute'] = $item['popup'] ?
210
+					if (empty($item['icon']))
211
+					{
212
+						$item['icon'] = $app.'/navbar';
213
+					}
214
+					if (empty($item['group']))
215
+					{
216
+						$item['group'] = $group;
217
+					}
218
+					if (empty($item['onExecute']))
219
+					{
220
+						$item['onExecute'] = $item['popup'] ?
204 221
 						'javaScript:nm_action' : 'javaScript:app.admin.iframe_location';
205
-					if (!isset($item['allowOnMultiple'])) $item['allowOnMultiple'] = false;
222
+					}
223
+					if (!isset($item['allowOnMultiple']))
224
+					{
225
+						$item['allowOnMultiple'] = false;
226
+					}
206 227
 
207 228
 					$actions[$item['id']] = $item;
208 229
 				}
@@ -248,7 +269,9 @@  discard block
 block discarded – undo
248 269
 				'allowOnMultiple' => false
249 270
 			),
250 271
 		);
251
-		if (!$GLOBALS['egw']->acl->check('account_access',64,'admin'))	// no rights to set ACL-rights
272
+		if (!$GLOBALS['egw']->acl->check('account_access',64,'admin'))
273
+		{
274
+			// no rights to set ACL-rights
252 275
 		{
253 276
 			$actions['deny'] = array(
254 277
 				'caption'   => 'Deny access',
@@ -259,6 +282,7 @@  discard block
 block discarded – undo
259 282
 				'allowOnMultiple' => false
260 283
 			);
261 284
 		}
285
+		}
262 286
 
263 287
 		$group = 5;	// allow to place actions in different groups by hook, this is the default
264 288
 
@@ -268,7 +292,10 @@  discard block
 block discarded – undo
268 292
 		{
269 293
 			$GLOBALS['menuData'] = $data = array();
270 294
 			$data = Api\Hooks::single('edit_group', $app);
271
-			if (!is_array($data)) $data = $GLOBALS['menuData'];
295
+			if (!is_array($data))
296
+			{
297
+				$data = $GLOBALS['menuData'];
298
+			}
272 299
 
273 300
 			foreach($data as $item)
274 301
 			{
@@ -288,14 +315,29 @@  discard block
 block discarded – undo
288 315
 					{
289 316
 						$item['popup'] = $matches[2].'x'.$matches[3];
290 317
 						$item['onExecute'] = 'javaScript:nm_action';
291
-						if (isset($matches[5])) $item['tooltip'] = $matches[5];
318
+						if (isset($matches[5]))
319
+						{
320
+							$item['tooltip'] = $matches[5];
321
+						}
292 322
 						unset($item['options']);
293 323
 					}
294 324
 				}
295
-				if (empty($item['icon'])) $item['icon'] = $app.'/navbar';
296
-				if (empty($item['group'])) $item['group'] = $group;
297
-				if (empty($item['onExecute'])) $item['onExecute'] = 'javaScript:app.admin.group';
298
-				if (!isset($item['allowOnMultiple'])) $item['allowOnMultiple'] = false;
325
+				if (empty($item['icon']))
326
+				{
327
+					$item['icon'] = $app.'/navbar';
328
+				}
329
+				if (empty($item['group']))
330
+				{
331
+					$item['group'] = $group;
332
+				}
333
+				if (empty($item['onExecute']))
334
+				{
335
+					$item['onExecute'] = 'javaScript:app.admin.group';
336
+				}
337
+				if (!isset($item['allowOnMultiple']))
338
+				{
339
+					$item['allowOnMultiple'] = false;
340
+				}
299 341
 
300 342
 				$actions[$item['id']] = $item;
301 343
 			}
@@ -342,7 +384,10 @@  discard block
 block discarded – undo
342 384
 						($row['account_expires'] != -1 ? lang('Expires').' '.Api\DateTime::to($row['account_expires'], true) :
343 385
 							lang('Enabled')));
344 386
 
345
-			if (!self::$accounts->is_active($row)) $row['status_class'] = 'adminAccountInactive';
387
+			if (!self::$accounts->is_active($row))
388
+			{
389
+				$row['status_class'] = 'adminAccountInactive';
390
+			}
346 391
 		}
347 392
 
348 393
 		return self::$accounts->total;
@@ -439,7 +484,10 @@  discard block
 block discarded – undo
439 484
 							'link' => $data,
440 485
 						);
441 486
 					}
442
-					if (empty($data['text'])) $data['text'] = $text;
487
+					if (empty($data['text']))
488
+					{
489
+						$data['text'] = $text;
490
+					}
443 491
 					if (empty($data['id']))
444 492
 					{
445 493
 						$data['id'] = $root.($app == 'admin' ? 'admin' : 'apps/'.$app).'/';
@@ -464,7 +512,11 @@  discard block
 block discarded – undo
464 512
 					unset($data['icon']);
465 513
 					$parent =& $tree['item'];
466 514
 					$parts = explode('/', $data['id']);
467
-					if ($data['id'][0] == '/') array_shift($parts);	// remove root
515
+					if ($data['id'][0] == '/')
516
+					{
517
+						array_shift($parts);
518
+					}
519
+					// remove root
468 520
 					array_pop($parts);
469 521
 					$path = '';
470 522
 					foreach($parts as $part)
@@ -483,14 +535,23 @@  discard block
 block discarded – undo
483 535
 								'item' => array(),
484 536
 								'child' => 1,
485 537
 							);
486
-							if ($path == '/admin') $parent[$path]['open'] = true;
538
+							if ($path == '/admin')
539
+							{
540
+								$parent[$path]['open'] = true;
541
+							}
487 542
 						}
488 543
 						$parent =& $parent[$path]['item'];
489 544
 					}
490 545
 					$data['text'] = lang($data['text']);
491
-					if (!empty($data['tooltip'])) $data['tooltip'] = lang($data['tooltip']);
546
+					if (!empty($data['tooltip']))
547
+					{
548
+						$data['tooltip'] = lang($data['tooltip']);
549
+					}
492 550
 					// make sure keys are unique, as we overwrite tree entries otherwise
493
-					if (isset($parent[$data['id']])) $data['id'] .= md5($data['link']);
551
+					if (isset($parent[$data['id']]))
552
+					{
553
+						$data['id'] .= md5($data['link']);
554
+					}
494 555
 					$parent[$data['id']] = self::fix_userdata($data);
495 556
 				}
496 557
 			}
Please login to merge, or discard this patch.