Skip to content

Commit 232ab91

Browse files
committed
Merge pull request #199 from symfony-cmf/elfinder
use ckeditor and elfinder
2 parents 8a3dde9 + a2b7594 commit 232ab91

File tree

12 files changed

+376
-253
lines changed

12 files changed

+376
-253
lines changed

app/AppKernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public function registerBundles()
3333
new Liip\SearchBundle\LiipSearchBundle(),
3434
new Symfony\Cmf\Bundle\SearchBundle\CmfSearchBundle(),
3535
new Symfony\Cmf\Bundle\MediaBundle\CmfMediaBundle(),
36+
new FM\ElfinderBundle\FMElfinderBundle(),
3637

3738
// language switcher
3839
new Lunetics\LocaleBundle\LuneticsLocaleBundle(),

app/config/config.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ cmf_simple_cms:
121121
Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page: CmfSimpleCmsBundle:Page:index.html.twig
122122

123123
cmf_create:
124-
map:
125-
'http://rdfs.org/sioc/ns#Post': 'Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent'
124+
editor_base_path: /bundles/cmfcreate/vendor/ckeditor/
126125

127126
sonata_block:
128127
default_contexts: [cms]
@@ -259,12 +258,12 @@ liip_search:
259258
restrict_by_language: true;
260259

261260
cmf_search:
262-
translation_strategy: child
263-
# translation_strategy: attribute
264-
# search_path: /cms/simple
265-
search_fields:
266-
title: title
267-
summary: body
261+
persistence:
262+
phpcr:
263+
translation_strategy: child
264+
search_fields:
265+
title: title
266+
summary: body
268267

269268
lunetics_locale:
270269
strict_mode: true
@@ -274,14 +273,6 @@ lunetics_locale:
274273
- browser
275274
allowed_locales: %locales%
276275

277-
# jackalope doctrine caching
278-
#liip_doctrine_cache:
279-
# namespaces:
280-
# meta:
281-
# type: file_system
282-
# nodes:
283-
# type: file_system
284-
285276
# The LiipImagineBundle can be used if you want to convert on demand an image
286277
# to a specific format. (ie a controller render the file)
287278
# more information can be found here : https://github.com/liip/LiipImagineBundle
@@ -298,3 +289,31 @@ liip_imagine:
298289
quality: 85
299290
filters:
300291
thumbnail: { size: [50, 50], mode: outbound }
292+
293+
cmf_media:
294+
upload_file_role: ROLE_CAN_UPLOAD_FILE
295+
use_jms_serializer: auto
296+
use_elfinder: auto
297+
use_imagine: auto
298+
imagine_filter:
299+
upload_thumbnail: ~ # default: image_upload_thumbnail
300+
elfinder_thumbnail: ~ # default: elfinder_thumbnail
301+
302+
fm_elfinder:
303+
locale: %locale%
304+
editor: ckeditor
305+
connector:
306+
roots:
307+
media:
308+
driver: cmf_media.adapter.elfinder.phpcr_driver
309+
path: %cmf_media.persistence.phpcr.media_basepath%
310+
upload_allow: ['all']
311+
upload_max_size: 2M
312+
313+
# jackalope doctrine caching
314+
#liip_doctrine_cache:
315+
# namespaces:
316+
# meta:
317+
# type: file_system
318+
# nodes:
319+
# type: file_system

app/config/routing.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ create_image:
6363
resource: "@CmfCreateBundle/Resources/config/routing/image.xml"
6464

6565
liip_search:
66-
resource: "@CmfSearchBundle/Resources/config/routing.xml"
66+
resource: "@CmfSearchBundle/Resources/config/routing/phpcr/search.xml"
6767

6868
block_cache:
6969
resource: "@CmfBlockBundle/Resources/config/routing/cache.xml"
@@ -75,6 +75,5 @@ cmf_media_file:
7575
cmf_media_image:
7676
resource: "@CmfMediaBundle/Resources/config/routing/image.xml"
7777

78-
tree:
79-
resource: "@SonataDoctrinePHPCRAdminBundle/Resources/config/routing/phpcrodmbrowser.xml"
80-
prefix: /phpcrodmbrowser
78+
elfinder:
79+
resource: "@FMElfinderBundle/Resources/config/routing.yml"

app/config/security.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ security:
2727
access_control:
2828
- { path: ^(/(de|fr|en))?/admin, roles: ROLE_ADMIN }
2929
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
30+
- { path: ^/efconnect, role: ROLE_USER }
31+
- { path: ^/elfinder, role: ROLE_USER }

app/tests/AdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testEdit()
4242

4343
$response = $client->getResponse();
4444
$this->assertEquals(200, $response->getStatusCode());
45-
$this->assertContains('Edit "External Link"', $response->getContent());
45+
$this->assertContains('Edit "external-item"', $response->getContent());
4646

4747
$this->assertCount(11, $crawler->filter('.control-group'));
4848
$this->assertContains('Parent', $crawler->filter('.control-group')->first()->children()->first()->text());

composer.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,24 @@
1919
"sensio/distribution-bundle": "2.3.*",
2020
"sensio/framework-extra-bundle": "2.3.*",
2121
"sensio/generator-bundle": "2.3.*",
22-
"symfony-cmf/symfony-cmf": "1.0.0-beta6",
23-
"symfony-cmf/simple-cms-bundle": "1.0.0-RC2",
24-
"symfony-cmf/search-bundle": "1.0.0-beta2",
25-
"symfony-cmf/create-bundle": "1.0.0-beta4",
22+
"symfony-cmf/symfony-cmf": "1.0.0-RC1",
23+
"symfony-cmf/simple-cms-bundle": "1.0.0-RC3",
24+
"symfony-cmf/search-bundle": "1.0.0-RC1",
25+
"symfony-cmf/create-bundle": "1.0.0-RC1",
2626
"symfony-cmf/routing-auto-bundle": "1.0.0-alpha4",
27-
"symfony-cmf/blog-bundle": "1.0.0-beta4",
28-
"jackalope/jackalope-doctrine-dbal": "1.0.0-beta3",
27+
"symfony-cmf/blog-bundle": "1.0.0-beta5",
28+
"jackalope/jackalope-doctrine-dbal": "1.0.0-beta4",
2929
"jackalope/jackalope-jackrabbit": "1.0.0-beta4",
3030
"doctrine/doctrine-bundle": "1.2.*",
3131
"doctrine/data-fixtures": "1.0.*",
3232
"sonata-project/cache-bundle": "2.1.*",
33-
"sonata-project/doctrine-phpcr-admin-bundle": "1.0.0-beta4",
33+
"sonata-project/doctrine-phpcr-admin-bundle": "1.0.0-beta5",
3434
"eko/feedbundle": "1.0.*",
3535
"lunetics/locale-bundle": "2.2.*",
3636
"liip/functional-test-bundle": "1.0.*",
3737
"liip/imagine-bundle": "~0.12",
38-
"wjzijderveld/check-bundles": "dev-master"
38+
"wjzijderveld/check-bundles": "1.0.*",
39+
"helios-ag/fm-elfinder-bundle": "1.x"
3940
},
4041
"require-dev": {
4142
"symfony-cmf/testing": "1.0.*"
@@ -46,14 +47,14 @@
4647
"scripts": {
4748
"post-install-cmd": [
4849
"WillemJan\\CheckBundles\\Composer\\CheckBundles::postPackageUpdate",
49-
"Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreate",
50+
"Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
5051
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
5152
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
5253
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
5354
],
5455
"post-update-cmd": [
5556
"WillemJan\\CheckBundles\\Composer\\CheckBundles::postPackageUpdate",
56-
"Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreate",
57+
"Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreateAndCkeditor",
5758
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
5859
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
5960
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"

0 commit comments

Comments
 (0)