@@ -15,74 +15,74 @@ 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 | - * Original status of the Exif data. |
|
72 | - */ |
|
71 | + * Original status of the Exif data. |
|
72 | + */ |
|
73 | 73 | public $orig_status = null; |
74 | 74 | |
75 | 75 | /** |
76 | - * Image-ID, just needed to update the Exif status |
|
77 | - */ |
|
76 | + * Image-ID, just needed to update the Exif status |
|
77 | + */ |
|
78 | 78 | public $image_id = false; |
79 | 79 | |
80 | 80 | /** |
81 | - * Constructor |
|
82 | - * |
|
83 | - * @param string $file Full link to the image-file |
|
84 | - * @param mixed $image_id False or integer |
|
85 | - */ |
|
81 | + * Constructor |
|
82 | + * |
|
83 | + * @param string $file Full link to the image-file |
|
84 | + * @param mixed $image_id False or integer |
|
85 | + */ |
|
86 | 86 | public function __construct($file, $image_id = false) |
87 | 87 | { |
88 | 88 | if (self::$function_exists === null) |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | - * Intepret the values from the database, and read the data if we don't have it. |
|
102 | - * |
|
103 | - * @param int $status Value of a status constant (see beginning of the class) |
|
104 | - * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
105 | - */ |
|
101 | + * Intepret the values from the database, and read the data if we don't have it. |
|
102 | + * |
|
103 | + * @param int $status Value of a status constant (see beginning of the class) |
|
104 | + * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
105 | + */ |
|
106 | 106 | public function interpret($status, $data) |
107 | 107 | { |
108 | 108 | $this->orig_status = $status; |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Read Exif data from the image |
|
122 | - */ |
|
121 | + * Read Exif data from the image |
|
122 | + */ |
|
123 | 123 | public function read() |
124 | 124 | { |
125 | 125 | if (!self::$function_exists || !$this->file || !file_exists($this->file)) |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * Validate and prepare the data, so we can send it into the template. |
|
169 | - */ |
|
168 | + * Validate and prepare the data, so we can send it into the template. |
|
169 | + */ |
|
170 | 170 | private function prepare_data() |
171 | 171 | { |
172 | 172 | global $user; |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | /** |
276 | - * Sends the Exif into the template |
|
277 | - * |
|
278 | - * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
279 | - * @param string $block Name of the template loop the Exifs are displayed in. |
|
280 | - */ |
|
276 | + * Sends the Exif into the template |
|
277 | + * |
|
278 | + * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
279 | + * @param string $block Name of the template loop the Exifs are displayed in. |
|
280 | + */ |
|
281 | 281 | public function send_to_template($expand_view = true, $block = 'exif_value') |
282 | 282 | { |
283 | 283 | $this->prepare_data(); |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
304 | - * Save the new Exif status in the database |
|
305 | - */ |
|
304 | + * Save the new Exif status in the database |
|
305 | + */ |
|
306 | 306 | public function set_status() |
307 | 307 | { |
308 | 308 | if (!$this->image_id || ($this->orig_status == $this->status)) |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
323 | - * There are lots of possible Exif Groups and Values. |
|
324 | - * But you will never heard of the missing ones. so we just allow the most common ones. |
|
325 | - */ |
|
323 | + * There are lots of possible Exif Groups and Values. |
|
324 | + * But you will never heard of the missing ones. so we just allow the most common ones. |
|
325 | + */ |
|
326 | 326 | static private $allowed_groups = array( |
327 | 327 | 'EXIF', |
328 | 328 | 'IFD0', |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * Default value for new users |
19 | 19 | */ |
20 | - const DEFAULT_DISPLAY = true; |
|
20 | + const DEFAULT_DISPLAY = true; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * phpBB will treat the time from the Exif data like UTC. |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | * |
27 | 27 | * Offset must be set in seconds. |
28 | 28 | */ |
29 | - const TIME_OFFSET = 0; |
|
29 | + const TIME_OFFSET = 0; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Constants for the status of the Exif data. |
33 | 33 | */ |
34 | - const UNAVAILABLE = 0; |
|
35 | - const AVAILABLE = 1; |
|
34 | + const UNAVAILABLE = 0; |
|
35 | + const AVAILABLE = 1; |
|
36 | 36 | const UNKNOWN = 2; |
37 | 37 | const DBSAVED = 3; |
38 | 38 | |
@@ -44,28 +44,28 @@ discard block |
||
44 | 44 | /** |
45 | 45 | * Exif data array with all allowed groups and keys. |
46 | 46 | */ |
47 | - public $data = array(); |
|
47 | + public $data = array(); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Filtered data array. We don't have empty or invalid values here. |
51 | 51 | */ |
52 | - public $prepared_data = array(); |
|
52 | + public $prepared_data = array(); |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Does the image have exif data? |
56 | 56 | * Values see constant declaration at the beginning of the class. |
57 | 57 | */ |
58 | - public $status = 2; |
|
58 | + public $status = 2; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Full data array, but serialized to a string |
62 | 62 | */ |
63 | - public $serialized = ''; |
|
63 | + public $serialized = ''; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * Full link to the image-file |
67 | 67 | */ |
68 | - public $file = ''; |
|
68 | + public $file = ''; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Original status of the Exif data. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * Image-ID, just needed to update the Exif status |
77 | 77 | */ |
78 | - public $image_id = false; |
|
78 | + public $image_id = false; |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Constructor |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | else if ($num) |
208 | 208 | { |
209 | - $exif_exposure = ' 1/' . $den / $num ; |
|
209 | + $exif_exposure = ' 1/' . $den / $num; |
|
210 | 210 | } |
211 | 211 | if ($exif_exposure) |
212 | 212 | { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | if (isset($this->data["EXIF"]["ExposureBiasValue"])) |
251 | 251 | { |
252 | - list($num,$den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
252 | + list($num, $den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
253 | 253 | if ($den) |
254 | 254 | { |
255 | 255 | if (($num / $den) == 0) |
@@ -323,12 +323,12 @@ discard block |
||
323 | 323 | * There are lots of possible Exif Groups and Values. |
324 | 324 | * But you will never heard of the missing ones. so we just allow the most common ones. |
325 | 325 | */ |
326 | - static private $allowed_groups = array( |
|
326 | + static private $allowed_groups = array( |
|
327 | 327 | 'EXIF', |
328 | 328 | 'IFD0', |
329 | 329 | ); |
330 | 330 | |
331 | - static private $allowed_keys = array( |
|
331 | + static private $allowed_keys = array( |
|
332 | 332 | 'DateTimeOriginal', |
333 | 333 | 'FocalLength', |
334 | 334 | 'ExposureTime', |
@@ -13,91 +13,91 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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)) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | protected $reports_table; |
65 | 65 | |
66 | 66 | public function __construct(\phpbbgallery\core\log $gallery_log, \phpbbgallery\core\auth\auth $gallery_auth, \phpbb\user $user, |
67 | - \phpbb\language\language $language, \phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader, |
|
67 | + \phpbb\language\language $language, \phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader, |
|
68 | 68 | \phpbbgallery\core\album\album $album, \phpbb\template\template $template, \phpbb\controller\helper $helper, |
69 | 69 | \phpbbgallery\core\config $gallery_config, \phpbb\pagination $pagination, \phpbbgallery\core\notification\helper $notification_helper, |
70 | 70 | $images_table, $reports_table) |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | 'REPORT_TIME' => $this->user->format_date($VAR['report_time']), |
364 | 364 | )); |
365 | 365 | unset($album_tmp); |
366 | - $reported_images_count ++; |
|
366 | + $reported_images_count++; |
|
367 | 367 | } |
368 | 368 | $this->template->assign_vars(array( |
369 | 369 | 'TOTAL_IMAGES_REPORTED' => $status == 1 ? $this->language->lang('WAITING_REPORTED_IMAGE', (int) $count) : $this->language->lang('WAITING_REPORTED_DONE', (int) $count), |
@@ -13,94 +13,94 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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(); |
@@ -41,57 +41,57 @@ discard block |
||
41 | 41 | protected $acl_cache = array(); |
42 | 42 | |
43 | 43 | /** |
44 | - * Cache object |
|
45 | - * @var \phpbbgallery\core\cache |
|
46 | - */ |
|
44 | + * Cache object |
|
45 | + * @var \phpbbgallery\core\cache |
|
46 | + */ |
|
47 | 47 | protected $cache; |
48 | 48 | |
49 | 49 | /** |
50 | - * Database object |
|
51 | - * @var \phpbb\db\driver\driver |
|
52 | - */ |
|
50 | + * Database object |
|
51 | + * @var \phpbb\db\driver\driver |
|
52 | + */ |
|
53 | 53 | protected $db; |
54 | 54 | |
55 | 55 | /** |
56 | - * Gallery user object |
|
57 | - * @var \phpbbgallery\core\user |
|
58 | - */ |
|
56 | + * Gallery user object |
|
57 | + * @var \phpbbgallery\core\user |
|
58 | + */ |
|
59 | 59 | protected $user; |
60 | 60 | |
61 | 61 | /** |
62 | - * phpBB user object |
|
63 | - * @var \phpbb\user |
|
64 | - */ |
|
62 | + * phpBB user object |
|
63 | + * @var \phpbb\user |
|
64 | + */ |
|
65 | 65 | protected $phpbb_user; |
66 | 66 | |
67 | 67 | /** |
68 | - * phpBB auth object |
|
69 | - * @var \phpbb\auth\auth |
|
70 | - */ |
|
68 | + * phpBB auth object |
|
69 | + * @var \phpbb\auth\auth |
|
70 | + */ |
|
71 | 71 | protected $auth; |
72 | 72 | |
73 | 73 | /** |
74 | - * Gallery permissions table |
|
75 | - * @var string |
|
76 | - */ |
|
74 | + * Gallery permissions table |
|
75 | + * @var string |
|
76 | + */ |
|
77 | 77 | protected $table_permissions; |
78 | 78 | |
79 | 79 | /** |
80 | - * Gallery permission roles table |
|
81 | - * @var string |
|
82 | - */ |
|
80 | + * Gallery permission roles table |
|
81 | + * @var string |
|
82 | + */ |
|
83 | 83 | protected $table_roles; |
84 | 84 | |
85 | 85 | /** |
86 | - * Gallery users table |
|
87 | - * @var string |
|
88 | - */ |
|
86 | + * Gallery users table |
|
87 | + * @var string |
|
88 | + */ |
|
89 | 89 | protected $table_users; |
90 | 90 | |
91 | 91 | /** |
92 | - * Gallery albums table |
|
93 | - * @var string |
|
94 | - */ |
|
92 | + * Gallery albums table |
|
93 | + * @var string |
|
94 | + */ |
|
95 | 95 | protected $table_albums; |
96 | 96 | |
97 | 97 | /** |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
342 | - * Merge the NEVER-options into the YES-options by removing the YES, if it is set. |
|
343 | - */ |
|
342 | + * Merge the NEVER-options into the YES-options by removing the YES, if it is set. |
|
343 | + */ |
|
344 | 344 | protected function merge_acl_row() |
345 | 345 | { |
346 | 346 | foreach ($this->_auth_data as $album_id => $obj) |
@@ -585,14 +585,14 @@ discard block |
||
585 | 585 | } |
586 | 586 | |
587 | 587 | /** |
588 | - * Get permission |
|
589 | - * |
|
590 | - * @param string $acl One of the permissions, Exp: i_view |
|
591 | - * @param int $a_id The album_id, from which we want to have the permissions |
|
592 | - * @param int $u_id The user_id from the album-owner. If not specified we need to get it from the cache. |
|
593 | - * |
|
594 | - * @return bool Is the user allowed to do the $acl? |
|
595 | - */ |
|
588 | + * Get permission |
|
589 | + * |
|
590 | + * @param string $acl One of the permissions, Exp: i_view |
|
591 | + * @param int $a_id The album_id, from which we want to have the permissions |
|
592 | + * @param int $u_id The user_id from the album-owner. If not specified we need to get it from the cache. |
|
593 | + * |
|
594 | + * @return bool Is the user allowed to do the $acl? |
|
595 | + */ |
|
596 | 596 | public function acl_check($acl, $a_id, $u_id = -1) |
597 | 597 | { |
598 | 598 | $bit = self::$_permissions_flipped[$acl]; |
@@ -655,12 +655,12 @@ discard block |
||
655 | 655 | } |
656 | 656 | |
657 | 657 | /** |
658 | - * Does the user have the permission for any album? |
|
659 | - * |
|
660 | - * @param string $acl One of the permissions, Exp: i_view; *_count permissions are not allowed! |
|
661 | - * |
|
662 | - * @return bool Is the user allowed to do the $acl? |
|
663 | - */ |
|
658 | + * Does the user have the permission for any album? |
|
659 | + * |
|
660 | + * @param string $acl One of the permissions, Exp: i_view; *_count permissions are not allowed! |
|
661 | + * |
|
662 | + * @return bool Is the user allowed to do the $acl? |
|
663 | + */ |
|
664 | 664 | public function acl_check_global($acl) |
665 | 665 | { |
666 | 666 | $bit = self::$_permissions_flipped[$acl]; |
@@ -692,16 +692,16 @@ discard block |
||
692 | 692 | } |
693 | 693 | |
694 | 694 | /** |
695 | - * Get albums by permission |
|
696 | - * |
|
697 | - * @param string $acl One of the permissions, Exp: i_view; *_count permissions are not allowed! |
|
698 | - * @param string $return Type of the return value. array returns an array, else it's a string. |
|
699 | - * bool means it only checks whether the user has the permission anywhere. |
|
700 | - * @param bool $display_in_rrc Only return albums, that have the display_in_rrc-flag set. |
|
701 | - * @param bool $display_pegas Include personal galleries in the list. |
|
702 | - * |
|
703 | - * @return mixed $album_ids, either as list or array. |
|
704 | - */ |
|
695 | + * Get albums by permission |
|
696 | + * |
|
697 | + * @param string $acl One of the permissions, Exp: i_view; *_count permissions are not allowed! |
|
698 | + * @param string $return Type of the return value. array returns an array, else it's a string. |
|
699 | + * bool means it only checks whether the user has the permission anywhere. |
|
700 | + * @param bool $display_in_rrc Only return albums, that have the display_in_rrc-flag set. |
|
701 | + * @param bool $display_pegas Include personal galleries in the list. |
|
702 | + * |
|
703 | + * @return mixed $album_ids, either as list or array. |
|
704 | + */ |
|
705 | 705 | public function acl_album_ids($acl, $return = 'array', $display_in_rrc = false, $display_pegas = true) |
706 | 706 | { |
707 | 707 | $bit = self::$_permissions_flipped[$acl]; |