@@ -114,9 +114,9 @@ function main($id, $mode)
114114
115115 $ album_data += array (
116116 'parent_id ' => $ request ->variable ('album_parent_id ' , $ this ->parent_id ),
117- 'album_type ' => $ request ->variable ('album_type ' , \phpbbgallery \core \block::TYPE_UPLOAD ),
117+ 'album_type ' => $ request ->variable ('album_type ' , ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ),
118118 'type_action ' => $ request ->variable ('type_action ' , '' ),
119- 'album_status ' => $ request ->variable ('album_status ' , \phpbbgallery \core \block::ALBUM_OPEN ),
119+ 'album_status ' => $ request ->variable ('album_status ' , ( int ) \phpbbgallery \core \block::ALBUM_OPEN ),
120120 'album_parents ' => '' ,
121121 'album_name ' => utf8_normalize_nfc ($ request ->variable ('album_name ' , '' , true )),
122122 'album_desc ' => utf8_normalize_nfc ($ request ->variable ('album_desc ' , '' , true )),
@@ -151,7 +151,7 @@ function main($id, $mode)
151151 // Categories are not able to be locked...
152152 if ($ album_data ['album_type ' ] == (int ) \phpbbgallery \core \block::TYPE_CAT )
153153 {
154- $ album_data ['album_status ' ] = \phpbbgallery \core \block::ALBUM_OPEN ;
154+ $ album_data ['album_status ' ] = ( int ) \phpbbgallery \core \block::ALBUM_OPEN ;
155155 }
156156
157157 // Contests need contest_data, freaky... :-O
@@ -346,7 +346,7 @@ function main($id, $mode)
346346
347347 // Make sure no direct child albums are able to be selected as parents.
348348 $ exclude_albums = array ();
349- foreach ($ phpbb_ext_gallery_core_album_display ->get_branch (\phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' ) as $ row )
349+ foreach ($ phpbb_ext_gallery_core_album_display ->get_branch (( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' ) as $ row )
350350 {
351351 $ exclude_albums [] = $ row ['album_id ' ];
352352 }
@@ -369,8 +369,8 @@ function main($id, $mode)
369369 {
370370 $ album_data = array (
371371 'parent_id ' => $ this ->parent_id ,
372- 'album_type ' => \phpbbgallery \core \block::TYPE_UPLOAD ,
373- 'album_status ' => \phpbbgallery \core \block::ALBUM_OPEN ,
372+ 'album_type ' => ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ,
373+ 'album_status ' => ( int ) \phpbbgallery \core \block::ALBUM_OPEN ,
374374 'album_name ' => utf8_normalize_nfc ($ request ->variable ('album_name ' , '' , true )),
375375 'album_desc ' => '' ,
376376 'album_image ' => '' ,
@@ -413,7 +413,7 @@ function main($id, $mode)
413413 'allow_urls ' => true
414414 );
415415
416- // Parse desciption if specified
416+ // Parse description if specified
417417 if ($ album_data ['album_desc ' ])
418418 {
419419 if (!isset ($ album_data ['album_desc_uid ' ]))
@@ -431,7 +431,7 @@ function main($id, $mode)
431431 }
432432
433433 $ album_type_options = '' ;
434- $ album_type_ary = array (\phpbbgallery \core \block::TYPE_CAT => 'CAT ' , \phpbbgallery \core \block::TYPE_UPLOAD => 'UPLOAD ' , \phpbbgallery \core \block::TYPE_CONTEST => 'CONTEST ' );
434+ $ album_type_ary = array (( int ) \phpbbgallery \core \block::TYPE_CAT => 'CAT ' , ( int ) \phpbbgallery \core \block::TYPE_UPLOAD => 'UPLOAD ' , ( int ) \phpbbgallery \core \block::TYPE_CONTEST => 'CONTEST ' );
435435
436436 foreach ($ album_type_ary as $ value => $ lang )
437437 {
@@ -454,12 +454,12 @@ function main($id, $mode)
454454 $ album_sort_dir_options .= '<option ' . (($ album_data ['album_sort_dir ' ] == 'd ' ) ? ' selected="selected" ' : '' ) . " value='d'> " . $ this ->language ->lang ('SORT_DESCENDING ' ) . '</option> ' ;
455455 $ album_sort_dir_options .= '<option ' . (($ album_data ['album_sort_dir ' ] == 'a ' ) ? ' selected="selected" ' : '' ) . " value='a'> " . $ this ->language ->lang ('SORT_ASCENDING ' ) . '</option> ' ;
456456
457- $ statuslist = '<option value=" ' . \phpbbgallery \core \block::ALBUM_OPEN . '" ' . (($ album_data ['album_status ' ] == (int ) \phpbbgallery \core \block::ALBUM_OPEN ) ? ' selected="selected" ' : '' ) . '> ' . $ user ->lang ['UNLOCKED ' ] . '</option><option value=" ' . \phpbbgallery \core \block::ALBUM_LOCKED . '" ' . (($ album_data ['album_status ' ] == (int ) \phpbbgallery \core \block::ALBUM_LOCKED ) ? ' selected="selected" ' : '' ) . '> ' . $ user ->lang ['LOCKED ' ] . '</option> ' ;
457+ $ statuslist = '<option value=" ' . ( int ) \phpbbgallery \core \block::ALBUM_OPEN . '" ' . (($ album_data ['album_status ' ] == (int ) \phpbbgallery \core \block::ALBUM_OPEN ) ? ' selected="selected" ' : '' ) . '> ' . $ user ->lang ['UNLOCKED ' ] . '</option><option value=" ' . ( int ) \phpbbgallery \core \block::ALBUM_LOCKED . '" ' . (($ album_data ['album_status ' ] == (int ) \phpbbgallery \core \block::ALBUM_LOCKED ) ? ' selected="selected" ' : '' ) . '> ' . $ user ->lang ['LOCKED ' ] . '</option> ' ;
458458
459459 $ sql = 'SELECT album_id
460460 FROM ' . $ table_prefix . 'gallery_albums
461- WHERE album_type = ' . \phpbbgallery \core \block::TYPE_UPLOAD . '
462- AND album_user_id = ' . \phpbbgallery \core \block::PUBLIC_ALBUM . '
461+ WHERE album_type = ' . ( int ) \phpbbgallery \core \block::TYPE_UPLOAD . '
462+ AND album_user_id = ' . ( int ) \phpbbgallery \core \block::PUBLIC_ALBUM . '
463463 AND album_id <> ' . (int ) $ album_id ;
464464 $ result = $ db ->sql_query_limit ($ sql , 1 );
465465
@@ -471,10 +471,10 @@ function main($id, $mode)
471471 $ db ->sql_freeresult ($ result );
472472
473473 // Subalbum move options
474- if ($ action == 'edit ' && in_array ($ album_data ['album_type ' ], array (\phpbbgallery \core \block::TYPE_UPLOAD , \phpbbgallery \core \block::TYPE_CONTEST )))
474+ if ($ action == 'edit ' && in_array ($ album_data ['album_type ' ], array (( int ) \phpbbgallery \core \block::TYPE_UPLOAD , ( int ) \phpbbgallery \core \block::TYPE_CONTEST )))
475475 {
476476 $ subalbums_id = array ();
477- $ subalbums = $ phpbb_ext_gallery_core_album_display ->get_branch (\phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' );
477+ $ subalbums = $ phpbb_ext_gallery_core_album_display ->get_branch (( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' );
478478
479479 foreach ($ subalbums as $ row )
480480 {
@@ -486,7 +486,7 @@ function main($id, $mode)
486486 if ($ uploadable_album_exists )
487487 {
488488 $ template ->assign_vars (array (
489- 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ subalbums_id , \phpbbgallery \core \block::PUBLIC_ALBUM , \phpbbgallery \core \block::TYPE_UPLOAD ),
489+ 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ subalbums_id , ( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ),
490490 ));
491491 }
492492
@@ -498,7 +498,7 @@ function main($id, $mode)
498498 else if ($ uploadable_album_exists )
499499 {
500500 $ template ->assign_vars (array (
501- 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ album_id , 0 , \phpbbgallery \core \block::TYPE_UPLOAD ),
501+ 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ album_id , 0 , ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ),
502502 ));
503503 }
504504
@@ -546,9 +546,9 @@ function main($id, $mode)
546546 'S_ALBUM_UPLOAD ' => ($ album_data ['album_type ' ] == (int ) \phpbbgallery \core \block::TYPE_UPLOAD ) ? true : false ,
547547 'S_ALBUM_CAT ' => ($ album_data ['album_type ' ] == (int ) \phpbbgallery \core \block::TYPE_CAT ) ? true : false ,
548548 'S_ALBUM_CONTEST ' => ($ album_data ['album_type ' ] == (int ) \phpbbgallery \core \block::TYPE_CONTEST ) ? true : false ,
549- 'ALBUM_UPLOAD ' => \phpbbgallery \core \block::TYPE_UPLOAD ,
550- 'ALBUM_CAT ' => \phpbbgallery \core \block::TYPE_CAT ,
551- 'ALBUM_CONTEST ' => \phpbbgallery \core \block::TYPE_CONTEST ,
549+ 'ALBUM_UPLOAD ' => ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ,
550+ 'ALBUM_CAT ' => ( int ) \phpbbgallery \core \block::TYPE_CAT ,
551+ 'ALBUM_CONTEST ' => ( int ) \phpbbgallery \core \block::TYPE_CONTEST ,
552552 'S_CAN_COPY_PERMISSIONS ' => true ,
553553
554554 'S_ALBUM_WATERMARK ' => ($ album_data ['album_watermark ' ]) ? true : false ,
@@ -588,7 +588,7 @@ function main($id, $mode)
588588 $ album_data = $ phpbb_ext_gallery_core_album ->get_info ($ album_id );
589589
590590 $ subalbums_id = array ();
591- $ subalbums = $ phpbb_ext_gallery_core_album_display ->get_branch (\phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' );
591+ $ subalbums = $ phpbb_ext_gallery_core_album_display ->get_branch (( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , $ album_id , 'children ' );
592592
593593 foreach ($ subalbums as $ row )
594594 {
@@ -599,15 +599,15 @@ function main($id, $mode)
599599
600600 $ sql = 'SELECT album_id
601601 FROM ' . $ table_prefix . 'gallery_albums
602- WHERE album_type = ' . \phpbbgallery \core \block::TYPE_UPLOAD . '
602+ WHERE album_type = ' . ( int ) \phpbbgallery \core \block::TYPE_UPLOAD . '
603603 AND album_id <> ' . (int ) $ album_id . '
604- AND album_user_id = ' . \phpbbgallery \core \block::PUBLIC_ALBUM ;
604+ AND album_user_id = ' . ( int ) \phpbbgallery \core \block::PUBLIC_ALBUM ;
605605 $ result = $ db ->sql_query_limit ($ sql , 1 );
606606
607607 if ($ db ->sql_fetchrow ($ result ))
608608 {
609609 $ template ->assign_vars (array (
610- 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ subalbums_id , \phpbbgallery \core \block::PUBLIC_ALBUM , \phpbbgallery \core \block::TYPE_UPLOAD ),
610+ 'S_MOVE_ALBUM_OPTIONS ' => $ phpbb_ext_gallery_core_album ->get_albumbox (true , '' , $ album_data ['parent_id ' ], false , $ subalbums_id , ( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , ( int ) \phpbbgallery \core \block::TYPE_UPLOAD ),
611611 ));
612612 }
613613 $ db ->sql_freeresult ($ result );
@@ -619,7 +619,7 @@ function main($id, $mode)
619619 'U_BACK ' => $ this ->u_action . '&parent_id= ' . $ this ->parent_id ,
620620
621621 'ALBUM_NAME ' => $ album_data ['album_name ' ],
622- 'S_ALBUM_POST ' => (in_array ($ album_data ['album_type ' ], array (\phpbbgallery \core \block::TYPE_UPLOAD , \phpbbgallery \core \block::TYPE_CONTEST ))) ? true : false ,
622+ 'S_ALBUM_POST ' => (in_array ($ album_data ['album_type ' ], array (( int ) \phpbbgallery \core \block::TYPE_UPLOAD , ( int ) \phpbbgallery \core \block::TYPE_CONTEST ))) ? true : false ,
623623 'S_HAS_SUBALBUMS ' => ($ album_data ['right_id ' ] - $ album_data ['left_id ' ] > 1 ) ? true : false ,
624624 'S_ALBUMS_LIST ' => $ albums_list ,
625625
@@ -640,7 +640,7 @@ function main($id, $mode)
640640 {
641641 $ navigation = '<a href=" ' . $ this ->u_action . '"> ' . $ user ->lang ['GALLERY_INDEX ' ] . '</a> ' ;
642642
643- $ albums_nav = $ phpbb_ext_gallery_core_album_display ->get_branch (\phpbbgallery \core \block::PUBLIC_ALBUM , $ this ->parent_id , 'parents ' , 'descending ' );
643+ $ albums_nav = $ phpbb_ext_gallery_core_album_display ->get_branch (( int ) \phpbbgallery \core \block::PUBLIC_ALBUM , $ this ->parent_id , 'parents ' , 'descending ' );
644644 foreach ($ albums_nav as $ row )
645645 {
646646 if ($ row ['album_id ' ] == $ this ->parent_id )
@@ -665,7 +665,7 @@ function main($id, $mode)
665665 $ sql = 'SELECT *
666666 FROM ' . $ table_prefix . "gallery_albums
667667 WHERE parent_id = {$ this ->parent_id }
668- AND album_user_id = " . \phpbbgallery \core \block::PUBLIC_ALBUM . '
668+ AND album_user_id = " . ( int ) \phpbbgallery \core \block::PUBLIC_ALBUM . '
669669 ORDER BY left_id ' ;
670670 $ result = $ db ->sql_query ($ sql );
671671
@@ -694,7 +694,7 @@ function main($id, $mode)
694694 'ALBUM_DESCRIPTION ' => generate_text_for_display ($ row ['album_desc ' ], $ row ['album_desc_uid ' ], $ row ['album_desc_bitfield ' ], $ row ['album_desc_options ' ]),
695695 'ALBUM_IMAGES ' => $ row ['album_images ' ],
696696
697- 'S_ALBUM_POST ' => ($ album_type != \phpbbgallery \core \block::TYPE_CAT ) ? true : false ,
697+ 'S_ALBUM_POST ' => ($ album_type != ( int ) \phpbbgallery \core \block::TYPE_CAT ) ? true : false ,
698698
699699 'U_ALBUM ' => $ this ->u_action . '&parent_id= ' . $ row ['album_id ' ],
700700 'U_MOVE_UP ' => $ url . '&action=move_up ' ,
@@ -734,7 +734,7 @@ function main($id, $mode)
734734 }
735735
736736 /**
737- * Display progress bar for syncinc albums
737+ * Display progress bar for syncing albums
738738 *
739739 * borrowed from phpBB3
740740 * @author: phpBB Group
0 commit comments