Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added slideshow block and CmfMedia #195

Merged
merged 2 commits into from
Aug 19, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ web/js/
web/css/
app/cache/*
app/logs/*
web/media
web/assetic
build/
vendor/
vendor
Expand Down
4 changes: 4 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function registerBundles()
new Symfony\Cmf\Bundle\BlogBundle\CmfBlogBundle(),
new Liip\SearchBundle\LiipSearchBundle(),
new Symfony\Cmf\Bundle\SearchBundle\CmfSearchBundle(),
new Symfony\Cmf\Bundle\MediaBundle\CmfMediaBundle(),

// language switcher
new Lunetics\LocaleBundle\LuneticsLocaleBundle(),
Expand All @@ -52,6 +53,9 @@ public function registerBundles()
new Sonata\DoctrinePHPCRAdminBundle\SonataDoctrinePHPCRAdminBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),

// Media support
new Liip\ImagineBundle\LiipImagineBundle(),

// jackalope doctrine caching
// new Liip\DoctrineCacheBundle\LiipDoctrineCacheBundle(),

Expand Down
36 changes: 32 additions & 4 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ framework:
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
form:
resources:
- 'CmfMediaBundle:Form:fields.html.twig'

# Assetic Configuration
assetic:
Expand Down Expand Up @@ -121,10 +124,11 @@ cmf_create:
phpcr_odm: true
map:
'http://rdfs.org/sioc/ns#Post': 'Symfony\Cmf\Bundle\ContentBundle\Document\MultilangStaticContent'
image:
enabled: true
model_class: Symfony\Cmf\Bundle\CreateBundle\Document\Image
controller_class: Symfony\Cmf\Bundle\CreateBundle\Controller\PHPCRImageController

cmf_block:
persistence:
phpcr:
enabled: true

sonata_block:
default_contexts: [cms]
Expand Down Expand Up @@ -175,6 +179,7 @@ sonata_admin:
- cmf_block.container_admin
- cmf_block.reference_admin
- cmf_block.action_admin
- cmf_block.imagine.slideshow_admin
routing:
label: URLs
items:
Expand Down Expand Up @@ -213,12 +218,18 @@ sonata_doctrine_phpcr_admin:
valid_children: []
Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock:
valid_children: []
Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SlideshowBlock:
valid_children:
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ImagineBlock
Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ImagineBlock:
valid_children: []
Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock:
valid_children:
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ContainerBlock
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ReferenceBlock
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\ActionBlock
- Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SlideshowBlock
Symfony\Cmf\Bundle\SimpleCmsBundle\Document\Page: ~
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route:
valid_children:
Expand Down Expand Up @@ -270,3 +281,20 @@ lunetics_locale:
# type: file_system
# nodes:
# type: file_system

# The LiipImagineBundle can be used if you want to convert on demand an image
# to a specific format. (ie a controller render the file)
# more information can be found here : https://github.com/liip/LiipImagineBundle
liip_imagine:
filter_sets:
# define the filter to be used with the image preview
image_upload_thumbnail:
data_loader: cmf_media_doctrine_phpcr
filters:
thumbnail: { size: [100, 100], mode: outbound }

cmf_block:
data_loader: cmf_media_doctrine_phpcr
quality: 85
filters:
thumbnail: { size: [50, 50], mode: outbound }
10 changes: 10 additions & 0 deletions app/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ sonata_admin:
type: sonata_admin
prefix: /{_locale}/admin

_imagine:
resource: .
type: imagine

fos_js_routing:
resource: @FOSJsRoutingBundle/Resources/config/routing/routing.xml

Expand All @@ -65,6 +69,12 @@ block_cache:
resource: "@CmfBlockBundle/Resources/config/routing/cache.xml"
prefix: /

cmf_media_file:
resource: "@CmfMediaBundle/Resources/config/routing/file.xml"

cmf_media_image:
resource: "@CmfMediaBundle/Resources/config/routing/image.xml"

tree:
resource: "@SonataDoctrinePHPCRAdminBundle/Resources/config/routing/phpcrodmbrowser.xml"
prefix: /phpcrodmbrowser
2 changes: 1 addition & 1 deletion app/tests/AdminDashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function testContents()
$this->assertContains('Sonata Admin', $response->getContent());

$this->assertCount(2, $crawler->filter('.container-fluid'));
$this->assertCount(12, $crawler->filter('.sonata-ba-list-label'));
$this->assertCount(13, $crawler->filter('.sonata-ba-list-label'));
}
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"sonata-project/doctrine-phpcr-admin-bundle": "1.0.0-beta3",
"eko/feedbundle": "1.0.*",
"lunetics/locale-bundle": "2.2.*",
"liip/functional-test-bundle": "1.0.*"
"liip/functional-test-bundle": "1.0.*",
"liip/imagine-bundle": "dev-master",
"symfony-cmf/media-bundle": "dev-master"
},
"require-dev": {
"symfony-cmf/testing": "1.0.*"
Expand Down
Loading