Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renaming slideshow stuff

  • Loading branch information...
commit ad4a92d635db45b9fa589d99ca5953a228f05e13 1 parent 6aeacfb
Reto Ryter authored
View
4 Admin/SlideshowItemAdmin.php → Admin/Imagine/MinimalImagineBlockAdmin.php
@@ -1,11 +1,11 @@
<?php
-namespace Symfony\Cmf\Bundle\BlockBundle\Admin;
+namespace Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine;
use Sonata\DoctrinePHPCRAdminBundle\Admin\Admin;
use Sonata\AdminBundle\Form\FormMapper;
-class SlideshowItemAdmin extends Admin
+class MinimalImagineBlockAdmin extends Admin
{
protected function configureFormFields(FormMapper $formMapper)
{
View
8 Admin/MinimalSlideshowAdmin.php → Admin/Imagine/MinimalSlideshowAdmin.php
@@ -1,6 +1,6 @@
<?php
-namespace Symfony\Cmf\Bundle\BlockBundle\Admin;
+namespace Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
@@ -15,8 +15,8 @@
class MinimalSlideshowAdmin extends Admin
{
- protected $baseRouteName = 'symfony_cmf_block.minimal_slideshow_admin';
- protected $baseRoutePattern = 'symfony_cmf/block/minimalSlideshow';
+ protected $baseRouteName = 'symfony_cmf_block.imagine.minimal_slideshow_admin';
+ protected $baseRoutePattern = 'symfony_cmf/block/imagineMinimalSlideshow';
protected function configureListFields(ListMapper $listMapper)
{
@@ -40,7 +40,7 @@ protected function configureFormFields(FormMapper $formMapper)
array(
'edit' => 'inline',
'inline' => 'table',
- 'admin_code' => 'symfony_cmf_block.slideshow_item_admin',
+ 'admin_code' => 'symfony_cmf_block.imagine.minimal_imagine_admin',
'sortable' => 'position',
))
->end();
View
6 Admin/SlideshowAdmin.php → Admin/Imagine/SlideshowAdmin.php
@@ -1,13 +1,13 @@
<?php
-namespace Symfony\Cmf\Bundle\BlockBundle\Admin;
+namespace Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine;
use Sonata\AdminBundle\Form\FormMapper;
class SlideshowAdmin extends MinimalSlideshowAdmin
{
- protected $baseRouteName = 'symfony_cmf_block.slideshow_admin';
- protected $baseRoutePattern = 'symfony_cmf/block/slideshow';
+ protected $baseRouteName = 'symfony_cmf_block.imagine.slideshow_admin';
+ protected $baseRoutePattern = 'symfony_cmf/block/imagineSlideshow';
protected $translationDomain = 'SymfonyCmfBlockBundle';
/**
View
2  DependencyInjection/Configuration.php
@@ -30,7 +30,7 @@ public function getConfigTreeBuilder()
->scalarNode('document_manager_name')->defaultValue('default')->end()
->scalarNode('content_basepath')->defaultValue('/cms/content')->end()
->scalarNode('block_basepath')->defaultValue('/cms/content')->end()
- ->scalarNode('slideshow')->defaultValue(false)->end()
+ ->scalarNode('imagine')->defaultValue(false)->end()
->scalarNode('simple_admin_class')->defaultNull()->end()
->scalarNode('simple_document_class')->defaultNull()->end()
->scalarNode('container_admin_class')->defaultNull()->end()
View
8 DependencyInjection/SymfonyCmfBlockExtension.php
@@ -36,8 +36,8 @@ public function load(array $configs, ContainerBuilder $container)
$container->setParameter($this->getAlias() . '.multilang.locales', $config['multilang']['locales']);
}
- if ($config['slideshow']) {
- $loader->load('slideshow.xml');
+ if ($config['imagine']) {
+ $loader->load('imagine.xml');
}
if (isset($config['simple_document_class'])) {
@@ -100,8 +100,8 @@ public function loadSonataAdmin($config, XmlFileLoader $loader, ContainerBuilder
$container->setParameter($this->getAlias() . '.' . $prefix . 'simple_admin_class', $config['simple_admin_class']);
}
- if (isset($config['slideshow']) && $config['slideshow']) {
- $loader->load('slideshow.admin.xml');
+ if (isset($config['imagine']) && $config['imagine']) {
+ $loader->load('imagine.admin.xml');
}
}
View
6 Document/ImageBlock.php → Document/ImagineBlock.php
@@ -6,11 +6,11 @@
use Symfony\Cmf\Bundle\BlockBundle\Document\BaseBlock;
/**
- * Block that can act as an item of a SlideshowBlock
+ * Block to hold an image
*
* @PHPCRODM\Document(referenceable=true)
*/
-class ImageBlock extends BaseBlock
+class ImagineBlock extends BaseBlock
{
/**
@@ -29,7 +29,7 @@ class ImageBlock extends BaseBlock
*/
public function getType()
{
- return 'symfony_cmf.block.image';
+ return 'symfony_cmf.block.imagine';
}
public function setLabel($label)
View
4 Document/MultilangImageBlock.php → Document/MultilangImagineBlock.php
@@ -5,11 +5,11 @@
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
/**
- * Block that can act as an item of a SlideshowBlock
+ * Block to hold an image
*
* @PHPCRODM\Document(referenceable=true, translator="attribute")
*/
-class MultilangImageBlock extends ImageBlock
+class MultilangImagineBlock extends ImagineBlock
{
/** @PHPCRODM\Locale */
View
29 Resources/config/slideshow.admin.xml → Resources/config/imagine.admin.xml
@@ -5,18 +5,19 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
- <parameter key="symfony_cmf_block.slideshow_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\SlideshowAdmin</parameter>
- <parameter key="symfony_cmf_block.minimal_slideshow_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\MinimalSlideshowAdmin</parameter>
+ <parameter key="symfony_cmf_block.imagine.slideshow_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine\SlideshowAdmin</parameter>
+ <parameter key="symfony_cmf_block.imagine.minimal_slideshow_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine\MinimalSlideshowAdmin</parameter>
<parameter key="symfony_cmf_block.slideshow_document_class">Symfony\Cmf\Bundle\BlockBundle\Document\SlideshowBlock</parameter>
- <parameter key="symfony_cmf_block.slideshow_item_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\SlideshowItemAdmin</parameter>
- <parameter key="symfony_cmf_block.image_document_class">Symfony\Cmf\Bundle\BlockBundle\Document\ImageBlock</parameter>
- <parameter key="symfony_cmf_block.multilang_image_document_class">Symfony\Cmf\Bundle\BlockBundle\Document\MultilangImageBlock</parameter>
+
+ <parameter key="symfony_cmf_block.imagine.minimal_imagine_admin_class">Symfony\Cmf\Bundle\BlockBundle\Admin\Imagine\MinimalImagineBlockAdmin</parameter>
+ <parameter key="symfony_cmf_block.imagine_document_class">Symfony\Cmf\Bundle\BlockBundle\Document\ImagineBlock</parameter>
+ <parameter key="symfony_cmf_block.multilang_imagine_document_class">Symfony\Cmf\Bundle\BlockBundle\Document\MultilangImagineBlock</parameter>
</parameters>
<services>
- <service id="symfony_cmf_block.minimal_slideshow_admin" class="%symfony_cmf_block.minimal_slideshow_admin_class%">
- <tag name="sonata.admin" manager_type="doctrine_phpcr" group="dashboard.group_routing" label_catalogue="SymfonyCmfBlockBundle" label="dashboard.minimal_slideshow_block" label_translator_strategy="sonata.admin.label.strategy.underscore" />
+ <service id="symfony_cmf_block.imagine.minimal_slideshow_admin" class="%symfony_cmf_block.imagine.minimal_slideshow_admin_class%">
+ <tag name="sonata.admin" manager_type="doctrine_phpcr" label_catalogue="SymfonyCmfBlockBundle" label_translator_strategy="sonata.admin.label.strategy.underscore" />
<argument/>
<argument>%symfony_cmf_block.slideshow_document_class%</argument>
<argument>SonataAdminBundle:CRUD</argument>
@@ -26,7 +27,7 @@
</call>
</service>
- <service id="symfony_cmf_block.slideshow_admin" class="%symfony_cmf_block.slideshow_admin_class%">
+ <service id="symfony_cmf_block.imagine.slideshow_admin" class="%symfony_cmf_block.imagine.slideshow_admin_class%">
<tag name="sonata.admin" manager_type="doctrine_phpcr" group="dashboard.group_content" label_catalogue="SymfonyCmfBlockBundle" label="dashboard.label_slideshow_block" label_translator_strategy="sonata.admin.label.strategy.underscore" />
<argument/>
<argument>%symfony_cmf_block.slideshow_document_class%</argument>
@@ -42,10 +43,10 @@
</service>
- <service id="symfony_cmf_block.slideshow_item_admin" class="%symfony_cmf_block.slideshow_item_admin_class%">
- <tag name="sonata.admin" manager_type="doctrine_phpcr" group="dashboard.group_content" label_catalogue="SymfonyCmfBlockBundle" label="dashboard.label_slideshow_item_block" label_translator_strategy="sonata.admin.label.strategy.underscore" />
+ <service id="symfony_cmf_block.imagine.minimal_imagine_admin" class="%symfony_cmf_block.imagine.minimal_imagine_admin_class%">
+ <tag name="sonata.admin" manager_type="doctrine_phpcr" label_catalogue="SymfonyCmfBlockBundle" label_translator_strategy="sonata.admin.label.strategy.underscore" />
<argument/>
- <argument>%symfony_cmf_block.image_document_class%</argument>
+ <argument>%symfony_cmf_block.imagine_document_class%</argument>
<argument>SonataAdminBundle:CRUD</argument>
<call method="setRouteBuilder">
@@ -57,10 +58,10 @@
</call>
</service>
- <service id="symfony_cmf_block.multilang_slideshow_item_admin" class="%symfony_cmf_block.slideshow_item_admin_class%">
- <tag name="sonata.admin" manager_type="doctrine_phpcr" group="dashboard.group_content" label_catalogue="SymfonyCmfBlockBundle" label="dashboard.label_slideshow_item_block" label_translator_strategy="sonata.admin.label.strategy.underscore" />
+ <service id="symfony_cmf_block.imagine.minimal_multilang_imagine_admin" class="%symfony_cmf_block.imagine.minimal_imagine_admin_class%">
+ <tag name="sonata.admin" manager_type="doctrine_phpcr" label_catalogue="SymfonyCmfBlockBundle" label_translator_strategy="sonata.admin.label.strategy.underscore" />
<argument/>
- <argument>%symfony_cmf_block.multilang_image_document_class%</argument>
+ <argument>%symfony_cmf_block.multilang_imagine_document_class%</argument>
<argument>SonataAdminBundle:CRUD</argument>
<call method="setRouteBuilder">
View
18 Resources/config/imagine.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<container xmlns="http://symfony.com/schema/dic/services"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
+
+ <services>
+
+ <!-- simple block service is reused for imagine items -->
+ <service id="symfony_cmf.block.imagine" class="Symfony\Cmf\Bundle\BlockBundle\Block\SimpleBlockService">
+ <tag name="sonata.block" />
+ <argument>symfony_cmf.block.imagine</argument>
+ <argument type="service" id="templating" />
+ <argument>SymfonyCmfBlockBundle:Block:block_imagine.html.twig</argument>
+ </service>
+
+ </services>
+</container>
View
9 Resources/config/services.xml
@@ -45,6 +45,15 @@
<argument type="service" id="fragment.handler" />
</service>
+ <!--container block service is reused for slideshows -->
+ <service id="symfony_cmf.block.slideshow" class="Symfony\Cmf\Bundle\BlockBundle\Block\ContainerBlockService">
+ <tag name="sonata.block" />
+ <argument>symfony_cmf.block.slideshow</argument>
+ <argument type="service" id="templating" />
+ <argument type="service" id="sonata.block.renderer" />
+ <argument>SymfonyCmfBlockBundle:Block:block_slideshow.html.twig</argument>
+ </service>
+
<service id="symfony_cmf.block.rss_controller" class="%symfony_cmf_block.rss_controller_class%" >
<call method="setContainer">
<argument type="service" id="service_container" />
View
27 Resources/config/slideshow.xml
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<container xmlns="http://symfony.com/schema/dic/services"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
-
- <services>
-
- <!--container block service is reused for slideshows -->
- <service id="symfony_cmf.block.slideshow" class="Symfony\Cmf\Bundle\BlockBundle\Block\ContainerBlockService">
- <tag name="sonata.block" />
- <argument>symfony_cmf.block.slideshow</argument>
- <argument type="service" id="templating" />
- <argument type="service" id="sonata.block.renderer" />
- <argument>SymfonyCmfBlockBundle:Block:block_slideshow.html.twig</argument>
- </service>
-
- <!-- simple block service is reused for slideshow items -->
- <service id="symfony_cmf.block.image" class="Symfony\Cmf\Bundle\BlockBundle\Block\SimpleBlockService">
- <tag name="sonata.block" />
- <argument>symfony_cmf.block.image</argument>
- <argument type="service" id="templating" />
- <argument>SymfonyCmfBlockBundle:Block:block_slideshow_item.html.twig</argument>
- </service>
-
- </services>
-</container>
View
4 ...iews/Block/block_slideshow_item.html.twig → ...urces/views/Block/block_imagine.html.twig
@@ -1,5 +1,5 @@
{% extends 'SymfonyCmfBlockBundle:Block:block_base.html.twig' %}
{% block block %}
- <span id="label">{{ block.label }}</span><img src="{{ block.image | imagine_filter('slideshow_image') }}" alt="{{ block.label }}" />
-{% endblock %}
+ <span id="label">{{ block.label }}</span><img src="{{ block.image | imagine_filter('symfony_cmf_block') }}" alt="{{ block.label }}" />
+{% endblock %}
View
2  composer.json
@@ -24,7 +24,7 @@
},
"suggest": {
"sonata-project/cache-bundle": "To add caching support for block loading",
- "liip/imagine-bundle": "When using the SlideshowItemBlock",
+ "liip/imagine-bundle": "When using the ImagineBlock",
"eko/feedbundle": "To use the RssBlock"
},
"autoload":{
Please sign in to comment.
Something went wrong with that request. Please try again.