2017 © Pedro PelĂĄez
 

symfony-bundle ri-filemanager

File manager bundle

image

qjon/ri-filemanager

File manager bundle

  • Wednesday, October 21, 2015
  • by qjon
  • Repository
  • 2 Watchers
  • 2 Stars
  • 49 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

ri-filemanager alt=""

Symfony2 filemanager bundle, (*1)

Requirements

JavaScript
  • lodash
  • jquery
  • bootstrap
  • angular
  • angular-route
  • angular-animate
  • angular-resource
  • angular-strap
  • angular-translate
  • angular-translate-loader-static-files
  • angular-growl-2
  • ng-flow
  • cropper
PHP
  • stfalcon/tinymce-bundle
  • friendsofsymfony/jsrouting-bundle

Demo

Here you can find DEMO., (*2)

Instalation

This tool is ready to use, you dont need to do anything, (*3)

1) Add to your composer.json, (*4)

...,
"require": {
    ...,
    "qjon/ri-filemanager": "dev-master"
}

2) Add to AppKernel.php, (*5)

public function registerBundles()
{
    $bundles = array(
       ...
        new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
        new RI\FileManagerBundle\RIFileManagerBundle(),
    );

    ...
}

The first bundle is used to use Symfony routing in JS, the second is our filemanager bundle., (*6)

3) Add routing, (*7)

RIFileManagerBundle:
    resource: "@RIFileManagerBundle/Resources/config/routing.yml"
    prefix: /filemanager

4) Set proper configuration in app/config.yml, (*8)

assetic:
    ...
    bundles: ["RIFileManagerBundle"]

...

ri_file_manager:
    upload_dir: /uploads
    resize: true
    resize_max_width: 1600
    allow_change_language: true
    default_language: pl_PL
    mime_types:
        images: ['image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'image/png']
        audio: ['audio/mpeg', 'audio/x-ms-wma', 'audio/vnd.rn-realaudio', 'audio/x-wav']
        video: ['video/mpeg', 'video/mp4', 'video/quicktime', 'video/x-ms-wmv']
        archive: ['application/zip']
        others:
            - 'application/pdf'
    dimensions: 
        -
            name: Crop size one
            width: 800
            height: 500
        -
            name: Crop size two
            width: 1200
            height: 400
  • __upload_dir__ (string) - name of dir in web directory when will be upload all files
  • __resize__ (bool) - all uploaded image will be resized if they are too large
  • __resize_max_width__ (int) - works only with resize = true
  • __allow_change_language__ (bool) - if true display dropdown to change language, if false the dropdown is not shown: default true
  • __default_language__ (string) - default language of the app (now available: en_EN, pl_PL), default: en_EN
  • __mime_types__ (array) - list of all file types which can be uploaded (if nothing set all file types are available)
    • __image__ (array) - list of mime file types which should be interpreted as image type
    • __audio__ (array) - list of mime file types which should be interpreted as audio type
    • __video__ (array) - list of mime file types which should be interpreted as video type
    • __archive__ (array) - list of mime file types which should be interpreted as archive type
    • __others__ (array) - list of mime file types which should be available for upload and does not match to any above categories
  • __dimensions__ (array) - predefined list of available crop dimensions

Usage

Standalone version

This is the simple way to use this bundle. In your twig template you should include:, (*9)

1) CSS template (include all CSS files), (*10)

{% include 'RIFileManagerBundle:Default:css.html.twig' %}

2) JS template (include third part libraries, application and templates), (*11)

{% include 'RIFileManagerBundle:Default:javascript_min.html.twig' %}

Then you should initialize application where you can set some configuration, (*12)

<script>
    var fm = angular.module('fm', ['filemanager'])
            .config(['configProviderProvider', function (ConfigProvider) {
                ConfigProvider.setConfig({{ filemanager_configuration|json_encode|raw }})
            }]);
</script>

<div class="filemanager" ng-app="fm">
    <h1>{% verbatim %}{{'FILEMANAGER' | translate}}{% endverbatim %}</h1>
    <div class="animation" ng-view  style="width: 100%;"></div>
</div>

All above configuration you find in Resources/views/Default/index.html.twig, (*13)

TinyMce file and image plugin

This bundle can be used as TinyMce file and image plugin. First you should prepare page with TinyMce editor. You can use _stfalcon/tinymce-bundle_ (read installation manual on https://github.com/stfalcon/TinymceBundle)., (*14)

If you have working example of TinyMce editor, you can attach filemanager plugin., (*15)

stfalcon_tinymce:
    ...
    theme:
       advanced:
            ...
            file_browser_callback: 'myFileBrowser'
            ...

Then you should include tinymce JS plugin file and routing files, which open select image dialog., (*16)

<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {'callback': 'fos.Router.setData'}) }}"></script>
<script src="{{ asset('bundles/rifilemanager/js/tinymce_plugin.js') }}"></script>

or simple one line, (*17)

{% include 'RIFileManagerBundle:Default:javascript_tinymce.html.twig' %}

After that you should change filemanager application configuration and set non stand alone version., (*18)

<script>
    var fm = angular.module('fm', ['filemanager'])
        .config(['configProviderProvider', function (configProviderProvider) {
            configProviderProvider.setConfig({
                standAlone: false
            })
        }]);
</script>

That is all, everything should work., (*19)

The Versions

21/10 2015

dev-master

9999999-dev

File manager bundle

  Sources   Download

MIT

The Requires

 

by RafaƂ Ignaszewski

filemanager tinymce

21/10 2015
21/10 2015

dev-develop

dev-develop

File manager bundle

  Sources   Download

MIT

The Requires

 

by RafaƂ Ignaszewski

filemanager tinymce

19/10 2015
19/10 2015

dev-version-1.3.0

dev-version-1.3.0

File manager bundle

  Sources   Download

MIT

The Requires

 

by RafaƂ Ignaszewski

filemanager tinymce

30/09 2015
27/09 2015
24/09 2015
06/09 2015
19/08 2015
31/07 2015
28/07 2015