@@ -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 | { |
@@ -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); |
@@ -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,8 @@ discard block |
||
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 |
||
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'); |
@@ -111,11 +111,11 @@ |
||
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 |
@@ -825,8 +825,8 @@ |
||
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 | { |
@@ -14,11 +14,11 @@ discard block |
||
14 | 14 | 'phpbbgallery/acpcleanup', |
15 | 15 | ); |
16 | 16 | /** |
17 | - * Single enable step that installs any included migrations |
|
18 | - * |
|
19 | - * @param mixed $old_state State returned by previous call of this method |
|
20 | - * @return mixed Returns false after last step, otherwise temporary state |
|
21 | - */ |
|
17 | + * Single enable step that installs any included migrations |
|
18 | + * |
|
19 | + * @param mixed $old_state State returned by previous call of this method |
|
20 | + * @return mixed Returns false after last step, otherwise temporary state |
|
21 | + */ |
|
22 | 22 | function enable_step($old_state) |
23 | 23 | { |
24 | 24 | switch ($old_state) |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * Single disable step that does nothing |
|
56 | - * |
|
57 | - * @param mixed $old_state State returned by previous call of this method |
|
58 | - * @return mixed Returns false after last step, otherwise temporary state |
|
59 | - */ |
|
55 | + * Single disable step that does nothing |
|
56 | + * |
|
57 | + * @param mixed $old_state State returned by previous call of this method |
|
58 | + * @return mixed Returns false after last step, otherwise temporary state |
|
59 | + */ |
|
60 | 60 | function disable_step($old_state) |
61 | 61 | { |
62 | 62 | switch ($old_state) |
@@ -87,21 +87,21 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * Single purge step that reverts any included and installed migrations |
|
91 | - * |
|
92 | - * @param mixed $old_state State returned by previous call of this method |
|
93 | - * @return mixed Returns false after last step, otherwise temporary state |
|
94 | - */ |
|
90 | + * Single purge step that reverts any included and installed migrations |
|
91 | + * |
|
92 | + * @param mixed $old_state State returned by previous call of this method |
|
93 | + * @return mixed Returns false after last step, otherwise temporary state |
|
94 | + */ |
|
95 | 95 | function purge_step($old_state) |
96 | 96 | { |
97 | 97 | switch ($old_state) |
98 | 98 | { |
99 | 99 | case '': // Empty means nothing has run yet |
100 | 100 | /** |
101 | - * @todo Remove this try/catch condition once purge_notifications is fixed |
|
102 | - * in the core to work with disabled extensions without fatal errors. |
|
103 | - * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
104 | - */ |
|
101 | + * @todo Remove this try/catch condition once purge_notifications is fixed |
|
102 | + * in the core to work with disabled extensions without fatal errors. |
|
103 | + * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
104 | + */ |
|
105 | 105 | try |
106 | 106 | { |
107 | 107 | // Purge board rules notifications |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * Load the data of an album |
|
44 | - * |
|
45 | - * @param int $album_id |
|
46 | - * @return bool True if the album was loaded |
|
47 | - * @throws \OutOfBoundsException if the album does not exist |
|
48 | - */ |
|
43 | + * Load the data of an album |
|
44 | + * |
|
45 | + * @param int $album_id |
|
46 | + * @return bool True if the album was loaded |
|
47 | + * @throws \OutOfBoundsException if the album does not exist |
|
48 | + */ |
|
49 | 49 | public function load($album_id) |
50 | 50 | { |
51 | 51 | $sql_array = array( |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | - * Check whether the album_user is the user who wants to do something |
|
111 | - * |
|
112 | - * @param int $album_id |
|
113 | - * @param mixed $user_id If false the current user will be compared |
|
114 | - * @return bool True if the user is the owner of the album |
|
115 | - * @throws \DomainException if the user is not the owner of the album |
|
116 | - */ |
|
110 | + * Check whether the album_user is the user who wants to do something |
|
111 | + * |
|
112 | + * @param int $album_id |
|
113 | + * @param mixed $user_id If false the current user will be compared |
|
114 | + * @return bool True if the user is the owner of the album |
|
115 | + * @throws \DomainException if the user is not the owner of the album |
|
116 | + */ |
|
117 | 117 | public function validate_owner($album_id, $user_id = false) |
118 | 118 | { |
119 | 119 | $album_id = (int) $album_id; |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
234 | - * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
235 | - * so that they can view them, if they logged in or the error was fixed. |
|
236 | - */ |
|
234 | + * We need to disable the "last-modified" caching for guests and in cases of image-errors, |
|
235 | + * so that they can view them, if they logged in or the error was fixed. |
|
236 | + */ |
|
237 | 237 | public function disable_browser_cache() |
238 | 238 | { |
239 | 239 | $this->browser_cache = false; |
@@ -460,12 +460,12 @@ discard block |
||
460 | 460 | } |
461 | 461 | |
462 | 462 | /** |
463 | - * Delete file from disc. |
|
464 | - * |
|
465 | - * @param mixed $files String with filename or an array of filenames |
|
466 | - * Array-Format: $image_id => $filename |
|
467 | - * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
468 | - */ |
|
463 | + * Delete file from disc. |
|
464 | + * |
|
465 | + * @param mixed $files String with filename or an array of filenames |
|
466 | + * Array-Format: $image_id => $filename |
|
467 | + * @param array $locations Array of valid url::path()s where the image should be deleted from |
|
468 | + */ |
|
469 | 469 | public function delete($files, $locations = array('thumbnail', 'medium', 'upload')) |
470 | 470 | { |
471 | 471 | if (!is_array($files)) |