@@ -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 | |
@@ -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']; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $phpbb_gallery_url = $phpbb_container->get('phpbbgallery.core.url'); |
| 31 | 31 | $phpbb_gallery_url->_include('functions_display', 'phpbb'); |
| 32 | 32 | |
| 33 | - $phpbb_ext_gallery_core_album =$phpbb_container->get('phpbbgallery.core.album'); |
|
| 33 | + $phpbb_ext_gallery_core_album = $phpbb_container->get('phpbbgallery.core.album'); |
|
| 34 | 34 | |
| 35 | 35 | $phpbb_ext_gallery_core_auth = $phpbb_container->get('phpbbgallery.core.auth'); |
| 36 | 36 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | function initialise_album() |
| 156 | 156 | { |
| 157 | - global $cache, $db, $user, $phpbb_ext_gallery_core_auth, $phpbb_ext_gallery_core_album, $phpbb_ext_gallery_config, $albums_table, $phpbb_ext_gallery_user; |
|
| 157 | + global $cache, $db, $user, $phpbb_ext_gallery_core_auth, $phpbb_ext_gallery_core_album, $phpbb_ext_gallery_config, $albums_table, $phpbb_ext_gallery_user; |
|
| 158 | 158 | global $request, $users_table, $phpbb_container; |
| 159 | 159 | |
| 160 | 160 | // we will have to initialise $phpbb_ext_gallery_user |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | $this->language = $phpbb_container->get('language'); |
| 450 | 450 | |
| 451 | - $phpbb_gallery_url->_include(array('bbcode','message_parser'), 'phpbb'); |
|
| 451 | + $phpbb_gallery_url->_include(array('bbcode', 'message_parser'), 'phpbb'); |
|
| 452 | 452 | |
| 453 | 453 | $album_id = $request->variable('album_id', 0); |
| 454 | 454 | $phpbb_ext_gallery_core_album->check_user($album_id); |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | $sql = 'UPDATE ' . $albums_table . " |
| 838 | 838 | SET right_id = right_id - $delete_id |
| 839 | 839 | WHERE right_id > $right_id |
| 840 | - AND album_user_id = ". (int) $user->data['user_id']; |
|
| 840 | + AND album_user_id = " . (int) $user->data['user_id']; |
|
| 841 | 841 | $db->sql_query($sql); |
| 842 | 842 | } |
| 843 | 843 | |
@@ -1021,9 +1021,9 @@ discard block |
||
| 1021 | 1021 | $db->sql_freeresult($result); |
| 1022 | 1022 | |
| 1023 | 1023 | // Subscribed images |
| 1024 | - $start = $request->variable('start', 0); |
|
| 1025 | - $images_per_page = $phpbb_ext_gallery_config->get('items_per_page'); |
|
| 1026 | - $total_images = 0; |
|
| 1024 | + $start = $request->variable('start', 0); |
|
| 1025 | + $images_per_page = $phpbb_ext_gallery_config->get('items_per_page'); |
|
| 1026 | + $total_images = 0; |
|
| 1027 | 1027 | |
| 1028 | 1028 | $sql = 'SELECT COUNT(image_id) as images |
| 1029 | 1029 | FROM ' . $watch_table . ' |
@@ -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 & |
@@ -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 = []; |
| 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'])) |
@@ -85,8 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $mod_array[] = 0; |
| 87 | 87 | } |
| 88 | - } |
|
| 89 | - else |
|
| 88 | + } else |
|
| 90 | 89 | { |
| 91 | 90 | $mod_array = array($album); |
| 92 | 91 | } |
@@ -162,8 +161,7 @@ discard block |
||
| 162 | 161 | $this->template->assign_vars(array( |
| 163 | 162 | 'TOTAL_PAGES' => $this->lang->lang('PAGE_TITLE_NUMBER', $page + 1), |
| 164 | 163 | )); |
| 165 | - } |
|
| 166 | - else |
|
| 164 | + } else |
|
| 167 | 165 | { |
| 168 | 166 | $this->pagination->generate_template_pagination(array( |
| 169 | 167 | 'routes' => array( |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | else |
| 262 | 262 | { |
| 263 | - $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
|
| 263 | + $s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />'; |
|
| 264 | 264 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
| 265 | 265 | foreach ($approve_ary as $id => $var) |
| 266 | 266 | { |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | else |
| 363 | 363 | { |
| 364 | - $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
|
| 364 | + $s_hidden_fields = '<input type="hidden" name="action[' . $action . ']" value="' . $action . '" />'; |
|
| 365 | 365 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
| 366 | 366 | foreach ($report_ary as $var) |
| 367 | 367 | { |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | case 'reports_close': |
| 584 | 584 | if (confirm_box(true)) |
| 585 | 585 | { |
| 586 | - $back_link = $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id)); |
|
| 586 | + $back_link = $this->helper->route('phpbbgallery_core_moderate_image', array('image_id' => $image_id)); |
|
| 587 | 587 | $this->report->close_reports_by_image($image_id); |
| 588 | 588 | $message = $this->language->lang('WAITING_REPORTED_DONE', 1); |
| 589 | 589 | $this->url->meta_refresh(3, $back_link); |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | 'REPORT_TIME' => $this->user->format_date($var['report_time']), |
| 680 | 680 | 'REPORT_NOTE' => $var['report_note'], |
| 681 | 681 | 'STATUS' => $var['report_status'], |
| 682 | - 'MANAGER' => $var['report_manager'] != 0 ? $this->user_loader->get_username($var['report_manager'], 'full') : false, |
|
| 682 | + 'MANAGER' => $var['report_manager'] != 0 ? $this->user_loader->get_username($var['report_manager'], 'full') : false, |
|
| 683 | 683 | )); |
| 684 | 684 | } |
| 685 | 685 | return $this->helper->render('gallery/moderate_image_overview.html', $this->language->lang('GALLERY')); |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | $image_data = $this->image->get_image_data($image_id); |
| 805 | 805 | $album_id = $image_data['image_album_id']; |
| 806 | 806 | //$user_id = $image_data['image_user_id']; |
| 807 | - $album_data = $this->album->get_info($album_id); |
|
| 807 | + $album_data = $this->album->get_info($album_id); |
|
| 808 | 808 | $album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id)); |
| 809 | 809 | $image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id)); |
| 810 | 810 | $album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login'); |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | $image_data = $this->image->get_image_data($image_id); |
| 853 | 853 | $album_id = $image_data['image_album_id']; |
| 854 | 854 | //$user_id = $image_data['image_user_id']; |
| 855 | - $album_data = $this->album->get_info($album_id); |
|
| 855 | + $album_data = $this->album->get_info($album_id); |
|
| 856 | 856 | $album_backlink = $this->helper->route('phpbbgallery_core_album', array('album_id' => $album_id)); |
| 857 | 857 | $image_backlink = $this->helper->route('phpbbgallery_core_image', array('image_id' => $image_id)); |
| 858 | 858 | $album_loginlink = append_sid($this->root_path . 'ucp.' . $this->php_ext . '?mode=login'); |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | $image_id_ary = array($image_id); |
| 869 | 869 | $this->image->lock_images($image_id_ary, $album_data['album_id']); |
| 870 | 870 | // To DO - add notification |
| 871 | - $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1)); |
|
| 871 | + $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE', 1)); |
|
| 872 | 872 | meta_refresh($meta_refresh_time, $image_backlink); |
| 873 | 873 | trigger_error($message); |
| 874 | 874 | } |
@@ -149,8 +149,7 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 151 | 151 | } |
| 152 | - } |
|
| 153 | - else |
|
| 152 | + } else |
|
| 154 | 153 | { |
| 155 | 154 | $album = $this->album->get_info($album_id); |
| 156 | 155 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | { |
| 212 | 211 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 213 | 212 | } |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | { |
| 217 | 215 | $album = $this->album->get_info($album_id); |
| 218 | 216 | if (!$this->gallery_auth->acl_check('m_status', $album['album_id'], $album['album_user_id'])) |
@@ -257,8 +255,7 @@ discard block |
||
| 257 | 255 | $this->url->meta_refresh(3, $back_link); |
| 258 | 256 | trigger_error($message); |
| 259 | 257 | } |
| 260 | - } |
|
| 261 | - else |
|
| 258 | + } else |
|
| 262 | 259 | { |
| 263 | 260 | $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
| 264 | 261 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -307,8 +304,7 @@ discard block |
||
| 307 | 304 | { |
| 308 | 305 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 309 | 306 | } |
| 310 | - } |
|
| 311 | - else |
|
| 307 | + } else |
|
| 312 | 308 | { |
| 313 | 309 | $album = $this->album->get_info($album_id); |
| 314 | 310 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -358,8 +354,7 @@ discard block |
||
| 358 | 354 | $message = $this->language->lang('WAITING_REPORTED_DONE', count($report_ary)); |
| 359 | 355 | $this->url->meta_refresh(3, $back_link); |
| 360 | 356 | trigger_error($message); |
| 361 | - } |
|
| 362 | - else |
|
| 357 | + } else |
|
| 363 | 358 | { |
| 364 | 359 | $s_hidden_fields = '<input type="hidden" name="action['.$action.']" value="' . $action . '" />'; |
| 365 | 360 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -379,8 +374,7 @@ discard block |
||
| 379 | 374 | { |
| 380 | 375 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 381 | 376 | } |
| 382 | - } |
|
| 383 | - else |
|
| 377 | + } else |
|
| 384 | 378 | { |
| 385 | 379 | $album = $this->album->get_info($album_id); |
| 386 | 380 | if (!$this->gallery_auth->acl_check('m_report', $album['album_id'], $album['album_user_id'])) |
@@ -470,8 +464,7 @@ discard block |
||
| 470 | 464 | $this->url->meta_refresh(3, $back_link); |
| 471 | 465 | trigger_error($message); |
| 472 | 466 | } |
| 473 | - } |
|
| 474 | - else |
|
| 467 | + } else |
|
| 475 | 468 | { |
| 476 | 469 | $s_hidden_fields = '<input type="hidden" name="select_action" value="' . $action . '" />'; |
| 477 | 470 | $s_hidden_fields .= '<input type="hidden" name="back_link" value="' . $back_link . '" />'; |
@@ -492,8 +485,7 @@ discard block |
||
| 492 | 485 | 'S_HIDDEN_FIELDS' => $s_hidden_fields, |
| 493 | 486 | )); |
| 494 | 487 | return $this->helper->render('gallery/mcp_body.html', $this->language->lang('GALLERY')); |
| 495 | - } |
|
| 496 | - else |
|
| 488 | + } else |
|
| 497 | 489 | { |
| 498 | 490 | confirm_box(false, $this->language->lang('QUEUES_A_' . strtoupper($action) . '2_CONFIRM'), $s_hidden_fields); |
| 499 | 491 | } |
@@ -508,8 +500,7 @@ discard block |
||
| 508 | 500 | { |
| 509 | 501 | $this->misc->not_authorised($album_backlink, $album_loginlink, 'LOGIN_EXPLAIN_UPLOAD'); |
| 510 | 502 | } |
| 511 | - } |
|
| 512 | - else |
|
| 503 | + } else |
|
| 513 | 504 | { |
| 514 | 505 | $album = $this->album->get_info($album_id); |
| 515 | 506 | if (!$this->gallery_auth->acl_check('m_', $album['album_id'], $album['album_user_id'])) |
@@ -583,8 +574,7 @@ discard block |
||
| 583 | 574 | $message = $this->language->lang('WAITING_REPORTED_DONE', 1); |
| 584 | 575 | $this->url->meta_refresh(3, $back_link); |
| 585 | 576 | trigger_error($message); |
| 586 | - } |
|
| 587 | - else |
|
| 577 | + } else |
|
| 588 | 578 | { |
| 589 | 579 | $s_hidden_fields = '<input type="hidden" name="action" value="reports_close" />'; |
| 590 | 580 | confirm_box(false, $this->language->lang('REPORT_A_CLOSE2_CONFIRM'), $s_hidden_fields); |
@@ -621,13 +611,11 @@ discard block |
||
| 621 | 611 | { |
| 622 | 612 | $select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>'; |
| 623 | 613 | $select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>'; |
| 624 | - } |
|
| 625 | - else if ($image_data['image_status'] == 1) |
|
| 614 | + } else if ($image_data['image_status'] == 1) |
|
| 626 | 615 | { |
| 627 | 616 | $select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>'; |
| 628 | 617 | $select_select .= '<option value="images_lock">' . $this->language->lang('QUEUE_A_LOCK') . '</option>'; |
| 629 | - } |
|
| 630 | - else |
|
| 618 | + } else |
|
| 631 | 619 | { |
| 632 | 620 | $select_select .= '<option value="images_approve">' . $this->language->lang('QUEUE_A_APPROVE') . '</option>'; |
| 633 | 621 | $select_select .= '<option value="images_unapprove">' . $this->language->lang('QUEUE_A_UNAPPROVE') . '</option>'; |
@@ -646,8 +634,7 @@ discard block |
||
| 646 | 634 | if ($open_report) |
| 647 | 635 | { |
| 648 | 636 | $select_select .= '<option value="reports_close">' . $this->language->lang('REPORT_A_CLOSE') . '</option>'; |
| 649 | - } |
|
| 650 | - else |
|
| 637 | + } else |
|
| 651 | 638 | { |
| 652 | 639 | $select_select .= '<option value="reports_open">' . $this->language->lang('REPORT_A_OPEN') . '</option>'; |
| 653 | 640 | } |
@@ -725,8 +712,7 @@ discard block |
||
| 725 | 712 | $message = $this->language->lang('WAITING_APPROVED_IMAGE', 1); |
| 726 | 713 | meta_refresh($meta_refresh_time, $image_backlink); |
| 727 | 714 | trigger_error($message); |
| 728 | - } |
|
| 729 | - else |
|
| 715 | + } else |
|
| 730 | 716 | { |
| 731 | 717 | $this->template->assign_vars(array( |
| 732 | 718 | 'S_NOTIFY_POSTER' => $show_notify, |
@@ -775,8 +761,7 @@ discard block |
||
| 775 | 761 | $message = sprintf($this->language->lang('WAITING_UNAPPROVED_IMAGE', 1)); |
| 776 | 762 | meta_refresh($meta_refresh_time, $image_backlink); |
| 777 | 763 | trigger_error($message); |
| 778 | - } |
|
| 779 | - else |
|
| 764 | + } else |
|
| 780 | 765 | { |
| 781 | 766 | $s_hidden_fields = ''; |
| 782 | 767 | confirm_box(false, 'QUEUE_A_UNAPPROVE2', $s_hidden_fields); |
@@ -817,8 +802,7 @@ discard block |
||
| 817 | 802 | $this->album->update_info($moving_target); |
| 818 | 803 | meta_refresh($meta_refresh_time, $image_backlink); |
| 819 | 804 | trigger_error($message); |
| 820 | - } |
|
| 821 | - else |
|
| 805 | + } else |
|
| 822 | 806 | { |
| 823 | 807 | $category_select = $this->album->get_albumbox(false, 'moving_target', $album_id, 'm_move', $album_id); |
| 824 | 808 | $this->template->assign_vars(array( |
@@ -862,8 +846,7 @@ discard block |
||
| 862 | 846 | $message = sprintf($this->language->lang('WAITING_LOCKED_IMAGE',1)); |
| 863 | 847 | meta_refresh($meta_refresh_time, $image_backlink); |
| 864 | 848 | trigger_error($message); |
| 865 | - } |
|
| 866 | - else |
|
| 849 | + } else |
|
| 867 | 850 | { |
| 868 | 851 | $s_hidden_fields = ''; |
| 869 | 852 | confirm_box(false, 'QUEUE_A_LOCK2', $s_hidden_fields); |
@@ -363,8 +363,7 @@ discard block |
||
| 363 | 363 | { |
| 364 | 364 | $url = $this->url->append_sid('image_page', "album_id=$album_id&image_id=$next_image{$additional_parameters}"); |
| 365 | 365 | $tpl = '<a href="{IMAGE_URL}" title="{IMAGE_NAME}">{CONTENT}</a>'; |
| 366 | - } |
|
| 367 | - else |
|
| 366 | + } else |
|
| 368 | 367 | { |
| 369 | 368 | $tpl = '{CONTENT}'; |
| 370 | 369 | } |
@@ -440,8 +439,7 @@ discard block |
||
| 440 | 439 | { |
| 441 | 440 | $this->gallery_config->inc('num_images', (int) $num_images); |
| 442 | 441 | $this->gallery_config->inc('num_comments', (int) $num_comments); |
| 443 | - } |
|
| 444 | - else |
|
| 442 | + } else |
|
| 445 | 443 | { |
| 446 | 444 | $this->gallery_config->dec('num_images', (int) $num_images); |
| 447 | 445 | $this->gallery_config->dec('num_comments', (int) $num_comments); |
@@ -190,13 +190,13 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
| 193 | - * Event delete images |
|
| 194 | - * |
|
| 195 | - * @event phpbbgallery.core.image.delete_images |
|
| 196 | - * @var array images array of the image ids we are deleting |
|
| 197 | - * @var array filenames array of the image filenames |
|
| 198 | - * @since 1.2.0 |
|
| 199 | - */ |
|
| 193 | + * Event delete images |
|
| 194 | + * |
|
| 195 | + * @event phpbbgallery.core.image.delete_images |
|
| 196 | + * @var array images array of the image ids we are deleting |
|
| 197 | + * @var array filenames array of the image filenames |
|
| 198 | + * @since 1.2.0 |
|
| 199 | + */ |
|
| 200 | 200 | $vars = array('images', 'filenames'); |
| 201 | 201 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.delete_images', compact($vars))); |
| 202 | 202 | |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
| 259 | - * Get the real filenames, so we can load/delete/edit the image-file. |
|
| 260 | - * |
|
| 261 | - * @param mixed $images Array or integer with the image_id(s) |
|
| 262 | - * @return array Format: $image_id => $filename |
|
| 263 | - */ |
|
| 259 | + * Get the real filenames, so we can load/delete/edit the image-file. |
|
| 260 | + * |
|
| 261 | + * @param mixed $images Array or integer with the image_id(s) |
|
| 262 | + * @return array Format: $image_id => $filename |
|
| 263 | + */ |
|
| 264 | 264 | public function get_filenames($images) |
| 265 | 265 | { |
| 266 | 266 | if (empty($images)) |
@@ -375,13 +375,13 @@ discard block |
||
| 375 | 375 | $tpl = '{CONTENT}'; |
| 376 | 376 | |
| 377 | 377 | /** |
| 378 | - * Event generate link |
|
| 379 | - * |
|
| 380 | - * @event phpbbgallery.core.image.generate_link |
|
| 381 | - * @var string mode type of link |
|
| 382 | - * @var string tpl html to be outputted |
|
| 383 | - * @since 1.2.0 |
|
| 384 | - */ |
|
| 378 | + * Event generate link |
|
| 379 | + * |
|
| 380 | + * @event phpbbgallery.core.image.generate_link |
|
| 381 | + * @var string mode type of link |
|
| 382 | + * @var string tpl html to be outputted |
|
| 383 | + * @since 1.2.0 |
|
| 384 | + */ |
|
| 385 | 385 | $vars = array('mode', 'tpl'); |
| 386 | 386 | extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event |
| 387 | 387 | break; |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /** |
| 394 | - * Handle user- & total image_counter |
|
| 395 | - * |
|
| 396 | - * @param array $image_id_ary array with the image_ids which changed their status |
|
| 397 | - * @param bool $add are we adding or removing the images |
|
| 398 | - * @param bool $readd is it possible that there are images which aren't really changed |
|
| 399 | - */ |
|
| 394 | + * Handle user- & total image_counter |
|
| 395 | + * |
|
| 396 | + * @param array $image_id_ary array with the image_ids which changed their status |
|
| 397 | + * @param bool $add are we adding or removing the images |
|
| 398 | + * @param bool $readd is it possible that there are images which aren't really changed |
|
| 399 | + */ |
|
| 400 | 400 | public function handle_counter($image_id_ary, $add, $readd = false) |
| 401 | 401 | { |
| 402 | 402 | if (empty($image_id_ary)) |
@@ -467,11 +467,11 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | - * Approve image |
|
| 471 | - * @param (array) $image_id_ary The image ID array to be approved |
|
| 472 | - * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 473 | - * return 0 on success |
|
| 474 | - */ |
|
| 470 | + * Approve image |
|
| 471 | + * @param (array) $image_id_ary The image ID array to be approved |
|
| 472 | + * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 473 | + * return 0 on success |
|
| 474 | + */ |
|
| 475 | 475 | public function approve_images($image_id_ary, $album_id) |
| 476 | 476 | { |
| 477 | 477 | $sql = 'SELECT image_id, image_name, image_user_id |
@@ -507,10 +507,10 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /** |
| 510 | - * UnApprove image |
|
| 511 | - * @param (array) $image_id_ary The image ID array to be unapproved |
|
| 512 | - * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 513 | - */ |
|
| 510 | + * UnApprove image |
|
| 511 | + * @param (array) $image_id_ary The image ID array to be unapproved |
|
| 512 | + * @param (int) $album_id The album image is approved to (just save some queries for log) |
|
| 513 | + */ |
|
| 514 | 514 | public function unapprove_images($image_id_ary, $album_id) |
| 515 | 515 | { |
| 516 | 516 | self::handle_counter($image_id_ary, false); |
@@ -563,10 +563,10 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | /** |
| 566 | - * Lock images |
|
| 567 | - * @param (array) $image_id_ary Array of images we want to lock |
|
| 568 | - * @param (int) $album_id Album id, so we can log the action |
|
| 569 | - */ |
|
| 566 | + * Lock images |
|
| 567 | + * @param (array) $image_id_ary Array of images we want to lock |
|
| 568 | + * @param (int) $album_id Album id, so we can log the action |
|
| 569 | + */ |
|
| 570 | 570 | public function lock_images($image_id_ary, $album_id) |
| 571 | 571 | { |
| 572 | 572 | self::handle_counter($image_id_ary, false); |
@@ -590,9 +590,9 @@ discard block |
||
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | /** |
| 593 | - * Get last image id |
|
| 594 | - * Return (int) image_id |
|
| 595 | - **/ |
|
| 593 | + * Get last image id |
|
| 594 | + * Return (int) image_id |
|
| 595 | + **/ |
|
| 596 | 596 | public function get_last_image() |
| 597 | 597 | { |
| 598 | 598 | $this->gallery_auth->load_user_permissions($this->user->data['user_id']); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | * @since 1.2.0 |
| 384 | 384 | */ |
| 385 | 385 | $vars = array('mode', 'tpl'); |
| 386 | - extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars)));//@todo: Correctly identify the event |
|
| 386 | + extract($this->phpbb_dispatcher->trigger_event('phpbbgallery.core.image.generate_link', compact($vars))); //@todo: Correctly identify the event |
|
| 387 | 387 | break; |
| 388 | 388 | } |
| 389 | 389 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | |
| 407 | 407 | $num_images = $num_comments = 0; |
| 408 | 408 | $sql = 'SELECT SUM(image_comments) as comments |
| 409 | - FROM ' . $this->table_images .' |
|
| 409 | + FROM ' . $this->table_images . ' |
|
| 410 | 410 | WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
| 411 | 411 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . ' |
| 412 | 412 | GROUP BY image_user_id'; |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $this->db->sql_freeresult($result); |
| 416 | 416 | |
| 417 | 417 | $sql = 'SELECT COUNT(image_id) images, image_user_id |
| 418 | - FROM ' . $this->table_images .' |
|
| 418 | + FROM ' . $this->table_images . ' |
|
| 419 | 419 | WHERE image_status ' . (($readd) ? '=' : '<>') . ' ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
| 420 | 420 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary) . ' |
| 421 | 421 | GROUP BY image_user_id'; |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | return; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - $sql = 'SELECT * FROM ' . $this->table_images .' WHERE image_id = ' . (int) $image_id; |
|
| 458 | + $sql = 'SELECT * FROM ' . $this->table_images . ' WHERE image_id = ' . (int) $image_id; |
|
| 459 | 459 | $result = $this->db->sql_query($sql); |
| 460 | 460 | $row = $this->db->sql_fetchrow($result); |
| 461 | 461 | $this->db->sql_freeresult($result); |
@@ -515,14 +515,14 @@ discard block |
||
| 515 | 515 | { |
| 516 | 516 | self::handle_counter($image_id_ary, false); |
| 517 | 517 | |
| 518 | - $sql = 'UPDATE ' . $this->table_images .' |
|
| 518 | + $sql = 'UPDATE ' . $this->table_images . ' |
|
| 519 | 519 | SET image_status = ' . (int) \phpbbgallery\core\block::STATUS_UNAPPROVED . ' |
| 520 | 520 | WHERE image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . ' |
| 521 | 521 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary); |
| 522 | 522 | $this->db->sql_query($sql); |
| 523 | 523 | |
| 524 | 524 | $sql = 'SELECT image_id, image_name |
| 525 | - FROM ' . $this->table_images .' |
|
| 525 | + FROM ' . $this->table_images . ' |
|
| 526 | 526 | WHERE image_status <> ' . (int) \phpbbgallery\core\block::STATUS_ORPHAN . ' |
| 527 | 527 | AND ' . $this->db->sql_in_set('image_id', $image_id_ary); |
| 528 | 528 | $result = $this->db->sql_query($sql); |
@@ -684,14 +684,14 @@ discard block |
||
| 684 | 684 | 'U_USER_IP' => $show_ip && $this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) ? $image_data['image_user_ip'] : false, |
| 685 | 685 | |
| 686 | 686 | 'S_IMAGE_REPORTED' => $image_data['image_reported'], |
| 687 | - 'U_IMAGE_REPORTED' => '',//($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
| 687 | + 'U_IMAGE_REPORTED' => '', //($image_data['image_reported']) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', |
|
| 688 | 688 | 'S_STATUS_APPROVED' => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? true : false, |
| 689 | 689 | 'S_STATUS_UNAPPROVED' => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? true : false, |
| 690 | 690 | 'S_STATUS_UNAPPROVED_ACTION' => ($this->gallery_auth->acl_check('m_status', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->helper->route('phpbbgallery_core_moderate_image_approve', array('image_id' => (int) $image_data['image_id'])) : '', |
| 691 | 691 | 'S_STATUS_LOCKED' => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_LOCKED) ? true : false, |
| 692 | 692 | |
| 693 | 693 | 'U_REPORT' => ($this->gallery_auth->acl_check('m_report', $image_data['image_album_id'], $image_data['album_user_id']) && $image_data['image_reported']) ? '123'/*$this->url->append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported'])*/ : '', |
| 694 | - 'U_STATUS' => '',//($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
| 694 | + 'U_STATUS' => '', //($this->auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id)) ? $phpbb_ext_gallery->url->append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', |
|
| 695 | 695 | 'L_STATUS' => ($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_UNAPPROVED) ? $this->language->lang('APPROVE_IMAGE') : (($image_data['image_status'] == (int) \phpbbgallery\core\block::STATUS_APPROVED) ? $this->language->lang('CHANGE_IMAGE_STATUS') : $this->language->lang('UNLOCK_IMAGE')), |
| 696 | 696 | )); |
| 697 | 697 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Default value for new users |
| 19 | 19 | */ |
| 20 | - const DEFAULT_DISPLAY = true; |
|
| 20 | + const DEFAULT_DISPLAY = true; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * phpBB will treat the time from the Exif data like UTC. |
@@ -26,13 +26,13 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * Offset must be set in seconds. |
| 28 | 28 | */ |
| 29 | - const TIME_OFFSET = 0; |
|
| 29 | + const TIME_OFFSET = 0; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Constants for the status of the Exif data. |
| 33 | 33 | */ |
| 34 | - const UNAVAILABLE = 0; |
|
| 35 | - const AVAILABLE = 1; |
|
| 34 | + const UNAVAILABLE = 0; |
|
| 35 | + const AVAILABLE = 1; |
|
| 36 | 36 | const UNKNOWN = 2; |
| 37 | 37 | const DBSAVED = 3; |
| 38 | 38 | |
@@ -44,28 +44,28 @@ discard block |
||
| 44 | 44 | /** |
| 45 | 45 | * Exif data array with all allowed groups and keys. |
| 46 | 46 | */ |
| 47 | - public $data = array(); |
|
| 47 | + public $data = array(); |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Filtered data array. We don't have empty or invalid values here. |
| 51 | 51 | */ |
| 52 | - public $prepared_data = array(); |
|
| 52 | + public $prepared_data = array(); |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * Does the image have exif data? |
| 56 | 56 | * Values see constant declaration at the beginning of the class. |
| 57 | 57 | */ |
| 58 | - public $status = 2; |
|
| 58 | + public $status = 2; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Full data array, but serialized to a string |
| 62 | 62 | */ |
| 63 | - public $serialized = ''; |
|
| 63 | + public $serialized = ''; |
|
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * Full link to the image-file |
| 67 | 67 | */ |
| 68 | - public $file = ''; |
|
| 68 | + public $file = ''; |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * Original status of the Exif data. |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | /** |
| 76 | 76 | * Image-ID, just needed to update the Exif status |
| 77 | 77 | */ |
| 78 | - public $image_id = false; |
|
| 78 | + public $image_id = false; |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Constructor |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | else if ($num) |
| 208 | 208 | { |
| 209 | - $exif_exposure = ' 1/' . $den / $num ; |
|
| 209 | + $exif_exposure = ' 1/' . $den / $num; |
|
| 210 | 210 | } |
| 211 | 211 | if ($exif_exposure) |
| 212 | 212 | { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | } |
| 250 | 250 | if (isset($this->data["EXIF"]["ExposureBiasValue"])) |
| 251 | 251 | { |
| 252 | - list($num,$den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
| 252 | + list($num, $den) = explode("/", $this->data["EXIF"]["ExposureBiasValue"]); |
|
| 253 | 253 | if ($den) |
| 254 | 254 | { |
| 255 | 255 | if (($num / $den) == 0) |
@@ -323,12 +323,12 @@ discard block |
||
| 323 | 323 | * There are lots of possible Exif Groups and Values. |
| 324 | 324 | * But you will never heard of the missing ones. so we just allow the most common ones. |
| 325 | 325 | */ |
| 326 | - static private $allowed_groups = array( |
|
| 326 | + static private $allowed_groups = array( |
|
| 327 | 327 | 'EXIF', |
| 328 | 328 | 'IFD0', |
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | - static private $allowed_keys = array( |
|
| 331 | + static private $allowed_keys = array( |
|
| 332 | 332 | 'DateTimeOriginal', |
| 333 | 333 | 'FocalLength', |
| 334 | 334 | 'ExposureTime', |
@@ -110,8 +110,7 @@ discard block |
||
| 110 | 110 | if ($this->status == self::DBSAVED) |
| 111 | 111 | { |
| 112 | 112 | $this->data = @unserialize($data); |
| 113 | - } |
|
| 114 | - else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
| 113 | + } else if (($this->status == self::AVAILABLE) || ($this->status == self::UNKNOWN)) |
|
| 115 | 114 | { |
| 116 | 115 | $this->read(); |
| 117 | 116 | } |
@@ -137,8 +136,7 @@ discard block |
||
| 137 | 136 | if (!in_array($key, self::$allowed_groups)) |
| 138 | 137 | { |
| 139 | 138 | unset($this->data[$key]); |
| 140 | - } |
|
| 141 | - else |
|
| 139 | + } else |
|
| 142 | 140 | { |
| 143 | 141 | foreach ($this->data[$key] as $subkey => $array) |
| 144 | 142 | { |
@@ -152,8 +150,7 @@ discard block |
||
| 152 | 150 | |
| 153 | 151 | $this->serialized = serialize($this->data); |
| 154 | 152 | $this->status = self::DBSAVED; |
| 155 | - } |
|
| 156 | - else |
|
| 153 | + } else |
|
| 157 | 154 | { |
| 158 | 155 | $this->status = self::UNAVAILABLE; |
| 159 | 156 | } |
@@ -203,8 +200,7 @@ discard block |
||
| 203 | 200 | if (($num > $den) && $den) |
| 204 | 201 | { |
| 205 | 202 | $exif_exposure = $num / $den; |
| 206 | - } |
|
| 207 | - else if ($num) |
|
| 203 | + } else if ($num) |
|
| 208 | 204 | { |
| 209 | 205 | $exif_exposure = ' 1/' . $den / $num ; |
| 210 | 206 | } |
@@ -255,8 +251,7 @@ discard block |
||
| 255 | 251 | if (($num / $den) == 0) |
| 256 | 252 | { |
| 257 | 253 | $exif_exposure_bias = 0; |
| 258 | - } |
|
| 259 | - else |
|
| 254 | + } else |
|
| 260 | 255 | { |
| 261 | 256 | $exif_exposure_bias = $this->data["EXIF"]["ExposureBiasValue"]; |
| 262 | 257 | } |
@@ -15,74 +15,74 @@ discard block |
||
| 15 | 15 | class exif |
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | - * Default value for new users |
|
| 19 | - */ |
|
| 18 | + * Default value for new users |
|
| 19 | + */ |
|
| 20 | 20 | const DEFAULT_DISPLAY = true; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * phpBB will treat the time from the Exif data like UTC. |
|
| 24 | - * If your images were taken with an other timezone, you can insert an offset here. |
|
| 25 | - * The offset is than added to the timestamp before it is converted into the users time. |
|
| 26 | - * |
|
| 27 | - * Offset must be set in seconds. |
|
| 28 | - */ |
|
| 23 | + * phpBB will treat the time from the Exif data like UTC. |
|
| 24 | + * If your images were taken with an other timezone, you can insert an offset here. |
|
| 25 | + * The offset is than added to the timestamp before it is converted into the users time. |
|
| 26 | + * |
|
| 27 | + * Offset must be set in seconds. |
|
| 28 | + */ |
|
| 29 | 29 | const TIME_OFFSET = 0; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * Constants for the status of the Exif data. |
|
| 33 | - */ |
|
| 32 | + * Constants for the status of the Exif data. |
|
| 33 | + */ |
|
| 34 | 34 | const UNAVAILABLE = 0; |
| 35 | 35 | const AVAILABLE = 1; |
| 36 | 36 | const UNKNOWN = 2; |
| 37 | 37 | const DBSAVED = 3; |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | - * Is the function available? |
|
| 41 | - */ |
|
| 40 | + * Is the function available? |
|
| 41 | + */ |
|
| 42 | 42 | static public $function_exists = null; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Exif data array with all allowed groups and keys. |
|
| 46 | - */ |
|
| 45 | + * Exif data array with all allowed groups and keys. |
|
| 46 | + */ |
|
| 47 | 47 | public $data = array(); |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Filtered data array. We don't have empty or invalid values here. |
|
| 51 | - */ |
|
| 50 | + * Filtered data array. We don't have empty or invalid values here. |
|
| 51 | + */ |
|
| 52 | 52 | public $prepared_data = array(); |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | - * Does the image have exif data? |
|
| 56 | - * Values see constant declaration at the beginning of the class. |
|
| 57 | - */ |
|
| 55 | + * Does the image have exif data? |
|
| 56 | + * Values see constant declaration at the beginning of the class. |
|
| 57 | + */ |
|
| 58 | 58 | public $status = 2; |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * Full data array, but serialized to a string |
|
| 62 | - */ |
|
| 61 | + * Full data array, but serialized to a string |
|
| 62 | + */ |
|
| 63 | 63 | public $serialized = ''; |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * Full link to the image-file |
|
| 67 | - */ |
|
| 66 | + * Full link to the image-file |
|
| 67 | + */ |
|
| 68 | 68 | public $file = ''; |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * Original status of the Exif data. |
|
| 72 | - */ |
|
| 71 | + * Original status of the Exif data. |
|
| 72 | + */ |
|
| 73 | 73 | public $orig_status = null; |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * Image-ID, just needed to update the Exif status |
|
| 77 | - */ |
|
| 76 | + * Image-ID, just needed to update the Exif status |
|
| 77 | + */ |
|
| 78 | 78 | public $image_id = false; |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * Constructor |
|
| 82 | - * |
|
| 83 | - * @param string $file Full link to the image-file |
|
| 84 | - * @param mixed $image_id False or integer |
|
| 85 | - */ |
|
| 81 | + * Constructor |
|
| 82 | + * |
|
| 83 | + * @param string $file Full link to the image-file |
|
| 84 | + * @param mixed $image_id False or integer |
|
| 85 | + */ |
|
| 86 | 86 | public function __construct($file, $image_id = false) |
| 87 | 87 | { |
| 88 | 88 | if (self::$function_exists === null) |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | - * Interpret the values from the database, and read the data if we don't have it. |
|
| 102 | - * |
|
| 103 | - * @param int $status Value of a status constant (see beginning of the class) |
|
| 104 | - * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
| 105 | - */ |
|
| 101 | + * Interpret the values from the database, and read the data if we don't have it. |
|
| 102 | + * |
|
| 103 | + * @param int $status Value of a status constant (see beginning of the class) |
|
| 104 | + * @param mixed $data Either an empty string or the serialized array of the Exif from the database |
|
| 105 | + */ |
|
| 106 | 106 | public function interpret($status, $data) |
| 107 | 107 | { |
| 108 | 108 | $this->orig_status = $status; |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * Read Exif data from the image |
|
| 122 | - */ |
|
| 121 | + * Read Exif data from the image |
|
| 122 | + */ |
|
| 123 | 123 | public function read() |
| 124 | 124 | { |
| 125 | 125 | if (!self::$function_exists || !$this->file || !file_exists($this->file)) |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
| 168 | - * Validate and prepare the data, so we can send it into the template. |
|
| 169 | - */ |
|
| 168 | + * Validate and prepare the data, so we can send it into the template. |
|
| 169 | + */ |
|
| 170 | 170 | private function prepare_data() |
| 171 | 171 | { |
| 172 | 172 | global $user; |
@@ -273,11 +273,11 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
| 276 | - * Sends the Exif into the template |
|
| 277 | - * |
|
| 278 | - * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
| 279 | - * @param string $block Name of the template loop the Exif's are displayed in. |
|
| 280 | - */ |
|
| 276 | + * Sends the Exif into the template |
|
| 277 | + * |
|
| 278 | + * @param bool $expand_view Shall we expand the Exif data on page view or collapse? |
|
| 279 | + * @param string $block Name of the template loop the Exif's are displayed in. |
|
| 280 | + */ |
|
| 281 | 281 | public function send_to_template($expand_view = true, $block = 'exif_value') |
| 282 | 282 | { |
| 283 | 283 | $this->prepare_data(); |
@@ -301,8 +301,8 @@ discard block |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
| 304 | - * Save the new Exif status in the database |
|
| 305 | - */ |
|
| 304 | + * Save the new Exif status in the database |
|
| 305 | + */ |
|
| 306 | 306 | public function set_status() |
| 307 | 307 | { |
| 308 | 308 | if (!$this->image_id || ($this->orig_status == $this->status)) |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
| 323 | - * There are lots of possible Exif Groups and Values. |
|
| 324 | - * But you will never heard of the missing ones. so we just allow the most common ones. |
|
| 325 | - */ |
|
| 323 | + * There are lots of possible Exif Groups and Values. |
|
| 324 | + * But you will never heard of the missing ones. so we just allow the most common ones. |
|
| 325 | + */ |
|
| 326 | 326 | static private $allowed_groups = array( |
| 327 | 327 | 'EXIF', |
| 328 | 328 | 'IFD0', |
@@ -223,14 +223,12 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | trigger_error($message_string . adm_back_link($this->u_action)); |
| 226 | - } |
|
| 227 | - else if ($delete || $prune || (isset($_POST['cancel']))) |
|
| 226 | + } else if ($delete || $prune || (isset($_POST['cancel']))) |
|
| 228 | 227 | { |
| 229 | 228 | if (isset($_POST['cancel'])) |
| 230 | 229 | { |
| 231 | 230 | trigger_error($user->lang['CLEAN_GALLERY_ABORT'] . adm_back_link($this->u_action), E_USER_WARNING); |
| 232 | - } |
|
| 233 | - else |
|
| 231 | + } else |
|
| 234 | 232 | { |
| 235 | 233 | $clean_gallery_confirm = $user->lang['CONFIRM_CLEAN']; |
| 236 | 234 | if ($missing_sources) |
@@ -261,8 +259,7 @@ discard block |
||
| 261 | 259 | if (in_array($row['album_user_id'], $personals_bad)) |
| 262 | 260 | { |
| 263 | 261 | $personals_bad_names[] = $row['album_name']; |
| 264 | - } |
|
| 265 | - else |
|
| 262 | + } else |
|
| 266 | 263 | { |
| 267 | 264 | $missing_personals_names[] = $row['album_name']; |
| 268 | 265 | } |
@@ -280,8 +277,7 @@ discard block |
||
| 280 | 277 | if ($prune && empty($prune_pattern)) |
| 281 | 278 | { |
| 282 | 279 | trigger_error($user->lang['CLEAN_PRUNE_NO_PATTERN'] . adm_back_link($this->u_action), E_USER_WARNING); |
| 283 | - } |
|
| 284 | - else if ($prune && $prune_pattern) |
|
| 280 | + } else if ($prune && $prune_pattern) |
|
| 285 | 281 | { |
| 286 | 282 | $clean_gallery_confirm = $user->lang('CONFIRM_PRUNE', $core_cleanup->lang_prune_pattern($prune_pattern)) . '<br />' . $clean_gallery_confirm; |
| 287 | 283 | } |