@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -59,11 +59,11 @@ |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * Helper function building queues |
|
63 | - * @param int $album album we build queue for |
|
64 | - * @param int $page This queue builder should return objects for MCP queues, so page? |
|
65 | - * @param int $per_page We need how many elements per page |
|
66 | - */ |
|
62 | + * Helper function building queues |
|
63 | + * @param int $album album we build queue for |
|
64 | + * @param int $page This queue builder should return objects for MCP queues, so page? |
|
65 | + * @param int $per_page We need how many elements per page |
|
66 | + */ |
|
67 | 67 | public function build_list($album, $page = 1, $per_page = 0) |
68 | 68 | { |
69 | 69 | // So if we are not forcing par page get it from config |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'IMAGE_ALBUM_ID' => $VAR['image_album_id'], |
143 | 143 | )); |
144 | 144 | unset($album_tmp); |
145 | - $waiting_images ++; |
|
145 | + $waiting_images++; |
|
146 | 146 | } |
147 | 147 | $this->template->assign_vars(array( |
148 | 148 | 'TOTAL_IMAGES_WAITING' => $this->lang->lang('WAITING_UNAPPROVED_IMAGE', (int) $count), |
@@ -212,21 +212,21 @@ discard block |
||
212 | 212 | { |
213 | 213 | $status[] = 0; |
214 | 214 | $status[] = 2; |
215 | - $actions['approve'] = 'QUEUES_A_APPROVE'; |
|
216 | - $actions['unapprove'] = 'QUEUES_A_UNAPPROVE'; |
|
217 | - $actions['lock'] = 'QUEUES_A_LOCK'; |
|
215 | + $actions['approve'] = 'QUEUES_A_APPROVE'; |
|
216 | + $actions['unapprove'] = 'QUEUES_A_UNAPPROVE'; |
|
217 | + $actions['lock'] = 'QUEUES_A_LOCK'; |
|
218 | 218 | } |
219 | 219 | if ($this->gallery_auth->acl_check('m_delete', $album['album_id'], $album['album_user_id'])) |
220 | 220 | { |
221 | - $actions['delete'] = 'QUEUES_A_DELETE'; |
|
221 | + $actions['delete'] = 'QUEUES_A_DELETE'; |
|
222 | 222 | } |
223 | 223 | if ($this->gallery_auth->acl_check('m_move', $album['album_id'], $album['album_user_id'])) |
224 | 224 | { |
225 | - $actions['move'] = 'QUEUES_A_MOVE'; |
|
225 | + $actions['move'] = 'QUEUES_A_MOVE'; |
|
226 | 226 | } |
227 | 227 | if ($this->gallery_auth->acl_check('m_report', $album['album_id'], $album['album_user_id'])) |
228 | 228 | { |
229 | - $actions['report'] = 'REPORT_A_CLOSE'; |
|
229 | + $actions['report'] = 'REPORT_A_CLOSE'; |
|
230 | 230 | } |
231 | 231 | $sql = 'SELECT COUNT(DISTINCT image_id) AS count FROM ' . $this->images_table . ' WHERE ' . $this->db->sql_in_set('image_status', $status) . ' AND image_album_id = ' . (int) $album_id; |
232 | 232 | $result = $this->db->sql_query($sql); |
@@ -83,8 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $mod_array[] = 0; |
85 | 85 | } |
86 | - } |
|
87 | - else |
|
86 | + } else |
|
88 | 87 | { |
89 | 88 | $mod_array = array($album); |
90 | 89 | } |
@@ -161,8 +160,7 @@ discard block |
||
161 | 160 | $this->template->assign_vars(array( |
162 | 161 | 'TOTAL_PAGES' => $this->lang->lang('PAGE_TITLE_NUMBER', $page + 1), |
163 | 162 | )); |
164 | - } |
|
165 | - else |
|
163 | + } else |
|
166 | 164 | { |
167 | 165 | $this->pagination->generate_template_pagination(array( |
168 | 166 | 'routes' => array( |
@@ -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 | } |
@@ -14,40 +14,40 @@ discard block |
||
14 | 14 | |
15 | 15 | class album |
16 | 16 | { |
17 | - /** @var \phpbb\db\driver\driver_interface */ |
|
18 | - protected $db; |
|
17 | + /** @var \phpbb\db\driver\driver_interface */ |
|
18 | + protected $db; |
|
19 | 19 | |
20 | - /** @var \phpbb\user */ |
|
21 | - protected $user; |
|
20 | + /** @var \phpbb\user */ |
|
21 | + protected $user; |
|
22 | 22 | |
23 | - /** @var language */ |
|
24 | - protected $language; |
|
23 | + /** @var language */ |
|
24 | + protected $language; |
|
25 | 25 | |
26 | - /** @var \phpbb\profilefields\manager */ |
|
27 | - protected $user_cpf; |
|
26 | + /** @var \phpbb\profilefields\manager */ |
|
27 | + protected $user_cpf; |
|
28 | 28 | |
29 | - /** @var \phpbbgallery\core\auth\auth */ |
|
30 | - protected $gallery_auth; |
|
29 | + /** @var \phpbbgallery\core\auth\auth */ |
|
30 | + protected $gallery_auth; |
|
31 | 31 | |
32 | - /** @var \phpbbgallery\core\cache */ |
|
33 | - protected $gallery_cache; |
|
32 | + /** @var \phpbbgallery\core\cache */ |
|
33 | + protected $gallery_cache; |
|
34 | 34 | |
35 | - /** @var \phpbbgallery\core\block */ |
|
36 | - protected $block; |
|
35 | + /** @var \phpbbgallery\core\block */ |
|
36 | + protected $block; |
|
37 | 37 | |
38 | - /** @var \phpbbgallery\core\config */ |
|
39 | - protected $gallery_config; |
|
38 | + /** @var \phpbbgallery\core\config */ |
|
39 | + protected $gallery_config; |
|
40 | 40 | |
41 | - /** @var */ |
|
42 | - protected $images_table; |
|
41 | + /** @var */ |
|
42 | + protected $images_table; |
|
43 | 43 | |
44 | - /** @var */ |
|
45 | - protected $watch_table; |
|
44 | + /** @var */ |
|
45 | + protected $watch_table; |
|
46 | 46 | |
47 | - /** @var */ |
|
48 | - protected $contest_table; |
|
47 | + /** @var */ |
|
48 | + protected $contest_table; |
|
49 | 49 | |
50 | - /** @var */ |
|
50 | + /** @var */ |
|
51 | 51 | protected $albums_table; |
52 | 52 | |
53 | 53 | /** |
@@ -463,8 +463,8 @@ discard block |
||
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
466 | - * Create array of album IDs that are public |
|
467 | - */ |
|
466 | + * Create array of album IDs that are public |
|
467 | + */ |
|
468 | 468 | public function get_public_albums() |
469 | 469 | { |
470 | 470 | $sql = 'SELECT album_id |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | throw new \phpbb\exception\http_exception(404, 'ALBUM_NOT_EXIST'); |
127 | 127 | } |
128 | 128 | |
129 | - if ($extended_info && !isset($row['contest_id'])) |
|
129 | + if ($extended_info && !isset($row['contest_id'])) |
|
130 | 130 | { |
131 | 131 | $row['contest_id'] = 0; |
132 | 132 | $row['contest_rates_start'] = 0; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | // Get the album_user_id, so we can keep the user_colour |
341 | 341 | $sql = 'SELECT album_user_id |
342 | - FROM ' . $this->albums_table .' |
|
342 | + FROM ' . $this->albums_table . ' |
|
343 | 343 | WHERE album_id = ' . (int) $album_id; |
344 | 344 | $result = $this->db->sql_query($sql); |
345 | 345 | $album_user_id = $this->db->sql_fetchfield('album_user_id'); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | // Number of not unapproved images |
349 | 349 | $sql = 'SELECT COUNT(image_id) images |
350 | - FROM ' . $this->images_table .' |
|
350 | + FROM ' . $this->images_table . ' |
|
351 | 351 | WHERE image_status <> ' . (int) $this->block->get_image_status_unapproved() . ' |
352 | 352 | AND image_status <> ' . (int) $this->block->get_image_status_orphan() . ' |
353 | 353 | AND image_album_id = ' . (int) $album_id; |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | // Number of total images |
359 | 359 | $sql = 'SELECT COUNT(image_id) images_real |
360 | - FROM ' . $this->images_table .' |
|
360 | + FROM ' . $this->images_table . ' |
|
361 | 361 | WHERE image_status <> ' . (int) $this->block->get_image_status_orphan() . ' |
362 | 362 | AND image_album_id = ' . (int) $album_id; |
363 | 363 | $result = $this->db->sql_query($sql); |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | |
367 | 367 | // Data of the last not unapproved image |
368 | 368 | $sql = 'SELECT image_id, image_time, image_name, image_username, image_user_colour, image_user_id |
369 | - FROM ' . $this->images_table .' |
|
369 | + FROM ' . $this->images_table . ' |
|
370 | 370 | WHERE image_status <> ' . (int) $this->block->get_image_status_unapproved() . ' |
371 | 371 | AND image_status <> ' . (int) $this->block->get_image_status_orphan() . ' |
372 | 372 | AND image_album_id = ' . (int) $album_id . ' |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | } |
406 | 406 | $this->db->sql_freeresult($result); |
407 | 407 | |
408 | - $sql = 'UPDATE ' . $this->albums_table .' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
408 | + $sql = 'UPDATE ' . $this->albums_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' |
|
409 | 409 | WHERE album_id = ' . (int) $album_id; |
410 | 410 | $this->db->sql_query($sql); |
411 | 411 | |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | 'album_last_username' => '', |
436 | 436 | 'album_last_user_colour' => $user_colour, |
437 | 437 | ); |
438 | - $this->db->sql_query('INSERT INTO ' . $this->albums_table. ' ' . $this->db->sql_build_array('INSERT', $album_data)); |
|
438 | + $this->db->sql_query('INSERT INTO ' . $this->albums_table . ' ' . $this->db->sql_build_array('INSERT', $album_data)); |
|
439 | 439 | $personal_album_id = $this->db->sql_nextid(); |
440 | 440 | |
441 | 441 | $gallery_user->update_data(array( |
@@ -219,8 +219,7 @@ discard block |
||
219 | 219 | { |
220 | 220 | $padding .= ' '; |
221 | 221 | $padding_store[$row['parent_id']] = $padding; |
222 | - } |
|
223 | - else if ($row['left_id'] > $right + 1) |
|
222 | + } else if ($row['left_id'] > $right + 1) |
|
224 | 223 | { |
225 | 224 | $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : ''; |
226 | 225 | } |
@@ -246,15 +245,13 @@ discard block |
||
246 | 245 | if (($select_id == $this->gallery_auth->get_setting_permissions()) && !$row['album_user_id']) |
247 | 246 | { |
248 | 247 | $list = true; |
249 | - } |
|
250 | - else if (!$row['album_user_id']) |
|
248 | + } else if (!$row['album_user_id']) |
|
251 | 249 | { |
252 | 250 | if ($this->gallery_auth->acl_check('a_list', $row['album_id'], $row['album_user_id']) || defined('IN_ADMIN')) |
253 | 251 | { |
254 | 252 | $list = true; |
255 | 253 | } |
256 | - } |
|
257 | - else if (!$ignore_personals) |
|
254 | + } else if (!$ignore_personals) |
|
258 | 255 | { |
259 | 256 | if ($row['album_user_id'] == $this->user->data['user_id']) |
260 | 257 | { |
@@ -265,16 +262,14 @@ discard block |
||
265 | 262 | if ($requested_permission) |
266 | 263 | { |
267 | 264 | $requested_own = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_own_album()); |
268 | - } |
|
269 | - else |
|
265 | + } else |
|
270 | 266 | { |
271 | 267 | $requested_own = false; // We need the negated version of true here |
272 | 268 | } |
273 | 269 | } |
274 | 270 | $list = (!$list) ? $access_own : $list; |
275 | 271 | $disabled = (!$disabled) ? $requested_own : $disabled; |
276 | - } |
|
277 | - else if ($row['album_user_id']) |
|
272 | + } else if ($row['album_user_id']) |
|
278 | 273 | { |
279 | 274 | if (!$c_access_personal) |
280 | 275 | { |
@@ -283,8 +278,7 @@ discard block |
||
283 | 278 | if ($requested_permission) |
284 | 279 | { |
285 | 280 | $requested_personal = !$this->gallery_auth->acl_check($requested_permission, $this->gallery_auth->get_personal_album()); |
286 | - } |
|
287 | - else |
|
281 | + } else |
|
288 | 282 | { |
289 | 283 | $requested_personal = false; // We need the negated version of true here |
290 | 284 | } |
@@ -296,8 +290,7 @@ discard block |
||
296 | 290 | if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($album_user_id != $row['album_user_id'])) |
297 | 291 | { |
298 | 292 | $list = false; |
299 | - } |
|
300 | - else if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0)) |
|
293 | + } else if (($album_user_id != \phpbbgallery\core\block::PUBLIC_ALBUM) && ($row['parent_id'] == 0)) |
|
301 | 294 | { |
302 | 295 | $disabled = true; |
303 | 296 | } |
@@ -315,8 +308,7 @@ discard block |
||
315 | 308 | $gallery_albumbox = "<select name='$select_name' id='$select_name'>"; |
316 | 309 | $gallery_albumbox .= $album_list; |
317 | 310 | $gallery_albumbox .= '</select>'; |
318 | - } |
|
319 | - else |
|
311 | + } else |
|
320 | 312 | { |
321 | 313 | $gallery_albumbox = $album_list; |
322 | 314 | } |
@@ -384,8 +376,7 @@ discard block |
||
384 | 376 | 'album_last_user_colour' => $row['image_user_colour'], |
385 | 377 | 'album_last_user_id' => $row['image_user_id'], |
386 | 378 | ); |
387 | - } |
|
388 | - else |
|
379 | + } else |
|
389 | 380 | { |
390 | 381 | // No approved image, so we clear the columns |
391 | 382 | $sql_ary = array( |
@@ -222,8 +222,7 @@ discard block |
||
222 | 222 | SET album_parents = '" . $this->db->sql_escape($album_data['album_parents']) . "' |
223 | 223 | WHERE parent_id = " . (int) $album_data['parent_id']; |
224 | 224 | $this->db->sql_query($sql); |
225 | - } |
|
226 | - else |
|
225 | + } else |
|
227 | 226 | { |
228 | 227 | $album_parents = unserialize($album_data['album_parents']); |
229 | 228 | } |
@@ -291,16 +290,14 @@ discard block |
||
291 | 290 | if (!empty($row['user_id'])) |
292 | 291 | { |
293 | 292 | $album_moderators[$a_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); |
294 | - } |
|
295 | - else |
|
293 | + } else |
|
296 | 294 | { |
297 | 295 | $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $this->language->lang('G_' . $row['group_name']) : $row['group_name']); |
298 | 296 | |
299 | 297 | if ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')) |
300 | 298 | { |
301 | 299 | $album_moderators[$a_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>'; |
302 | - } |
|
303 | - else |
|
300 | + } else |
|
304 | 301 | { |
305 | 302 | $album_moderators[$a_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid($this->root_path . 'memberlist.' . $this->php_ext, 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>'; |
306 | 303 | } |
@@ -344,8 +341,7 @@ discard block |
||
344 | 341 | } |
345 | 342 | $root_data = array('album_id' => \phpbbgallery\core\block::PUBLIC_ALBUM); |
346 | 343 | $sql_where = 'a.album_user_id = ' . \phpbbgallery\core\block::PUBLIC_ALBUM; |
347 | - } |
|
348 | - else if ($root_data == 'personal') |
|
344 | + } else if ($root_data == 'personal') |
|
349 | 345 | { |
350 | 346 | if ($mark_read == 'albums') |
351 | 347 | { |
@@ -362,8 +358,7 @@ discard block |
||
362 | 358 | { |
363 | 359 | $sql_where .= ' AND u.username_clean NOT ' . $this->db->sql_like_expression(chr($i) . $this->db->any_char); |
364 | 360 | } |
365 | - } |
|
366 | - else if ($first_char) |
|
361 | + } else if ($first_char) |
|
367 | 362 | { |
368 | 363 | $sql_where .= ' AND u.username_clean ' . $this->db->sql_like_expression(substr($first_char, 0, 1) . $this->db->any_char); |
369 | 364 | } |
@@ -407,8 +402,7 @@ discard block |
||
407 | 402 | 'phpbbgallery_core_search_recent_page',), |
408 | 403 | 'params' => array()), 'pagination', 'page', $num_pegas, $limit, $start |
409 | 404 | );*/ |
410 | - } |
|
411 | - else |
|
405 | + } else |
|
412 | 406 | { |
413 | 407 | $sql_where = 'a.left_id > ' . $root_data['left_id'] . ' AND a.left_id < ' . $root_data['right_id'] . ' AND a.album_user_id = ' . $root_data['album_user_id']; |
414 | 408 | } |
@@ -496,10 +490,12 @@ discard block |
||
496 | 490 | continue; |
497 | 491 | } |
498 | 492 | |
499 | - if (false)//@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
493 | + if (false) { |
|
494 | + //@todo !$this->gallery_auth->acl_check('a_list', $album_id, $row['album_user_id'])) |
|
500 | 495 | { |
501 | 496 | // if the user does not have permissions to list this album, skip everything until next branch |
502 | 497 | $right_id = $row['right_id']; |
498 | + } |
|
503 | 499 | continue; |
504 | 500 | } |
505 | 501 | |
@@ -524,8 +520,7 @@ discard block |
||
524 | 520 | $album_rows[$parent_id]['album_type_last_image'] = $row['album_type']; |
525 | 521 | $album_rows[$parent_id]['album_contest_marked'] = $row['contest_marked']; |
526 | 522 | $album_rows[$parent_id]['orig_album_last_image_time'] = $row['album_last_image_time']; |
527 | - } |
|
528 | - else if ($row['album_type']) |
|
523 | + } else if ($row['album_type']) |
|
529 | 524 | { |
530 | 525 | $subalbums[$parent_id][$album_id]['display'] = ($row['display_on_index']) ? true : false; |
531 | 526 | $subalbums[$parent_id][$album_id]['name'] = $row['album_name']; |
@@ -567,16 +562,14 @@ discard block |
||
567 | 562 | { |
568 | 563 | $this->misc->markread('all'); |
569 | 564 | $message = $this->language->lang('RETURN_INDEX', '<a href="' . $redirect . '">', '</a>'); |
570 | - } |
|
571 | - else |
|
565 | + } else |
|
572 | 566 | { |
573 | 567 | $this->misc->markread('albums', $album_ids); |
574 | 568 | $message = $this->language->lang('RETURN_ALBUM', '<a href="' . $redirect . '">', '</a>'); |
575 | 569 | } |
576 | 570 | meta_refresh(3, $redirect); |
577 | 571 | trigger_error($this->language->lang('ALBUMS_MARKED') . '<br /><br />' . $message); |
578 | - } |
|
579 | - else |
|
572 | + } else |
|
580 | 573 | { |
581 | 574 | $message = $this->language->lang('RETURN_PAGE', '<a href="' . $redirect . '">', '</a>'); |
582 | 575 | meta_refresh(3, $redirect); |
@@ -654,8 +647,7 @@ discard block |
||
654 | 647 | 'name' => $subalbum_row['name'], |
655 | 648 | 'unread' => $subalbum_unread, |
656 | 649 | ); |
657 | - } |
|
658 | - else |
|
650 | + } else |
|
659 | 651 | { |
660 | 652 | unset($subalbums[$album_id][$subalbum_id]); |
661 | 653 | } |
@@ -668,8 +660,7 @@ discard block |
||
668 | 660 | |
669 | 661 | $l_subalbums = (sizeof($subalbums[$album_id]) == 1) ? $this->language->lang('SUBALBUM') : $this->language->lang('SUBALBUMS'); |
670 | 662 | $folder_image = ($album_unread) ? 'forum_unread_subforum' : 'forum_read_subforum'; |
671 | - } |
|
672 | - else |
|
663 | + } else |
|
673 | 664 | { |
674 | 665 | $folder_alt = ($album_unread) ? 'NEW_IMAGES' : 'NO_NEW_IMAGES'; |
675 | 666 | $folder_image = ($album_unread) ? 'forum_unread' : 'forum_read'; |
@@ -694,8 +685,7 @@ discard block |
||
694 | 685 | $lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
695 | 686 | // phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
696 | 687 | $lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
697 | - } |
|
698 | - else |
|
688 | + } else |
|
699 | 689 | { |
700 | 690 | $lastimage_time = $lastimage_album_type = $lastimage_contest_marked = 0; |
701 | 691 | $lastimage_uc_fake_thumbnail = $lastimage_uc_thumbnail = $lastimage_uc_name = $lastimage_uc_icon = ''; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public $album_mode; |
35 | 35 | |
36 | 36 | public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $helper, |
37 | - \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, |
|
37 | + \phpbb\db\driver\driver_interface $db, \phpbb\pagination $pagination, |
|
38 | 38 | \phpbb\request\request $request, \phpbb\template\template $template, |
39 | 39 | \phpbb\user $user, \phpbb\language\language $language, \phpbbgallery\core\auth\auth $gallery_auth, |
40 | 40 | \phpbbgallery\core\user $gallery_user, \phpbbgallery\core\misc $misc, |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $sql = 'SELECT a2.* |
96 | 96 | FROM ' . $this->table_albums . ' a1 |
97 | - LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition .') AND a2.album_user_id = ' . (int) $branch_user_id .' |
|
97 | + LEFT JOIN ' . $this->table_albums . ' a2 ON (' . $condition . ') AND a2.album_user_id = ' . (int) $branch_user_id . ' |
|
98 | 98 | WHERE a1.album_id = ' . (int) $album_id . ' |
99 | 99 | AND a1.album_user_id = ' . (int) $branch_user_id . ' |
100 | 100 | ORDER BY a2.left_id ' . (($order == 'descending') ? 'ASC' : 'DESC'); |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | 'ALBUM_ID' => $album_data['album_id'], |
178 | 178 | 'ALBUM_NAME' => $album_data['album_name'], |
179 | 179 | 'ALBUM_DESC' => generate_text_for_display($album_data['album_desc'], $album_data['album_desc_uid'], $album_data['album_desc_bitfield'], $album_data['album_desc_options']), |
180 | - 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
181 | - 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
182 | - 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time())? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
180 | + 'ALBUM_CONTEST_START' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_START' . ((($album_data['contest_start']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start']), false, true)) : '', |
|
181 | + 'ALBUM_CONTEST_RATING' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_RATING_START' . ((($album_data['contest_start'] + $album_data['contest_rating']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_rating']), false, true)) : '', |
|
182 | + 'ALBUM_CONTEST_END' => ($album_data['album_type'] == \phpbbgallery\core\block::TYPE_CONTEST) ? $this->language->lang('CONTEST_END' . ((($album_data['contest_start'] + $album_data['contest_end']) < time()) ? 'ED' : 'S'), $this->user->format_date(($album_data['contest_start'] + $album_data['contest_end']), false, true)) : '', |
|
183 | 183 | 'U_VIEW_ALBUM' => $this->helper->route('phpbbgallery_core_album', array('album_id' => (int) $album_data['album_id'])), |
184 | 184 | )); |
185 | 185 | |
@@ -691,9 +691,9 @@ discard block |
||
691 | 691 | // phpbb_ext_gallery_core_image::generate_link('thumbnail', $phpbb_ext_gallery->config->get('link_thumbnail'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
692 | 692 | $lastimage_uc_thumbnail = $row['album_image'] ? generate_board_url() . '/' . $row['album_image'] : $this->helper->route('phpbbgallery_core_image_file_mini', array('image_id' => $row['album_last_image_id'])); |
693 | 693 | // phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
694 | - $lastimage_uc_name = '';//@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
694 | + $lastimage_uc_name = ''; //@todo phpbb_ext_gallery_core_image::generate_link('image_name', $phpbb_ext_gallery->config->get('link_image_name'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
695 | 695 | // phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
696 | - $lastimage_uc_icon = '';//@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
696 | + $lastimage_uc_icon = ''; //@todo phpbb_ext_gallery_core_image::generate_link('lastimage_icon', $phpbb_ext_gallery->config->get('link_image_icon'), $lastimage_image_id, $lastimage_name, $lastimage_album_id); |
|
697 | 697 | } |
698 | 698 | else |
699 | 699 | { |
@@ -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; |