| @@ 101-113 (lines=13) @@ | ||
| 98 | } |
|
| 99 | ||
| 100 | // Managers can create new media paths (subfolders). Users must use existing folders. |
|
| 101 | if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 102 | if (Auth::isManager($WT_TREE)) { |
|
| 103 | if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 104 | FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); |
|
| 105 | } else { |
|
| 106 | 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'); |
|
| 107 | break; |
|
| 108 | } |
|
| 109 | } else { |
|
| 110 | // Regular users should not have seen this option - so no need for an error message. |
|
| 111 | break; |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | // The media folder exists. Now create a thumbnail folder to match it. |
|
| 116 | if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { |
|
| @@ 257-269 (lines=13) @@ | ||
| 254 | } |
|
| 255 | ||
| 256 | // Managers can create new media paths (subfolders). Users must use existing folders. |
|
| 257 | if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 258 | if (Auth::isManager($WT_TREE)) { |
|
| 259 | if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 260 | FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); |
|
| 261 | } else { |
|
| 262 | 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'); |
|
| 263 | break; |
|
| 264 | } |
|
| 265 | } else { |
|
| 266 | // Regular users should not have seen this option - so no need for an error message. |
|
| 267 | break; |
|
| 268 | } |
|
| 269 | } |
|
| 270 | ||
| 271 | // The media folder exists. Now create a thumbnail folder to match it. |
|
| 272 | if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { |
|
| @@ 67-79 (lines=13) @@ | ||
| 64 | } |
|
| 65 | ||
| 66 | // Managers can create new media paths (subfolders). Users must use existing folders. |
|
| 67 | if ($folderName && !is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 68 | if (Auth::isManager($WT_TREE)) { |
|
| 69 | if (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName)) { |
|
| 70 | FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY . $folderName))); |
|
| 71 | } else { |
|
| 72 | 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'); |
|
| 73 | break; |
|
| 74 | } |
|
| 75 | } else { |
|
| 76 | // Regular users should not have seen this option - so no need for an error message. |
|
| 77 | break; |
|
| 78 | } |
|
| 79 | } |
|
| 80 | ||
| 81 | // The media folder exists. Now create a thumbnail folder to match it. |
|
| 82 | if (!is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY . 'thumbs/' . $folderName)) { |
|