@@ -106,9 +106,9 @@ |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * Delete logs |
|
110 | - * @param array $mark Logs selected for deletion |
|
111 | - **/ |
|
109 | + * Delete logs |
|
110 | + * @param array $mark Logs selected for deletion |
|
111 | + **/ |
|
112 | 112 | public function delete_logs($mark) |
113 | 113 | { |
114 | 114 | $sql = 'DELETE FROM ' . $this->log_table . ' WHERE ' . $this->db->sql_in_set('log_id', $mark); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $limit = $this->gallery_config->get('items_per_page'); |
135 | 135 | // If its called from ACP album is 0 if MCP then is not |
136 | - if($album == 0) $page = (int) ($page / $limit) + 1; |
|
136 | + if ($album == 0) $page = (int) ($page / $limit) + 1; |
|
137 | 137 | } |
138 | 138 | $this->language->add_lang(['info_acp_gallery_logs'], 'phpbbgallery/core'); |
139 | 139 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | ), |
284 | 284 | 'params' => array( |
285 | 285 | ), |
286 | - ), 'pagination', 'page', $count, $limit, ($page-1) * $limit); |
|
286 | + ), 'pagination', 'page', $count, $limit, ($page - 1) * $limit); |
|
287 | 287 | } |
288 | 288 | else if ($album == -1) |
289 | 289 | { |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | { |
305 | 305 | $url_array['sd'] = $additional['sort_dir']; |
306 | 306 | } |
307 | - $url = http_build_query($url_array,'','&'); |
|
307 | + $url = http_build_query($url_array, '', '&'); |
|
308 | 308 | |
309 | - $this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page-1) * $limit); |
|
309 | + $this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page - 1) * $limit); |
|
310 | 310 | } |
311 | 311 | else |
312 | 312 | { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | 'params' => array( |
319 | 319 | 'album_id' => $album, |
320 | 320 | ), |
321 | - ), 'pagination', 'page', $count, $limit, ($page-1) * $limit); |
|
321 | + ), 'pagination', 'page', $count, $limit, ($page - 1) * $limit); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | } |
@@ -133,7 +133,9 @@ discard block |
||
133 | 133 | { |
134 | 134 | $limit = $this->gallery_config->get('items_per_page'); |
135 | 135 | // If its called from ACP album is 0 if MCP then is not |
136 | - if($album == 0) $page = (int) ($page / $limit) + 1; |
|
136 | + if($album == 0) { |
|
137 | + $page = (int) ($page / $limit) + 1; |
|
138 | + } |
|
137 | 139 | } |
138 | 140 | $this->language->add_lang(['info_acp_gallery_logs'], 'phpbbgallery/core'); |
139 | 141 | |
@@ -206,8 +208,7 @@ discard block |
||
206 | 208 | $sql_array['GROUP_BY'] = 'l.description, l.log_id, i.image_id'; |
207 | 209 | break; |
208 | 210 | } |
209 | - } |
|
210 | - else |
|
211 | + } else |
|
211 | 212 | { |
212 | 213 | $sql_array['ORDER_BY'] = 'l.log_time ' . (isset($additional['sort_dir']) ? 'ASC' : 'DESC'); |
213 | 214 | $sql_array['GROUP_BY'] = 'l.log_time, l.log_id, i.image_id'; |
@@ -284,8 +285,7 @@ discard block |
||
284 | 285 | 'params' => array( |
285 | 286 | ), |
286 | 287 | ), 'pagination', 'page', $count, $limit, ($page-1) * $limit); |
287 | - } |
|
288 | - else if ($album == -1) |
|
288 | + } else if ($album == -1) |
|
289 | 289 | { |
290 | 290 | $url_array = array( |
291 | 291 | 'i' => '-phpbbgallery-core-acp-gallery_logs_module', |
@@ -307,8 +307,7 @@ discard block |
||
307 | 307 | $url = http_build_query($url_array,'','&'); |
308 | 308 | |
309 | 309 | $this->pagination->generate_template_pagination(append_sid('index.php?' . $url), 'pagination', 'page', $count, $limit, ($page-1) * $limit); |
310 | - } |
|
311 | - else |
|
310 | + } else |
|
312 | 311 | { |
313 | 312 | $this->pagination->generate_template_pagination(array( |
314 | 313 | 'routes' => array( |
@@ -55,7 +55,7 @@ |
||
55 | 55 | if (($albums = $this->phpbb_cache->get('_albums')) === false) |
56 | 56 | { |
57 | 57 | $sql = 'SELECT a.album_id, a.parent_id, a.album_name, a.album_type, a.left_id, a.right_id, a.album_user_id, a.display_in_rrc, a.album_auth_access |
58 | - FROM ' . $this->table_albums. ' a |
|
58 | + FROM ' . $this->table_albums . ' a |
|
59 | 59 | LEFT JOIN ' . USERS_TABLE . ' u |
60 | 60 | ON (u.user_id = a.album_user_id) |
61 | 61 | ORDER BY u.username_clean, a.album_user_id, a.left_id ASC'; |
@@ -180,8 +180,7 @@ |
||
180 | 180 | if ($subtarget) |
181 | 181 | { |
182 | 182 | $this->phpbb_cache->destroy($target, $subtarget); |
183 | - } |
|
184 | - else |
|
183 | + } else |
|
185 | 184 | { |
186 | 185 | $this->phpbb_cache->destroy($target); |
187 | 186 | } |
@@ -19,12 +19,12 @@ discard block |
||
19 | 19 | protected $table_images; |
20 | 20 | |
21 | 21 | /** |
22 | - * cache constructor. |
|
23 | - * @param \phpbb\cache\service $cache |
|
24 | - * @param \phpbb\db\driver\driver_interface $db |
|
25 | - * @param $albums_table |
|
26 | - * @param $images_table |
|
27 | - */ |
|
22 | + * cache constructor. |
|
23 | + * @param \phpbb\cache\service $cache |
|
24 | + * @param \phpbb\db\driver\driver_interface $db |
|
25 | + * @param $albums_table |
|
26 | + * @param $images_table |
|
27 | + */ |
|
28 | 28 | public function __construct(\phpbb\cache\service $cache, \phpbb\db\driver\driver_interface $db, |
29 | 29 | $albums_table, $images_table) |
30 | 30 | { |
@@ -155,18 +155,18 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
158 | - * Destroy images cache - if we had updated image information or we want other set - we will have to destroy cache |
|
159 | - */ |
|
158 | + * Destroy images cache - if we had updated image information or we want other set - we will have to destroy cache |
|
159 | + */ |
|
160 | 160 | public function destroy_images() |
161 | 161 | { |
162 | 162 | $this->phpbb_cache->destroy('_images'); |
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | - * Destroy album cache |
|
167 | - * Basically some tests fail due album cache not destroyed ... |
|
168 | - * So lets try it now? |
|
169 | - */ |
|
166 | + * Destroy album cache |
|
167 | + * Basically some tests fail due album cache not destroyed ... |
|
168 | + * So lets try it now? |
|
169 | + */ |
|
170 | 170 | public function destroy_albums() |
171 | 171 | { |
172 | 172 | $this->phpbb_cache->destroy('_albums'); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $additional_settings = array(); |
93 | 93 | |
94 | 94 | /** |
95 | - * Event set personal settings |
|
96 | - * |
|
97 | - * @event phpbbgallery.core.ucp.set_settings_submit |
|
98 | - * @var array additional_settings array of additional settings |
|
99 | - * @since 1.2.0 |
|
100 | - */ |
|
95 | + * Event set personal settings |
|
96 | + * |
|
97 | + * @event phpbbgallery.core.ucp.set_settings_submit |
|
98 | + * @var array additional_settings array of additional settings |
|
99 | + * @since 1.2.0 |
|
100 | + */ |
|
101 | 101 | $vars = array('additional_settings'); |
102 | 102 | extract($this->dispatcher->trigger_event('phpbbgallery.core.ucp.set_settings_submit', compact($vars))); |
103 | 103 | |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * Event no submit personal settings |
|
122 | - * |
|
123 | - * @event phpbbgallery.core.ucp.set_settings_nosubmit |
|
124 | - * @since 1.2.0 |
|
125 | - */ |
|
121 | + * Event no submit personal settings |
|
122 | + * |
|
123 | + * @event phpbbgallery.core.ucp.set_settings_nosubmit |
|
124 | + * @since 1.2.0 |
|
125 | + */ |
|
126 | 126 | $this->dispatcher->dispatch('phpbbgallery.core.ucp.set_settings_nosubmit'); |
127 | 127 | |
128 | 128 | $this->template->assign_vars(array( |
@@ -389,10 +389,10 @@ discard block |
||
389 | 389 | generate_text_for_storage($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options'], $request->variable('desc_parse_bbcode', false), $request->variable('desc_parse_urls', false), $request->variable('desc_parse_smilies', false)); |
390 | 390 | |
391 | 391 | /** |
392 | - * borrowed from phpBB3 |
|
393 | - * @author: phpBB Group |
|
394 | - * @location: acp_forums->manage_forums |
|
395 | - */ |
|
392 | + * borrowed from phpBB3 |
|
393 | + * @author: phpBB Group |
|
394 | + * @location: acp_forums->manage_forums |
|
395 | + */ |
|
396 | 396 | // Parent should always be filled otherwise we use initialise_album() |
397 | 397 | if ($album_data['parent_id']) |
398 | 398 | { |
@@ -833,13 +833,13 @@ discard block |
||
833 | 833 | } |
834 | 834 | |
835 | 835 | /** |
836 | - * Event delete user albums |
|
837 | - * |
|
838 | - * @event phpbbgallery.core.ucp.delete_album |
|
839 | - * @var int album_id Album ID |
|
840 | - * @var array deleted_albums Deleted album IDs |
|
841 | - * @since 1.2.0 |
|
842 | - */ |
|
836 | + * Event delete user albums |
|
837 | + * |
|
838 | + * @event phpbbgallery.core.ucp.delete_album |
|
839 | + * @var int album_id Album ID |
|
840 | + * @var array deleted_albums Deleted album IDs |
|
841 | + * @since 1.2.0 |
|
842 | + */ |
|
843 | 843 | $vars = array('album_id', 'deleted_albums'); |
844 | 844 | extract($phpbb_dispatcher->trigger_event('phpbbgallery.core.ucp.delete_album', compact($vars))); |
845 | 845 |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $phpbb_gallery_url = $phpbb_container->get('phpbbgallery.core.url'); |
28 | 28 | $phpbb_gallery_url->_include('functions_display', 'phpbb'); |
29 | 29 | |
30 | - $phpbb_ext_gallery_core_album =$phpbb_container->get('phpbbgallery.core.album'); |
|
30 | + $phpbb_ext_gallery_core_album = $phpbb_container->get('phpbbgallery.core.album'); |
|
31 | 31 | |
32 | 32 | $phpbb_ext_gallery_core_auth = $phpbb_container->get('phpbbgallery.core.auth'); |
33 | 33 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | function initialise_album() |
153 | 153 | { |
154 | - global $cache, $db, $user, $phpbb_ext_gallery_core_auth, $phpbb_ext_gallery_core_album, $phpbb_ext_gallery_config, $albums_table, $phpbb_ext_gallery_user; |
|
154 | + global $cache, $db, $user, $phpbb_ext_gallery_core_auth, $phpbb_ext_gallery_core_album, $phpbb_ext_gallery_config, $albums_table, $phpbb_ext_gallery_user; |
|
155 | 155 | global $request, $users_table, $phpbb_container; |
156 | 156 | |
157 | 157 | // we will have to initialse $phpbb_ext_gallery_user |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | |
446 | 446 | $this->language = $phpbb_container->get('language'); |
447 | 447 | |
448 | - $phpbb_gallery_url->_include(array('bbcode','message_parser'), 'phpbb'); |
|
448 | + $phpbb_gallery_url->_include(array('bbcode', 'message_parser'), 'phpbb'); |
|
449 | 449 | |
450 | 450 | $album_id = $request->variable('album_id', 0); |
451 | 451 | $phpbb_ext_gallery_core_album->check_user($album_id); |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | $sql = 'UPDATE ' . $albums_table . " |
829 | 829 | SET right_id = right_id - $delete_id |
830 | 830 | WHERE right_id > $right_id |
831 | - AND album_user_id = ". (int) $user->data['user_id']; |
|
831 | + AND album_user_id = " . (int) $user->data['user_id']; |
|
832 | 832 | $db->sql_query($sql); |
833 | 833 | } |
834 | 834 | |
@@ -1012,9 +1012,9 @@ discard block |
||
1012 | 1012 | $db->sql_freeresult($result); |
1013 | 1013 | |
1014 | 1014 | // Subscribed images |
1015 | - $start = $request->variable('start', 0); |
|
1016 | - $images_per_page = $phpbb_ext_gallery_config->get('items_per_page'); |
|
1017 | - $total_images = 0; |
|
1015 | + $start = $request->variable('start', 0); |
|
1016 | + $images_per_page = $phpbb_ext_gallery_config->get('items_per_page'); |
|
1017 | + $total_images = 0; |
|
1018 | 1018 | |
1019 | 1019 | $sql = 'SELECT COUNT(image_id) as images |
1020 | 1020 | FROM ' . $watch_table . ' |
@@ -108,8 +108,7 @@ discard block |
||
108 | 108 | if (!$phpbb_ext_gallery_user->get_data('personal_album_id')) |
109 | 109 | { |
110 | 110 | $this->info(); |
111 | - } |
|
112 | - else |
|
111 | + } else |
|
113 | 112 | { |
114 | 113 | $this->manage_albums(); |
115 | 114 | } |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | 'L_TITLE' => $this->language->lang('UCP_GALLERY_PERSONAL_ALBUMS'), |
143 | 142 | 'L_TITLE_EXPLAIN' => $this->language->lang('NO_PERSONAL_ALBUM'), |
144 | 143 | )); |
145 | - } |
|
146 | - else |
|
144 | + } else |
|
147 | 145 | { |
148 | 146 | $phpbb_gallery_url->redirect('phpbb', 'ucp', 'i=-phpbbgallery-core-ucp-main_module&mode=manage_albums&action=manage'); |
149 | 147 | } |
@@ -230,8 +228,7 @@ discard block |
||
230 | 228 | if (!$parent_id) |
231 | 229 | { |
232 | 230 | $navigation = $this->language->lang('PERSONAL_ALBUM'); |
233 | - } |
|
234 | - else |
|
231 | + } else |
|
235 | 232 | { |
236 | 233 | $navigation = $this->language->lang('PERSONAL_ALBUM'); |
237 | 234 | |
@@ -241,8 +238,7 @@ discard block |
||
241 | 238 | if ($row['album_id'] == $parent_id) |
242 | 239 | { |
243 | 240 | $navigation .= ' » ' . $row['album_name']; |
244 | - } |
|
245 | - else |
|
241 | + } else |
|
246 | 242 | { |
247 | 243 | $navigation .= ' » <a href="' . $this->u_action . '&action=manage&parent_id=' . $row['album_id'] . '">' . $row['album_name'] . '</a>'; |
248 | 244 | } |
@@ -357,8 +353,7 @@ discard block |
||
357 | 353 | 'S_AUTH_ACCESS_OPTIONS' => $s_access_options, |
358 | 354 | 'L_ALBUM_ACCESS_EXPLAIN' => $this->language->lang('ALBUM_ACCESS_EXPLAIN', '<a href="' . $phpbb_gallery_url->append_sid('phpbb', 'faq') . '#f6r0">', '</a>'), |
359 | 355 | )); |
360 | - } |
|
361 | - else |
|
356 | + } else |
|
362 | 357 | { |
363 | 358 | if (!check_form_key('ucp_gallery')) |
364 | 359 | { |
@@ -506,8 +501,7 @@ discard block |
||
506 | 501 | |
507 | 502 | 'S_MODE' => 'edit', |
508 | 503 | )); |
509 | - } |
|
510 | - else |
|
504 | + } else |
|
511 | 505 | { |
512 | 506 | // Is it salty ? |
513 | 507 | if (!check_form_key('ucp_gallery')) |
@@ -591,8 +585,7 @@ discard block |
||
591 | 585 | WHERE album_user_id = ' . (int) $row['album_user_id'] . ' |
592 | 586 | AND right_id >= ' . (int) $row['left_id']; |
593 | 587 | $db->sql_query($sql); |
594 | - } |
|
595 | - else |
|
588 | + } else |
|
596 | 589 | { |
597 | 590 | $sql = 'UPDATE ' . $albums_table . ' |
598 | 591 | SET left_id = left_id - ' . $moving_ids . ' |
@@ -638,8 +631,7 @@ discard block |
||
638 | 631 | if ($album_data['album_name'] == '') |
639 | 632 | { |
640 | 633 | $album_data['album_name'] = $row['album_name']; |
641 | - } |
|
642 | - else if ($row['album_name'] != $album_data['album_name']) |
|
634 | + } else if ($row['album_name'] != $album_data['album_name']) |
|
643 | 635 | { |
644 | 636 | $sql = 'UPDATE ' . $albums_table . " |
645 | 637 | SET album_parents = ''"; |
@@ -650,8 +642,7 @@ discard block |
||
650 | 642 | if (isset($config['zebra_enhance_version'])) |
651 | 643 | { |
652 | 644 | $album_data['album_auth_access'] = min(4, max(0, $album_data['album_auth_access'])); |
653 | - } |
|
654 | - else |
|
645 | + } else |
|
655 | 646 | { |
656 | 647 | $album_data['album_auth_access'] = min(3, max(0, $album_data['album_auth_access'])); |
657 | 648 | } |
@@ -804,8 +795,7 @@ discard block |
||
804 | 795 | $phpbb_ext_gallery_config->set('newest_pega_username', $newest_pgallery['username']); |
805 | 796 | $phpbb_ext_gallery_config->set('newest_pega_user_colour', $newest_pgallery['user_colour']); |
806 | 797 | $phpbb_ext_gallery_config->set('newest_pega_album_id', $newest_pgallery['album_id']); |
807 | - } |
|
808 | - else |
|
798 | + } else |
|
809 | 799 | { |
810 | 800 | $phpbb_ext_gallery_config->set('newest_pega_user_id', 0); |
811 | 801 | $phpbb_ext_gallery_config->set('newest_pega_username', ''); |
@@ -813,8 +803,7 @@ discard block |
||
813 | 803 | $phpbb_ext_gallery_config->set('newest_pega_album_id', 0); |
814 | 804 | } |
815 | 805 | } |
816 | - } |
|
817 | - else |
|
806 | + } else |
|
818 | 807 | { |
819 | 808 | // Solve the left_id right_id problem |
820 | 809 | $delete_id = $right_id - ($left_id - 1); |
@@ -855,8 +844,7 @@ discard block |
||
855 | 844 | |
856 | 845 | trigger_error($this->language->lang('DELETED_ALBUMS') . '<br /><br /> |
857 | 846 | <a href="' . (($parent_id) ? $phpbb_gallery_url->append_sid('phpbb', 'ucp', 'i=-phpbbgallery-core-ucp-main_module&mode=manage_albums&action=manage&parent_id=' . $parent_id) : $phpbb_gallery_url->append_sid('phpbb', 'ucp', 'i=-phpbbgallery-core-ucp-main_module&mode=manage_albums')) . '">' . $this->language->lang('BACK_TO_PREV') . '</a>'); |
858 | - } |
|
859 | - else |
|
847 | + } else |
|
860 | 848 | { |
861 | 849 | $album_id = $request->variable('album_id', 0); |
862 | 850 | $phpbb_ext_gallery_core_album->check_user($album_id); |
@@ -899,8 +887,7 @@ discard block |
||
899 | 887 | |
900 | 888 | $move_up_left = $moving['left_id']; |
901 | 889 | $move_up_right = $moving['right_id']; |
902 | - } |
|
903 | - else |
|
890 | + } else |
|
904 | 891 | { |
905 | 892 | $left_id = $moving['left_id']; |
906 | 893 | $right_id = $target['right_id']; |
@@ -129,12 +129,12 @@ |
||
129 | 129 | |
130 | 130 | if (isset($args[1])) |
131 | 131 | { |
132 | - $args[1] .= '';//@todo: phpbb_gallery::$display_popup; |
|
132 | + $args[1] .= ''; //@todo: phpbb_gallery::$display_popup; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $params = $args + array( |
136 | 136 | 0 => '', |
137 | - 1 => '',//@todo: phpbb_gallery::$display_popup, |
|
137 | + 1 => '', //@todo: phpbb_gallery::$display_popup, |
|
138 | 138 | 2 => true, |
139 | 139 | 3 => false, |
140 | 140 | ); |
@@ -121,8 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | $mode = array_shift($args); |
123 | 123 | $args[0] = $this->path($mode) . $this->phpEx_file($args[0]); |
124 | - } |
|
125 | - else |
|
124 | + } else |
|
126 | 125 | { |
127 | 126 | $args[0] = $this->path() . $this->phpEx_file($args[0]); |
128 | 127 | } |
@@ -197,8 +196,7 @@ discard block |
||
197 | 196 | if (!is_array($file)) |
198 | 197 | { |
199 | 198 | include($this->path($path) . $sub_directory . $this->phpEx_file($file)); |
200 | - } |
|
201 | - else |
|
199 | + } else |
|
202 | 200 | { |
203 | 201 | foreach ($file as $real_file) |
204 | 202 | { |
@@ -244,8 +242,7 @@ discard block |
||
244 | 242 | if (strpos($path, 'https:/') === 0) |
245 | 243 | { |
246 | 244 | $path = 'https://' . substr($path, 7); |
247 | - } |
|
248 | - else if (strpos($path, 'http:/') === 0) |
|
245 | + } else if (strpos($path, 'http:/') === 0) |
|
249 | 246 | { |
250 | 247 | $path = 'http://' . substr($path, 6); |
251 | 248 | } |
@@ -300,15 +297,13 @@ discard block |
||
300 | 297 | if ($this->config['force_server_vars'] == 1) |
301 | 298 | { |
302 | 299 | $url = $this->config['server_protocol'] . $url; |
303 | - } |
|
304 | - else |
|
300 | + } else |
|
305 | 301 | { |
306 | 302 | $is_secure = $this->request->server('HTTPS', ''); |
307 | 303 | if ($is_secure == 'on') |
308 | 304 | { |
309 | 305 | $url = 'https://' . $url; |
310 | - } |
|
311 | - else |
|
306 | + } else |
|
312 | 307 | { |
313 | 308 | $url = 'http://' . $url; |
314 | 309 | } |
@@ -22,28 +22,28 @@ discard block |
||
22 | 22 | private $config; |
23 | 23 | |
24 | 24 | /** |
25 | - * Path from the gallery root, back to phpbb's root |
|
26 | - */ |
|
25 | + * Path from the gallery root, back to phpbb's root |
|
26 | + */ |
|
27 | 27 | private $phpbb_root_path = '../'; |
28 | 28 | |
29 | 29 | /** |
30 | - * Path from the phpbb root, into admin's root |
|
31 | - */ |
|
30 | + * Path from the phpbb root, into admin's root |
|
31 | + */ |
|
32 | 32 | private $phpbb_admin_path = 'adm/'; |
33 | 33 | |
34 | 34 | /** |
35 | - * Path from the phpbb root, into gallery's file root |
|
36 | - */ |
|
35 | + * Path from the phpbb root, into gallery's file root |
|
36 | + */ |
|
37 | 37 | private $phpbb_gallery_file_path = 'files/phpbbgallery/'; |
38 | 38 | |
39 | 39 | /** |
40 | - * Path from the phpbb root, into gallery's root |
|
41 | - */ |
|
40 | + * Path from the phpbb root, into gallery's root |
|
41 | + */ |
|
42 | 42 | private $phpbb_gallery_path = 'gallery/'; |
43 | 43 | |
44 | 44 | /** |
45 | - * PHP file extension (e.g. .php) |
|
46 | - */ |
|
45 | + * PHP file extension (e.g. .php) |
|
46 | + */ |
|
47 | 47 | private $php_ext; |
48 | 48 | |
49 | 49 | const IMAGE_PATH = 'images/'; |
@@ -237,16 +237,16 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
240 | - * Creates beautiful relative path from ugly relative path |
|
241 | - * Resolves .. (up directory) |
|
242 | - * |
|
243 | - * @author bantu based on phpbb_own_realpath() by Chris Smith |
|
244 | - * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|
245 | - * |
|
246 | - * @param string ugly path e.g. "../community/../gallery/" |
|
247 | - * @param bool is it a full url, so we need to fix teh http:// at the beginning? |
|
248 | - * @return string beautiful path e.g. "../gallery/" |
|
249 | - */ |
|
240 | + * Creates beautiful relative path from ugly relative path |
|
241 | + * Resolves .. (up directory) |
|
242 | + * |
|
243 | + * @author bantu based on phpbb_own_realpath() by Chris Smith |
|
244 | + * @license http://opensource.org/licenses/gpl-license.php GNU Public License |
|
245 | + * |
|
246 | + * @param string ugly path e.g. "../community/../gallery/" |
|
247 | + * @param bool is it a full url, so we need to fix teh http:// at the beginning? |
|
248 | + * @return string beautiful path e.g. "../gallery/" |
|
249 | + */ |
|
250 | 250 | static public function beautiful_path($path, $is_full_url = false) |
251 | 251 | { |
252 | 252 | // Remove any repeated slashes |
@@ -288,10 +288,10 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
291 | - * Custom meta_refresh implementation |
|
292 | - * @param int $time Time in seconds. |
|
293 | - * @param string $route Route generated by $helper->route |
|
294 | - */ |
|
291 | + * Custom meta_refresh implementation |
|
292 | + * @param int $time Time in seconds. |
|
293 | + * @param string $route Route generated by $helper->route |
|
294 | + */ |
|
295 | 295 | public function meta_refresh($time, $route) |
296 | 296 | { |
297 | 297 | // For XHTML compatibility we change back & to & |
@@ -69,8 +69,7 @@ |
||
69 | 69 | if (is_dir($file)) |
70 | 70 | { |
71 | 71 | recursiveRemoveDirectory($file); |
72 | - } |
|
73 | - else |
|
72 | + } else |
|
74 | 73 | { |
75 | 74 | unlink($file); |
76 | 75 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | function import() |
34 | 34 | { |
35 | - global $db, $template, $user, $phpbb_dispatcher, $phpbb_container, $gallery_url, $request, $table_prefix ,$gallery_config, $gallery_album, $request; |
|
35 | + global $db, $template, $user, $phpbb_dispatcher, $phpbb_container, $gallery_url, $request, $table_prefix, $gallery_config, $gallery_album, $request; |
|
36 | 36 | |
37 | 37 | $import_schema = $request->variable('import_schema', ''); |
38 | 38 | $images = $request->variable('images', array(''), true); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $album_id = $request->variable('album_id', 0); |
303 | 303 | if (isset($_POST['users_pega'])) |
304 | 304 | { |
305 | - $image_user = $phpbb_container->get('phpbbgallery.core.user'); |
|
305 | + $image_user = $phpbb_container->get('phpbbgallery.core.user'); |
|
306 | 306 | $image_user->set_user_id($user_row['user_id']); |
307 | 307 | if ($user->data['user_id'] != $user_row['user_id']) |
308 | 308 | { |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | // Replace the md5 with the ' again and remove the space at the end to prevent \' troubles |
48 | 48 | $user_data['username'] = utf8_substr(str_replace("{{$import_schema}}", "'", $user_data['username']), 0, -1); |
49 | 49 | $image_name = utf8_substr(str_replace("{{$import_schema}}", "'", $image_name), 0, -1); |
50 | - } |
|
51 | - else |
|
50 | + } else |
|
52 | 51 | { |
53 | 52 | global $phpEx; |
54 | 53 | trigger_error($user->lang('MISSING_IMPORT_SCHEMA', ($import_schema . '.' . $phpEx)), E_USER_WARNING); |
@@ -198,8 +197,7 @@ discard block |
||
198 | 197 | if ($filename || ($image_name == '')) |
199 | 198 | { |
200 | 199 | $sql_ary['image_name'] = str_replace("_", " ", utf8_substr($image_src, 0, utf8_strrpos($image_src, '.'))); |
201 | - } |
|
202 | - else |
|
200 | + } else |
|
203 | 201 | { |
204 | 202 | $sql_ary['image_name'] = str_replace('{NUM}', $num_offset + $done_images, $image_name); |
205 | 203 | } |
@@ -239,14 +237,12 @@ discard block |
||
239 | 237 | if (!$errors) |
240 | 238 | { |
241 | 239 | trigger_error(sprintf($user->lang['IMPORT_FINISHED'], $done_images) . adm_back_link($this->u_action)); |
242 | - } |
|
243 | - else |
|
240 | + } else |
|
244 | 241 | { |
245 | 242 | $errors = explode("\n", $errors); |
246 | 243 | trigger_error(sprintf($user->lang['IMPORT_FINISHED_ERRORS'], $done_images - sizeof($errors)) . implode('<br />', $errors) . adm_back_link($this->u_action), E_USER_WARNING); |
247 | 244 | } |
248 | - } |
|
249 | - else |
|
245 | + } else |
|
250 | 246 | { |
251 | 247 | // Write the new list |
252 | 248 | $this->create_import_schema($import_schema, $album_id, $user_data, $start_time, $num_offset, $done_images, $todo_images, $image_name, $filename, $images); |
@@ -256,8 +252,7 @@ discard block |
||
256 | 252 | meta_refresh(1, $forward_url); |
257 | 253 | trigger_error(sprintf($user->lang['IMPORT_DEBUG_MES'], $done_images, $todo_images)); |
258 | 254 | } |
259 | - } |
|
260 | - else if ($submit) |
|
255 | + } else if ($submit) |
|
261 | 256 | { |
262 | 257 | if (!check_form_key('acp_gallery')) |
263 | 258 | { |
@@ -313,8 +308,7 @@ discard block |
||
313 | 308 | $album_id = $gallery_album->generate_personal_album($user_row['username'], $user_row['user_id'], $user_row['user_colour'], $image_user); |
314 | 309 | } |
315 | 310 | unset($image_user); |
316 | - } |
|
317 | - else |
|
311 | + } else |
|
318 | 312 | { |
319 | 313 | $album_id = $image_user->get_data('personal_album_id'); |
320 | 314 | if (!$album_id) |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | foreach ($images as $image_src) |
59 | 59 | { |
60 | 60 | /** |
61 | - * Import the images |
|
62 | - */ |
|
61 | + * Import the images |
|
62 | + */ |
|
63 | 63 | |
64 | 64 | $image_src = str_replace("{{$import_schema}}", "'", $image_src); |
65 | 65 | $image_src_full = $gallery_url->path('import') . utf8_decode($image_src); |
@@ -160,21 +160,21 @@ discard block |
||
160 | 160 | $additional_sql_data = array(); |
161 | 161 | |
162 | 162 | /** |
163 | - * Event to trigger before mass update |
|
164 | - * |
|
165 | - * @event phpbbgallery.acpimport.update_image_before |
|
166 | - * @var array additional_sql_data array of additional sql_data |
|
167 | - * @var string file_link String with real file link |
|
168 | - * @since 1.2.0 |
|
169 | - */ |
|
163 | + * Event to trigger before mass update |
|
164 | + * |
|
165 | + * @event phpbbgallery.acpimport.update_image_before |
|
166 | + * @var array additional_sql_data array of additional sql_data |
|
167 | + * @var string file_link String with real file link |
|
168 | + * @since 1.2.0 |
|
169 | + */ |
|
170 | 170 | $vars = array('additional_sql_data', 'file_link'); |
171 | 171 | extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image_before', compact($vars))); |
172 | 172 | |
173 | 173 | if (($filetype[0] > $gallery_config->get('max_width')) || ($filetype[1] > $gallery_config->get('max_height'))) |
174 | 174 | { |
175 | 175 | /** |
176 | - * Resize oversize images |
|
177 | - */ |
|
176 | + * Resize oversize images |
|
177 | + */ |
|
178 | 178 | if ($gallery_config->get('allow_resize')) |
179 | 179 | { |
180 | 180 | $image_tools->resize_image($gallery_config->get('max_width'), $gallery_config->get('max_height')); |
@@ -187,13 +187,13 @@ discard block |
||
187 | 187 | $file_updated = (bool) $image_tools->resized; |
188 | 188 | |
189 | 189 | /** |
190 | - * Event to trigger before mass update |
|
191 | - * |
|
192 | - * @event phpbbgallery.acpimport.update_image |
|
193 | - * @var array additional_sql_data array of additional sql_data |
|
194 | - * @var bool file_updated is file resized |
|
195 | - * @since 1.2.0 |
|
196 | - */ |
|
190 | + * Event to trigger before mass update |
|
191 | + * |
|
192 | + * @event phpbbgallery.acpimport.update_image |
|
193 | + * @var array additional_sql_data array of additional sql_data |
|
194 | + * @var bool file_updated is file resized |
|
195 | + * @since 1.2.0 |
|
196 | + */ |
|
197 | 197 | $vars = array('additional_sql_data', 'file_updated'); |
198 | 198 | extract($phpbb_dispatcher->trigger_event('phpbbgallery.acpimport.update_image', compact($vars))); |
199 | 199 |
@@ -196,8 +196,7 @@ discard block |
||
196 | 196 | if (isset($user_image_count[(int) $row['image_user_id']])) |
197 | 197 | { |
198 | 198 | $user_image_count[(int) $row['image_user_id']]++; |
199 | - } |
|
200 | - else |
|
199 | + } else |
|
201 | 200 | { |
202 | 201 | $user_image_count[(int) $row['image_user_id']] = 1; |
203 | 202 | } |
@@ -246,8 +245,7 @@ discard block |
||
246 | 245 | $this->gallery_config->set('newest_pega_username', $newest_pega['username']); |
247 | 246 | $this->gallery_config->set('newest_pega_user_colour', $newest_pega['user_colour']); |
248 | 247 | $this->gallery_config->set('newest_pega_album_id', $newest_pega['album_id']); |
249 | - } |
|
250 | - else |
|
248 | + } else |
|
251 | 249 | { |
252 | 250 | $this->gallery_config->set('newest_pega_user_id', 0); |
253 | 251 | $this->gallery_config->set('newest_pega_username', ''); |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Delete source files without a database entry. |
|
89 | - * |
|
90 | - * @param array $filenames An array of filenames |
|
91 | - * @return string Language key for the success message. |
|
92 | - */ |
|
88 | + * Delete source files without a database entry. |
|
89 | + * |
|
90 | + * @param array $filenames An array of filenames |
|
91 | + * @return string Language key for the success message. |
|
92 | + */ |
|
93 | 93 | public function delete_files($filenames) |
94 | 94 | { |
95 | 95 | foreach ($filenames as $file) |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
105 | - * Delete images, where the source file is missing. |
|
106 | - * |
|
107 | - * @param mixed $image_ids Either an array of integers or an integer. |
|
108 | - * @return string Language key for the success message. |
|
109 | - */ |
|
105 | + * Delete images, where the source file is missing. |
|
106 | + * |
|
107 | + * @param mixed $image_ids Either an array of integers or an integer. |
|
108 | + * @return string Language key for the success message. |
|
109 | + */ |
|
110 | 110 | public function delete_images($image_ids) |
111 | 111 | { |
112 | 112 | $this->log->add_log('admin', 'clean_deleteentries', 0, 0, array('LOG_CLEANUP_DELETE_ENTRIES', count($image_ids))); |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
119 | - * Delete images, where the author is missing. |
|
120 | - * |
|
121 | - * @param mixed $image_ids Either an array of integers or an integer. |
|
122 | - * @return string Language key for the success message. |
|
123 | - */ |
|
119 | + * Delete images, where the author is missing. |
|
120 | + * |
|
121 | + * @param mixed $image_ids Either an array of integers or an integer. |
|
122 | + * @return string Language key for the success message. |
|
123 | + */ |
|
124 | 124 | public function delete_author_images($image_ids) |
125 | 125 | { |
126 | 126 | $this->log->add_log('admin', 'clean_deletenoauthors', 0, 0, array('LOG_CLEANUP_DELETE_NO_AUTHOR', count($image_ids))); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * Delete comments, where the author is missing. |
|
134 | - * |
|
135 | - * @param mixed $comment_ids Either an array of integers or an integer. |
|
136 | - * @return string Language key for the success message. |
|
137 | - */ |
|
133 | + * Delete comments, where the author is missing. |
|
134 | + * |
|
135 | + * @param mixed $comment_ids Either an array of integers or an integer. |
|
136 | + * @return string Language key for the success message. |
|
137 | + */ |
|
138 | 138 | public function delete_author_comments($comment_ids) |
139 | 139 | { |
140 | 140 | $this->log->add_log('admin', 'clean_deletecna', 0, 0, array('LOG_CLEANUP_COMMENT_DELETE_NO_AUTHOR', count($comment_ids))); |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * Delete unwanted and obsolete personal galleries. |
|
148 | - * |
|
149 | - * @param array $unwanted_pegas User IDs we want to delete the pegas. |
|
150 | - * @param array $obsolete_pegas User IDs we want to delete the pegas. |
|
151 | - * @return array Language keys for the success messages. |
|
152 | - */ |
|
147 | + * Delete unwanted and obsolete personal galleries. |
|
148 | + * |
|
149 | + * @param array $unwanted_pegas User IDs we want to delete the pegas. |
|
150 | + * @param array $obsolete_pegas User IDs we want to delete the pegas. |
|
151 | + * @return array Language keys for the success messages. |
|
152 | + */ |
|
153 | 153 | public function delete_pegas($unwanted_pegas, $obsolete_pegas) |
154 | 154 | { |
155 | 155 | |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
283 | - * |
|
284 | - */ |
|
283 | + * |
|
284 | + */ |
|
285 | 285 | public function prune($pattern) |
286 | 286 | { |
287 | 287 | $sql_where = ''; |
@@ -325,8 +325,8 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | /** |
328 | - * |
|
329 | - */ |
|
328 | + * |
|
329 | + */ |
|
330 | 330 | public function lang_prune_pattern($pattern) |
331 | 331 | { |
332 | 332 | if (isset($pattern['image_album_id'])) |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | 'EXIF_CAM_MODEL' => 'Camera-model', |
31 | 31 | 'EXIF_DATE' => 'Image taken on', |
32 | 32 | 'EXIF_EXPOSURE' => 'Shutter speed', |
33 | - 'EXIF_EXPOSURE_EXP' => '%s Sec',// 'EXIF_EXPOSURE' unit |
|
33 | + 'EXIF_EXPOSURE_EXP' => '%s Sec', // 'EXIF_EXPOSURE' unit |
|
34 | 34 | 'EXIF_EXPOSURE_BIAS' => 'Exposure bias', |
35 | - 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV',// 'EXIF_EXPOSURE_BIAS' unit |
|
35 | + 'EXIF_EXPOSURE_BIAS_EXP' => '%s EV', // 'EXIF_EXPOSURE_BIAS' unit |
|
36 | 36 | 'EXIF_EXPOSURE_PROG' => 'Exposure program', |
37 | 37 | 'EXIF_EXPOSURE_PROG_0' => 'Not defined', |
38 | 38 | 'EXIF_EXPOSURE_PROG_1' => 'Manual', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'EXIF_FLASH_CASE_93' => 'Flash fired, auto mode, return light not detected, red-eye reduction mode', |
73 | 73 | 'EXIF_FLASH_CASE_95' => 'Flash fired, auto mode, return light detected, red-eye reduction mode', |
74 | 74 | 'EXIF_FOCAL' => 'Focus length', |
75 | - 'EXIF_FOCAL_EXP' => '%s mm',// 'EXIF_FOCAL' unit |
|
75 | + 'EXIF_FOCAL_EXP' => '%s mm', // 'EXIF_FOCAL' unit |
|
76 | 76 | 'EXIF_ISO' => 'ISO speed rating', |
77 | 77 | 'EXIF_METERING_MODE' => 'Metering mode', |
78 | 78 | 'EXIF_METERING_MODE_0' => 'Unknown', |