Skip to content

Commit

Permalink
Merge pull request #92 from helios-ag/assetic
Browse files Browse the repository at this point in the history
Assetic
  • Loading branch information
helios-ag committed Dec 28, 2014
2 parents dc8b219 + a71a8f2 commit 4201d7e
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 361 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ php:
- 5.6
- hhvm

before_script: composer install --dev --prefer-source
before_script:
- travis_retry composer self-update
- travis_retry composer install --dev --prefer-source

notifications:
email: [email protected]
28 changes: 13 additions & 15 deletions Controller/ElFinderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,37 @@ private function selectEditor($parameters, $instance, $formTypeId = null)
$fullscreen = $parameters['fullscreen'];
$relativePath = $parameters['relative_path'];
$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,
'locale' => $locale,
'fullscreen' => $fullscreen,
'includeAssets' => $includeAssets,
'instance' => $instance
'instance' => $instance
);
return $result;
case 'tinymce':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':tinymce.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:tinymce.html.twig';
$result['params'] = array(
'locale' => $locale,
'locale' => $locale,
'tinymce_popup_path' => $this->getAssetsUrl($parameters['tinymce_popup_path']),
'includeAssets' => $includeAssets,
'instance' => $instance
'includeAssets' => $includeAssets,
'instance' => $instance
);
return $result;
case 'tinymce4':
$result['template'] = 'FMElfinderBundle:Elfinder'.$prefix.':tinymce4.html.twig';
$result['template'] = 'FMElfinderBundle:Elfinder:tinymce4.html.twig';
$result['params'] = array(
'locale' => $locale,
'locale' => $locale,
'includeAssets' => $includeAssets,
'instance' => $instance
'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 @@ -86,7 +84,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
32 changes: 16 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Copyright (c) 2012-2014 Albert Ganiev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Copyright (c) 2012-2015 Al Ganiev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
30 changes: 4 additions & 26 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 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 @@ -120,35 +119,13 @@ security:
```
role ROLE_USER is provided as example.

### Step 5: Configure assetic

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
### Step 5: Install assets

Install and dump assets using symfony built-in commands:

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

## Basic configuration
Expand Down Expand Up @@ -402,7 +379,8 @@ Manual integration guide can be found [here](/INTEGRATION_GUIDE.md)
##Changelog
### 3.2
* Removed assetic support
### 3.0
* BC in public api (controllers showAction method with second parameter)
Expand Down
20 changes: 0 additions & 20 deletions Resources/views/Elfinder/_tinymce.html.twig

This file was deleted.

16 changes: 0 additions & 16 deletions Resources/views/Elfinder/_tinymce4.html.twig

This file was deleted.

20 changes: 0 additions & 20 deletions Resources/views/Elfinder/compressed/_tinymce.html.twig

This file was deleted.

16 changes: 0 additions & 16 deletions Resources/views/Elfinder/compressed/_tinymce4.html.twig

This file was deleted.

55 changes: 0 additions & 55 deletions Resources/views/Elfinder/compressed/ckeditor.html.twig

This file was deleted.

38 changes: 0 additions & 38 deletions Resources/views/Elfinder/compressed/simple.html.twig

This file was deleted.

Loading

0 comments on commit 4201d7e

Please sign in to comment.