Completed
Push — 16.1 ( b39e15...d98aac )
by Klaus
18:52
created
api/src/Framework/Template.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -547,7 +547,10 @@
 block discarded – undo
547 547
 
548 548
 	function check_debug()
549 549
 	{
550
-		if (!$this->debug) return False;
550
+		if (!$this->debug)
551
+		{
552
+			return False;
553
+		}
551 554
 
552 555
 		foreach(func_get_args() as $arg)
553 556
 		{
Please login to merge, or discard this patch.
api/src/Framework/Favorites.php 1 patch
Braces   +5 added lines, -1 removed lines patch added patch discarded remove patch
@@ -161,7 +161,11 @@
 block discarded – undo
161 161
 		{
162 162
 			if(strpos($pref_name, $pref_prefix) === 0)
163 163
 			{
164
-				if(!is_array($pref)) continue;	// old favorite
164
+				if(!is_array($pref))
165
+				{
166
+					continue;
167
+				}
168
+				// old favorite
165 169
 
166 170
 				$favorites[(string)substr($pref_name,strlen($pref_prefix))] = $pref;
167 171
 			}
Please login to merge, or discard this patch.
api/src/Framework/CssIncludes.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,14 +107,20 @@
 block discarded – undo
107 107
 		$max_modified = 0;
108 108
 		//no more dynamic minifying: $debug_minify = $GLOBALS['egw_info']['server']['debug_minify'] === 'True';
109 109
 		$base_path = $GLOBALS['egw_info']['server']['webserver_url'];
110
-		if ($base_path[0] != '/') $base_path = parse_url($base_path, PHP_URL_PATH);
110
+		if ($base_path[0] != '/')
111
+		{
112
+			$base_path = parse_url($base_path, PHP_URL_PATH);
113
+		}
111 114
 		$css_files = '';
112 115
 		foreach(self::$files as $path)
113 116
 		{
114 117
 			foreach(self::resolve_css_includes($path) as $path)
115 118
 			{
116 119
 				list($file,$query) = explode('?',$path,2);
117
-				if (($mod = filemtime(EGW_SERVER_ROOT.$file)) > $max_modified) $max_modified = $mod;
120
+				if (($mod = filemtime(EGW_SERVER_ROOT.$file)) > $max_modified)
121
+				{
122
+					$max_modified = $mod;
123
+				}
118 124
 
119 125
 				// do NOT include app.css or categories.php, as it changes from app to app
120 126
 				//no more dynamic minifying: if ($debug_minify || substr($path, -8) == '/app.css' || substr($file,-14) == 'categories.php')
Please login to merge, or discard this patch.
api/src/Framework/Tutorial.php 1 patch
Braces   +16 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,10 @@  discard block
 block discarded – undo
65 65
 		foreach (array_keys($tutorials) as $app)
66 66
 		{
67 67
 			// show only apps user has access to them
68
-			if (in_array($app, array_keys($GLOBALS['egw_info']['user']['apps']))) $apps [$app] = $app;
68
+			if (in_array($app, array_keys($GLOBALS['egw_info']['user']['apps'])))
69
+			{
70
+				$apps [$app] = $app;
71
+			}
69 72
 		}
70 73
 		$sel_options = array(
71 74
 			'apps' => $apps,
@@ -122,7 +125,10 @@  discard block
 block discarded – undo
122 125
 		{
123 126
 			$json = file_get_contents('http://www.egroupware.de/videos/tutorials.json');
124 127
 			// Fallback tutorials.json
125
-			if (!$json) $json = file_get_contents('api/setup/tutorials.json');
128
+			if (!$json)
129
+			{
130
+				$json = file_get_contents('api/setup/tutorials.json');
131
+			}
126 132
 			// Cache the json object for two hours
127 133
 			Api\Cache::setCache(Api\Cache::TREE, __CLASS__, 'egw_tutorial_json', $json, 7200);
128 134
 		}
@@ -136,10 +142,16 @@  discard block
 block discarded – undo
136 142
 	 */
137 143
 	public static function tutorial_menu()
138 144
 	{
139
-		if (Api\Header\UserAgent::mobile()) return;
145
+		if (Api\Header\UserAgent::mobile())
146
+		{
147
+			return;
148
+		}
140 149
 		$tutorials = json_decode(self::getJsonData(),true);
141 150
 		$appname = $GLOBALS['egw_info']['flags']['currentapp'];
142
-		if (!is_array($tutorials[$appname])) return false;
151
+		if (!is_array($tutorials[$appname]))
152
+		{
153
+			return false;
154
+		}
143 155
 		if (!$GLOBALS['egw_info']['server']['egw_tutorial_disable']
144 156
 			|| $GLOBALS['egw_info']['server']['egw_tutorial_disable'] == 'intro')
145 157
 		{
Please login to merge, or discard this patch.
api/src/Framework/About.php 1 patch
Braces   +53 added lines, -21 removed lines patch added patch discarded remove patch
@@ -168,7 +168,11 @@  discard block
 block discarded – undo
168 168
 				}
169 169
 			}
170 170
 		}
171
-		if (!isset($setup_info[$app]) || !is_array($setup_info[$app])) return null;	// app got eg. removed in filesystem
171
+		if (!isset($setup_info[$app]) || !is_array($setup_info[$app]))
172
+		{
173
+			return null;
174
+		}
175
+		// app got eg. removed in filesystem
172 176
 
173 177
 		$app_info  = array_merge($GLOBALS['egw_info']['apps'][$app], $setup_info[$app]);
174 178
 
@@ -191,7 +195,10 @@  discard block
 block discarded – undo
191 195
 		{
192 196
 			$ret['author'] = $this->_getHtmlPersonalInfo($setup_info[$app], 'author');
193 197
 			$ret['maintainer'] = $this->_getHtmlPersonalInfo($setup_info[$app], 'maintainer');
194
-			if ($app_info['version'] != $setup_info[$app]['version']) $ret['version'] .= ' ('.$setup_info[$app]['version'].')';
198
+			if ($app_info['version'] != $setup_info[$app]['version'])
199
+			{
200
+				$ret['version'] .= ' ('.$setup_info[$app]['version'].')';
201
+			}
195 202
 			$ret['license'] = $setup_info[$app]['license'];
196 203
 			$ret['description'] = $setup_info[$app]['description'];
197 204
 			$ret['note'] = $setup_info[$app]['note'];
@@ -216,39 +223,54 @@  discard block
 block discarded – undo
216 223
 	{
217 224
 		$authors = array();
218 225
 			// get the author(s)
219
-			if ($setup_info[$f]) {
226
+			if ($setup_info[$f])
227
+			{
220 228
 				// author is set
221
-				if (!is_array($setup_info[$f])) {
229
+				if (!is_array($setup_info[$f]))
230
+				{
222 231
 					// author is no array
223 232
 					$authors[0]['name'] = $setup_info[$f];
224
-					if ($setup_info[$f.'_email']) {
233
+					if ($setup_info[$f.'_email'])
234
+					{
225 235
 						$authors[0]['email'] = $setup_info[$f.'_email'];
226 236
 					}
227
-					if ($setup_info[$f.'_url']) {
237
+					if ($setup_info[$f.'_url'])
238
+					{
228 239
 						$authors[0]['url'] = $setup_info[$f.'_url'];
229 240
 					}
230 241
 
231
-				} else {
242
+				}
243
+				else
244
+				{
232 245
 					// author is array
233
-					if ($setup_info[$f]['name']) {
246
+					if ($setup_info[$f]['name'])
247
+					{
234 248
 						// only one author
235 249
 						$authors[0]['name'] = $setup_info[$f]['name'];
236
-						if ($setup_info[$f]['email']) {
250
+						if ($setup_info[$f]['email'])
251
+						{
237 252
 							$authors[0]['email'] = $setup_info[$f]['email'];
238 253
 						}
239
-						if ($setup_info[$f]['url']) {
254
+						if ($setup_info[$f]['url'])
255
+						{
240 256
 							$authors[0]['url'] = $setup_info[$f]['url'];
241 257
 						}
242
-					} else {
258
+					}
259
+					else
260
+					{
243 261
 						// may be more authors
244
-						foreach (array_keys($setup_info[$f]) as $number) {
245
-							if ($setup_info[$f][$number]['name']) {
262
+						foreach (array_keys($setup_info[$f]) as $number)
263
+						{
264
+							if ($setup_info[$f][$number]['name'])
265
+							{
246 266
 									$authors[$number]['name'] = $setup_info[$f][$number]['name'];
247 267
 							}
248
-							if ($setup_info[$f][$number]['email']) {
268
+							if ($setup_info[$f][$number]['email'])
269
+							{
249 270
 									$authors[$number]['email'] = $setup_info[$f][$number]['email'];
250 271
 							}
251
-							if ($setup_info[$f][$number]['url']) {
272
+							if ($setup_info[$f][$number]['url'])
273
+							{
252 274
 									$authors[$number]['url'] = $setup_info[$f][$number]['url'];
253 275
 							}
254 276
 						}
@@ -258,15 +280,19 @@  discard block
 block discarded – undo
258 280
 
259 281
 		// html format authors
260 282
 		$s = '';
261
-		foreach ($authors as $author) {
262
-			if ($s != '') {
283
+		foreach ($authors as $author)
284
+		{
285
+			if ($s != '')
286
+			{
263 287
 					$s .= '<br />';
264 288
 			}
265 289
 			$s .= lang('name').': '.$author['name'];
266
-			if ($author['email']) {
290
+			if ($author['email'])
291
+			{
267 292
 					$s .= '<br />'.lang('email').': <a href="mailto:'.$author['email'].'">'.$author['email'].'</a>';
268 293
 			}
269
-			if ($author['url']) {
294
+			if ($author['url'])
295
+			{
270 296
 					$s .= '<br />'.lang('url').': <a href="'.$author['url'].'" target="_blank">'.$author['url'].'</a>';
271 297
 			}
272 298
 		}
@@ -300,8 +326,14 @@  discard block
 block discarded – undo
300 326
 
301 327
 		if (isset(self::$knownLicenses[strtoupper($name)]))
302 328
 		{
303
-			if (empty($url)) $url = self::$knownLicenses[$name=strtoupper($name)][0];
304
-			if (empty($title)) $title = self::$knownLicenses[$name=strtoupper($name)][1];
329
+			if (empty($url))
330
+			{
331
+				$url = self::$knownLicenses[$name=strtoupper($name)][0];
332
+			}
333
+			if (empty($title))
334
+			{
335
+				$title = self::$knownLicenses[$name=strtoupper($name)][1];
336
+			}
305 337
 		}
306 338
 
307 339
 		return array(
Please login to merge, or discard this patch.
api/src/Framework/Bundle.php 1 patch
Braces   +22 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,7 +74,11 @@  discard block
 block discarded – undo
74 74
 		$query = null;
75 75
 		foreach($js_includes as $file)
76 76
 		{
77
-			if ($file == '/api/js/jsapi/egw.js') continue;	// loaded via own tag, and we must not load it twice!
77
+			if ($file == '/api/js/jsapi/egw.js')
78
+			{
79
+				continue;
80
+			}
81
+			// loaded via own tag, and we must not load it twice!
78 82
 
79 83
 			if (!isset($to_include[$file]))
80 84
 			{
@@ -133,17 +137,27 @@  discard block
 block discarded – undo
133 137
 	{
134 138
 		$debug_minify = $GLOBALS['egw_info']['server']['debug_minify'] === 'True';
135 139
 		// ignore not existing minurl
136
-		if (!empty($minurl) && !file_exists(EGW_SERVER_ROOT.$minurl)) $minurl = null;
140
+		if (!empty($minurl) && !file_exists(EGW_SERVER_ROOT.$minurl))
141
+		{
142
+			$minurl = null;
143
+		}
137 144
 		$to_include_first = $to_include = $to_minify = array();
138 145
 		$max_modified = 0;
139 146
 		$query = null;
140 147
 		foreach($js_includes as $path)
141 148
 		{
142
-			if ($path == '/api/js/jsapi/egw.js') continue; // Leave egw.js out of bundle
149
+			if ($path == '/api/js/jsapi/egw.js')
150
+			{
151
+				continue;
152
+			}
153
+			// Leave egw.js out of bundle
143 154
 			unset($query);
144 155
 			list($path,$query) = explode('?',$path,2);
145 156
 			$mod = filemtime(EGW_SERVER_ROOT.$path);
146
-			if ($mod > $max_modified) $max_modified = $mod;
157
+			if ($mod > $max_modified)
158
+			{
159
+				$max_modified = $mod;
160
+			}
147 161
 
148 162
 			// ckeditor must be included before bundled files, as they depend on it!
149 163
 			if (strpos($path,'/ckeditor/ckeditor.js') !== false)
@@ -182,7 +196,10 @@  discard block
 block discarded – undo
182 196
 			// need to include minified javascript before not minified stuff like jscalendar-setup, as it might depend on it
183 197
 			array_unshift($to_include, $path);
184 198
 		}
185
-		if ($to_include_first) $to_include = array_merge($to_include_first, $to_include);
199
+		if ($to_include_first)
200
+		{
201
+			$to_include = array_merge($to_include_first, $to_include);
202
+		}
186 203
 		//error_log(__METHOD__."("./*array2string($js_includes).*/", $max_modified, $minurl) returning ".array2string($to_include));
187 204
 		return $to_include;
188 205
 	}
Please login to merge, or discard this patch.
api/src/Framework/Extra.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,9 +164,12 @@
 block discarded – undo
164 164
 	{
165 165
 		// adding links of refreshed entry, to give others apps more information about necessity to refresh
166 166
 		if (isset(self::$extra['refresh-opener']) && count(self::$extra['refresh-opener']) <= 8 &&	// do not run twice
167
-			!empty(self::$extra['refresh-opener'][1]) && !empty(self::$extra['refresh-opener'][2]))	// app/id given
167
+			!empty(self::$extra['refresh-opener'][1]) && !empty(self::$extra['refresh-opener'][2]))
168
+		{
169
+			// app/id given
168 170
 		{
169 171
 			$links = Link::get_links(self::$extra['refresh-opener'][1], self::$extra['refresh-opener'][2]);
172
+		}
170 173
 			$apps = array();
171 174
 			foreach($links as $link)
172 175
 			{
Please login to merge, or discard this patch.
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.