Passed
Pull Request — master (#331)
by
unknown
02:34
created
exif/event/exif_listener.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,8 +146,7 @@
 block discarded – undo
146 146
 
147 147
 			$event['additional_sql_data'] = $additional_sql_data;
148 148
 			unset($exif);
149
-		}
150
-		else
149
+		} else
151 150
 		{
152 151
 			$additional_sql_data = $event['additional_sql_data'];
153 152
 			$additional_sql_data['image_exif_data'] = '';
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@
 block discarded – undo
54 54
 	}
55 55
 
56 56
 	/**
57
-	* Constructor
58
-	* NOTE: The parameters of this method must match in order and type with
59
-	* the dependencies defined in the services.yml file for this service.
60
-	*
61
-	* @param \phpbb\user					$user			User object
62
-	* @param \phpbbgallery\core\config		$gallery_config	Core gallery config object
63
-	* @param \phpbbgallery\core\auth\auth	$gallery_auth	Core gallery auth object
64
-	* @param \phpbbgallery\core\url			$gallery_url	Core gallery url object
65
-	* @param \phpbbgallery\core\user		$gallery_user	Core gallery user wrapper
66
-	*/
57
+	 * Constructor
58
+	 * NOTE: The parameters of this method must match in order and type with
59
+	 * the dependencies defined in the services.yml file for this service.
60
+	 *
61
+	 * @param \phpbb\user					$user			User object
62
+	 * @param \phpbbgallery\core\config		$gallery_config	Core gallery config object
63
+	 * @param \phpbbgallery\core\auth\auth	$gallery_auth	Core gallery auth object
64
+	 * @param \phpbbgallery\core\url			$gallery_url	Core gallery url object
65
+	 * @param \phpbbgallery\core\user		$gallery_user	Core gallery user wrapper
66
+	 */
67 67
 
68 68
 	public function __construct(\phpbb\user $user, \phpbbgallery\core\config $gallery_config, \phpbbgallery\core\auth\auth $gallery_auth, \phpbbgallery\core\url $gallery_url, \phpbbgallery\core\user $gallery_user)
69 69
 	{
Please login to merge, or discard this patch.
core/report.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 	}
141 141
 
142 142
 	/**
143
-	* Delete reports for given report_ids
144
-	*
145
-	* @param	mixed	$report_ids		Array or integer with report_id.
146
-	*/
143
+	 * Delete reports for given report_ids
144
+	 *
145
+	 * @param	mixed	$report_ids		Array or integer with report_id.
146
+	 */
147 147
 	public function delete($report_ids)
148 148
 	{
149 149
 		$report_ids = self::cast_mixed_int2array($report_ids);
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 
164 164
 
165 165
 	/**
166
-	* Delete reports for given image_ids
167
-	*
168
-	* @param	mixed	$image_ids		Array or integer with image_id.
169
-	*/
166
+	 * Delete reports for given image_ids
167
+	 *
168
+	 * @param	mixed	$image_ids		Array or integer with image_id.
169
+	 */
170 170
 	public function delete_images($image_ids)
171 171
 	{
172 172
 		$image_ids = self::cast_mixed_int2array($image_ids);
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
 
195 195
 
196 196
 	/**
197
-	* Delete reports for given album_ids
198
-	*
199
-	* @param	mixed	$album_ids		Array or integer with album_id.
200
-	*/
197
+	 * Delete reports for given album_ids
198
+	 *
199
+	 * @param	mixed	$album_ids		Array or integer with album_id.
200
+	 */
201 201
 	public function delete_albums($album_ids)
202 202
 	{
203 203
 		$album_ids = self::cast_mixed_int2array($album_ids);
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -249,8 +249,7 @@  discard block
 block discarded – undo
249 249
 			{
250 250
 				$mod_array[] = 0;
251 251
 			}
252
-		}
253
-		else
252
+		} else
254 253
 		{
255 254
 			$mod_array = array($album);
256 255
 		}
@@ -340,8 +339,7 @@  discard block
 block discarded – undo
340 339
 			$this->template->assign_vars(array(
341 340
 				'TOTAL_PAGES'				=> $this->language->lang('PAGE_TITLE_NUMBER', $page + 1),
342 341
 			));
343
-		}
344
-		else
342
+		} else
345 343
 		{
346 344
 			$this->pagination->generate_template_pagination(array(
347 345
 				'routes' => array(
@@ -396,8 +394,7 @@  discard block
 block discarded – undo
396 394
 		if (is_array($ids))
397 395
 		{
398 396
 			return array_map('intval', $ids);
399
-		}
400
-		else
397
+		} else
401 398
 		{
402 399
 			return array((int) $ids);
403 400
 		}
Please login to merge, or discard this patch.
core/upload.php 2 patches
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -144,8 +144,7 @@  discard block
 block discarded – undo
144 144
 			{
145 145
 				$this->zip_file = $this->file;
146 146
 				$this->upload_zip();
147
-			}
148
-			else
147
+			} else
149 148
 			{
150 149
 				$image_id = $this->prepare_file();
151 150
 				if ($image_id)
@@ -210,8 +209,7 @@  discard block
 block discarded – undo
210 209
 			if (is_dir($current_dir . $file))
211 210
 			{
212 211
 				$this->read_zip_folder($current_dir . $file . '/');
213
-			}
214
-			else if (in_array(utf8_substr(strtolower($file), utf8_strrpos($file, '.') + 1), self::get_allowed_types(false, true)))
212
+			} else if (in_array(utf8_substr(strtolower($file), utf8_strrpos($file, '.') + 1), self::get_allowed_types(false, true)))
215 213
 			{
216 214
 				if (!$this->file_limit || ($this->uploaded_files < $this->file_limit))
217 215
 				{
@@ -231,23 +229,20 @@  discard block
 block discarded – undo
231 229
 					{
232 230
 						$this->uploaded_files++;
233 231
 						$this->images[] = (int) $image_id;
234
-					}
235
-					else
232
+					} else
236 233
 					{
237 234
 						if ($this->file->error)
238 235
 						{
239 236
 							$this->new_error($this->language->lang('UPLOAD_ERROR', $this->file->get('uploadname'), implode('<br />&raquo; ', $this->file->error)));
240 237
 						}
241 238
 					}
242
-				}
243
-				else
239
+				} else
244 240
 				{
245 241
 					$this->quota_error();
246 242
 					@unlink($current_dir . $file);
247 243
 				}
248 244
 
249
-			}
250
-			else
245
+			} else
251 246
 			{
252 247
 				@unlink($current_dir . $file);
253 248
 			}
@@ -356,8 +351,7 @@  discard block
 block discarded – undo
356 351
 		{
357 352
 			$this->file->clean_filename('unique_ext');
358 353
 			$this->file->move_file(substr($this->gallery_url->path('upload'), 0, -1), false, false, CHMOD_ALL);
359
-		}
360
-		else
354
+		} else
361 355
 		{
362 356
 			// Okay, this looks hacky, but what we do here is, we store the directory name in the filename.
363 357
 			// However phpBB strips directories form the filename, when moving, so we need to specify that again.
@@ -411,8 +405,7 @@  discard block
 block discarded – undo
411 405
 					//$this->file->height = $this->tools->image_size['height'];
412 406
 					//$this->file->width = $this->tools->image_size['width'];
413 407
 				}
414
-			}
415
-			else
408
+			} else
416 409
 			{
417 410
 				$this->file->remove();
418 411
 				$this->new_error($this->language->lang('UPLOAD_ERROR', $this->file->get('uploadname'), $this->language->lang('UPLOAD_IMAGE_SIZE_TOO_BIG')));
Please login to merge, or discard this patch.
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -13,94 +13,94 @@  discard block
 block discarded – undo
13 13
 class upload
14 14
 {
15 15
 	/**
16
-	* @var \phpbb\user
17
-	*/
16
+	 * @var \phpbb\user
17
+	 */
18 18
 	protected $user;
19 19
 
20 20
 	/**
21
-	* @var \phpbb\language\language
22
-	*/
21
+	 * @var \phpbb\language\language
22
+	 */
23 23
 	protected $language;
24 24
 
25 25
 	/**
26
-	* @var \phpbb\db\driver\driver_interface
27
-	*/
26
+	 * @var \phpbb\db\driver\driver_interface
27
+	 */
28 28
 	protected $db;
29 29
 
30 30
 	/**
31
-	* @var \phpbb\event\dispatcher_interface
32
-	*/
31
+	 * @var \phpbb\event\dispatcher_interface
32
+	 */
33 33
 	protected $phpbb_dispatcher;
34 34
 
35 35
 	/**
36
-	* @var \phpbb\request\request
37
-	*/
36
+	 * @var \phpbb\request\request
37
+	 */
38 38
 	protected $request;
39 39
 
40 40
 	/**
41
-	* @var \phpbb\files\upload
42
-	*/
41
+	 * @var \phpbb\files\upload
42
+	 */
43 43
 	protected $file_upload;
44 44
 
45 45
 	/**
46
-	* @var \phpbbgallery\core\image\image
47
-	*/
46
+	 * @var \phpbbgallery\core\image\image
47
+	 */
48 48
 	protected $gallery_image;
49 49
 
50 50
 	/**
51
-	* @var \phpbbgallery\core\config
52
-	*/
51
+	 * @var \phpbbgallery\core\config
52
+	 */
53 53
 	protected $gallery_config;
54 54
 
55 55
 	/**
56
-	* @var \phpbbgallery\core\url
57
-	*/
56
+	 * @var \phpbbgallery\core\url
57
+	 */
58 58
 	protected $gallery_url;
59 59
 
60 60
 	/**
61
-	* @var \phpbbgallery\core\block
62
-	*/
61
+	 * @var \phpbbgallery\core\block
62
+	 */
63 63
 	protected $block;
64 64
 
65 65
 	/**
66
-	* @var \phpbbgallery\core\file\file
67
-	*/
66
+	 * @var \phpbbgallery\core\file\file
67
+	 */
68 68
 	protected $tools;
69 69
 
70 70
 	/**
71
-	* @var string
72
-	*/
71
+	 * @var string
72
+	 */
73 73
 	protected $images_table;
74 74
 
75 75
 	/**
76
-	* @var string
77
-	*/
76
+	 * @var string
77
+	 */
78 78
 	protected $root_path;
79 79
 
80 80
 	/**
81
-	* @var string
82
-	*/
81
+	 * @var string
82
+	 */
83 83
 	protected $php_ext;
84 84
 
85 85
 	/**
86
-	* Number of Files per Directory
87
-	*
88
-	* If this constant is set to a value >0 the gallery will create a new directory,
89
-	* when the current directory has more files in it than set here.
90
-	*/
86
+	 * Number of Files per Directory
87
+	 *
88
+	 * If this constant is set to a value >0 the gallery will create a new directory,
89
+	 * when the current directory has more files in it than set here.
90
+	 */
91 91
 	const NUM_FILES_PER_DIR = 0;
92 92
 
93 93
 	/**
94
-	* Objects: phpBB Upload, 2 Files and Image-Functions
95
-	*/
94
+	 * Objects: phpBB Upload, 2 Files and Image-Functions
95
+	 */
96 96
 	private $upload = null;
97 97
 	private $file = null;
98 98
 	private $zip_file = null;
99 99
 	//private $tools = null;
100 100
 
101 101
 	/**
102
-	* Basic variables...
103
-	*/
102
+	 * Basic variables...
103
+	 */
104 104
 	public $loaded_files = 0;
105 105
 	public $uploaded_files = 0;
106 106
 	public $errors = array();
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 	}
229 229
 
230 230
 	/**
231
-	* Upload a zip file and save the images into the import/ directory.
232
-	*/
231
+	 * Upload a zip file and save the images into the import/ directory.
232
+	 */
233 233
 	public function upload_zip()
234 234
 	{
235 235
 		if (!class_exists('compress_zip'))
@@ -377,14 +377,14 @@  discard block
 block discarded – undo
377 377
 		$file_link = $this->gallery_url->path('upload') . $this->image_data[$image_id]['image_filename'];
378 378
 
379 379
 		/**
380
-		* Event upload image before
381
-		*
382
-		* @event phpbbgallery.core.upload.update_image_before
383
-		* @var	array	additional_sql_data		array of additional settings
384
-		* @var	array	image_data				array of image_data
385
-		* @var	string	file_link				link to file
386
-		* @since 1.2.0
387
-		*/
380
+		 * Event upload image before
381
+		 *
382
+		 * @event phpbbgallery.core.upload.update_image_before
383
+		 * @var	array	additional_sql_data		array of additional settings
384
+		 * @var	array	image_data				array of image_data
385
+		 * @var	string	file_link				link to file
386
+		 * @since 1.2.0
387
+		 */
388 388
 		$vars = array('additional_sql_data', 'image_data', 'file_link');
389 389
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_before', compact($vars)));
390 390
 
@@ -392,12 +392,12 @@  discard block
 block discarded – undo
392 392
 		if (!$this->prepare_file_update($image_id))
393 393
 		{
394 394
 			/**
395
-			* Event upload image update
396
-			*
397
-			* @event phpbbgallery.core.upload.update_image_nofilechange
398
-			* @var	array	additional_sql_data		array of additional settings
399
-			* @since 1.2.0
400
-			*/
395
+			 * Event upload image update
396
+			 *
397
+			 * @event phpbbgallery.core.upload.update_image_nofilechange
398
+			 * @var	array	additional_sql_data		array of additional settings
399
+			 * @since 1.2.0
400
+			 */
401 401
 			$vars = array('additional_sql_data');
402 402
 			extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_nofilechange', compact($vars)));
403 403
 		}
@@ -415,8 +415,8 @@  discard block
 block discarded – undo
415 415
 	}
416 416
 
417 417
 	/**
418
-	* Prepare file on upload: rotate and resize
419
-	*/
418
+	 * Prepare file on upload: rotate and resize
419
+	 */
420 420
 	public function prepare_file()
421 421
 	{
422 422
 		$upload_dir = $this->get_current_upload_dir();
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
 		$file = $this->file;
447 447
 
448 448
 		/**
449
-		* Event upload image update
450
-		*
451
-		* @event phpbbgallery.core.upload.prepare_file_before
452
-		* @var	array	additional_sql_data		array of additional settings
453
-		* @var	array	file					File object
454
-		* @since 1.2.0
455
-		*/
449
+		 * Event upload image update
450
+		 *
451
+		 * @event phpbbgallery.core.upload.prepare_file_before
452
+		 * @var	array	additional_sql_data		array of additional settings
453
+		 * @var	array	file					File object
454
+		 * @since 1.2.0
455
+		 */
456 456
 		$vars = array('additional_sql_data', 'file');
457 457
 		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.prepare_file_before', compact($vars)));
458 458
 
@@ -804,8 +804,8 @@  discard block
 block discarded – undo
804 804
 	}
805 805
 
806 806
 	/**
807
-	* Generate some kind of check so users only complete the uplaod for their images
808
-	*/
807
+	 * Generate some kind of check so users only complete the uplaod for their images
808
+	 */
809 809
 	public function generate_hidden_fields()
810 810
 	{
811 811
 		$checks = array();
Please login to merge, or discard this patch.
core/contest.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
 	const NUM_IMAGES = 3;
35 35
 
36 36
 	/**
37
-	* There are different modes to calculate who won the contest.
38
-	* This value should be one of the constant-names below.
39
-	*/
37
+	 * There are different modes to calculate who won the contest.
38
+	 * This value should be one of the constant-names below.
39
+	 */
40 40
 	static public $mode = self::MODE_AVERAGE;
41 41
 
42 42
 	/**
43
-	* The image with the highest average wins.
44
-	*/
43
+	 * The image with the highest average wins.
44
+	 */
45 45
 	const MODE_AVERAGE = 1;
46 46
 	/**
47
-	* The image with the highest number of total points wins.
48
-	*/
47
+	 * The image with the highest number of total points wins.
48
+	 */
49 49
 	const MODE_SUM = 2;
50 50
 
51 51
 	public function __construct(\phpbb\db\driver\driver_interface $db,
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 
61 61
 	/**
62
-	* Get the contest row from the table
63
-	*
64
-	* @param	int		$id				ID of the contest or album, depending on second parameter
65
-	* @param	string	$mode			contest or album ID to get the contest.
66
-	* @param	bool	$throw_error	Shall we throw an error if the contest was not found?
67
-	*
68
-	* @return	mixed	Either the array or boolean false if contest does not exist
69
-	*/
62
+	 * Get the contest row from the table
63
+	 *
64
+	 * @param	int		$id				ID of the contest or album, depending on second parameter
65
+	 * @param	string	$mode			contest or album ID to get the contest.
66
+	 * @param	bool	$throw_error	Shall we throw an error if the contest was not found?
67
+	 *
68
+	 * @return	mixed	Either the array or boolean false if contest does not exist
69
+	 */
70 70
 	public function get_contest($id, $mode = 'contest', $throw_error = true)
71 71
 	{
72 72
 		$sql = 'SELECT *
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -165,8 +165,7 @@
 block discarded – undo
165 165
 			{
166 166
 				$this->resync($album_id);
167 167
 			}
168
-		}
169
-		else
168
+		} else
170 169
 		{
171 170
 			$this->resync((int) $album_ids);
172 171
 		}
Please login to merge, or discard this patch.
core/rating.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -216,8 +216,7 @@  discard block
 block discarded – undo
216 216
 						return $this->language->lang('CONTEST_RATING_HIDDEN');
217 217
 					}
218 218
 					return $this->language->lang('CONTEST_RESULT_HIDDEN', $this->user->format_date(($this->album_data('contest_start') + $this->album_data('contest_end')), false, true));
219
-				}
220
-				else
219
+				} else
221 220
 				{
222 221
 					if ($user_rating)
223 222
 					{
@@ -364,8 +363,7 @@  discard block
 block discarded – undo
364 363
 		if (is_array($image_ids))
365 364
 		{
366 365
 			$image_ids = array_map('intval', $image_ids);
367
-		}
368
-		else
366
+		} else
369 367
 		{
370 368
 			$image_ids = (int) $image_ids;
371 369
 		}
@@ -399,8 +397,7 @@  discard block
 block discarded – undo
399 397
 		if (is_array($image_ids))
400 398
 		{
401 399
 			$image_ids = array_map('intval', $image_ids);
402
-		}
403
-		else
400
+		} else
404 401
 		{
405 402
 			$image_ids = (int) $image_ids;
406 403
 		}
Please login to merge, or discard this patch.
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -13,91 +13,91 @@  discard block
 block discarded – undo
13 13
 class rating
14 14
 {
15 15
 	/**
16
-	* @var \phpbb\db\driver\driver_interface
17
-	*/
16
+	 * @var \phpbb\db\driver\driver_interface
17
+	 */
18 18
 	protected $db;
19 19
 
20 20
 	/**
21
-	* @var \phpbb\template\template
22
-	*/
21
+	 * @var \phpbb\template\template
22
+	 */
23 23
 	protected $template;
24 24
 
25 25
 	/**
26
-	* @var \phpbb\user
27
-	*/
26
+	 * @var \phpbb\user
27
+	 */
28 28
 	protected $user;
29 29
 
30 30
 	/**
31
-	* @var \phpbb\language\language
32
-	*/
31
+	 * @var \phpbb\language\language
32
+	 */
33 33
 	protected $language;
34 34
 
35 35
 	/**
36
-	* @var \phpbb\request\request
37
-	*/
36
+	 * @var \phpbb\request\request
37
+	 */
38 38
 	protected $request;
39 39
 
40 40
 	/**
41
-	* @var \phpbbgallery\core\config
42
-	*/
41
+	 * @var \phpbbgallery\core\config
42
+	 */
43 43
 	protected $gallery_config;
44 44
 
45 45
 	/**
46
-	* @var \phpbbgallery\core\auth\auth
47
-	*/
46
+	 * @var \phpbbgallery\core\auth\auth
47
+	 */
48 48
 	protected $gallery_auth;
49 49
 
50 50
 	/**
51
-	* @var string
52
-	*/
51
+	 * @var string
52
+	 */
53 53
 	protected $images_table;
54 54
 
55 55
 	/**
56
-	* @var string
57
-	*/
56
+	 * @var string
57
+	 */
58 58
 	protected $albums_table;
59 59
 
60 60
 	/**
61
-	* @var string
62
-	*/
61
+	 * @var string
62
+	 */
63 63
 	protected $rates_table;
64 64
 
65 65
 	/**
66
-	* The image ID we want to rate
67
-	*/
66
+	 * The image ID we want to rate
67
+	 */
68 68
 	public $image_id = 0;
69 69
 
70 70
 	/**
71
-	* Private objects with the values for the image/album from the database
72
-	*/
71
+	 * Private objects with the values for the image/album from the database
72
+	 */
73 73
 	private $image_data = null;
74 74
 	private $album_data = null;
75 75
 
76 76
 	/**
77
-	* Rating the user gave the image.
78
-	*/
77
+	 * Rating the user gave the image.
78
+	 */
79 79
 	public $user_rating = null;
80 80
 
81 81
 	/**
82
-	* Is rating currently possible?
83
-	* Might be blocked because of contest-settings.
84
-	*/
82
+	 * Is rating currently possible?
83
+	 * Might be blocked because of contest-settings.
84
+	 */
85 85
 	public $rating_enabled = false;
86 86
 
87 87
 	/**
88
-	* Classic-rating box with a dropdown.
89
-	*/
88
+	 * Classic-rating box with a dropdown.
89
+	 */
90 90
 	const MODE_SELECT = 1;
91 91
 
92 92
 	/**
93
-	* Rating with stars, like the old-system from youtube.
93
+	 * Rating with stars, like the old-system from youtube.
94 94
 	//@todo: const MODE_STARS = 2;
95
-	*/
95
+	 */
96 96
 
97 97
 	/**
98
-	* Simple thumbs up or down.
98
+	 * Simple thumbs up or down.
99 99
 	//@todo: const MODE_THUMB = 3;
100
-	*/
100
+	 */
101 101
 
102 102
 	/**
103 103
 	 * Constructor
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
 	}
205 205
 
206 206
 	/**
207
-	* Displays the box where the user can rate the image.
208
-	*/
207
+	 * Displays the box where the user can rate the image.
208
+	 */
209 209
 	public function display_box()
210 210
 	{
211 211
 		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode'));
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 	}
281 281
 
282 282
 	/**
283
-	* Get rated value for a image
284
-	*/
283
+	 * Get rated value for a image
284
+	 */
285 285
 	private function get_image_rating_value()
286 286
 	{
287 287
 		/*if (phpbb_ext_gallery_core_contest::$mode == phpbb_ext_gallery_core_contest::MODE_SUM)
@@ -295,14 +295,14 @@  discard block
 block discarded – undo
295 295
 	}
296 296
 
297 297
 	/**
298
-	* Is the user allowed to rate?
299
-	* Following statements must be true:
300
-	*	- User must have permissions.
301
-	*	- User is neither owner of the image nor guest.
302
-	*	- Album and image are not locked.
303
-	*
304
-	* @return	bool
305
-	*/
298
+	 * Is the user allowed to rate?
299
+	 * Following statements must be true:
300
+	 *	- User must have permissions.
301
+	 *	- User is neither owner of the image nor guest.
302
+	 *	- Album and image are not locked.
303
+	 *
304
+	 * @return	bool
305
+	 */
306 306
 	public function is_allowed()
307 307
 	{
308 308
 		return $this->gallery_auth->acl_check('i_rate', $this->album_data('album_id'), $this->album_data('album_user_id')) &&
@@ -311,25 +311,25 @@  discard block
 block discarded – undo
311 311
 	}
312 312
 
313 313
 	/**
314
-	* Is the user able to rate?
315
-	* Following statements must be true:
316
-	*	- User must be allowed to rate
317
-	*	- If the image is in a contest, it must be in the rating timespan
318
-	*
319
-	* @return	bool
320
-	*/
314
+	 * Is the user able to rate?
315
+	 * Following statements must be true:
316
+	 *	- User must be allowed to rate
317
+	 *	- If the image is in a contest, it must be in the rating timespan
318
+	 *
319
+	 * @return	bool
320
+	 */
321 321
 	public function is_able()
322 322
 	{
323 323
 		return $this->is_allowed(); //&& phpbb_ext_gallery_core_contest::is_step('rate', $this->album_data(true));
324 324
 	}
325 325
 
326 326
 	/**
327
-	* Get rating from a user for a given image
328
-	*
329
-	* @param	int		$user_id
330
-	*
331
-	* @return	mixed	False if the user did not rate or is guest, otherwise int the points.
332
-	*/
327
+	 * Get rating from a user for a given image
328
+	 *
329
+	 * @param	int		$user_id
330
+	 *
331
+	 * @return	mixed	False if the user did not rate or is guest, otherwise int the points.
332
+	 */
333 333
 	public function get_user_rating($user_id)
334 334
 	{
335 335
 		if (isset($this->user_rating[$user_id]))
@@ -405,10 +405,10 @@  discard block
 block discarded – undo
405 405
 	}
406 406
 
407 407
 	/**
408
-	* Recalculate the average image-rating and such stuff.
409
-	*
410
-	* @param	mixed	$image_ids	Array or integer with image_id where we recalculate the rating.
411
-	*/
408
+	 * Recalculate the average image-rating and such stuff.
409
+	 *
410
+	 * @param	mixed	$image_ids	Array or integer with image_id where we recalculate the rating.
411
+	 */
412 412
 	public function recalc_image_rating($image_ids)
413 413
 	{
414 414
 		if (is_array($image_ids))
@@ -439,11 +439,11 @@  discard block
 block discarded – undo
439 439
 	}
440 440
 
441 441
 	/**
442
-	* Delete all ratings for given image_ids
443
-	*
444
-	* @param	mixed	$image_ids		Array or integer with image_id where we delete the rating.
445
-	* @param	bool	$reset_average	Shall we also reset the average? We can save that query, when the images are deleted anyway.
446
-	*/
442
+	 * Delete all ratings for given image_ids
443
+	 *
444
+	 * @param	mixed	$image_ids		Array or integer with image_id where we delete the rating.
445
+	 * @param	bool	$reset_average	Shall we also reset the average? We can save that query, when the images are deleted anyway.
446
+	 */
447 447
 	public function delete_ratings($image_ids, $reset_average = false)
448 448
 	{
449 449
 		if (is_array($image_ids))
Please login to merge, or discard this patch.
core/controller/upload.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -249,8 +249,7 @@  discard block
 block discarded – undo
249 249
 					'last_image'	=> end($process->images),
250 250
 				);
251 251
 				$this->notification_helper->new_image($data);
252
-			}
253
-			else
252
+			} else
254 253
 			{
255 254
 				$target = array(
256 255
 					'album_id'	=>	$album_id,
@@ -355,8 +354,7 @@  discard block
 block discarded – undo
355 354
 					{
356 355
 						$this->language->add_lang('ucp');
357 356
 						$error_array[] = $this->language->lang($result . '_USERNAME');
358
-					}
359
-					else
357
+					} else
360 358
 					{
361 359
 						$process->set_username($username);
362 360
 					}
@@ -375,8 +373,7 @@  discard block
 block discarded – undo
375 373
 				if (!$process->uploaded_files)
376 374
 				{
377 375
 					$process->new_error($this->language->lang('UPLOAD_NO_FILE'));
378
-				}
379
-				else
376
+				} else
380 377
 				{
381 378
 					$mode = 'upload_edit';
382 379
 					// Remove submit, so we get the first screen of step 2.
@@ -422,8 +419,7 @@  discard block
 block discarded – undo
422 419
 						if ($VAR == 'zip')
423 420
 						{
424 421
 							continue;
425
-						}
426
-						else
422
+						} else
427 423
 						{
428 424
 							$filetypes[] = $VAR;
429 425
 						}
@@ -523,8 +519,7 @@  discard block
 block discarded – undo
523 519
 						'last_image'	=> end($process->images),
524 520
 					);
525 521
 					$this->notification_helper->new_image($data);
526
-				}
527
-				else
522
+				} else
528 523
 				{
529 524
 					$target = array(
530 525
 						'album_id'	=>	(int) $album_id,
@@ -591,8 +586,7 @@  discard block
 block discarded – undo
591 586
 		if (file_exists($phpbbgallery_core_file) && is_writable($phpbbgallery_core_file) && file_exists($phpbbgallery_core_file_source) && is_writable($phpbbgallery_core_file_source) && file_exists($phpbbgallery_core_file_medium) && is_writable($phpbbgallery_core_file_medium) && file_exists($phpbbgallery_core_file_mini) && is_writable($phpbbgallery_core_file_mini))
592 587
 		{
593 588
 			return true;
594
-		}
595
-		else
589
+		} else
596 590
 		{
597 591
 			return false;
598 592
 		}
Please login to merge, or discard this patch.
core/controller/search.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 		$this->language->add_lang(array('gallery'), 'phpbbgallery/core');
166 166
 		$this->language->add_lang('search');
167 167
 		/**
168
-		* Build the sort options
169
-		*/
168
+		 * Build the sort options
169
+		 */
170 170
 		$limit_days = array(0 => $this->language->lang('ALL_IMAGES'), 1 => $this->language->lang('1_DAY'), 7 => $this->language->lang('7_DAYS'), 14 => $this->language->lang('2_WEEKS'), 30 => $this->language->lang('1_MONTH'), 90 => $this->language->lang('3_MONTHS'), 180 => $this->language->lang('6_MONTHS'), 365 => $this->language->lang('1_YEAR'));
171 171
 		$sort_by_text = array('t' => $this->language->lang('TIME'), 'n' => $this->language->lang('IMAGE_NAME'), 'u' => $this->language->lang('SORT_USERNAME'), 'vc' => $this->language->lang('GALLERY_VIEWS'));
172 172
 		$sort_by_sql = array('t' => 'image_time', 'n' => 'image_name_clean', 'u' => 'image_username_clean', 'vc' => 'image_view_count');
@@ -369,11 +369,11 @@  discard block
 block discarded – undo
369 369
 	}
370 370
 
371 371
 	/**
372
-	* Index Controller
373
-	*	Route: gallery/search/random
374
-	*
375
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
376
-	*/
372
+	 * Index Controller
373
+	 *	Route: gallery/search/random
374
+	 *
375
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
376
+	 */
377 377
 	public function random()
378 378
 	{
379 379
 		$this->language->add_lang(array('gallery'), 'phpbbgallery/core');
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
 				if ($search_terms == 'all')
233 233
 				{
234 234
 					$keywords .= ' ' . $add_keywords;
235
-				}
236
-				else
235
+				} else
237 236
 				{
238 237
 					$search_terms = 'all';
239 238
 					$keywords = preg_replace('#\s+#u', ' |', $keywords) . ' ' .$add_keywords;
@@ -271,8 +270,7 @@  discard block
 block discarded – undo
271 270
 			if (empty($search_album))
272 271
 			{
273 272
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $this->gallery_auth->acl_album_ids('i_view'));
274
-			}
275
-			else
273
+			} else
276 274
 			{
277 275
 				$sql_where[] = $this->db->sql_in_set('i.image_album_id', $search_album);
278 276
 			}
Please login to merge, or discard this patch.
core/controller/index.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -111,11 +111,11 @@
 block discarded – undo
111 111
 	}
112 112
 
113 113
 	/**
114
-	* Index Controller
115
-	*	Route: gallery
116
-	*
117
-	* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
118
-	*/
114
+	 * Index Controller
115
+	 *	Route: gallery
116
+	 *
117
+	 * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
118
+	 */
119 119
 	public function base()
120 120
 	{
121 121
 		// Display login box for guests and an error for users
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
131 131
 		if ($this->gallery_config->get('pegas_index_album'))
132 132
 		{
133 133
 			$this->display->display_albums('personal', $this->config['load_moderators']);
134
-		}
135
-		else
134
+		} else
136 135
 		{
137 136
 			$last_image = $this->image->get_last_image();
138 137
 			if (empty($last_image))
@@ -347,8 +346,7 @@  discard block
 block discarded – undo
347 346
 				FROM ' . GROUPS_TABLE . '
348 347
 				WHERE group_legend > 0
349 348
 				ORDER BY ' . $order_legend . ' ASC';
350
-		}
351
-		else
349
+		} else
352 350
 		{
353 351
 			$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
354 352
 				FROM ' . GROUPS_TABLE . ' g
@@ -373,8 +371,7 @@  discard block
 block discarded – undo
373 371
 			if ($row['group_name'] == 'BOTS' || ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')))
374 372
 			{
375 373
 				$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
376
-			}
377
-			else
374
+			} else
378 375
 			{
379 376
 				$legend[] = '<a' . $colour_text . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
380 377
 			}
Please login to merge, or discard this patch.
core/controller/comment.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -825,8 +825,8 @@
 block discarded – undo
825 825
 		generate_smilies('inline', 0);
826 826
 
827 827
 		/**
828
-		* Rating-System: now you can comment and rate in one form
829
-		*/
828
+		 * Rating-System: now you can comment and rate in one form
829
+		 */
830 830
 		$s_user_rated = false;
831 831
 		if ($this->gallery_config->get('allow_rates'))
832 832
 		{
Please login to merge, or discard this patch.
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -213,8 +213,7 @@  discard block
 block discarded – undo
213 213
 		if (isset($album_data['contest_start']))
214 214
 		{
215 215
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
216
-		}
217
-		else
216
+		} else
218 217
 		{
219 218
 			$s_hide_comment_input = false;
220 219
 		}
@@ -338,14 +337,12 @@  discard block
 block discarded – undo
338 337
 				$this->notification_helper->notify('new_comment', $data);
339 338
 				//$phpbb_gallery_notification->send_notification('image', $image_id, $image_data['image_name']);
340 339
 				$message .= $this->language->lang('COMMENT_STORED') . '<br />';
341
-			}
342
-			else if ($this->misc->display_captcha('comment'))
340
+			} else if ($this->misc->display_captcha('comment'))
343 341
 			{
344 342
 				$s_captcha_hidden_fields = ($captcha->is_solved()) ? build_hidden_fields($captcha->get_hidden_fields()) : '';
345 343
 			}
346 344
 			$sig_checked = ($this->auth->acl_get('u_sig') && isset($_POST['attach_sig']));
347
-		}
348
-		else
345
+		} else
349 346
 		{
350 347
 			if ($comment_id != 0)
351 348
 			{
@@ -439,8 +436,7 @@  discard block
 block discarded – undo
439 436
 			$comment_data = $this->db->sql_fetchrow($result);
440 437
 			$this->db->sql_freeresult($result);
441 438
 			$image_id = (int) $comment_data['comment_image_id'];
442
-		}
443
-		else
439
+		} else
444 440
 		{
445 441
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
446 442
 		}
@@ -451,8 +447,7 @@  discard block
 block discarded – undo
451 447
 			{
452 448
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
453 449
 			}
454
-		}
455
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
450
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
456 451
 		{
457 452
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
458 453
 		}
@@ -485,8 +480,7 @@  discard block
 block discarded – undo
485 480
 		if (isset($album_data['contest_start']))
486 481
 		{
487 482
 			$s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false;
488
-		}
489
-		else
483
+		} else
490 484
 		{
491 485
 			$s_hide_comment_input = false;
492 486
 		}
@@ -578,8 +572,7 @@  discard block
 block discarded – undo
578 572
 					$this->gallery_log->add_log('moderator', 'c_edit', $image_data['image_album_id'], $image_data['image_id'], array('LOG_GALLERY_COMMENT_EDITED', $image_data['image_name']));
579 573
 				}
580 574
 			}
581
-		}
582
-		else
575
+		} else
583 576
 		{
584 577
 			$sig_checked = (bool) $comment_data['comment_signature'];
585 578
 
@@ -653,8 +646,7 @@  discard block
 block discarded – undo
653 646
 			$comment_data = $this->db->sql_fetchrow($result);
654 647
 			$this->db->sql_freeresult($result);
655 648
 			$image_id = (int) $comment_data['comment_image_id'];
656
-		}
657
-		else
649
+		} else
658 650
 		{
659 651
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
660 652
 		}
@@ -665,8 +657,7 @@  discard block
 block discarded – undo
665 657
 			{
666 658
 				$this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD');
667 659
 			}
668
-		}
669
-		else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
660
+		} else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id']))
670 661
 		{
671 662
 			$this->misc->not_authorised($image_backlink, $image_loginlink);
672 663
 		}
@@ -731,15 +722,13 @@  discard block
 block discarded – undo
731 722
 
732 723
 			$message = $this->language->lang('DELETED_COMMENT') . '<br />';
733 724
 			$submit = true;
734
-		}
735
-		else
725
+		} else
736 726
 		{
737 727
 			if (isset($_POST['cancel']))
738 728
 			{
739 729
 				$message = $this->language->lang('DELETED_COMMENT_NOT') . '<br />';
740 730
 				$submit = true;
741
-			}
742
-			else
731
+			} else
743 732
 			{
744 733
 				confirm_box(false, 'DELETE_COMMENT2', $s_hidden_fields);
745 734
 			}
Please login to merge, or discard this patch.