Skip to content

Commit

Permalink
Merge pull request #89 from helios-ag/noassetic
Browse files Browse the repository at this point in the history
Noassetic
  • Loading branch information
helios-ag committed Dec 6, 2014
2 parents 4834631 + afb0377 commit 2c0974e
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 679 deletions.
13 changes: 6 additions & 7 deletions Controller/ElFinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function showAction($instance)
/**
* @param $parameters
* @param $instance
* @param null $formTypeId
* @return array
*/
private function selectEditor($parameters, $instance, $formTypeId = null)
Expand All @@ -39,13 +40,11 @@ private function selectEditor($parameters, $instance, $formTypeId = null)
$locale = $parameters['locale'] ?: $this->container->getParameter('locale');
$fullscreen = $parameters['fullscreen'];
$includeAssets = $parameters['include_assets'];
$compression = $parameters['compression'];
$prefix = ($compression ? '/compressed' : '');
$result = array();

switch ($editor) {
case 'ckeditor':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':ckeditor.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:ckeditor.html.twig';
$result['params'] = array(
'locale' => $locale,
'fullscreen' => $fullscreen,
Expand All @@ -54,7 +53,7 @@ private function selectEditor($parameters, $instance, $formTypeId = null)
);
return $result;
case 'tinymce':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':tinymce.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:tinymce.html.twig';
$result['params'] = array(
'locale' => $locale,
'tinymce_popup_path' => $this->getAssetsUrl($parameters['tinymce_popup_path']),
Expand All @@ -63,15 +62,15 @@ private function selectEditor($parameters, $instance, $formTypeId = null)
);
return $result;
case 'tinymce4':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':tinymce4.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:tinymce4.html.twig';
$result['params'] = array(
'locale' => $locale,
'includeAssets' => $includeAssets,
'instance' => $instance
);
return $result;
case 'form':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':elfinder_type.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:elfinder_type.html.twig';
$result['params'] = array(
'locale' => $locale,
'fullscreen' => $fullscreen,
Expand All @@ -81,7 +80,7 @@ private function selectEditor($parameters, $instance, $formTypeId = null)
);
return $result;
default:
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':simple.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:simple.html.twig';
$result['params'] = array(
'locale' => $locale,
'fullscreen' => $fullscreen,
Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('locale')->defaultNull()->end()
->scalarNode('editor')->defaultValue('simple')->end()
->booleanNode('compression')->defaultFalse()->end()
->booleanNode('fullscreen')->defaultTrue()->end()
->booleanNode('include_assets')->defaultTrue()->end()
->scalarNode('tinymce_popup_path')->defaultValue('')->end()
Expand Down
39 changes: 7 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ Recommended bundles to use with:
- [Step 2: Enable the bundle](#step-2-enable-the-bundle)
- [Step 3: Import FMElfinderBundle routing file](#step-3-import-fmelfinderbundle-routing-file)
- [Step 4: Configure your application's security.yml](#step-4-configure-your-applications-securityyml)
- [Step 5: Configure assetic](#step-5-configure-assetic)
- [Step 6: Install and dump assets](#step-6-install-and-dump-assets)
- [Step 5: Install and dump assets](#step-5-install-assets)
- [Basic configuration](#basic-configuration)
- [Add configuration options to your config.yml](#add-configuration-options-to-your-configyml)
- [Configuring symfony service as a volumeDriver](#configuring-symfony-service-as-a-volumedriver)
Expand Down Expand Up @@ -105,35 +104,12 @@ security:
```
role ROLE_USER is provided as example.

### Step 5: Configure assetic
### Step 5: Install assets

Under assetic section of your config.yml, add FMElfinderBundle to bundles section, also you can enable uglify js/css
compressor (also you need to enable option "compression: true" under bundle configuration).

Also set "use_controller: false".

``` yaml
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [FMElfinderBundle]
java: /usr/bin/java
filters:
cssrewrite: ~
uglifyjs2:
# the path to the uglifyjs executable
bin: /usr/bin/uglifyjs
uglifycss:
bin: /usr/bin/uglifycss
```
### Step 6: Install and dump assets
Install and dump assets using symfony built-in commands:
Install assets using symfony built-in commands:

```sh
app/console assets:install web
app/console assetic:dump --env=prod
```

## Basic configuration
Expand All @@ -148,7 +124,6 @@ fm_elfinder:
editor: ckeditor # other choices are tinymce or simple, and form
fullscreen: true # defaults true, applies to simple and ckeditor editors
include_assets: true # disable if you want to handle loading of the javascript and css assets yourself
compression: false # enable if you configured the uglifycss and uglifyjs2 assetic filters and want compression
connector:
debug: false # defaults to false
roots: # at least one root must be defined
Expand Down Expand Up @@ -385,11 +360,11 @@ method getConfiguration($instance) should return array of parameters compatible
Manual integration guide can be found [here](/INTEGRATION_GUIDE.md)
##Todo
More tests, gridfs support, complex user intergration(?)
##Changelog
### 2.3.3
* Compression option deprecated
* assetic dep removed
### 2.1
* New Elfinder form type, provides basic <input type="text"/> field with Elfinder callback
Expand Down
Loading

0 comments on commit 2c0974e

Please sign in to comment.