Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from flagbit/develop
Browse files Browse the repository at this point in the history
Release Version 0.2.0
  • Loading branch information
robin-homberg authored Feb 18, 2019
2 parents 73fffa3 + edef5d7 commit 4828394
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ an Abstraction for local and remote filesystems into Magento2 without overriding

## Features ##

* Integrate Flysystem to configure different file storages like **ftp**, **local** and **cloud** (S3).
* Integrate Flysystem to configure different file storages like **sftp**, **local** or **cloud** (S3).
* Provide modularity to easily integrate more adapters in the projects which use it.
* Integrate image modal for Magento2 product and category image uploads.
* You can select from the same **file-pool** instead of uploading from local.
* So you can select an image like in the image selector for cms pages and blocks.
* ACL Configuration for insert, upload, delete files and for create, delete folders and more.
* Separate media page for fast access to flysystem media files. No need for WYSIWYG-Editor Button.

## Flysystem Adapters ##
* In core module integrated **local**, **ftp** and **sftp** adapters
* [**S3** Flysystem Adapter](https://github.com/flagbit/Magento2-Flysystem-S3) (install the additional magento2 module)

## Wiki Pages ##

Expand Down
15 changes: 8 additions & 7 deletions view/adminhtml/templates/browser/content.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
?>

<div class="flysystem-browser" data-mage-init='{"mediabrowser": <?= $block->escapeHtml($block->getFilebrowserSetupObject()) ?>}'>
<div class="side-col"><?= $block->getChildHtml('flagbit_flysystem.tree') ?></div>
<div class="main-col">
<div class="insert-title" id="content_header">
<div class="insert-title-inner">
<div class="insert-actions">
<div class="page-main-actions">
<div class="page-actions">
<div class="page-actions-inner">
<div class="page-actions-buttons">
<?= $block->getButtonsHtml() ?>
</div>
<div class="title"><?= $block->escapeHtml($block->getHeaderText()) ?></div>
</div>
</div>
</div>
<div class="side-col"><?= $block->getChildHtml('flagbit_flysystem.tree') ?></div>
<div class="main-col">
<div id="error-message" data-action="show-error"></div>
<div id="contents-uploader" class="contents-uploader"><?= $block->getChildHtml('flagbit_flysystem.uploader') ?></div>
<div id="contents"></div>
Expand All @@ -30,4 +31,4 @@
}
}
}
</script>
</script>
10 changes: 9 additions & 1 deletion view/adminhtml/web/js/cms/mediabrowserExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ define([
newButton.title = data.flysystemButtonTitle;
newButton.type = 'button';
newButton.innerHTML = '<span>' + data.flysystemButtonTitle + '</span>';
newButton.classList.add('action-default');
newButton.classList.add('scalable');
newButton.classList.add('action-quaternary');
newButton.on('click', function () {
MediabrowserUtility.openDialog(data.flysystemButtonUrl)
});

$('#modal_dialog_message').find('.insert-actions').first().prepend(newButton);

if($('#modal_dialog_message').find('.page-action-buttons').length) {
$('#modal_dialog_message').find('.page-action-buttons').first().prepend(newButton);
} else if($('#modal_dialog_message').find('.insert-actions').length) {
$('#modal_dialog_message').find('.insert-actions').first().prepend(newButton);
}
}
}
});
2 changes: 1 addition & 1 deletion view/base/web/js/flysystemUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ define([
console.log(data.error);
if(!data.error) {
var previewHtml = $('#flysystem-image-preview');
previewHtml.find('img').attr('src', data.previewUrl);
previewHtml.find('img').first().attr('src', data.url);
previewHtml.show();
}
}, this)
Expand Down

0 comments on commit 4828394

Please sign in to comment.