@@ -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 * |
@@ -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']); |
@@ -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')); |
@@ -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 |