@@ -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 | { |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | include_once($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); |
198 | 198 | } |
199 | 199 | |
200 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
201 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
200 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
201 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
202 | 202 | $img_status = ($bbcode_status) ? true : false; |
203 | 203 | $url_status = ($this->config['allow_post_links']) ? true : false; |
204 | 204 | $flash_status = false; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | |
307 | 307 | $message_parser = new \parse_message(); |
308 | - $message_parser->message = utf8_normalize_nfc($comment_plain); |
|
308 | + $message_parser->message = utf8_normalize_nfc($comment_plain); |
|
309 | 309 | if ($message_parser->message) |
310 | 310 | { |
311 | 311 | $message_parser->parse(true, true, true, true, false, true, true, true); |
@@ -464,8 +464,8 @@ discard block |
||
464 | 464 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
465 | 465 | } |
466 | 466 | |
467 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
468 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
467 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
468 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
469 | 469 | $img_status = ($bbcode_status) ? true : false; |
470 | 470 | $url_status = ($this->config['allow_post_links']) ? true : false; |
471 | 471 | $flash_status = false; |
@@ -678,8 +678,8 @@ discard block |
||
678 | 678 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
679 | 679 | } |
680 | 680 | |
681 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
682 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
681 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
682 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
683 | 683 | $img_status = ($bbcode_status) ? true : false; |
684 | 684 | $url_status = ($this->config['allow_post_links']) ? true : false; |
685 | 685 | $flash_status = false; |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | 'IMAGE_NAME' => $image_data['image_name'], |
760 | 760 | |
761 | 761 | 'S_SIGNATURE_CHECKED' => (isset($sig_checked) && $sig_checked) ? ' checked="checked"' : '', |
762 | - 'S_ALBUM_ACTION' => append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/'. (int) $comment_id), |
|
762 | + 'S_ALBUM_ACTION' => append_sid($this->url->path('full') . 'comment/' . (int) $image_id . '/edit/' . (int) $comment_id), |
|
763 | 763 | )); |
764 | 764 | |
765 | 765 | if ($submit && !$error) |
@@ -808,8 +808,8 @@ discard block |
||
808 | 808 | include_once($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext); |
809 | 809 | } |
810 | 810 | |
811 | - $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
812 | - $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
811 | + $bbcode_status = ($this->config['allow_bbcode']) ? true : false; |
|
812 | + $smilies_status = ($this->config['allow_smilies']) ? true : false; |
|
813 | 813 | $img_status = ($bbcode_status) ? true : false; |
814 | 814 | $url_status = ($this->config['allow_post_links']) ? true : false; |
815 | 815 | $flash_status = false; |
@@ -213,8 +213,7 @@ discard block |
||
213 | 213 | if (isset($album_data['contest_start'])) |
214 | 214 | { |
215 | 215 | $s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false; |
216 | - } |
|
217 | - else |
|
216 | + } else |
|
218 | 217 | { |
219 | 218 | $s_hide_comment_input = false; |
220 | 219 | } |
@@ -338,14 +337,12 @@ discard block |
||
338 | 337 | $this->notification_helper->notify('new_comment', $data); |
339 | 338 | //$phpbb_gallery_notification->send_notification('image', $image_id, $image_data['image_name']); |
340 | 339 | $message .= $this->language->lang('COMMENT_STORED') . '<br />'; |
341 | - } |
|
342 | - else if ($this->misc->display_captcha('comment')) |
|
340 | + } else if ($this->misc->display_captcha('comment')) |
|
343 | 341 | { |
344 | 342 | $s_captcha_hidden_fields = ($captcha->is_solved()) ? build_hidden_fields($captcha->get_hidden_fields()) : ''; |
345 | 343 | } |
346 | 344 | $sig_checked = ($this->auth->acl_get('u_sig') && isset($_POST['attach_sig'])); |
347 | - } |
|
348 | - else |
|
345 | + } else |
|
349 | 346 | { |
350 | 347 | if ($comment_id != 0) |
351 | 348 | { |
@@ -439,8 +436,7 @@ discard block |
||
439 | 436 | $comment_data = $this->db->sql_fetchrow($result); |
440 | 437 | $this->db->sql_freeresult($result); |
441 | 438 | $image_id = (int) $comment_data['comment_image_id']; |
442 | - } |
|
443 | - else |
|
439 | + } else |
|
444 | 440 | { |
445 | 441 | $this->misc->not_authorised($image_backlink, $image_loginlink); |
446 | 442 | } |
@@ -451,8 +447,7 @@ discard block |
||
451 | 447 | { |
452 | 448 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
453 | 449 | } |
454 | - } |
|
455 | - else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id'])) |
|
450 | + } else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id'])) |
|
456 | 451 | { |
457 | 452 | $this->misc->not_authorised($image_backlink, $image_loginlink); |
458 | 453 | } |
@@ -485,8 +480,7 @@ discard block |
||
485 | 480 | if (isset($album_data['contest_start'])) |
486 | 481 | { |
487 | 482 | $s_hide_comment_input = (time() < ($album_data['contest_start'] + $album_data['contest_end'])) ? true : false; |
488 | - } |
|
489 | - else |
|
483 | + } else |
|
490 | 484 | { |
491 | 485 | $s_hide_comment_input = false; |
492 | 486 | } |
@@ -578,8 +572,7 @@ discard block |
||
578 | 572 | $this->gallery_log->add_log('moderator', 'c_edit', $image_data['image_album_id'], $image_data['image_id'], array('LOG_GALLERY_COMMENT_EDITED', $image_data['image_name'])); |
579 | 573 | } |
580 | 574 | } |
581 | - } |
|
582 | - else |
|
575 | + } else |
|
583 | 576 | { |
584 | 577 | $sig_checked = (bool) $comment_data['comment_signature']; |
585 | 578 | |
@@ -653,8 +646,7 @@ discard block |
||
653 | 646 | $comment_data = $this->db->sql_fetchrow($result); |
654 | 647 | $this->db->sql_freeresult($result); |
655 | 648 | $image_id = (int) $comment_data['comment_image_id']; |
656 | - } |
|
657 | - else |
|
649 | + } else |
|
658 | 650 | { |
659 | 651 | $this->misc->not_authorised($image_backlink, $image_loginlink); |
660 | 652 | } |
@@ -665,8 +657,7 @@ discard block |
||
665 | 657 | { |
666 | 658 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
667 | 659 | } |
668 | - } |
|
669 | - else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id'])) |
|
660 | + } else if (($comment_data['comment_user_id'] != $this->user->data['user_id']) && !$this->gallery_auth->acl_check('m_comments', $album_id, $album_data['album_user_id'])) |
|
670 | 661 | { |
671 | 662 | $this->misc->not_authorised($image_backlink, $image_loginlink); |
672 | 663 | } |
@@ -731,15 +722,13 @@ discard block |
||
731 | 722 | |
732 | 723 | $message = $this->language->lang('DELETED_COMMENT') . '<br />'; |
733 | 724 | $submit = true; |
734 | - } |
|
735 | - else |
|
725 | + } else |
|
736 | 726 | { |
737 | 727 | if (isset($_POST['cancel'])) |
738 | 728 | { |
739 | 729 | $message = $this->language->lang('DELETED_COMMENT_NOT') . '<br />'; |
740 | 730 | $submit = true; |
741 | - } |
|
742 | - else |
|
731 | + } else |
|
743 | 732 | { |
744 | 733 | confirm_box(false, 'DELETE_COMMENT2', $s_hidden_fields); |
745 | 734 | } |
@@ -53,8 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | $bbcode_id = NUM_CORE_BBCODES + 1; |
55 | 55 | } |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | $bbcode_id = NUM_CORE_BBCODES + 1; |
60 | 59 | } |
@@ -63,8 +62,7 @@ discard block |
||
63 | 62 | if ($this->config['enable_mod_rewrite']) |
64 | 63 | { |
65 | 64 | $url .= 'gallery/image/'; |
66 | - } |
|
67 | - else |
|
65 | + } else |
|
68 | 66 | { |
69 | 67 | $url .= 'app.php/gallery/image/'; |
70 | 68 | } |
@@ -118,8 +118,7 @@ |
||
118 | 118 | if (isset(self::$is_dynamic[$name])) |
119 | 119 | { |
120 | 120 | $config->set('phpbb_gallery_' . $name, $value, true); |
121 | - } |
|
122 | - else |
|
121 | + } else |
|
123 | 122 | { |
124 | 123 | $config->set('phpbb_gallery_' . $name, $value); |
125 | 124 | } |
@@ -89,8 +89,7 @@ |
||
89 | 89 | if (is_dir($file)) |
90 | 90 | { |
91 | 91 | $this->recursiveRemoveDirectory($file); |
92 | - } |
|
93 | - else |
|
92 | + } else |
|
94 | 93 | { |
95 | 94 | unlink($file); |
96 | 95 | } |
@@ -111,8 +111,7 @@ |
||
111 | 111 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_image'); |
112 | 112 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_comment'); |
113 | 113 | $phpbb_notifications->purge_notifications('phpbbgallery.core.notification.new_report'); |
114 | - } |
|
115 | - catch (\phpbb\notification\exception $e) |
|
114 | + } catch (\phpbb\notification\exception $e) |
|
116 | 115 | { |
117 | 116 | // continue |
118 | 117 | } |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | ]; |
25 | 25 | |
26 | 26 | /** |
27 | - * Single enable step that installs any included migrations |
|
28 | - * |
|
29 | - * @param mixed $old_state State returned by previous call of this method |
|
30 | - * @return mixed Returns false after last step, otherwise temporary state |
|
31 | - */ |
|
27 | + * Single enable step that installs any included migrations |
|
28 | + * |
|
29 | + * @param mixed $old_state State returned by previous call of this method |
|
30 | + * @return mixed Returns false after last step, otherwise temporary state |
|
31 | + */ |
|
32 | 32 | function enable_step($old_state) |
33 | 33 | { |
34 | 34 | switch ($old_state) |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | - * Single disable step that does nothing |
|
66 | - * |
|
67 | - * @param mixed $old_state State returned by previous call of this method |
|
68 | - * @return mixed Returns false after last step, otherwise temporary state |
|
69 | - */ |
|
65 | + * Single disable step that does nothing |
|
66 | + * |
|
67 | + * @param mixed $old_state State returned by previous call of this method |
|
68 | + * @return mixed Returns false after last step, otherwise temporary state |
|
69 | + */ |
|
70 | 70 | function disable_step($old_state) |
71 | 71 | { |
72 | 72 | switch ($old_state) |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | - * Single purge step that reverts any included and installed migrations |
|
101 | - * |
|
102 | - * @param mixed $old_state State returned by previous call of this method |
|
103 | - * @return mixed Returns false after last step, otherwise temporary state |
|
104 | - */ |
|
100 | + * Single purge step that reverts any included and installed migrations |
|
101 | + * |
|
102 | + * @param mixed $old_state State returned by previous call of this method |
|
103 | + * @return mixed Returns false after last step, otherwise temporary state |
|
104 | + */ |
|
105 | 105 | function purge_step($old_state) |
106 | 106 | { |
107 | 107 | $extensions = $this->container->get('ext.manager'); |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | { |
125 | 125 | case '': // Empty means nothing has run yet |
126 | 126 | /** |
127 | - * @todo Remove this try/catch condition once purge_notifications is fixed |
|
128 | - * in the core to work with disabled extensions without fatal errors. |
|
129 | - * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
130 | - */ |
|
127 | + * @todo Remove this try/catch condition once purge_notifications is fixed |
|
128 | + * in the core to work with disabled extensions without fatal errors. |
|
129 | + * https://tracker.phpbb.com/browse/PHPBB3-12435 |
|
130 | + */ |
|
131 | 131 | try |
132 | 132 | { |
133 | 133 | // Purge board rules notifications |
@@ -111,7 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | $this->container->get('user')->add_lang_ext('phpbbgallery/core', 'install_gallery'); |
113 | 113 | $error_msg = sprintf($this->container->get('user')->lang( |
114 | - 'GALLERY_SUB_EXT_UNINSTALL', implode('<br />', $disabled_sub_exts),count($disabled_sub_exts))); |
|
114 | + 'GALLERY_SUB_EXT_UNINSTALL', implode('<br />', $disabled_sub_exts), count($disabled_sub_exts))); |
|
115 | 115 | trigger_error($error_msg, E_USER_WARNING); |
116 | 116 | } |
117 | 117 |
@@ -147,8 +147,7 @@ discard block |
||
147 | 147 | if (isset($this->config['phpbb_gallery_' . $option])) |
148 | 148 | { |
149 | 149 | $config_ary[$option] = $this->config['phpbb_gallery_' . $option]; |
150 | - } |
|
151 | - else |
|
150 | + } else |
|
152 | 151 | { |
153 | 152 | $config_ary[$option] = $default; |
154 | 153 | } |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | if (isset($this->config['phpbb_gallery_' . $key])) |
162 | 161 | { |
163 | 162 | return $this->config['phpbb_gallery_' . $key]; |
164 | - } |
|
165 | - else |
|
163 | + } else |
|
166 | 164 | { |
167 | 165 | return $this->configs_array[$key]; |
168 | 166 | } |
@@ -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; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | else |
168 | 168 | { |
169 | - $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset; |
|
169 | + $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset(); // - $offset; |
|
170 | 170 | } |
171 | 171 | if (!preg_match('#(\\d{4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{2})#', $contest_data['contest_rating'], $m)) |
172 | 172 | { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | else if (!$start_date_error) |
177 | 177 | { |
178 | - $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
|
178 | + $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset(); //- $offset; |
|
179 | 179 | } |
180 | 180 | if (!preg_match('#(\\d{4})-(\\d{1,2})-(\\d{1,2}) (\\d{1,2}):(\\d{2})#', $contest_data['contest_end'], $m)) |
181 | 181 | { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | else if (!$start_date_error) |
186 | 186 | { |
187 | - $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
|
187 | + $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset(); //- $offset; |
|
188 | 188 | } |
189 | 189 | if (!$start_date_error && !$date_error) |
190 | 190 | { |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | $album_data = $this->gallery_album->get_info($album_id); |
711 | 711 | |
712 | 712 | $sql = 'UPDATE ' . $this->albums_table . ' |
713 | - SET parent_id = ' . (int) $subalbums_to_id .' |
|
713 | + SET parent_id = ' . (int) $subalbums_to_id . ' |
|
714 | 714 | WHERE parent_id = ' . (int) $album_id . ' |
715 | 715 | AND album_user_id = ' . (int) $this->user_id; |
716 | 716 | $this->db->sql_query($sql); |
@@ -738,13 +738,13 @@ discard block |
||
738 | 738 | // Resync tree |
739 | 739 | $sql = 'UPDATE ' . $this->albums_table . ' |
740 | 740 | SET right_id = right_id - ' . (int) $diff . ' |
741 | - WHERE left_id < ' . (int) $album_data['right_id'] . ' AND right_id > ' . (int) $album_data['right_id']. ' |
|
741 | + WHERE left_id < ' . (int) $album_data['right_id'] . ' AND right_id > ' . (int) $album_data['right_id'] . ' |
|
742 | 742 | AND album_user_id = ' . (int) $this->user_id; |
743 | 743 | $this->db->sql_query($sql); |
744 | 744 | |
745 | 745 | $sql = 'UPDATE ' . $this->albums_table . ' |
746 | 746 | SET left_id = left_id - ' . (int) $diff . ', right_id = right_id - ' . (int) $diff . ' |
747 | - WHERE left_id > ' . (int) $album_data['right_id']. ' |
|
747 | + WHERE left_id > ' . (int) $album_data['right_id'] . ' |
|
748 | 748 | AND album_user_id = ' . (int) $this->user_id; |
749 | 749 | $this->db->sql_query($sql); |
750 | 750 | |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | // Now do the dirty job |
1038 | 1038 | $sql = 'UPDATE ' . $this->albums_table . ' |
1039 | 1039 | SET left_id = left_id + CASE |
1040 | - WHEN left_id BETWEEN ' . (int) $move_up_left . ' AND ' . (int) $move_up_right . ' THEN -' .(int) $diff_up . ' |
|
1040 | + WHEN left_id BETWEEN ' . (int) $move_up_left . ' AND ' . (int) $move_up_right . ' THEN -' . (int) $diff_up . ' |
|
1041 | 1041 | ELSE ' .(int) $diff_down . ' |
1042 | 1042 | END, |
1043 | 1043 | right_id = right_id + CASE |
@@ -817,8 +817,8 @@ discard block |
||
817 | 817 | $log_action = implode('_', array($log_action_images, $log_action_albums)); |
818 | 818 | |
819 | 819 | /** |
820 | - * Log what we did |
|
821 | - */ |
|
820 | + * Log what we did |
|
821 | + */ |
|
822 | 822 | switch ($log_action) |
823 | 823 | { |
824 | 824 | case 'MOVE_IMAGES_MOVE_ALBUMS': |
@@ -908,14 +908,14 @@ discard block |
||
908 | 908 | $this->gallery_notification->delete_albums($from_id); |
909 | 909 | |
910 | 910 | /** |
911 | - * Event related to moving album content |
|
912 | - * |
|
913 | - * @event phpbbgallery.core.album.manage.move_album_content |
|
914 | - * @var int from_id Album we are moving from |
|
915 | - * @var int to_id Album we are moving to |
|
916 | - * @var bool sync Should we sync the albums data |
|
917 | - * @since 1.2.0 |
|
918 | - */ |
|
911 | + * Event related to moving album content |
|
912 | + * |
|
913 | + * @event phpbbgallery.core.album.manage.move_album_content |
|
914 | + * @var int from_id Album we are moving from |
|
915 | + * @var int to_id Album we are moving to |
|
916 | + * @var bool sync Should we sync the albums data |
|
917 | + * @since 1.2.0 |
|
918 | + */ |
|
919 | 919 | $vars = array('from_id', 'to_id', 'sync'); |
920 | 920 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.move_album_content', compact($vars))); |
921 | 921 | |
@@ -1017,12 +1017,12 @@ discard block |
||
1017 | 1017 | $this->gallery_config->set('num_comments', (int) $row['num_comments']); |
1018 | 1018 | |
1019 | 1019 | /** |
1020 | - * Event delete album content |
|
1021 | - * |
|
1022 | - * @event phpbbgallery.core.album.manage.delete_album_content |
|
1023 | - * @var int album_id Album we are deleting |
|
1024 | - * @since 1.2.0 |
|
1025 | - */ |
|
1020 | + * Event delete album content |
|
1021 | + * |
|
1022 | + * @event phpbbgallery.core.album.manage.delete_album_content |
|
1023 | + * @var int album_id Album we are deleting |
|
1024 | + * @since 1.2.0 |
|
1025 | + */ |
|
1026 | 1026 | $vars = array('album_id'); |
1027 | 1027 | extract($this->dispatcher->trigger_event('phpbbgallery.core.album.manage.delete_album_content', compact($vars))); |
1028 | 1028 | |
@@ -1045,11 +1045,11 @@ discard block |
||
1045 | 1045 | public function move_album_by($album_row, $action = 'move_up', $steps = 1) |
1046 | 1046 | { |
1047 | 1047 | /** |
1048 | - * Fetch all the siblings between the module's current spot |
|
1049 | - * and where we want to move it to. If there are less than $steps |
|
1050 | - * siblings between the current spot and the target then the |
|
1051 | - * module will move as far as possible |
|
1052 | - */ |
|
1048 | + * Fetch all the siblings between the module's current spot |
|
1049 | + * and where we want to move it to. If there are less than $steps |
|
1050 | + * siblings between the current spot and the target then the |
|
1051 | + * module will move as far as possible |
|
1052 | + */ |
|
1053 | 1053 | $sql = 'SELECT album_id, album_name, left_id, right_id |
1054 | 1054 | FROM ' . $this->albums_table . ' |
1055 | 1055 | WHERE parent_id = ' . (int) $album_row['parent_id'] . ' |
@@ -1071,12 +1071,12 @@ discard block |
||
1071 | 1071 | } |
1072 | 1072 | |
1073 | 1073 | /** |
1074 | - * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
1075 | - * $diff_up and $diff_down are the values to subtract or add to each node's left_id |
|
1076 | - * and right_id in order to move them up or down. |
|
1077 | - * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
1078 | - * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
1079 | - */ |
|
1074 | + * $left_id and $right_id define the scope of the nodes that are affected by the move. |
|
1075 | + * $diff_up and $diff_down are the values to subtract or add to each node's left_id |
|
1076 | + * and right_id in order to move them up or down. |
|
1077 | + * $move_up_left and $move_up_right define the scope of the nodes that are moving |
|
1078 | + * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down. |
|
1079 | + */ |
|
1080 | 1080 | if ($action == 'move_up') |
1081 | 1081 | { |
1082 | 1082 | $left_id = $target['left_id']; |
@@ -216,8 +216,7 @@ discard block |
||
216 | 216 | if ($this->user->data['user_timezone'] == '') |
217 | 217 | { |
218 | 218 | $timezone = 'UTC'; |
219 | - } |
|
220 | - else |
|
219 | + } else |
|
221 | 220 | { |
222 | 221 | $timezone = $this->user->data['user_timezone']; |
223 | 222 | } |
@@ -229,8 +228,7 @@ discard block |
||
229 | 228 | { |
230 | 229 | $errors[] = sprintf($this->language->lang('CONTEST_START_INVALID'), $contest_data['contest_start']); |
231 | 230 | $start_date_error = true; |
232 | - } |
|
233 | - else |
|
231 | + } else |
|
234 | 232 | { |
235 | 233 | $contest_data['contest_start'] = gmmktime((int) $m[4], (int) $m[5], 0, (int) $m[2], (int) $m[3], (int) $m[1]) - $time->getOffset();// - $offset; |
236 | 234 | } |
@@ -238,8 +236,7 @@ discard block |
||
238 | 236 | { |
239 | 237 | $errors[] = sprintf($this->language->lang('CONTEST_RATING_INVALID'), $contest_data['contest_rating']); |
240 | 238 | $date_error = true; |
241 | - } |
|
242 | - else if (!$start_date_error) |
|
239 | + } else if (!$start_date_error) |
|
243 | 240 | { |
244 | 241 | $contest_data['contest_rating'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
245 | 242 | } |
@@ -247,8 +244,7 @@ discard block |
||
247 | 244 | { |
248 | 245 | $errors[] = sprintf($this->language->lang('CONTEST_END_INVALID'), $contest_data['contest_end']); |
249 | 246 | $date_error = true; |
250 | - } |
|
251 | - else if (!$start_date_error) |
|
247 | + } else if (!$start_date_error) |
|
252 | 248 | { |
253 | 249 | $contest_data['contest_end'] = gmmktime($m[4], $m[5], 0, $m[2], $m[3], $m[1]) - $contest_data['contest_start'] - $time->getOffset();//- $offset; |
254 | 250 | } |
@@ -336,8 +332,7 @@ discard block |
||
336 | 332 | |
337 | 333 | $album_data_sql['left_id'] = $row['right_id']; |
338 | 334 | $album_data_sql['right_id'] = $row['right_id'] + 1; |
339 | - } |
|
340 | - else |
|
335 | + } else |
|
341 | 336 | { |
342 | 337 | $sql = 'UPDATE ' . $this->albums_table . ' |
343 | 338 | SET left_id = left_id + 2, right_id = right_id + 2 |
@@ -354,8 +349,7 @@ discard block |
||
354 | 349 | $album_data_sql['left_id'] = $row['left_id'] + 1; |
355 | 350 | $album_data_sql['right_id'] = $row['left_id'] + 2; |
356 | 351 | } |
357 | - } |
|
358 | - else |
|
352 | + } else |
|
359 | 353 | { |
360 | 354 | if (!$add_on_top) |
361 | 355 | { |
@@ -368,8 +362,7 @@ discard block |
||
368 | 362 | |
369 | 363 | $album_data_sql['left_id'] = $row['right_id'] + 1; |
370 | 364 | $album_data_sql['right_id'] = $row['right_id'] + 2; |
371 | - } |
|
372 | - else |
|
365 | + } else |
|
373 | 366 | { |
374 | 367 | $sql = 'UPDATE ' . $this->albums_table . ' |
375 | 368 | SET left_id = left_id + 2, right_id = right_id + 2 |
@@ -402,8 +395,7 @@ discard block |
||
402 | 395 | $this->db->sql_query($sql); |
403 | 396 | } |
404 | 397 | $this->gallery_log->add_log('admin', 'add', $album_data['album_id'], 0, array('LOG_ALBUM_ADD', $album_data['album_name'])); |
405 | - } |
|
406 | - else |
|
398 | + } else |
|
407 | 399 | { |
408 | 400 | $row = $this->gallery_album->get_info($album_data_sql['album_id']); |
409 | 401 | $reset_marked_images = false; |
@@ -414,22 +406,19 @@ discard block |
||
414 | 406 | // Changing a contest to category? No! |
415 | 407 | $errors[] = $this->language->lang('ALBUM_WITH_CONTEST_NO_TYPE_CHANGE'); |
416 | 408 | return $errors; |
417 | - } |
|
418 | - else if ($row['album_type'] != (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) |
|
409 | + } else if ($row['album_type'] != (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) |
|
419 | 410 | { |
420 | 411 | // Changing a album to contest? No! |
421 | 412 | // Changing a category to contest? No! |
422 | 413 | $errors[] = $this->language->lang('ALBUM_NO_TYPE_CHANGE_TO_CONTEST'); |
423 | 414 | return $errors; |
424 | - } |
|
425 | - else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD) |
|
415 | + } else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD) |
|
426 | 416 | { |
427 | 417 | // Changing a category to a album? Yes! |
428 | 418 | // Reset the data (you couldn't upload directly in a cat, you must use a album) |
429 | 419 | $album_data_sql['album_images'] = $album_data_sql['album_images_real'] = $album_data_sql['album_last_image_id'] = $album_data_sql['album_last_user_id'] = $album_data_sql['album_last_image_time'] = $album_data_sql['album_contest'] = 0; |
430 | 420 | $album_data_sql['album_last_username'] = $album_data_sql['album_last_user_colour'] = $album_data_sql['album_last_image_name'] = ''; |
431 | - } |
|
432 | - else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT) |
|
421 | + } else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_UPLOAD && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CAT) |
|
433 | 422 | { |
434 | 423 | // Changing a album to a category? Yes! |
435 | 424 | // we're turning a uploadable album into a non-uploadable album |
@@ -440,22 +429,18 @@ discard block |
||
440 | 429 | if ($to_album_id) |
441 | 430 | { |
442 | 431 | $errors = $this->move_album_content($album_data_sql['album_id'], $to_album_id); |
443 | - } |
|
444 | - else |
|
432 | + } else |
|
445 | 433 | { |
446 | 434 | return array($this->language->lang('NO_DESTINATION_ALBUM')); |
447 | 435 | } |
448 | - } |
|
449 | - else if ($album_data_sql['type_action'] == 'delete') |
|
436 | + } else if ($album_data_sql['type_action'] == 'delete') |
|
450 | 437 | { |
451 | 438 | $errors = $this->delete_album_content($album_data_sql['album_id']); |
452 | - } |
|
453 | - else |
|
439 | + } else |
|
454 | 440 | { |
455 | 441 | return array($this->language->lang('NO_ALBUM_ACTION')); |
456 | 442 | } |
457 | - } |
|
458 | - else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) |
|
443 | + } else if ($row['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST && $album_data_sql['album_type'] == (int) \phpbbgallery\core\block::TYPE_CONTEST) |
|
459 | 444 | { |
460 | 445 | // Changing a contest to contest? Yes! |
461 | 446 | // We need to check for the contest_data |
@@ -483,8 +468,7 @@ discard block |
||
483 | 468 | if ($row['album_id'] != $album_data_sql['parent_id']) |
484 | 469 | { |
485 | 470 | $errors = $this->move_album($album_data_sql['album_id'], $album_data_sql['parent_id']); |
486 | - } |
|
487 | - else |
|
471 | + } else |
|
488 | 472 | { |
489 | 473 | $album_data_sql['parent_id'] = $row['parent_id']; |
490 | 474 | } |
@@ -627,13 +611,11 @@ discard block |
||
627 | 611 | if ($to_data['right_id'] > $from_data['right_id']) |
628 | 612 | { |
629 | 613 | $diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1); |
630 | - } |
|
631 | - else |
|
614 | + } else |
|
632 | 615 | { |
633 | 616 | $diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1); |
634 | 617 | } |
635 | - } |
|
636 | - else |
|
618 | + } else |
|
637 | 619 | { |
638 | 620 | $sql = 'SELECT MAX(right_id) AS right_id |
639 | 621 | FROM ' . $this->albums_table . ' |
@@ -679,14 +661,12 @@ discard block |
||
679 | 661 | { |
680 | 662 | $log_action_images = 'IMAGES'; |
681 | 663 | $errors = array_merge($errors, $this->delete_album_content($album_id)); |
682 | - } |
|
683 | - else if ($action_images == 'move') |
|
664 | + } else if ($action_images == 'move') |
|
684 | 665 | { |
685 | 666 | if (!$images_to_id) |
686 | 667 | { |
687 | 668 | $errors[] = $this->language->lang('NO_DESTINATION_ALBUM'); |
688 | - } |
|
689 | - else |
|
669 | + } else |
|
690 | 670 | { |
691 | 671 | $log_action_images = 'MOVE_IMAGES'; |
692 | 672 | |
@@ -700,8 +680,7 @@ discard block |
||
700 | 680 | if (!$row) |
701 | 681 | { |
702 | 682 | $errors[] = $this->language->lang('NO_ALBUM'); |
703 | - } |
|
704 | - else |
|
683 | + } else |
|
705 | 684 | { |
706 | 685 | $images_to_name = $row['album_name']; |
707 | 686 | $errors = array_merge($errors, $this->move_album_content($album_id, $images_to_id)); |
@@ -735,14 +714,12 @@ discard block |
||
735 | 714 | $sql = 'DELETE FROM ' . $this->albums_table . ' |
736 | 715 | WHERE ' . $this->db->sql_in_set('album_id', $album_ids); |
737 | 716 | $this->db->sql_query($sql); |
738 | - } |
|
739 | - else if ($action_subalbums == 'move') |
|
717 | + } else if ($action_subalbums == 'move') |
|
740 | 718 | { |
741 | 719 | if (!$subalbums_to_id) |
742 | 720 | { |
743 | 721 | $errors[] = $this->language->lang('NO_DESTINATION_ALBUM'); |
744 | - } |
|
745 | - else |
|
722 | + } else |
|
746 | 723 | { |
747 | 724 | $log_action_albums = 'MOVE_ALBUMS'; |
748 | 725 | |
@@ -756,8 +733,7 @@ discard block |
||
756 | 733 | if (!$row) |
757 | 734 | { |
758 | 735 | $errors[] = $this->language->lang('NO_ALBUM'); |
759 | - } |
|
760 | - else |
|
736 | + } else |
|
761 | 737 | { |
762 | 738 | $subalbums_to_name = $row['album_name']; |
763 | 739 | |
@@ -792,8 +768,7 @@ discard block |
||
792 | 768 | { |
793 | 769 | return $errors; |
794 | 770 | } |
795 | - } |
|
796 | - else |
|
771 | + } else |
|
797 | 772 | { |
798 | 773 | $diff = 2; |
799 | 774 | $sql = 'DELETE FROM ' . $this->albums_table . ' |
@@ -1087,8 +1062,7 @@ discard block |
||
1087 | 1062 | |
1088 | 1063 | $move_up_left = $album_row['left_id']; |
1089 | 1064 | $move_up_right = $album_row['right_id']; |
1090 | - } |
|
1091 | - else |
|
1065 | + } else |
|
1092 | 1066 | { |
1093 | 1067 | $left_id = $album_row['left_id']; |
1094 | 1068 | $right_id = $target['right_id']; |
@@ -149,8 +149,7 @@ discard block |
||
149 | 149 | if (!$sql_limit) |
150 | 150 | { |
151 | 151 | $result = $this->db->sql_query($sql); |
152 | - } |
|
153 | - else |
|
152 | + } else |
|
154 | 153 | { |
155 | 154 | $result = $this->db->sql_query_limit($sql, $sql_limit); |
156 | 155 | } |
@@ -446,8 +445,7 @@ discard block |
||
446 | 445 | 'BLOCK_NAME' => $block_name ? $block_name : '' , |
447 | 446 | 'U_BLOCK' => $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'), |
448 | 447 | )); |
449 | - } |
|
450 | - else |
|
448 | + } else |
|
451 | 449 | { |
452 | 450 | $this->template->assign_block_vars('imageblock', array( |
453 | 451 | 'BLOCK_NAME' => $block_name ? $block_name : $this->language->lang('RECENT_IMAGES'), |
@@ -505,8 +503,7 @@ discard block |
||
505 | 503 | 'phpbbgallery_core_search_egosearch_page',), |
506 | 504 | 'params' => array()), 'pagination', 'page', $count, $limit, $start |
507 | 505 | ); |
508 | - } |
|
509 | - else |
|
506 | + } else |
|
510 | 507 | { |
511 | 508 | $this->template->assign_vars(array( |
512 | 509 | 'TOTAL_IMAGES' => $this->language->lang('VIEW_ALBUM_IMAGES', $count), |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $this->template->assign_block_vars('commentrow', array( |
315 | 315 | 'COMMENT_ID' => (int) $var['comment_id'], |
316 | 316 | 'U_DELETE' => ($this->gallery_auth->acl_check('m_comments', $album_tmp['album_id'], $album_tmp['album_user_id']) || ($this->gallery_auth->acl_check('c_delete', $album_tmp['album_id'], $album_tmp['album_user_id']) && ($var['comment_user_id'] == $this->user->data['user_id']) && $this->user->data['is_registered'])) ? $this->helper->route('phpbbgallery_core_comment_delete', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
317 | - 'U_EDIT' => $this->gallery_auth->acl_check('c_edit', $album_tmp['album_id'], $album_tmp['album_user_id'])? $this->helper->route('phpbbgallery_core_comment_edit', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
|
317 | + 'U_EDIT' => $this->gallery_auth->acl_check('c_edit', $album_tmp['album_id'], $album_tmp['album_user_id']) ? $this->helper->route('phpbbgallery_core_comment_edit', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
|
318 | 318 | 'U_QUOTE' => ($this->gallery_auth->acl_check('c_post', $album_tmp['album_id'], $album_tmp['album_user_id'])) ? $this->helper->route('phpbbgallery_core_comment_add', array('image_id' => $var['comment_image_id'], 'comment_id' => $var['comment_id'])) : false, |
319 | 319 | 'U_COMMENT' => $this->helper->route('phpbbgallery_core_image', array('image_id' => $var['comment_image_id'])) . '#comment_' . $var['comment_id'], |
320 | 320 | 'POST_AUTHOR_FULL' => (string) $this->user_loader->get_username($var['comment_user_id'], 'full'), |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | if ($user > 0) |
448 | 448 | { |
449 | 449 | $this->template->assign_block_vars('imageblock', array( |
450 | - 'BLOCK_NAME' => $block_name ? $block_name : '' , |
|
450 | + 'BLOCK_NAME' => $block_name ? $block_name : '', |
|
451 | 451 | 'U_BLOCK' => $u_block ? $u_block : $this->helper->route('phpbbgallery_core_search_egosearch'), |
452 | 452 | )); |
453 | 453 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $this->db->sql_freeresult($result); |
548 | 548 | $count = $row['count']; |
549 | 549 | $sql_array['SELECT'] = '* , a.album_name, a.album_status, a.album_user_id, a.album_id'; |
550 | - $sql_array['LEFT_JOIN'] = array( |
|
550 | + $sql_array['LEFT_JOIN'] = array( |
|
551 | 551 | array( |
552 | 552 | 'FROM' => array($this->albums_table => 'a'), |
553 | 553 | 'ON' => 'a.album_id = i.image_album_id', |
@@ -243,9 +243,9 @@ |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
246 | - * Get all recent images the user has access to |
|
247 | - * return (int) $images_count |
|
248 | - */ |
|
246 | + * Get all recent images the user has access to |
|
247 | + * return (int) $images_count |
|
248 | + */ |
|
249 | 249 | public function recent_count() |
250 | 250 | { |
251 | 251 | $this->gallery_auth->load_user_permissions($this->user->data['user_id']); |