diff --git a/.travis.yml b/.travis.yml index a7f9385..1bae2b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: helios.ag@gmail.com diff --git a/Controller/ElFinderController.php b/Controller/ElFinderController.php index e41f624..ccad2ac 100644 --- a/Controller/ElFinderController.php +++ b/Controller/ElFinderController.php @@ -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, @@ -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, diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 7d6b813..bab8faa 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -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() diff --git a/LICENSE b/LICENSE index 55c2ca0..4313aeb 100644 --- a/LICENSE +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md index ef4a675..b5db613 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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) diff --git a/Resources/views/Elfinder/_tinymce.html.twig b/Resources/views/Elfinder/_tinymce.html.twig deleted file mode 100644 index ae5490d..0000000 --- a/Resources/views/Elfinder/_tinymce.html.twig +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/Resources/views/Elfinder/_tinymce4.html.twig b/Resources/views/Elfinder/_tinymce4.html.twig deleted file mode 100644 index 26d145e..0000000 --- a/Resources/views/Elfinder/_tinymce4.html.twig +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/Resources/views/Elfinder/compressed/_tinymce.html.twig b/Resources/views/Elfinder/compressed/_tinymce.html.twig deleted file mode 100644 index 237b02e..0000000 --- a/Resources/views/Elfinder/compressed/_tinymce.html.twig +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/Resources/views/Elfinder/compressed/_tinymce4.html.twig b/Resources/views/Elfinder/compressed/_tinymce4.html.twig deleted file mode 100644 index 0c8aa09..0000000 --- a/Resources/views/Elfinder/compressed/_tinymce4.html.twig +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/Resources/views/Elfinder/compressed/ckeditor.html.twig b/Resources/views/Elfinder/compressed/ckeditor.html.twig deleted file mode 100644 index b21eee8..0000000 --- a/Resources/views/Elfinder/compressed/ckeditor.html.twig +++ /dev/null @@ -1,55 +0,0 @@ - - - - - {% stylesheets output='assetic/css/compiled/fmelfinder/main.css' - 'bundles/fmelfinder/css/*' filter='cssrewrite,?uglifycss' %} - - {% endstylesheets %} - - - {% javascripts output='assetic/js/compiled/fmelfinder/main.js' filter='?uglifyjs2' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-1.8.0.min.js' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-ui-1.8.23.custom.min.js' - '@FMElfinderBundle/Resources/public/js/elfinder.min.js' - '@FMElfinderBundle/Resources/public/js/i18n/*' - %} - - {% endjavascripts %} - - -
- - diff --git a/Resources/views/Elfinder/compressed/simple.html.twig b/Resources/views/Elfinder/compressed/simple.html.twig deleted file mode 100644 index a94f97f..0000000 --- a/Resources/views/Elfinder/compressed/simple.html.twig +++ /dev/null @@ -1,38 +0,0 @@ - - - - {% stylesheets output='assetic/css/compiled/fmelfinder/main.css' - 'bundles/fmelfinder/css/*' filter='cssrewrite,?uglifycss' %} - - {% endstylesheets %} - - - {% javascripts output='bundles/fmelfinder/js/main.js' filter='?uglifyjs2' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-1.8.0.min.js' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-ui-1.8.23.custom.min.js' - '@FMElfinderBundle/Resources/public/js/elfinder.min.js' - '@FMElfinderBundle/Resources/public/js/i18n/*' - %} - - {% endjavascripts %} - -
- - diff --git a/Resources/views/Elfinder/compressed/tinymce.html.twig b/Resources/views/Elfinder/compressed/tinymce.html.twig deleted file mode 100644 index 5ced749..0000000 --- a/Resources/views/Elfinder/compressed/tinymce.html.twig +++ /dev/null @@ -1,70 +0,0 @@ - - - - {% stylesheets output='assetic/css/compiled/fmelfinder/main.css' - 'bundles/fmelfinder/css/*' filter='cssrewrite,?uglifycss' %} - - {% endstylesheets %} - - - {% javascripts output='bundles/fmelfinder/js/main.js' filter='?uglifyjs2' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-1.8.0.min.js' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-ui-1.8.23.custom.min.js' - '@FMElfinderBundle/Resources/public/js/elfinder.min.js' - '@FMElfinderBundle/Resources/public/js/i18n/*' - %} - - {% endjavascripts %} - - -
- - diff --git a/Resources/views/Elfinder/compressed/tinymce4.html.twig b/Resources/views/Elfinder/compressed/tinymce4.html.twig deleted file mode 100644 index d61028f..0000000 --- a/Resources/views/Elfinder/compressed/tinymce4.html.twig +++ /dev/null @@ -1,46 +0,0 @@ - - - - {% stylesheets output='assetic/css/compiled/fmelfinder/main.css' - 'bundles/fmelfinder/css/*' filter='cssrewrite,?uglifycss' %} - - {% endstylesheets %} - - -{% javascripts output='bundles/fmelfinder/js/main.js' filter='?uglifyjs2' -'@FMElfinderBundle/Resources/public/js/jquery/jquery-1.8.0.min.js' -'@FMElfinderBundle/Resources/public/js/jquery/jquery-ui-1.8.23.custom.min.js' -'@FMElfinderBundle/Resources/public/js/elfinder.min.js' -'@FMElfinderBundle/Resources/public/js/i18n/*' -%} - -{% endjavascripts %} - -
- - diff --git a/Resources/views/Elfinder/helper/assets_css.html.twig b/Resources/views/Elfinder/helper/assets_css.html.twig index 1fbec41..b6bd54e 100644 --- a/Resources/views/Elfinder/helper/assets_css.html.twig +++ b/Resources/views/Elfinder/helper/assets_css.html.twig @@ -1,4 +1,3 @@ -{% stylesheets output='assetic/css/compiled/fmelfinder/main.css' - 'bundles/fmelfinder/css/*' filter='cssrewrite' %} - -{% endstylesheets %} + + + \ No newline at end of file diff --git a/Resources/views/Elfinder/helper/assets_js.html.twig b/Resources/views/Elfinder/helper/assets_js.html.twig index 99c7011..a643758 100644 --- a/Resources/views/Elfinder/helper/assets_js.html.twig +++ b/Resources/views/Elfinder/helper/assets_js.html.twig @@ -1,8 +1,30 @@ -{% javascripts output='assetic/js/compiled/fmelfinder/main.js' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-1.8.0.min.js' - '@FMElfinderBundle/Resources/public/js/jquery/jquery-ui-1.8.23.custom.min.js' - '@FMElfinderBundle/Resources/public/js/elfinder.min.js' - '@FMElfinderBundle/Resources/public/js/i18n/*' -%} - -{% endjavascripts %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/DependencyInjection/FMElfinderExtensionTest.php b/Tests/DependencyInjection/FMElfinderExtensionTest.php index 4576979..0207f17 100644 --- a/Tests/DependencyInjection/FMElfinderExtensionTest.php +++ b/Tests/DependencyInjection/FMElfinderExtensionTest.php @@ -44,7 +44,6 @@ protected function getMinimalConfiguration() default: locale: %locale% editor: simple # other choices are tinymce or simple - compression: false include_assets: true fullscreen: true connector: diff --git a/Tests/Twig/Extension/FMElfinderTinymceExtensionTest.php b/Tests/Twig/Extension/FMElfinderTinymceExtensionTest.php index 1983ae1..f2969e8 100644 --- a/Tests/Twig/Extension/FMElfinderTinymceExtensionTest.php +++ b/Tests/Twig/Extension/FMElfinderTinymceExtensionTest.php @@ -35,7 +35,7 @@ class FMElfinderTinymceExtensionTest extends \PHPUnit_Framework_TestCase */ protected function setUp() { - $this->twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array(__DIR__.'/../../../Resources/views/Elfinder'))); + $this->twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array(__DIR__.'/../../../Resources/views/Elfinder/helper'))); $this->extension = new FMElfinderTinymceExtension($this->twig); $this->twig->addExtension($this->extension); $loader = new YamlFileLoader(new FileLocator(__DIR__ . '/../../../Resources/config')); @@ -57,9 +57,9 @@ public function testRenderTinyMCE3() function elFinderBrowser (field_name, url, type, win) { tinyMCE.activeEditor.windowManager.open({ file: "http://localhost/elfinder/minimal", - title: 'elFinder 2.0', - width: 900, - height: 450, + title: "", + width:, + height:, resizable: 'yes', inline: 'yes', // This parameter only has an effect if you use the inlinepopups plugin! popup_css: false, // Disable TinyMCE's default popup CSS @@ -87,9 +87,9 @@ public function testRenderTinyMCE4() function elFinderBrowser (field_name, url, type, win) { tinymce.activeEditor.windowManager.open({ file:"http://localhost/elfinder/minimal", - title: 'elFinder 2.0', - width: 900, - height: 450, + title: "", + width:, + height:, resizable: 'yes' }, { setUrl: function (url) { @@ -150,4 +150,4 @@ public function testSubClassOfTwigExtension() $this->assertTrue($rc->isSubclassOf('Twig_Extension')); } -} \ No newline at end of file +}