Completed
Push — 16.1 ( 2b6741...abc73d )
by Nathan
50:22 queued 36:36
created
api/src/Framework/Ajax.php 1 patch
Braces   +56 added lines, -14 removed lines patch added patch discarded remove patch
@@ -104,7 +104,9 @@  discard block
 block discarded – undo
104 104
 
105 105
 		//Width may not be smaller than MIN_SIDEBAR_WIDTH
106 106
 		if ($width < self::MIN_SIDEBAR_WIDTH)
107
-			$width = self::MIN_SIDEBAR_WIDTH;
107
+		{
108
+					$width = self::MIN_SIDEBAR_WIDTH;
109
+		}
108 110
 
109 111
 		return $width;
110 112
 	}
@@ -156,7 +158,10 @@  discard block
 block discarded – undo
156 158
 	 */
157 159
 	static function link($url = '', $extravars = '', $link_app=null)
158 160
 	{
159
-		if (is_null($link_app)) $link_app = self::$link_app;
161
+		if (is_null($link_app))
162
+		{
163
+			$link_app = self::$link_app;
164
+		}
160 165
 		$link = parent::link($url, $extravars);
161 166
 
162 167
 		// $link_app === true --> detect application, otherwise use given application
@@ -185,7 +190,10 @@  discard block
 block discarded – undo
185 190
 		$srcs = array();
186 191
 		foreach(Api\Hooks::process('csp-frame-src') as $src)
187 192
 		{
188
-			if ($src) $srcs = array_merge($srcs, $src);
193
+			if ($src)
194
+			{
195
+				$srcs = array_merge($srcs, $src);
196
+			}
189 197
 		}
190 198
 		return $srcs;
191 199
 	}
@@ -199,7 +207,10 @@  discard block
 block discarded – undo
199 207
 	function header(array $extra=array())
200 208
 	{
201 209
 		// make sure header is output only once
202
-		if (self::$header_done) return '';
210
+		if (self::$header_done)
211
+		{
212
+			return '';
213
+		}
203 214
 		self::$header_done = true;
204 215
 
205 216
 		$this->send_headers();
@@ -266,7 +277,10 @@  discard block
 block discarded – undo
266 277
 			// for remote manual never check/create framework
267 278
 			if (!in_array($GLOBALS['egw_info']['flags']['currentapp'], array('manual', 'login', 'logout', 'sitemgr')))
268 279
 			{
269
-				if (empty($GLOBALS['egw_info']['flags']['java_script'])) $GLOBALS['egw_info']['flags']['java_script']='';
280
+				if (empty($GLOBALS['egw_info']['flags']['java_script']))
281
+				{
282
+					$GLOBALS['egw_info']['flags']['java_script']='';
283
+				}
270 284
 				$extra['check-framework'] = $_GET['cd'] !== 'no';
271 285
 			}
272 286
 		}
@@ -539,7 +553,10 @@  discard block
 block discarded – undo
539 553
 	 */
540 554
 	public function sidebox($appname,$menu_title,$file,$type=null)
541 555
 	{
542
-		if (!isset($file['menuOpened'])) $file['menuOpened'] = (boolean)$this->sidebox_menu_opened;
556
+		if (!isset($file['menuOpened']))
557
+		{
558
+			$file['menuOpened'] = (boolean)$this->sidebox_menu_opened;
559
+		}
543 560
 		//error_log(__METHOD__."('$appname', '$menu_title', file[menuOpened]=$file[menuOpened], ...) this->sidebox_menu_opened=$this->sidebox_menu_opened");
544 561
 		$this->sidebox_menu_opened = false;
545 562
 
@@ -666,7 +683,10 @@  discard block
 block discarded – undo
666 683
 		foreach($tablist as $data)
667 684
 		{
668 685
 			$tabs[] = $data['appName'];
669
-			if ($data['active']) $active = $data['appName'];
686
+			if ($data['active'])
687
+			{
688
+				$active = $data['appName'];
689
+			}
670 690
 		}
671 691
 		// send app a notification, that it's tab got closed
672 692
 		// used eg. in phpFreeChat to leave the chat
@@ -790,10 +810,22 @@  discard block
 block discarded – undo
790 810
 		}
791 811
 
792 812
 		unset($apps['logout']);	// never display it
793
-		if (isset($apps['about'])) $apps['about']['noNavbar'] = true;
794
-		if (isset($apps['preferences'])) $apps['preferences']['noNavbar'] = true;
795
-		if (isset($apps['manual'])) $apps['manual']['noNavbar'] = true;
796
-		if (isset($apps['home'])) $apps['home']['noNavbar'] = true;
813
+		if (isset($apps['about']))
814
+		{
815
+			$apps['about']['noNavbar'] = true;
816
+		}
817
+		if (isset($apps['preferences']))
818
+		{
819
+			$apps['preferences']['noNavbar'] = true;
820
+		}
821
+		if (isset($apps['manual']))
822
+		{
823
+			$apps['manual']['noNavbar'] = true;
824
+		}
825
+		if (isset($apps['home']))
826
+		{
827
+			$apps['home']['noNavbar'] = true;
828
+		}
797 829
 
798 830
 		// no need for website icon, if we have sitemgr
799 831
 		if (isset($apps['sitemgr']) && isset($apps['sitemgr-link']))
@@ -862,7 +894,10 @@  discard block
 block discarded – undo
862 894
 		else
863 895
 		{
864 896
 			$active_tab = $GLOBALS['egw_info']['user']['preferences']['common']['active_tab'];
865
-			if (!$active_tab) $active_tab = $default_app;
897
+			if (!$active_tab)
898
+			{
899
+				$active_tab = $default_app;
900
+			}
866 901
 		}
867 902
 		// if we have the open tabs in the session, use it instead the maybe forced common prefs open_tabs
868 903
 		if (!($open_tabs = Api\Cache::getSession(__CLASS__, 'open_tabs')))
@@ -887,9 +922,12 @@  discard block
 block discarded – undo
887 922
 		// Restore Tabs
888 923
 		foreach($open_tabs as $n => $app)
889 924
 		{
890
-			if (isset($apps[$app]))		// user might no longer have app rights
925
+			if (isset($apps[$app]))
926
+			{
927
+				// user might no longer have app rights
891 928
 			{
892 929
 				$apps[$app]['opened'] = $n;
930
+			}
893 931
 				if ($app == $active_tab)
894 932
 				{
895 933
 					$apps[$app]['active'] = true;
@@ -915,7 +953,11 @@  discard block
 block discarded – undo
915 953
 	function footer($no_framework=true)
916 954
 	{
917 955
 		//error_log(__METHOD__."($no_framework) footer_done=".array2string(self::$footer_done).' '.function_backtrace());
918
-		if (self::$footer_done) return;	// prevent (multiple) footers
956
+		if (self::$footer_done)
957
+		{
958
+			return;
959
+		}
960
+		// prevent (multiple) footers
919 961
 		self::$footer_done = true;
920 962
 
921 963
 		if (!isset($GLOBALS['egw_info']['flags']['nofooter']) || !$GLOBALS['egw_info']['flags']['nofooter'])
Please login to merge, or discard this patch.
api/src/Framework/Minimal.php 1 patch
Braces   +9 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,10 @@  discard block
 block discarded – undo
47 47
 	function header(array $extra=array())
48 48
 	{
49 49
 		// make sure header is output only once
50
-		if (self::$header_done) return '';
50
+		if (self::$header_done)
51
+		{
52
+			return '';
53
+		}
51 54
 		self::$header_done = true;
52 55
 
53 56
 		// js stuff is not needed by login page or in popups
@@ -135,7 +138,11 @@  discard block
 block discarded – undo
135 138
 	function footer()
136 139
 	{
137 140
 		static $footer_done=0;
138
-		if ($footer_done++) return;	// prevent multiple footers, not sure we still need this (RalfBecker)
141
+		if ($footer_done++)
142
+		{
143
+			return;
144
+		}
145
+		// prevent multiple footers, not sure we still need this (RalfBecker)
139 146
 
140 147
 		return "</body>\n</html>\n";	// close body and html tag, eg. for popups
141 148
 	}
Please login to merge, or discard this patch.
api/src/Framework/Updates.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
 			if (($remote = file_get_contents(self::CURRENT_VERSION_URL, false, Api\Framework::proxy_context())))
50 50
 			{
51 51
 				list($current, $security) = explode("\n", $remote);
52
-				if (empty($security)) $security = $current;
52
+				if (empty($security))
53
+				{
54
+					$security = $current;
55
+				}
53 56
 				$versions = array(
54 57
 					'current'  => $current,		// last maintenance update
55 58
 					'security' => $security,	// last security update
@@ -114,7 +117,10 @@  discard block
 block discarded – undo
114 117
 	protected static function update_older($version, $days)
115 118
 	{
116 119
 		list(,,$date) = explode('.', $version);
117
-		if ($date < 20140000) return false;
120
+		if ($date < 20140000)
121
+		{
122
+			return false;
123
+		}
118 124
 		$version_timestamp = mktime(0, 0, 0, (int)substr($date, 4, 2), (int)substr($date, -2), (int)substr($date, 0, 4));
119 125
 
120 126
 		return (time() - $version_timestamp) / 86400 > $days;
Please login to merge, or discard this patch.
api/src/autoload.php 1 patch
Braces   +9 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,11 @@  discard block
 block discarded – undo
37 37
 spl_autoload_register(function($class)
38 38
 {
39 39
 	$parts = explode('\\', $class);
40
-	if (array_shift($parts) != 'EGroupware') return;	// not our prefix
40
+	if (array_shift($parts) != 'EGroupware')
41
+	{
42
+		return;
43
+	}
44
+	// not our prefix
41 45
 
42 46
 	$app = lcfirst(array_shift($parts));
43 47
 	$base = EGW_INCLUDE_ROOT.'/'.$app.'/src/';
@@ -63,7 +67,10 @@  discard block
 block discarded – undo
63 67
 spl_autoload_register(function($class)
64 68
 {
65 69
 	// fixing warnings generated by php 5.3.8 is_a($obj) trying to autoload huge strings
66
-	if (strlen($class) > 64 || strpos($class, '.') !== false) return;
70
+	if (strlen($class) > 64 || strpos($class, '.') !== false)
71
+	{
72
+		return;
73
+	}
67 74
 
68 75
 	$components = explode('_',$class);
69 76
 	$app = array_shift($components);
Please login to merge, or discard this patch.
api/src/Ldap/ServerInfo.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -218,7 +218,8 @@
 block discarded – undo
218 218
 					{
219 219
 						if(($info = ldap_get_entries($ds, $sr)))
220 220
 						{
221
-							if($info[0]['objectclasses']) {
221
+							if($info[0]['objectclasses'])
222
+							{
222 223
 								for($i=0; $i<$info[0]['objectclasses']['count']; $i++)
223 224
 								{
224 225
 									$matches = null;
Please login to merge, or discard this patch.
api/src/Preferences.php 1 patch
Braces   +81 added lines, -20 removed lines patch added patch discarded remove patch
@@ -196,7 +196,10 @@  discard block
 block discarded – undo
196 196
 		foreach((array)$ids as $id)
197 197
 		{
198 198
 			// if prefs are not returned, null or not an array, read them from db
199
-			if (!isset($prefs[$id]) && !is_array($prefs[$id])) $db_read[] = $id;
199
+			if (!isset($prefs[$id]) && !is_array($prefs[$id]))
200
+			{
201
+				$db_read[] = $id;
202
+			}
200 203
 		}
201 204
 		if ($db_read)
202 205
 		{
@@ -209,7 +212,10 @@  discard block
 block discarded – undo
209 212
 			}
210 213
 			foreach($db_read as $id)
211 214
 			{
212
-				if (!isset($prefs[$id])) $prefs[$id] = array();
215
+				if (!isset($prefs[$id]))
216
+				{
217
+					$prefs[$id] = array();
218
+				}
213 219
 				Cache::setInstance(__CLASS__, $id, $prefs[$id]);
214 220
 			}
215 221
 		}
@@ -237,7 +243,10 @@  discard block
 block discarded – undo
237 243
 		$replace = $with = array();
238 244
 		foreach($vals as $key => $val)
239 245
 		{
240
-			if ($this->debug) error_log(__METHOD__." replacing \$\$$key\$\$ with $val  ");
246
+			if ($this->debug)
247
+			{
248
+				error_log(__METHOD__." replacing \$\$$key\$\$ with $val  ");
249
+			}
241 250
 			$replace[] = '$$'.$key.'$$';
242 251
 			$with[]    = $val;
243 252
 		}
@@ -275,7 +284,10 @@  discard block
 block discarded – undo
275 284
 	 */
276 285
 	function standard_substitutes()
277 286
 	{
278
-		if ($this->debug) error_log(__METHOD__." is called ");
287
+		if ($this->debug)
288
+		{
289
+			error_log(__METHOD__." is called ");
290
+		}
279 291
 		if (!is_array(@$GLOBALS['egw_info']['user']['preferences']))
280 292
 		{
281 293
 			$GLOBALS['egw_info']['user']['preferences'] = $this->data;	// else no lang()
@@ -301,12 +313,18 @@  discard block
 block discarded – undo
301 313
 			'email'     => lang('email-address of the user, eg. "%1"',$this->values['email']),
302 314
 			'date'      => lang('todays date, eg. "%1"',$this->values['date']),
303 315
 		);
304
-		if ($this->debug) error_log(__METHOD__.print_r($this->vars,true));
316
+		if ($this->debug)
317
+		{
318
+			error_log(__METHOD__.print_r($this->vars,true));
319
+		}
305 320
 		// do the substituetion in the effective prefs (data)
306 321
 		//
307 322
 		foreach($this->data as $app => $data)
308 323
 		{
309
-			if(!is_array($data)) continue;
324
+			if(!is_array($data))
325
+			{
326
+				continue;
327
+			}
310 328
 			foreach($data as $key => $val)
311 329
 			{
312 330
 				if (!is_array($val) && strpos($val,'$$') !== False)
@@ -401,7 +419,11 @@  discard block
 block discarded – undo
401 419
 			$primary_group = Accounts::id2name($this->account_id, 'account_primary_group');
402 420
 			foreach((array)$GLOBALS['egw']->accounts->memberships($this->account_id, true) as $gid)
403 421
 			{
404
-				if ($gid != $primary_group) $to_read[] = $gid + self::DEFAULT_ID;	// need to offset it with DEFAULT_ID = -2!
422
+				if ($gid != $primary_group)
423
+				{
424
+					$to_read[] = $gid + self::DEFAULT_ID;
425
+				}
426
+				// need to offset it with DEFAULT_ID = -2!
405 427
 			}
406 428
 			$to_read[] = $primary_group + self::DEFAULT_ID;
407 429
 		}
@@ -508,9 +530,15 @@  discard block
 block discarded – undo
508 530
 		// Etemplate::complete_array_merge() is identical to PHP >= 5.3 array_replace_recursive()
509 531
 		$default = Etemplate::complete_array_merge($this->default, $this->forced);
510 532
 
511
-		if ($app) $default = $default[$app];
533
+		if ($app)
534
+		{
535
+			$default = $default[$app];
536
+		}
512 537
 
513
-		if ($name && is_array($default)) $default = $default[$name];
538
+		if ($name && is_array($default))
539
+		{
540
+			$default = $default[$name];
541
+		}
514 542
 
515 543
 		return $default;
516 544
 	}
@@ -588,9 +616,13 @@  discard block
 block discarded – undo
588 616
 				{
589 617
 					$this->session[$app_name][$var] = $this->data[$app_name][$var] = $value;
590 618
 					Cache::setSession('preferences','preferences',$this->session);
591
-					if (method_exists($GLOBALS['egw'],'invalidate_session_cache'))	// egw object in setup is limited
619
+					if (method_exists($GLOBALS['egw'],'invalidate_session_cache'))
620
+					{
621
+						// egw object in setup is limited
592 622
 					{
593
-						$GLOBALS['egw']->invalidate_session_cache();	// in case with cache the egw_info array in the session
623
+						$GLOBALS['egw']->invalidate_session_cache();
624
+					}
625
+					// in case with cache the egw_info array in the session
594 626
 					}
595 627
 				}
596 628
 				break;
@@ -646,9 +678,12 @@  discard block
 block discarded – undo
646 678
 		}
647 679
 		$pref = &$this->$type;
648 680
 
649
-		if (($all = empty($var))) // to check if $var is regarded as empty (false, 0, '', null, array() should do the trick
681
+		if (($all = empty($var)))
682
+		{
683
+			// to check if $var is regarded as empty (false, 0, '', null, array() should do the trick
650 684
 		{
651 685
 			unset($pref[$app_name]);
686
+		}
652 687
 			unset($this->data[$app_name]);
653 688
 		}
654 689
 		else
@@ -727,7 +762,10 @@  discard block
 block discarded – undo
727 762
 		$db = isset($GLOBALS['egw_setup']->db) ? $GLOBALS['egw_setup']->db : $GLOBALS['egw']->db;
728 763
 
729 764
 		$where = array();
730
-		if ($app) $where['preference_app'] = $app;
765
+		if ($app)
766
+		{
767
+			$where['preference_app'] = $app;
768
+		}
731 769
 
732 770
 		switch($type)
733 771
 		{
@@ -747,7 +785,11 @@  discard block
 block discarded – undo
747 785
 		foreach($db->select(self::TABLE, '*', $where, __LINE__, __FILE__) as $row)
748 786
 		{
749 787
 			$prefs = self::unserialize($row['preference_value']);
750
-			if (!is_array($prefs)) $prefs = array();	// would stall update otherwise
788
+			if (!is_array($prefs))
789
+			{
790
+				$prefs = array();
791
+			}
792
+			// would stall update otherwise
751 793
 
752 794
 			if ($name[0] == '/' && substr($name, -1) == '/')
753 795
 			{
@@ -764,10 +806,16 @@  discard block
 block discarded – undo
764 806
 			$updated = false;
765 807
 			foreach($attrs as $attr)
766 808
 			{
767
-				if (isset($old_value) && $prefs[$attr] != $old_value) continue;
809
+				if (isset($old_value) && $prefs[$attr] != $old_value)
810
+				{
811
+					continue;
812
+				}
768 813
 
769 814
 				$val = is_callable($value) ? call_user_func($value, $attr, $prefs[$attr], $row['preference_owner']) : $value;
770
-				if ($val === $prefs[$attr]) continue;
815
+				if ($val === $prefs[$attr])
816
+				{
817
+					continue;
818
+				}
771 819
 
772 820
 				$updated = true;
773 821
 				if ((string)$val !== '')
@@ -832,7 +880,11 @@  discard block
 block discarded – undo
832 880
 			{
833 881
 				$prefs = array_intersect_key($prefs, array_flip($names));
834 882
 			}
835
-			if (!$prefs) continue;	// nothing to change, as nothing set
883
+			if (!$prefs)
884
+			{
885
+				continue;
886
+			}
887
+			// nothing to change, as nothing set
836 888
 
837 889
 			$row['preference_app'] = $to_app;
838 890
 			unset($row['preference_value']);
@@ -898,9 +950,15 @@  discard block
 block discarded – undo
898 950
 			foreach($prefs as $app => $value)
899 951
 			{
900 952
 				// check if app preferences have changed, if not no need to save them
901
-				if ($old_prefs && $old_prefs[$app] == $value) continue;
953
+				if ($old_prefs && $old_prefs[$app] == $value)
954
+				{
955
+					continue;
956
+				}
902 957
 
903
-				if (!$changed++) $this->db->transaction_begin();
958
+				if (!$changed++)
959
+				{
960
+					$this->db->transaction_begin();
961
+				}
904 962
 
905 963
 				if (!is_array($value) || !$value)
906 964
 				{
@@ -986,7 +1044,10 @@  discard block
 block discarded – undo
986 1044
 			list($lang,$lang2) = explode('-',$lang);
987 1045
 			$country_from_lang = strtoupper($lang2);
988 1046
 		}
989
-		if (is_null($charset)) $charset = Translation::charset();
1047
+		if (is_null($charset))
1048
+		{
1049
+			$charset = Translation::charset();
1050
+		}
990 1051
 
991 1052
 		foreach(array(
992 1053
 			$lang.'_'.$country,
Please login to merge, or discard this patch.
api/src/Json/Exception/InvalidName.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,4 +20,6 @@
 block discarded – undo
20 20
  *
21 21
  * As you get this only by an error in the code or during development, the message does not need to be translated
22 22
  */
23
-class InvalidName extends Exception\NoPermission { }
23
+class InvalidName extends Exception\NoPermission
24
+{
25
+}
Please login to merge, or discard this patch.
api/src/Json/Request.php 1 patch
Braces   +16 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,10 @@  discard block
 block discarded – undo
42 42
 	public static function isJSONRequest($set=null)
43 43
 	{
44 44
 		$ret = self::$_hadJSONRequest;
45
-		if (isset($set)) self::$_hadJSONRequest = $set;
45
+		if (isset($set))
46
+		{
47
+			self::$_hadJSONRequest = $set;
48
+		}
46 49
 		return $ret;
47 50
 	}
48 51
 
@@ -60,7 +63,10 @@  discard block
 block discarded – undo
60 63
 		// Remember that we currently are in a JSON request - e.g. used in the redirect code
61 64
 		self::$_hadJSONRequest = true;
62 65
 
63
-		if (get_magic_quotes_gpc()) $input_data = stripslashes($input_data);
66
+		if (get_magic_quotes_gpc())
67
+		{
68
+			$input_data = stripslashes($input_data);
69
+		}
64 70
 
65 71
 		$json_data = json_decode($input_data,true);
66 72
 		if (is_array($json_data) && isset($json_data['request']) && isset($json_data['request']['parameters']) && is_array($json_data['request']['parameters']))
@@ -100,9 +106,12 @@  discard block
 block discarded – undo
100 106
 	 */
101 107
 	public function handleRequest($menuaction, array $parameters)
102 108
 	{
103
-		if (strpos($menuaction,'::') !== false && strpos($menuaction,'.') === false)	// static method name app_something::method
109
+		if (strpos($menuaction,'::') !== false && strpos($menuaction,'.') === false)
110
+		{
111
+			// static method name app_something::method
104 112
 		{
105 113
 			@list($className,$functionName,$handler) = explode('::',$menuaction);
114
+		}
106 115
 			if (substr($className, 0, 11) == 'EGroupware\\')
107 116
 			{
108 117
 				list(,$appName) = explode('\\', strtolower($className));
@@ -179,6 +188,9 @@  discard block
 block discarded – undo
179 188
 			Api\Translation::convert($parameters, 'utf-8'));
180 189
 
181 190
 		// check if we have push notifications, if notifications app available
182
-		if (class_exists('notifications_push')) notifications_push::get();
191
+		if (class_exists('notifications_push'))
192
+		{
193
+			notifications_push::get();
194
+		}
183 195
 	}
184 196
 }
Please login to merge, or discard this patch.
api/src/Json/Response.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -268,7 +268,10 @@
 block discarded – undo
268 268
 	 */
269 269
 	public static function fix_content($var, $prefix='')
270 270
 	{
271
-		if (json_encode($var) !== false) return $var;
271
+		if (json_encode($var) !== false)
272
+		{
273
+			return $var;
274
+		}
272 275
 
273 276
 		if (is_scalar($var))
274 277
 		{
Please login to merge, or discard this patch.