| @@ 108-120 (lines=13) @@ | ||
| 105 | } | |
| 106 | ||
| 107 | // Managers can create new media paths (subfolders). Users must use existing folders. | |
| 108 | 	if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 109 | 		if (Auth::isManager($WT_TREE)) { | |
| 110 | 			if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 111 | 				FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); | |
| 112 | 			} else { | |
| 113 | 				FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)), 'danger'); | |
| 114 | break; | |
| 115 | } | |
| 116 | 		} else { | |
| 117 | // Regular users should not have seen this option - so no need for an error message. | |
| 118 | break; | |
| 119 | } | |
| 120 | } | |
| 121 | ||
| 122 | // The media folder exists. Now create a thumbnail folder to match it. | |
| 123 | 	if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { | |
| @@ 265-277 (lines=13) @@ | ||
| 262 | } | |
| 263 | ||
| 264 | // Managers can create new media paths (subfolders). Users must use existing folders. | |
| 265 | 	if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 266 | 		if (Auth::isManager($WT_TREE)) { | |
| 267 | 			if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 268 | 				FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); | |
| 269 | 			} else { | |
| 270 | 				FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)), 'danger'); | |
| 271 | break; | |
| 272 | } | |
| 273 | 		} else { | |
| 274 | // Regular users should not have seen this option - so no need for an error message. | |
| 275 | break; | |
| 276 | } | |
| 277 | } | |
| 278 | ||
| 279 | // The media folder exists. Now create a thumbnail folder to match it. | |
| 280 | 	if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { | |
| @@ 72-84 (lines=13) @@ | ||
| 69 | } | |
| 70 | ||
| 71 | // Managers can create new media paths (subfolders). Users must use existing folders. | |
| 72 | 			if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 73 | 				if (Auth::isManager($WT_TREE)) { | |
| 74 | 					if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { | |
| 75 | 						FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); | |
| 76 | 					} else { | |
| 77 | 						FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)), 'danger'); | |
| 78 | break; | |
| 79 | } | |
| 80 | 				} else { | |
| 81 | // Regular users should not have seen this option - so no need for an error message. | |
| 82 | break; | |
| 83 | } | |
| 84 | } | |
| 85 | ||
| 86 | // The media folder exists. Now create a thumbnail folder to match it. | |
| 87 | 			if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { | |