Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mce Media Bundle Laravel Package

elao/mce-media-bundle

Symfony bundle integrating TinyMCE Image Manager/File Manager. Adds an “asset” input type with upload button, image preview, and stored path. Supports configurable labels/icons/sizes plus external authentication and role/secret key access control.

View on GitHub
Deep Wiki
Context7

Elao MceMedia Bundle

This bundle handles the integration of File Manager and Image Manager plugins inside TinyMCE

We added as an extra feature an input of type asset that is linked to the Image Manager. What's that ?

It adds next to the text input, an extra button to upload any image to the Image Manager. Once the upload is done, a preview of the image is shown.

Once the form is saved, it stores the image path.

Changelog

  • 1.1.0
    • Rename configuration parameters from elao_mce_media.configuration.[…] to elao_mce_media.configuration.parameters.[…]

Download & Install

Via composer:

// composer.json
{
    // ...
    "require": {
        // ...
        "elao/mce-media-bundle": "1.1.*"
    }
}

Update your composer.phar:

$ php composer.phar update

Include it in your Kernel class:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        new Elao\Bundle\MceMediaBundle\ElaoMceMediaBundle(),
        ...
    );
}

How to use the asset field ?

First, you must include the js file /bundles/elaomcemedia/js/input_asset.js, the TinyMCE script, and the file tiny_mce/plugins/imagemanager/

Then you just need to transform your text input into an asset input:

<script type="text/javascript">
    $('myInput').inputAsset();
</script>

Different configurations are available for the field:

  • delete_image: The delete icon
  • delete_label: The delete label that appears when hovering the delete_image
  • pick_up_image: The icon to open the Image Manager plugin
  • pick_up_label: The label that is shown when hovering the pick_up_image
  • image_size: The size of the preview image

Authenticator for Image Manager & File Manager

We need to modify the file /tinymce/plugins/imagemanger/config.php or/and /tinymce/plugins/filemanger/config.php

'authenticator' = ExternalAuthenticator
'ExternalAuthenticator.external_auth_url' = /_tinymce/login
'ExternalAuthenticator.secret_key' = someSecretKey

Configuration under Symfony

[yml]
# config.yml
elao_mce_media:
    is_login: false # Default nobody has access to the manager, but if true, the role is ignored
    role: ROLE_ADMIN # The role that the user must have in order to access to the manager
    secret_key: someSecretKey
    configs:
        my.key: value

[yml]
# routing.yml
elao_mce_media:
    resource: @ElaoMceMediaBundle/Resources/config/routing.yml

Things to configure with the application

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver