@@ 46-60 (lines=15) @@ | ||
43 | $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
44 | switch ($op) { |
|
45 | ||
46 | case 'add_photo': |
|
47 | /** @var ExtgalleryPublicPhotoHandler $photoHandler */ |
|
48 | $photoHandler = xoops_getModuleHandler('publicphoto', 'extgallery'); |
|
49 | $result = $photoHandler->postPhotoTraitement('photo_file', false); |
|
50 | ||
51 | if (2 == $result) { |
|
52 | redirect_header('photo.php', 3, _AM_EXTGALLERY_NOT_AN_ALBUM); |
|
53 | } elseif (4 == $result || 5 == $result) { |
|
54 | redirect_header('photo.php', 3, _AM_EXTGALLERY_UPLOAD_ERROR . ' :<br>' . $photoHandler->photoUploader->getErrors()); |
|
55 | } elseif (0 == $result) { |
|
56 | redirect_header('photo.php', 3, _AM_EXTGALLERY_PHOTO_UPLOADED); |
|
57 | } elseif (1 == $result) { |
|
58 | redirect_header('photo.php', 3, _AM_EXTGALLERY_PHOTO_PENDING); |
|
59 | } |
|
60 | break; |
|
61 | ||
62 | case 'batchAdd': |
|
63 |
@@ 38-54 (lines=17) @@ | ||
35 | $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
36 | switch ($step) { |
|
37 | ||
38 | case 'enreg': |
|
39 | /** @var ExtgalleryPublicPhotoHandler $photoHandler */ |
|
40 | $photoHandler = xoops_getModuleHandler('publicphoto', 'extgallery'); |
|
41 | ||
42 | $result = $photoHandler->postPhotoTraitement('photo_file', false); |
|
43 | ||
44 | if (2 == $result) { |
|
45 | redirect_header('public-upload.php', 3, _MD_EXTGALLERY_NOT_AN_ALBUM); |
|
46 | } elseif (4 == $result || 5 == $result) { |
|
47 | redirect_header('public-upload.php', 3, _MD_EXTGALLERY_UPLOAD_ERROR . ' :<br>' . $photoHandler->photoUploader->getError()); |
|
48 | } elseif (0 == $result) { |
|
49 | redirect_header('public-upload.php', 3, _MD_EXTGALLERY_PHOTO_UPLOADED); |
|
50 | } elseif (1 == $result) { |
|
51 | redirect_header('public-upload.php', 3, _MD_EXTGALLERY_PHOTO_PENDING); |
|
52 | } |
|
53 | ||
54 | break; |
|
55 | ||
56 | case 'default': |
|
57 | default: |