1 Commits
master ... v0.9

Author SHA1 Message Date
Jérémy J
7fc2e790b8 Compatibility with eZPlatform 2.5 2023-08-28 10:39:09 +02:00
18 changed files with 42 additions and 32 deletions

View File

@@ -34,14 +34,17 @@
}
},
"require": {
"php": ">=7.4",
"php": ">=7.2",
"ext-json": "*",
"ezsystems/ezplatform-admin-ui": "^2.3",
"ezsystems/ezplatform-kernel": "^1.3"
"ezsystems/ezplatform-admin-ui": "^1.5",
"ezsystems/ezpublish-kernel": "^7.5"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
}
}

View File

@@ -19,7 +19,8 @@ class SchemaCommand extends Command
{
protected static $defaultName = 'onisep:imagemap:dump-schema';
private Connection $connection;
/** @var Connection */
private $connection;
public function __construct(Connection $connection)
{

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\DataTransformer;
use EzSystems\EzPlatformContentForms\FieldType\DataTransformer\ImageValueTransformer;
use EzSystems\RepositoryForms\FieldType\DataTransformer\ImageValueTransformer;
use Onisep\IbexaImageMapBundle\FieldType\ImageMap\Value;
class ImageMapTransformer extends ImageValueTransformer

View File

@@ -11,7 +11,8 @@ class ImageMapRepository
{
public const TABLE_NAME = 'onisep_imagemap';
private Connection $connection;
/** @var Connection */
private $connection;
public function __construct(Connection $connection)
{

View File

@@ -10,7 +10,8 @@ use Onisep\IbexaImageMapBundle\Database\ImageMapRepository;
class LegacyStorage
{
private ImageMapRepository $repository;
/** @var ImageMapRepository */
private $repository;
public function __construct(ImageMapRepository $repository)
{

View File

@@ -21,7 +21,8 @@ use Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\Legacy
*/
class Storage extends ImageStorage
{
private ImageMapStorageGateway $imageMapGateway;
/** @var ImageMapStorageGateway */
private $imageMapGateway;
public function __construct(
ImageStorageGateway $baseGateway,

View File

@@ -58,7 +58,6 @@ class Type extends ImageType
'imageId' => $fieldValue->data['imageId'] ?? null,
'width' => $fieldValue->data['width'] ?? null,
'height' => $fieldValue->data['height'] ?? null,
'additionalData' => $fieldValue->data['additionalData'] ?? [],
'map' => $fieldValue->data['map'] ?? [],
]);
}

View File

@@ -11,5 +11,6 @@ use eZ\Publish\Core\FieldType\Image\Value as ImageValue;
*/
class Value extends ImageValue
{
public array $map = [];
/** @var array */
public $map = [];
}

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\Form;
use EzSystems\EzPlatformContentForms\Form\Type\FieldType\ImageFieldType;
use EzSystems\RepositoryForms\Form\Type\FieldType\ImageFieldType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

View File

@@ -12,7 +12,8 @@ use Symfony\Component\Form\FormView;
class LinkType extends AbstractType
{
private ContentService $contentService;
/** @var ContentService */
private $contentService;
public function __construct(ContentService $contentService)
{

View File

@@ -7,10 +7,10 @@ namespace Onisep\IbexaImageMapBundle\FormMapper;
use eZ\Publish\API\Repository\ContentTypeService;
use eZ\Publish\API\Repository\FieldTypeService;
use eZ\Publish\API\Repository\LocationService;
use EzSystems\EzPlatformAdminUi\FieldType\Mapper\AbstractRelationFormMapper;
use EzSystems\EzPlatformAdminUi\Form\Data\FieldDefinitionData;
use EzSystems\EzPlatformContentForms\Data\Content\FieldData;
use EzSystems\EzPlatformContentForms\FieldType\FieldValueFormMapperInterface;
use EzSystems\RepositoryForms\Data\Content\FieldData;
use EzSystems\RepositoryForms\Data\FieldDefinitionData;
use EzSystems\RepositoryForms\FieldType\FieldValueFormMapperInterface;
use EzSystems\RepositoryForms\FieldType\Mapper\AbstractRelationFormMapper;
use Onisep\IbexaImageMapBundle\DataTransformer\ImageMapTransformer;
use Onisep\IbexaImageMapBundle\FieldType\ImageMap\Value;
use Onisep\IbexaImageMapBundle\Form\ImageMapType;
@@ -19,7 +19,8 @@ use Symfony\Component\Form\FormInterface;
class ImageMapFormMapper extends AbstractRelationFormMapper implements FieldValueFormMapperInterface
{
private FieldTypeService $fieldTypeService;
/** @var FieldTypeService */
private $fieldTypeService;
public function __construct(
ContentTypeService $contentTypeService,

View File

@@ -4,7 +4,7 @@ services:
- ['@ezpublish.fieldType.validator.black_list', '@ezpublish.fieldType.validator.image']
parent: ezpublish.fieldType
tags:
- { name: ezplatform.field_type, alias: imagemap }
- { name: ezpublish.fieldType, alias: imagemap }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage:
arguments:
@@ -17,19 +17,17 @@ services:
- '@?ezpublish.image_alias.imagine.alias_cleaner'
- '@eZ\Publish\Core\IO\FilePathNormalizerInterface'
tags:
- { name: ezplatform.field_type.external_storage_handler, alias: imagemap }
- { name: ezpublish.fieldType.externalStorageHandler, alias: imagemap }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter:
arguments:
- '@ezpublish.fieldType.ezimage.io_service'
- '@ezpublish.core.io.image_fieldtype.legacy_url_redecorator'
tags:
- { name: ezplatform.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' }
- { name: ezpublish.storageEngine.legacy.converter, alias: imagemap, lazy: true, callback: '::create' }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage:
arguments: ['@Onisep\IbexaImageMapBundle\Database\ImageMapRepository']
tags:
- { name: ezplatform.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage }
Onisep\IbexaImageMapBundle\Database\ImageMapRepository:
arguments: ['@ezpublish.persistence.connection']
@@ -63,8 +61,8 @@ services:
$locationService: '@eZ\Publish\API\Repository\LocationService'
$fieldTypeService: '@eZ\Publish\API\Repository\FieldTypeService'
tags:
- { name: ezplatform.field_type.form_mapper.definition, fieldType: imagemap }
- { name: ezplatform.field_type.form_mapper.value, fieldType: imagemap }
- { name: ez.fieldFormMapper.definition, fieldType: imagemap }
- { name: ez.fieldFormMapper.value, fieldType: imagemap }
Onisep\IbexaImageMapBundle\Command\SchemaCommand:
arguments:
@@ -74,4 +72,4 @@ services:
onisep.imagemap.unindexed:
class: eZ\Publish\Core\FieldType\Unindexed
tags:
- { name: ezplatform.field_type.indexable, alias: imagemap }
- { name: ezpublish.fieldType.indexable, alias: imagemap }

View File

@@ -1 +1 @@
{{ ez_render_content(content, {'viewType': 'embed'}) }}
{{ render(controller('ez_content:viewAction', {'contentId': content.id, 'viewType': 'embed'})) }}

View File

@@ -1 +1 @@
{{ ez_render_content(content, {'viewType': 'embed'}) }}
{{ render(controller('ez_content:viewAction', {'contentId': content.id, 'viewType': 'embed'})) }}

View File

@@ -39,7 +39,7 @@
{% for item in items|filter((item) => item.target == 'embed')|filter((item) => item.content is defined) %}
{% set id = item.anchor ?: 'imagemap-target-' ~ field.id ~ '-' ~ item.content.id %}
<div id="{{ id }}" class="imagemap__embeds__item" hidden>
{{ ez_render_content(item.content, {'viewType': 'imagemap_embed'}) }}
{{ render(controller('ez_content:viewAction', {'contentId': item.content.id, 'viewType': 'imagemap_embed'})) }}
</div>
{% endfor %}
</div>
@@ -48,7 +48,7 @@
<div id="imagemap-target-{{ field.id}}-{{ item.content.id }}" class="imagemap__popins__item">
<div class="imagemap__popins__item__bg imagemap__popins__item__exit"></div>
<div class="imagemap__popins__item__container">
{{ ez_render_content(item.content, {'viewType': 'imagemap_popin'}) }}
{{ render(controller('ez_content:viewAction', {'contentId': item.content.id, 'viewType': 'imagemap_popin'})) }}
<button class="imagemap__popins__item__close imagemap__popins__item__exit">X</button>
</div>
</div>

View File

@@ -12,8 +12,11 @@ use Twig\Extension\RuntimeExtensionInterface;
class ImageMapRuntime implements RuntimeExtensionInterface
{
private LocationService $locationService;
private ContentService $contentService;
/** @var LocationService */
private $locationService;
/** @var ContentService */
private $contentService;
public function __construct(LocationService $locationService, ContentService $contentService)
{