diff --git a/administrator/components/com_media/resources/scripts/store/state.es6.js b/administrator/components/com_media/resources/scripts/store/state.es6.js index 9d856eecba012..4be6b73e4cfa8 100644 --- a/administrator/components/com_media/resources/scripts/store/state.es6.js +++ b/administrator/components/com_media/resources/scripts/store/state.es6.js @@ -6,12 +6,25 @@ if (options.providers === undefined || options.providers.length === 0) { throw new TypeError('Media providers are not defined.'); } +/** + * Get the drives + * + * @param {Array} adapterNames + * @param {String} provider + * + * @return {Array} + */ +const getDrives = (adapterNames, provider) => { + const drives = []; + adapterNames.map((name) => drives.push({ root: `${provider}-${name}:/`, displayName: name })); + + return drives; +}; + // Load disks from options const loadedDisks = options.providers.map((disk) => ({ displayName: disk.displayName, - drives: disk.adapterNames.map( - (account, index) => ({ root: `${disk.name}-${index}:/`, displayName: account }), - ), + drives: getDrives(disk.adapterNames, disk.name), })); if (loadedDisks[0].drives[0] === undefined || loadedDisks[0].drives.length === 0) { diff --git a/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js b/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js index add4506c24d1c..09444086a15f7 100644 --- a/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js +++ b/build/media_source/system/js/fields/joomla-image-select.w-c.es6.js @@ -12,7 +12,7 @@ * extension: "png" * fileType: "image/png" * height: 44 - * path: "local-0:/powered_by.png" + * path: "local-images:/powered_by.png" * thumb: undefined * width: 294 * } diff --git a/layouts/joomla/form/field/media.php b/layouts/joomla/form/field/media.php index ba00b77da4fe3..3046fce3865aa 100644 --- a/layouts/joomla/form/field/media.php +++ b/layouts/joomla/form/field/media.php @@ -104,7 +104,7 @@ $url = ($readonly ? '' : ($link ?: 'index.php?option=com_media&view=media&tmpl=component&asset=' . $asset . '&author=' . $authorId) - . '&fieldid={field-media-id}&path=local-0:/' . $folder); + . '&fieldid={field-media-id}&path=local-images:/' . $folder); // Correctly route the url to ensure it's correctly using sef modes and subfolders $url = Route::_($url); diff --git a/plugins/editors/tinymce/tinymce.php b/plugins/editors/tinymce/tinymce.php index 19d35b1989b03..602de0b967323 100644 --- a/plugins/editors/tinymce/tinymce.php +++ b/plugins/editors/tinymce/tinymce.php @@ -543,7 +543,7 @@ public function onDisplay( $scriptOptions['uploadUri'] = $uploadUrl; // @TODO have a way to select the adapter, similar to $levelParams->get('path', ''); - $scriptOptions['comMediaAdapter'] = 'local-0:'; + $scriptOptions['comMediaAdapter'] = 'local-images:'; } // Convert pt to px in dropdown diff --git a/plugins/filesystem/local/local.php b/plugins/filesystem/local/local.php index beb5ef98455d4..2483d15eb4fa9 100644 --- a/plugins/filesystem/local/local.php +++ b/plugins/filesystem/local/local.php @@ -94,7 +94,12 @@ public function getAdapters() { $directoryPath = JPATH_ROOT . '/' . $directoryEntity->directory; $directoryPath = rtrim($directoryPath) . '/'; - $adapters[] = new \Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter($directoryPath, $directoryEntity->directory); + + $adapter = new \Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter( + $directoryPath, $directoryEntity->directory + ); + + $adapters[$adapter->getAdapterName()] = $adapter; } } diff --git a/plugins/filesystem/local/local.xml b/plugins/filesystem/local/local.xml index e1fcd9f1146c8..260786c5cd7c7 100644 --- a/plugins/filesystem/local/local.xml +++ b/plugins/filesystem/local/local.xml @@ -29,7 +29,7 @@ label="PLG_FILESYSTEM_LOCAL_DIRECTORIES_LABEL" multiple="true" layout="joomla.form.field.subform.repeatable-table" - buttons="add,remove" + buttons="add,remove,move" default='[{"directory":"images"}]' >