| @@ -15,69 +15,69 @@ discard block | ||
| 15 | 15 | class exif | 
| 16 | 16 |  { | 
| 17 | 17 | /** | 
| 18 | - * Default value for new users | |
| 19 | - */ | |
| 18 | + * Default value for new users | |
| 19 | + */ | |
| 20 | 20 | const DEFAULT_DISPLAY = true; | 
| 21 | 21 | |
| 22 | 22 | /** | 
| 23 | - * phpBB will treat the time from the Exif data like UTC. | |
| 24 | - * If your images were taken with an other timezone, you can insert an offset here. | |
| 25 | - * The offset is than added to the timestamp before it is converted into the users time. | |
| 26 | - * | |
| 27 | - * Offset must be set in seconds. | |
| 28 | - */ | |
| 23 | + * phpBB will treat the time from the Exif data like UTC. | |
| 24 | + * If your images were taken with an other timezone, you can insert an offset here. | |
| 25 | + * The offset is than added to the timestamp before it is converted into the users time. | |
| 26 | + * | |
| 27 | + * Offset must be set in seconds. | |
| 28 | + */ | |
| 29 | 29 | const TIME_OFFSET = 0; | 
| 30 | 30 | |
| 31 | 31 | /** | 
| 32 | - * Constants for the status of the Exif data. | |
| 33 | - */ | |
| 32 | + * Constants for the status of the Exif data. | |
| 33 | + */ | |
| 34 | 34 | const UNAVAILABLE = 0; | 
| 35 | 35 | const AVAILABLE = 1; | 
| 36 | 36 | const UNKNOWN = 2; | 
| 37 | 37 | const DBSAVED = 3; | 
| 38 | 38 | |
| 39 | 39 | /** | 
| 40 | - * Is the function available? | |
| 41 | - */ | |
| 40 | + * Is the function available? | |
| 41 | + */ | |
| 42 | 42 | static public $function_exists = null; | 
| 43 | 43 | |
| 44 | 44 | /** | 
| 45 | - * Exif data array with all allowed groups and keys. | |
| 46 | - */ | |
| 45 | + * Exif data array with all allowed groups and keys. | |
| 46 | + */ | |
| 47 | 47 | public $data = array(); | 
| 48 | 48 | |
| 49 | 49 | /** | 
| 50 | - * Filtered data array. We don't have empty or invalid values here. | |
| 51 | - */ | |
| 50 | + * Filtered data array. We don't have empty or invalid values here. | |
| 51 | + */ | |
| 52 | 52 | public $prepared_data = array(); | 
| 53 | 53 | |
| 54 | 54 | /** | 
| 55 | - * Does the image have exif data? | |
| 56 | - * Values see constant declaration at the beginning of the class. | |
| 57 | - */ | |
| 55 | + * Does the image have exif data? | |
| 56 | + * Values see constant declaration at the beginning of the class. | |
| 57 | + */ | |
| 58 | 58 | public $status = 2; | 
| 59 | 59 | |
| 60 | 60 | /** | 
| 61 | - * Full data array, but serialized to a string | |
| 62 | - */ | |
| 61 | + * Full data array, but serialized to a string | |
| 62 | + */ | |
| 63 | 63 | public $serialized = ''; | 
| 64 | 64 | |
| 65 | 65 | /** | 
| 66 | - * Full link to the image-file | |
| 67 | - */ | |
| 66 | + * Full link to the image-file | |
| 67 | + */ | |
| 68 | 68 | public $file = ''; | 
| 69 | 69 | |
| 70 | 70 | /** | 
| 71 | - * Image-ID, just needed to update the Exif status | |
| 72 | - */ | |
| 71 | + * Image-ID, just needed to update the Exif status | |
| 72 | + */ | |
| 73 | 73 | public $image_id = false; | 
| 74 | 74 | |
| 75 | 75 | /** | 
| 76 | - * Constructor | |
| 77 | - * | |
| 78 | - * @param string $file Full link to the image-file | |
| 79 | - * @param mixed $image_id False or integer | |
| 80 | - */ | |
| 76 | + * Constructor | |
| 77 | + * | |
| 78 | + * @param string $file Full link to the image-file | |
| 79 | + * @param mixed $image_id False or integer | |
| 80 | + */ | |
| 81 | 81 | public function __construct($file, $image_id = false) | 
| 82 | 82 |  	{ | 
| 83 | 83 | if (self::$function_exists === null) | 
| @@ -93,11 +93,11 @@ discard block | ||
| 93 | 93 | } | 
| 94 | 94 | |
| 95 | 95 | /** | 
| 96 | - * Intepret the values from the database, and read the data if we don't have it. | |
| 97 | - * | |
| 98 | - * @param int $status Value of a status constant (see beginning of the class) | |
| 99 | - * @param mixed $data Either an empty string or the serialized array of the Exif from the database | |
| 100 | - */ | |
| 96 | + * Intepret the values from the database, and read the data if we don't have it. | |
| 97 | + * | |
| 98 | + * @param int $status Value of a status constant (see beginning of the class) | |
| 99 | + * @param mixed $data Either an empty string or the serialized array of the Exif from the database | |
| 100 | + */ | |
| 101 | 101 | public function interpret($status, $data) | 
| 102 | 102 |  	{ | 
| 103 | 103 | $this->orig_status = $status; | 
| @@ -113,8 +113,8 @@ discard block | ||
| 113 | 113 | } | 
| 114 | 114 | |
| 115 | 115 | /** | 
| 116 | - * Read Exif data from the image | |
| 117 | - */ | |
| 116 | + * Read Exif data from the image | |
| 117 | + */ | |
| 118 | 118 | public function read() | 
| 119 | 119 |  	{ | 
| 120 | 120 | if (!self::$function_exists || !$this->file || !file_exists($this->file)) | 
| @@ -160,8 +160,8 @@ discard block | ||
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | 162 | /** | 
| 163 | - * Validate and prepare the data, so we can send it into the template. | |
| 164 | - */ | |
| 163 | + * Validate and prepare the data, so we can send it into the template. | |
| 164 | + */ | |
| 165 | 165 | private function prepare_data() | 
| 166 | 166 |  	{ | 
| 167 | 167 | global $user; | 
| @@ -268,11 +268,11 @@ discard block | ||
| 268 | 268 | } | 
| 269 | 269 | |
| 270 | 270 | /** | 
| 271 | - * Sends the Exif into the template | |
| 272 | - * | |
| 273 | - * @param bool $expand_view Shall we expand the Exif data on page view or collapse? | |
| 274 | - * @param string $block Name of the template loop the Exifs are displayed in. | |
| 275 | - */ | |
| 271 | + * Sends the Exif into the template | |
| 272 | + * | |
| 273 | + * @param bool $expand_view Shall we expand the Exif data on page view or collapse? | |
| 274 | + * @param string $block Name of the template loop the Exifs are displayed in. | |
| 275 | + */ | |
| 276 | 276 | public function send_to_template($expand_view = true, $block = 'exif_value') | 
| 277 | 277 |  	{ | 
| 278 | 278 | $this->prepare_data(); | 
| @@ -296,8 +296,8 @@ discard block | ||
| 296 | 296 | } | 
| 297 | 297 | |
| 298 | 298 | /** | 
| 299 | - * Save the new Exif status in the database | |
| 300 | - */ | |
| 299 | + * Save the new Exif status in the database | |
| 300 | + */ | |
| 301 | 301 | public function set_status() | 
| 302 | 302 |  	{ | 
| 303 | 303 | if (!$this->image_id || ($this->orig_status == $this->status)) | 
| @@ -315,9 +315,9 @@ discard block | ||
| 315 | 315 | } | 
| 316 | 316 | |
| 317 | 317 | /** | 
| 318 | - * There are lots of possible Exif Groups and Values. | |
| 319 | - * But you will never heard of the missing ones. so we just allow the most common ones. | |
| 320 | - */ | |
| 318 | + * There are lots of possible Exif Groups and Values. | |
| 319 | + * But you will never heard of the missing ones. so we just allow the most common ones. | |
| 320 | + */ | |
| 321 | 321 | static private $allowed_groups = array( | 
| 322 | 322 | 'EXIF', | 
| 323 | 323 | 'IFD0', | 
| @@ -105,8 +105,7 @@ discard block | ||
| 105 | 105 | if ($this->status == self::DBSAVED) | 
| 106 | 106 |  		{ | 
| 107 | 107 | $this->data = unserialize($data); | 
| 108 | - } | |
| 109 | - else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) | |
| 108 | + } else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) | |
| 110 | 109 |  		{ | 
| 111 | 110 | $this->read(); | 
| 112 | 111 | } | 
| @@ -132,8 +131,7 @@ discard block | ||
| 132 | 131 | if (!in_array($key, self::$allowed_groups)) | 
| 133 | 132 |  				{ | 
| 134 | 133 | unset($this->data[$key]); | 
| 135 | - } | |
| 136 | - else | |
| 134 | + } else | |
| 137 | 135 |  				{ | 
| 138 | 136 | foreach ($this->data[$key] as $subkey => $array) | 
| 139 | 137 |  					{ | 
| @@ -147,8 +145,7 @@ discard block | ||
| 147 | 145 | |
| 148 | 146 | $this->serialized = serialize($this->data); | 
| 149 | 147 | $this->status = self::DBSAVED; | 
| 150 | - } | |
| 151 | - else | |
| 148 | + } else | |
| 152 | 149 |  		{ | 
| 153 | 150 | $this->status = self::UNAVAILABLE; | 
| 154 | 151 | } | 
| @@ -198,8 +195,7 @@ discard block | ||
| 198 | 195 | if (($num > $den) && $den) | 
| 199 | 196 |  			{ | 
| 200 | 197 | $exif_exposure = $num / $den; | 
| 201 | - } | |
| 202 | - else if ($num) | |
| 198 | + } else if ($num) | |
| 203 | 199 |  			{ | 
| 204 | 200 | $exif_exposure = ' 1/' . $den / $num ; | 
| 205 | 201 | } | 
| @@ -250,8 +246,7 @@ discard block | ||
| 250 | 246 | if (($num / $den) == 0) | 
| 251 | 247 |  				{ | 
| 252 | 248 | $exif_exposure_bias = 0; | 
| 253 | - } | |
| 254 | - else | |
| 249 | + } else | |
| 255 | 250 |  				{ | 
| 256 | 251 | $exif_exposure_bias = $this->data["EXIF"]["ExposureBiasValue"]; | 
| 257 | 252 | } | 
| @@ -36,16 +36,16 @@ | ||
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | /** | 
| 39 | - * Constructor | |
| 40 | - * NOTE: The parameters of this method must match in order and type with | |
| 41 | - * the dependencies defined in the services.yml file for this service. | |
| 42 | - * | |
| 43 | - * @param \phpbb\user $user User object | |
| 44 | - * @param \phpbbgallery\core\config $gallery_config Core gallery config object | |
| 45 | - * @param \phpbbgallery\core\auth\auth $gallery_auth Core gallery auth object | |
| 46 | - * @param \phpbbgallery\core\url $gallery_url Core gallery url object | |
| 47 | - * @param \phpbbgallery\core\user $gallery_user Core gallery user wraper | |
| 48 | - */ | |
| 39 | + * Constructor | |
| 40 | + * NOTE: The parameters of this method must match in order and type with | |
| 41 | + * the dependencies defined in the services.yml file for this service. | |
| 42 | + * | |
| 43 | + * @param \phpbb\user $user User object | |
| 44 | + * @param \phpbbgallery\core\config $gallery_config Core gallery config object | |
| 45 | + * @param \phpbbgallery\core\auth\auth $gallery_auth Core gallery auth object | |
| 46 | + * @param \phpbbgallery\core\url $gallery_url Core gallery url object | |
| 47 | + * @param \phpbbgallery\core\user $gallery_user Core gallery user wraper | |
| 48 | + */ | |
| 49 | 49 | |
| 50 | 50 | 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) | 
| 51 | 51 |  	{ | 
| @@ -146,8 +146,7 @@ | ||
| 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'] = ''; | 
| @@ -140,10 +140,10 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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); | 
| @@ -249,8 +249,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | } | 
| @@ -13,24 +13,24 @@ discard block | ||
| 13 | 13 | class upload | 
| 14 | 14 |  { | 
| 15 | 15 | /** | 
| 16 | - * Number of Files per Directory | |
| 17 | - * | |
| 18 | - * If this constant is set to a value >0 the gallery will create a new directory, | |
| 19 | - * when the current directory has more files in it than set here. | |
| 20 | - */ | |
| 16 | + * Number of Files per Directory | |
| 17 | + * | |
| 18 | + * If this constant is set to a value >0 the gallery will create a new directory, | |
| 19 | + * when the current directory has more files in it than set here. | |
| 20 | + */ | |
| 21 | 21 | const NUM_FILES_PER_DIR = 0; | 
| 22 | 22 | |
| 23 | 23 | /** | 
| 24 | - * Objects: phpBB Upload, 2 Files and Image-Functions | |
| 25 | - */ | |
| 24 | + * Objects: phpBB Upload, 2 Files and Image-Functions | |
| 25 | + */ | |
| 26 | 26 | private $upload = null; | 
| 27 | 27 | private $file = null; | 
| 28 | 28 | private $zip_file = null; | 
| 29 | 29 | //private $tools = null; | 
| 30 | 30 | |
| 31 | 31 | /** | 
| 32 | - * Basic variables... | |
| 33 | - */ | |
| 32 | + * Basic variables... | |
| 33 | + */ | |
| 34 | 34 | public $loaded_files = 0; | 
| 35 | 35 | public $uploaded_files = 0; | 
| 36 | 36 | public $errors = array(); | 
| @@ -158,8 +158,8 @@ discard block | ||
| 158 | 158 | } | 
| 159 | 159 | |
| 160 | 160 | /** | 
| 161 | - * Upload a zip file and save the images into the import/ directory. | |
| 162 | - */ | |
| 161 | + * Upload a zip file and save the images into the import/ directory. | |
| 162 | + */ | |
| 163 | 163 | public function upload_zip() | 
| 164 | 164 |  	{ | 
| 165 | 165 |  		if (!class_exists('compress_zip')) | 
| @@ -307,14 +307,14 @@ discard block | ||
| 307 | 307 |  		$file_link = $this->gallery_url->path('upload') . $this->image_data[$image_id]['image_filename']; | 
| 308 | 308 | |
| 309 | 309 | /** | 
| 310 | - * Event upload image before | |
| 311 | - * | |
| 312 | - * @event phpbbgallery.core.upload.update_image_before | |
| 313 | - * @var array additional_sql_data array of additional settings | |
| 314 | - * @var array image_data array of image_data | |
| 315 | - * @var string file_link link to file | |
| 316 | - * @since 1.2.0 | |
| 317 | - */ | |
| 310 | + * Event upload image before | |
| 311 | + * | |
| 312 | + * @event phpbbgallery.core.upload.update_image_before | |
| 313 | + * @var array additional_sql_data array of additional settings | |
| 314 | + * @var array image_data array of image_data | |
| 315 | + * @var string file_link link to file | |
| 316 | + * @since 1.2.0 | |
| 317 | + */ | |
| 318 | 318 |  		$vars = array('additional_sql_data', 'image_data', 'file_link'); | 
| 319 | 319 |  		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_before', compact($vars))); | 
| 320 | 320 | |
| @@ -322,12 +322,12 @@ discard block | ||
| 322 | 322 | if (!$this->prepare_file_update($image_id)) | 
| 323 | 323 |  		{ | 
| 324 | 324 | /** | 
| 325 | - * Event upload image update | |
| 326 | - * | |
| 327 | - * @event phpbbgallery.core.upload.update_image_nofilechange | |
| 328 | - * @var array additional_sql_data array of additional settings | |
| 329 | - * @since 1.2.0 | |
| 330 | - */ | |
| 325 | + * Event upload image update | |
| 326 | + * | |
| 327 | + * @event phpbbgallery.core.upload.update_image_nofilechange | |
| 328 | + * @var array additional_sql_data array of additional settings | |
| 329 | + * @since 1.2.0 | |
| 330 | + */ | |
| 331 | 331 |  			$vars = array('additional_sql_data'); | 
| 332 | 332 |  			extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.update_image_nofilechange', compact($vars))); | 
| 333 | 333 | } | 
| @@ -345,8 +345,8 @@ discard block | ||
| 345 | 345 | } | 
| 346 | 346 | |
| 347 | 347 | /** | 
| 348 | - * Prepare file on upload: rotate and resize | |
| 349 | - */ | |
| 348 | + * Prepare file on upload: rotate and resize | |
| 349 | + */ | |
| 350 | 350 | public function prepare_file() | 
| 351 | 351 |  	{ | 
| 352 | 352 | $upload_dir = $this->get_current_upload_dir(); | 
| @@ -376,13 +376,13 @@ discard block | ||
| 376 | 376 | $file = $this->file; | 
| 377 | 377 | |
| 378 | 378 | /** | 
| 379 | - * Event upload image update | |
| 380 | - * | |
| 381 | - * @event phpbbgallery.core.upload.prepare_file_before | |
| 382 | - * @var array additional_sql_data array of additional settings | |
| 383 | - * @var array file File object | |
| 384 | - * @since 1.2.0 | |
| 385 | - */ | |
| 379 | + * Event upload image update | |
| 380 | + * | |
| 381 | + * @event phpbbgallery.core.upload.prepare_file_before | |
| 382 | + * @var array additional_sql_data array of additional settings | |
| 383 | + * @var array file File object | |
| 384 | + * @since 1.2.0 | |
| 385 | + */ | |
| 386 | 386 |  		$vars = array('additional_sql_data', 'file'); | 
| 387 | 387 |  		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.upload.prepare_file_before', compact($vars))); | 
| 388 | 388 | |
| @@ -729,8 +729,8 @@ discard block | ||
| 729 | 729 | } | 
| 730 | 730 | |
| 731 | 731 | /** | 
| 732 | - * Generate some kind of check so users only complete the uplaod for their images | |
| 733 | - */ | |
| 732 | + * Generate some kind of check so users only complete the uplaod for their images | |
| 733 | + */ | |
| 734 | 734 | public function generate_hidden_fields() | 
| 735 | 735 |  	{ | 
| 736 | 736 | $checks = array(); | 
| @@ -144,8 +144,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 />» ', $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 | ||
| 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 | ||
| 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'))); | 
| @@ -34,18 +34,18 @@ discard block | ||
| 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 | ||
| 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 * | 
| @@ -165,8 +165,7 @@ | ||
| 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 | } | 
| @@ -13,41 +13,41 @@ discard block | ||
| 13 | 13 | class rating | 
| 14 | 14 |  { | 
| 15 | 15 | /** | 
| 16 | - * The image ID we want to rate | |
| 17 | - */ | |
| 16 | + * The image ID we want to rate | |
| 17 | + */ | |
| 18 | 18 | public $image_id = 0; | 
| 19 | 19 | |
| 20 | 20 | /** | 
| 21 | - * Private objects with the values for the image/album from the database | |
| 22 | - */ | |
| 21 | + * Private objects with the values for the image/album from the database | |
| 22 | + */ | |
| 23 | 23 | private $image_data = null; | 
| 24 | 24 | private $album_data = null; | 
| 25 | 25 | |
| 26 | 26 | /** | 
| 27 | - * Rating the user gave the image. | |
| 28 | - */ | |
| 27 | + * Rating the user gave the image. | |
| 28 | + */ | |
| 29 | 29 | public $user_rating = null; | 
| 30 | 30 | |
| 31 | 31 | /** | 
| 32 | - * Is rating currently possible? | |
| 33 | - * Might be blocked because of contest-settings. | |
| 34 | - */ | |
| 32 | + * Is rating currently possible? | |
| 33 | + * Might be blocked because of contest-settings. | |
| 34 | + */ | |
| 35 | 35 | public $rating_enabled = false; | 
| 36 | 36 | |
| 37 | 37 | /** | 
| 38 | - * Classic-rating box with a dropdown. | |
| 39 | - */ | |
| 38 | + * Classic-rating box with a dropdown. | |
| 39 | + */ | |
| 40 | 40 | const MODE_SELECT = 1; | 
| 41 | 41 | |
| 42 | 42 | /** | 
| 43 | - * Rating with stars, like the old-system from youtube. | |
| 43 | + * Rating with stars, like the old-system from youtube. | |
| 44 | 44 | //@todo: const MODE_STARS = 2; | 
| 45 | - */ | |
| 45 | + */ | |
| 46 | 46 | |
| 47 | 47 | /** | 
| 48 | - * Simple thumbs up or down. | |
| 48 | + * Simple thumbs up or down. | |
| 49 | 49 | //@todo: const MODE_THUMB = 3; | 
| 50 | - */ | |
| 50 | + */ | |
| 51 | 51 | |
| 52 | 52 | /** | 
| 53 | 53 | * Constructor | 
| @@ -154,8 +154,8 @@ discard block | ||
| 154 | 154 | } | 
| 155 | 155 | |
| 156 | 156 | /** | 
| 157 | - * Displays the box where the user can rate the image. | |
| 158 | - */ | |
| 157 | + * Displays the box where the user can rate the image. | |
| 158 | + */ | |
| 159 | 159 | public function display_box() | 
| 160 | 160 |  	{ | 
| 161 | 161 |  		$this->template->assign_var('GALLERY_RATING', self::MODE_SELECT);//@todo: phpbb_ext_gallery_core_config::get('rating_mode')); | 
| @@ -230,8 +230,8 @@ discard block | ||
| 230 | 230 | } | 
| 231 | 231 | |
| 232 | 232 | /** | 
| 233 | - * Get rated value for a image | |
| 234 | - */ | |
| 233 | + * Get rated value for a image | |
| 234 | + */ | |
| 235 | 235 | private function get_image_rating_value() | 
| 236 | 236 |  	{ | 
| 237 | 237 | /*if (phpbb_ext_gallery_core_contest::$mode == phpbb_ext_gallery_core_contest::MODE_SUM) | 
| @@ -245,14 +245,14 @@ discard block | ||
| 245 | 245 | } | 
| 246 | 246 | |
| 247 | 247 | /** | 
| 248 | - * Is the user allowed to rate? | |
| 249 | - * Following statements must be true: | |
| 250 | - * - User must have permissions. | |
| 251 | - * - User is neither owner of the image nor guest. | |
| 252 | - * - Album and image are not locked. | |
| 253 | - * | |
| 254 | - * @return bool | |
| 255 | - */ | |
| 248 | + * Is the user allowed to rate? | |
| 249 | + * Following statements must be true: | |
| 250 | + * - User must have permissions. | |
| 251 | + * - User is neither owner of the image nor guest. | |
| 252 | + * - Album and image are not locked. | |
| 253 | + * | |
| 254 | + * @return bool | |
| 255 | + */ | |
| 256 | 256 | public function is_allowed() | 
| 257 | 257 |  	{ | 
| 258 | 258 |  		return $this->gallery_auth->acl_check('i_rate', $this->album_data('album_id'), $this->album_data('album_user_id')) && | 
| @@ -261,25 +261,25 @@ discard block | ||
| 261 | 261 | } | 
| 262 | 262 | |
| 263 | 263 | /** | 
| 264 | - * Is the user able to rate? | |
| 265 | - * Following statements must be true: | |
| 266 | - * - User must be allowed to rate | |
| 267 | - * - If the image is in a contest, it must be in the rating timespan | |
| 268 | - * | |
| 269 | - * @return bool | |
| 270 | - */ | |
| 264 | + * Is the user able to rate? | |
| 265 | + * Following statements must be true: | |
| 266 | + * - User must be allowed to rate | |
| 267 | + * - If the image is in a contest, it must be in the rating timespan | |
| 268 | + * | |
| 269 | + * @return bool | |
| 270 | + */ | |
| 271 | 271 | public function is_able() | 
| 272 | 272 |  	{ | 
| 273 | 273 |  		return $this->is_allowed(); //&& phpbb_ext_gallery_core_contest::is_step('rate', $this->album_data(true)); | 
| 274 | 274 | } | 
| 275 | 275 | |
| 276 | 276 | /** | 
| 277 | - * Get rating from a user for a given image | |
| 278 | - * | |
| 279 | - * @param int $user_id | |
| 280 | - * | |
| 281 | - * @return mixed False if the user did not rate or is guest, otherwise int the points. | |
| 282 | - */ | |
| 277 | + * Get rating from a user for a given image | |
| 278 | + * | |
| 279 | + * @param int $user_id | |
| 280 | + * | |
| 281 | + * @return mixed False if the user did not rate or is guest, otherwise int the points. | |
| 282 | + */ | |
| 283 | 283 | public function get_user_rating($user_id) | 
| 284 | 284 |  	{ | 
| 285 | 285 | if (isset($this->user_rating[$user_id])) | 
| @@ -355,10 +355,10 @@ discard block | ||
| 355 | 355 | } | 
| 356 | 356 | |
| 357 | 357 | /** | 
| 358 | - * Recalculate the average image-rating and such stuff. | |
| 359 | - * | |
| 360 | - * @param mixed $image_ids Array or integer with image_id where we recalculate the rating. | |
| 361 | - */ | |
| 358 | + * Recalculate the average image-rating and such stuff. | |
| 359 | + * | |
| 360 | + * @param mixed $image_ids Array or integer with image_id where we recalculate the rating. | |
| 361 | + */ | |
| 362 | 362 | public function recalc_image_rating($image_ids) | 
| 363 | 363 |  	{ | 
| 364 | 364 | if (is_array($image_ids)) | 
| @@ -389,11 +389,11 @@ discard block | ||
| 389 | 389 | } | 
| 390 | 390 | |
| 391 | 391 | /** | 
| 392 | - * Delete all ratings for given image_ids | |
| 393 | - * | |
| 394 | - * @param mixed $image_ids Array or integer with image_id where we delete the rating. | |
| 395 | - * @param bool $reset_average Shall we also reset the average? We can save that query, when the images are deleted anyway. | |
| 396 | - */ | |
| 392 | + * Delete all ratings for given image_ids | |
| 393 | + * | |
| 394 | + * @param mixed $image_ids Array or integer with image_id where we delete the rating. | |
| 395 | + * @param bool $reset_average Shall we also reset the average? We can save that query, when the images are deleted anyway. | |
| 396 | + */ | |
| 397 | 397 | public function delete_ratings($image_ids, $reset_average = false) | 
| 398 | 398 |  	{ | 
| 399 | 399 | if (is_array($image_ids)) | 
| @@ -216,8 +216,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | } | 
| @@ -190,13 +190,13 @@ discard block | ||
| 190 | 190 | } | 
| 191 | 191 | |
| 192 | 192 | /** | 
| 193 | - * Event delete images | |
| 194 | - * | |
| 195 | - * @event phpbbgallery.core.image.delete_images | |
| 196 | - * @var array images array of the image ids we are deleting | |
| 197 | - * @var array filenames array of the image filenames | |
| 198 | - * @since 1.2.0 | |
| 199 | - */ | |
| 193 | + * Event delete images | |
| 194 | + * | |
| 195 | + * @event phpbbgallery.core.image.delete_images | |
| 196 | + * @var array images array of the image ids we are deleting | |
| 197 | + * @var array filenames array of the image filenames | |
| 198 | + * @since 1.2.0 | |
| 199 | + */ | |
| 200 | 200 |  		$vars = array('images', 'filenames'); | 
| 201 | 201 |  		extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.delete_images', compact($vars))); | 
| 202 | 202 | |
| @@ -256,11 +256,11 @@ discard block | ||
| 256 | 256 | } | 
| 257 | 257 | |
| 258 | 258 | /** | 
| 259 | - * Get the real filenames, so we can load/delete/edit the image-file. | |
| 260 | - * | |
| 261 | - * @param mixed $images Array or integer with the image_id(s) | |
| 262 | - * @return array Format: $image_id => $filename | |
| 263 | - */ | |
| 259 | + * Get the real filenames, so we can load/delete/edit the image-file. | |
| 260 | + * | |
| 261 | + * @param mixed $images Array or integer with the image_id(s) | |
| 262 | + * @return array Format: $image_id => $filename | |
| 263 | + */ | |
| 264 | 264 | public function get_filenames($images) | 
| 265 | 265 |  	{ | 
| 266 | 266 | if (empty($images)) | 
| @@ -375,13 +375,13 @@ discard block | ||
| 375 | 375 |  				$tpl = '{CONTENT}'; | 
| 376 | 376 | |
| 377 | 377 | /** | 
| 378 | - * Event generate link | |
| 379 | - * | |
| 380 | - * @event phpbbgallery.core.image.generate_link | |
| 381 | - * @var string mode type of link | |
| 382 | - * @var string tpl html to be outputed | |
| 383 | - * @since 1.2.0 | |
| 384 | - */ | |
| 378 | + * Event generate link | |
| 379 | + * | |
| 380 | + * @event phpbbgallery.core.image.generate_link | |
| 381 | + * @var string mode type of link | |
| 382 | + * @var string tpl html to be outputed | |
| 383 | + * @since 1.2.0 | |
| 384 | + */ | |
| 385 | 385 |  				$vars = array('mode', 'tpl'); | 
| 386 | 386 |  				extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event | 
| 387 | 387 | break; | 
| @@ -391,12 +391,12 @@ discard block | ||
| 391 | 391 | } | 
| 392 | 392 | |
| 393 | 393 | /** | 
| 394 | - * Handle user- & total image_counter | |
| 395 | - * | |
| 396 | - * @param array $image_id_ary array with the image_ids which changed their status | |
| 397 | - * @param bool $add are we adding or removing the images | |
| 398 | - * @param bool $readd is it possible that there are images which aren't really changed | |
| 399 | - */ | |
| 394 | + * Handle user- & total image_counter | |
| 395 | + * | |
| 396 | + * @param array $image_id_ary array with the image_ids which changed their status | |
| 397 | + * @param bool $add are we adding or removing the images | |
| 398 | + * @param bool $readd is it possible that there are images which aren't really changed | |
| 399 | + */ | |
| 400 | 400 | public function handle_counter($image_id_ary, $add, $readd = false) | 
| 401 | 401 |  	{ | 
| 402 | 402 | if (empty($image_id_ary)) | 
| @@ -467,11 +467,11 @@ discard block | ||
| 467 | 467 | } | 
| 468 | 468 | |
| 469 | 469 | /** | 
| 470 | - * Approve image | |
| 471 | - * @param (array) $image_id_ary The image ID array to be approved | |
| 472 | - * @param (int) $album_id The album image is approved to (just save some queries for log) | |
| 473 | - * return 0 on success | |
| 474 | - */ | |
| 470 | + * Approve image | |
| 471 | + * @param (array) $image_id_ary The image ID array to be approved | |
| 472 | + * @param (int) $album_id The album image is approved to (just save some queries for log) | |
| 473 | + * return 0 on success | |
| 474 | + */ | |
| 475 | 475 | public function approve_images($image_id_ary, $album_id) | 
| 476 | 476 |  	{ | 
| 477 | 477 | $sql = 'SELECT image_id, image_name, image_user_id | 
| @@ -507,10 +507,10 @@ discard block | ||
| 507 | 507 | } | 
| 508 | 508 | |
| 509 | 509 | /** | 
| 510 | - * UnApprove image | |
| 511 | - * @param (array) $image_id_ary The image ID array to be unapproved | |
| 512 | - * @param (int) $album_id The album image is approved to (just save some queries for log) | |
| 513 | - */ | |
| 510 | + * UnApprove image | |
| 511 | + * @param (array) $image_id_ary The image ID array to be unapproved | |
| 512 | + * @param (int) $album_id The album image is approved to (just save some queries for log) | |
| 513 | + */ | |
| 514 | 514 | public function unapprove_images($image_id_ary, $album_id) | 
| 515 | 515 |  	{ | 
| 516 | 516 | self::handle_counter($image_id_ary, false); | 
| @@ -563,10 +563,10 @@ discard block | ||
| 563 | 563 | } | 
| 564 | 564 | |
| 565 | 565 | /** | 
| 566 | - * Lock images | |
| 567 | - * @param (array) $image_id_ary Array of images we want to lock | |
| 568 | - * @param (int) $album_id Album id, so we can log the action | |
| 569 | - */ | |
| 566 | + * Lock images | |
| 567 | + * @param (array) $image_id_ary Array of images we want to lock | |
| 568 | + * @param (int) $album_id Album id, so we can log the action | |
| 569 | + */ | |
| 570 | 570 | public function lock_images($image_id_ary, $album_id) | 
| 571 | 571 |  	{ | 
| 572 | 572 | self::handle_counter($image_id_ary, false); | 
| @@ -590,9 +590,9 @@ discard block | ||
| 590 | 590 | } | 
| 591 | 591 | |
| 592 | 592 | /** | 
| 593 | - * Get last image id | |
| 594 | - * Return (int) image_id | |
| 595 | - **/ | |
| 593 | + * Get last image id | |
| 594 | + * Return (int) image_id | |
| 595 | + **/ | |
| 596 | 596 | public function get_last_image() | 
| 597 | 597 |  	{ | 
| 598 | 598 | $this->gallery_auth->load_user_premissions($this->user->data['user_id']); | 
| @@ -363,8 +363,7 @@ discard block | ||
| 363 | 363 |  				{ | 
| 364 | 364 |  					$url = $this->url->append_sid('image_page', "album_id=$album_id&image_id=$next_image{$additional_parameters}"); | 
| 365 | 365 |  					$tpl = '<a href="{IMAGE_URL}" title="{IMAGE_NAME}">{CONTENT}</a>'; | 
| 366 | - } | |
| 367 | - else | |
| 366 | + } else | |
| 368 | 367 |  				{ | 
| 369 | 368 |  					$tpl = '{CONTENT}'; | 
| 370 | 369 | } | 
| @@ -440,8 +439,7 @@ discard block | ||
| 440 | 439 |  		{ | 
| 441 | 440 |  			$this->gallery_config->inc('num_images', (int) $num_images); | 
| 442 | 441 |  			$this->gallery_config->inc('num_comments', (int) $num_comments); | 
| 443 | - } | |
| 444 | - else | |
| 442 | + } else | |
| 445 | 443 |  		{ | 
| 446 | 444 |  			$this->gallery_config->dec('num_images', (int) $num_images); | 
| 447 | 445 |  			$this->gallery_config->dec('num_comments', (int) $num_comments); | 
| @@ -98,12 +98,12 @@ discard block | ||
| 98 | 98 | } | 
| 99 | 99 | |
| 100 | 100 | /** | 
| 101 | - * Image File Controller | |
| 102 | -	*	Route: gallery/image/{image_id}/source | |
| 103 | - * | |
| 104 | - * @param int $image_id | |
| 105 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 106 | - */ | |
| 101 | + * Image File Controller | |
| 102 | +	 *	Route: gallery/image/{image_id}/source | |
| 103 | + * | |
| 104 | + * @param int $image_id | |
| 105 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 106 | + */ | |
| 107 | 107 | public function source($image_id) | 
| 108 | 108 |  	{ | 
| 109 | 109 | $this->auth->load_user_premissions($this->user->data['user_id']); | 
| @@ -155,12 +155,12 @@ discard block | ||
| 155 | 155 | } | 
| 156 | 156 | |
| 157 | 157 | /** | 
| 158 | - * Image File Controller | |
| 159 | -	*	Route: gallery/image/{image_id}/medium | |
| 160 | - * | |
| 161 | - * @param int $image_id | |
| 162 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 163 | - */ | |
| 158 | + * Image File Controller | |
| 159 | +	 *	Route: gallery/image/{image_id}/medium | |
| 160 | + * | |
| 161 | + * @param int $image_id | |
| 162 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 163 | + */ | |
| 164 | 164 | public function medium($image_id) | 
| 165 | 165 |  	{ | 
| 166 | 166 | |
| @@ -190,12 +190,12 @@ discard block | ||
| 190 | 190 | } | 
| 191 | 191 | |
| 192 | 192 | /** | 
| 193 | - * Image File Controller | |
| 194 | -	*	Route: gallery/image/{image_id}/mini | |
| 195 | - * | |
| 196 | - * @param int $image_id | |
| 197 | - * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 198 | - */ | |
| 193 | + * Image File Controller | |
| 194 | +	 *	Route: gallery/image/{image_id}/mini | |
| 195 | + * | |
| 196 | + * @param int $image_id | |
| 197 | + * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object | |
| 198 | + */ | |
| 199 | 199 | public function mini($image_id) | 
| 200 | 200 |  	{ | 
| 201 | 201 | $this->path = $this->path_mini; | 
| @@ -354,11 +354,11 @@ discard block | ||
| 354 | 354 | } | 
| 355 | 355 | |
| 356 | 356 | /** | 
| 357 | - * Image File Controller | |
| 358 | -	*	Route: gallery/image/{image_id}/x | |
| 359 | - * | |
| 360 | - * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object | |
| 361 | - */ | |
| 357 | + * Image File Controller | |
| 358 | +	 *	Route: gallery/image/{image_id}/x | |
| 359 | + * | |
| 360 | + * @return \Symfony\Component\HttpFoundation\BinaryFileResponseResponse A Symfony Response object | |
| 361 | + */ | |
| 362 | 362 | public function display() | 
| 363 | 363 |  	{ | 
| 364 | 364 |  		$this->tool->set_last_modified($this->gallery_user->get_data('user_permissions_changed')); | 
| @@ -234,8 +234,7 @@ discard block | ||
| 234 | 234 | $this->data['image_filemissing'] = 0; | 
| 235 | 235 | $this->data['image_filemissing'] = 0; | 
| 236 | 236 | $this->data['album_watermark'] = 0; | 
| 237 | - } | |
| 238 | - else | |
| 237 | + } else | |
| 239 | 238 |  		{ | 
| 240 | 239 | $sql = 'SELECT * | 
| 241 | 240 | FROM ' . $this->table_images . ' i | 
| @@ -398,8 +397,7 @@ discard block | ||
| 398 | 397 |  			{ | 
| 399 | 398 |  				$response->headers->set('expires', '-1'); | 
| 400 | 399 | } | 
| 401 | - } | |
| 402 | - else | |
| 400 | + } else | |
| 403 | 401 |  		{ | 
| 404 | 402 |  			$response->headers->set('Content-Disposition', 'inline; ' . $this->tool->header_filename(htmlspecialchars_decode($this->tool->image_name)) . '.' . ($this->tool->image_type == 'jpeg' ? 'jpg' : $this->tool->image_type)); | 
| 405 | 403 | if ($this->tool->is_ie_greater7($this->user->browser)) | 
| @@ -249,8 +249,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | } |