16 Commits

Author SHA1 Message Date
Jérémy J
056493cc6a Ibexa 4.6.2 support 2024-07-31 10:31:27 +02:00
Jérémy J
05a8ae58b0 Restrict version below 4.6.2 as ImageStorage constructor got a new argument 2024-07-31 09:13:25 +02:00
Florian Bouché
315c7facf7 Ibexa 4 support (14) 2024-01-08 16:37:55 +01:00
Jérémy J
3eafda2575 Fix edition 2023-12-08 16:52:06 +01:00
Florian Bouché
30a1ce1456 Ibexa 4 support (12) 2023-11-15 10:40:38 +01:00
Florian Bouché
99184c4312 Ibexa 4 support (11) 2023-11-06 10:10:38 +01:00
Florian Bouché
35db03a841 Ibexa 4 support (10) 2023-10-25 14:58:04 +02:00
Florian Bouché
01d62189d1 Ibexa 4 support (9) 2023-10-23 10:27:09 +02:00
Florian Bouché
d2800cf666 Ibexa 4 support (8) 2023-10-20 11:09:49 +02:00
Florian Bouché
3517f044fe Ibexa 4 support (7) 2023-10-20 11:06:43 +02:00
Florian Bouché
c09bd52dc4 Ibexa 4 support (6) 2023-10-20 10:42:39 +02:00
Florian Bouché
100f0a2c64 Ibexa 4 support (5) 2023-10-20 10:12:37 +02:00
Florian Bouché
1c8c88b956 Ibexa 4 support (4) 2023-10-20 09:55:36 +02:00
Florian Bouché
8a97f154c0 Ibexa 4 support (3) 2023-10-20 09:53:58 +02:00
Florian Bouché
11935a6e4c Ibexa 4 support (2) 2023-10-20 09:42:08 +02:00
Florian Bouché
bd15dfb6c1 Ibexa 4 support 2023-10-20 09:36:50 +02:00
31 changed files with 180 additions and 134 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.idea
vendor
composer.lock
.php-version

View File

@@ -1,6 +1,6 @@
# Onisep Ibexa Imagemap Bundle
This bundle provides an image map field type for Ibexa 3.3+.
This bundle provides an image map field type for Ibexa 4.6.2+.
## Installation
@@ -39,7 +39,7 @@ $ bin/console onisep:imagemap:dump-schema --update
To build admin assets:
```shell script
yarn encore prod --config-name=ezplatform
yarn encore prod --config-name=ibexa
```
For the front assets, you need to import the bundle files in your own entry points. For example, if your entry point is

View File

@@ -21,7 +21,7 @@
border: 1px solid black;
svg {
fill: #17a2b8;
fill: #ae1164;
width: 40px;
height: 40px;
}
@@ -41,10 +41,37 @@
svg {
width: 50px;
height: 50px;
fill: #17a2b8;
fill: #ae1164;
}
}
.imagemap-shape {
cursor: pointer;
}
.imagemap-edit {
.ibexa-field-edit--with-preview .ibexa-field-edit-preview__visual {
grid-template-columns: 100% auto;
grid-template-rows: 40.125rem auto;
.ibexa-field-edit-preview__details {
display: none;
}
.ibexa-field-edit-preview__media {
max-height: 40rem;
}
}
}
.imagemap-areas {
margin: 1rem 0 1rem 2.5rem;
}
.imagemap-add {
margin-left: 2.5rem;
}
.imagemap-draw-buttons {
margin-bottom: 1rem;
}

View File

@@ -106,7 +106,7 @@ const initImageMap = function (imageMap) {
const prototype = areas.parentNode.dataset.prototype;
const map = imageMap.querySelector('.imagemap-map');
const image = imageMap.querySelector('.ez-field-edit-preview__media');
const image = imageMap.querySelector('.ibexa-field-edit-preview__media');
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
const draw = SVG(svg);
const parent = image.parentNode;
@@ -168,6 +168,20 @@ const initArea = function (area, map, draw) {
target.querySelector('option[value="popin"]').hidden = true;
}
area.querySelectorAll('.ibexa-dropdown').forEach((dropdownContainer) => {
const dropdownAlreadyInitialized = !!global.ibexa.helpers.objectInstances.getInstance(dropdownContainer);
if (dropdownAlreadyInitialized) {
return;
}
const dropdown = new global.ibexa.core.Dropdown({
container: dropdownContainer,
});
dropdown.init();
});
recreateShape(area, draw);
}

View File

@@ -1,6 +1,6 @@
{
"name": "onisep/ibexa-imagemap-bundle",
"description": "Image map field type for Ibexa 3.3",
"description": "Image map field type for Ibexa 4.0+",
"type": "symfony-bundle",
"keywords": ["ibexa", "image map"],
"license": "MIT",
@@ -23,6 +23,16 @@
"homepage": "https://github.com/onisep/imagemap-bundle/graphs/contributors"
}
],
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*",
"http-interop/http-factory-guzzle": "^1.2",
"ibexa/admin-ui": "^4.5.3",
"ibexa/core": "^4.6.2"
},
"require-dev": {
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
"Onisep\\IbexaImageMapBundle\\": "src/"
@@ -33,15 +43,15 @@
"Onisep\\IbexaImageMapBundle\\Tests\\": "tests/"
}
},
"require": {
"php": ">=7.4",
"ext-json": "*",
"ezsystems/ezplatform-admin-ui": "^2.3",
"ezsystems/ezplatform-kernel": "^1.3"
"scripts": {
"phpstan": "phpstan analyse -l 1 src"
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
}
}

View File

@@ -28,9 +28,6 @@ class SchemaCommand extends Command
$this->connection = $connection;
}
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
@@ -40,9 +37,6 @@ class SchemaCommand extends Command
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$schemaProvider = new SchemaProvider();

View File

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

View File

@@ -11,20 +11,20 @@ class AddDefaultViewTemplatePass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$parameter = $container->getParameter('ezsettings.default.content_view_defaults');
$parameter = $container->getParameter('ibexa.site_access.config.default.content_view_defaults');
$parameter['imagemap_embed'] = [
'default' => [
'template' => '@ezdesign/default/content/imagemap_embed.html.twig',
'template' => '@ibexadesign/default/content/imagemap_embed.html.twig',
'match' => [],
],
];
$parameter['imagemap_popin'] = [
'default' => [
'template' => '@ezdesign/default/content/imagemap_popin.html.twig',
'template' => '@ibexadesign/default/content/imagemap_popin.html.twig',
'match' => [],
],
];
$container->setParameter('ezsettings.default.content_view_defaults', $parameter);
$container->setParameter('ibexa.site_access.config.default.content_view_defaults', $parameter);
}
}

View File

@@ -24,7 +24,7 @@ class OnisepImageMapExtension extends Extension implements PrependExtensionInter
{
$adminUiFormsConfigFile = __DIR__.'/../Resources/config/admin_ui_forms.yaml';
$config = Yaml::parseFile($adminUiFormsConfigFile);
$container->prependExtensionConfig('ezpublish', $config);
$container->prependExtensionConfig('ibexa', $config);
$container->addResource(new FileResource($adminUiFormsConfigFile));
}
}

View File

@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap;
use eZ\Publish\Core\FieldType\FieldSettings;
use eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter\ImageConverter;
use eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition;
use eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition;
use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition;
use Ibexa\Core\FieldType\FieldSettings;
use Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\ImageConverter;
use Ibexa\Core\Persistence\Legacy\Content\StorageFieldDefinition;
class FieldValueConverter extends ImageConverter
{

View File

@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway;
use eZ\Publish\SPI\Persistence\Content\Field;
use eZ\Publish\SPI\Persistence\Content\VersionInfo;
use Ibexa\Contracts\Core\Persistence\Content\Field;
use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
use Onisep\IbexaImageMapBundle\Database\ImageMapRepository;
class LegacyStorage
@@ -29,7 +29,7 @@ class LegacyStorage
$exists = $this->repository->get($fieldId, $version);
if ($exists) {
if ($exists !== null) {
$this->repository->update($fieldId, $version, $field->value->data['map']);
return;

View File

@@ -4,16 +4,16 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap;
use eZ\Publish\Core\Base\Utils\DeprecationWarnerInterface as DeprecationWarner;
use eZ\Publish\Core\FieldType\Image\AliasCleanerInterface;
use eZ\Publish\Core\FieldType\Image\ImageStorage;
use eZ\Publish\Core\FieldType\Image\ImageStorage\Gateway as ImageStorageGateway;
use eZ\Publish\Core\FieldType\Image\PathGenerator;
use eZ\Publish\Core\IO\FilePathNormalizerInterface;
use eZ\Publish\Core\IO\IOServiceInterface;
use eZ\Publish\Core\IO\MetadataHandler;
use eZ\Publish\SPI\Persistence\Content\Field;
use eZ\Publish\SPI\Persistence\Content\VersionInfo;
use Ibexa\Contracts\Core\FieldType\StorageGatewayInterface;
use Ibexa\Contracts\Core\Persistence\Content\Field;
use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
use Ibexa\Core\FieldType\Image\AliasCleanerInterface;
use Ibexa\Core\FieldType\Image\ImageStorage;
use Ibexa\Core\FieldType\Image\PathGenerator;
use Ibexa\Core\FieldType\Validator\FileExtensionBlackListValidator;
use Ibexa\Core\IO\FilePathNormalizerInterface;
use Ibexa\Core\IO\IOServiceInterface;
use Ibexa\Core\IO\MetadataHandler;
use Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage as ImageMapStorageGateway;
/**
@@ -24,16 +24,16 @@ class Storage extends ImageStorage
private ImageMapStorageGateway $imageMapGateway;
public function __construct(
ImageStorageGateway $baseGateway,
IOServiceInterface $IOService,
StorageGatewayInterface $gateway,
IOServiceInterface $ioService,
PathGenerator $pathGenerator,
MetadataHandler $imageSizeMetadataHandler,
DeprecationWarner $deprecationWarner,
ImageMapStorageGateway $imageMapGateway,
AliasCleanerInterface $aliasCleaner,
FilePathNormalizerInterface $filePathNormalizer
FilePathNormalizerInterface $filePathNormalizer,
FileExtensionBlackListValidator $fileExtensionBlackListValidator,
ImageMapStorageGateway $imageMapGateway
) {
parent::__construct($baseGateway, $IOService, $pathGenerator, $imageSizeMetadataHandler, $deprecationWarner, $aliasCleaner, $filePathNormalizer);
parent::__construct($gateway, $ioService, $pathGenerator, $imageSizeMetadataHandler, $aliasCleaner, $filePathNormalizer, $fileExtensionBlackListValidator);
$this->imageMapGateway = $imageMapGateway;
}

View File

@@ -4,9 +4,9 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap;
use eZ\Publish\Core\FieldType\Image\Type as ImageType;
use eZ\Publish\SPI\FieldType\Value as SPIValue;
use eZ\Publish\SPI\Persistence\Content\FieldValue as PersistenceValue;
use Ibexa\Contracts\Core\FieldType\Value as SPIValue;
use Ibexa\Contracts\Core\Persistence\Content\FieldValue as PersistenceValue;
use Ibexa\Core\FieldType\Image\Type as ImageType;
/**
* The ImageMap field type.
@@ -18,7 +18,7 @@ class Type extends ImageType
return 'imagemap';
}
public function validateFieldSettings($fieldSettings)
public function validateFieldSettings($fieldSettings): array
{
return [];
}

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\FieldType\ImageMap;
use eZ\Publish\Core\FieldType\Image\Value as ImageValue;
use Ibexa\Core\FieldType\Image\Value as ImageValue;
/**
* Value for ImageMap field type.

View File

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

View File

@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\Form;
use eZ\Publish\API\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\ContentService;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;

View File

@@ -4,13 +4,13 @@ declare(strict_types=1);
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 Ibexa\AdminUi\FieldType\Mapper\AbstractRelationFormMapper;
use Ibexa\AdminUi\Form\Data\FieldDefinitionData;
use Ibexa\Contracts\ContentForms\Data\Content\FieldData;
use Ibexa\Contracts\ContentForms\FieldType\FieldValueFormMapperInterface;
use Ibexa\Contracts\Core\Repository\ContentTypeService;
use Ibexa\Contracts\Core\Repository\FieldTypeService;
use Ibexa\Contracts\Core\Repository\LocationService;
use Onisep\IbexaImageMapBundle\DataTransformer\ImageMapTransformer;
use Onisep\IbexaImageMapBundle\FieldType\ImageMap\Value;
use Onisep\IbexaImageMapBundle\Form\ImageMapType;

View File

@@ -2,8 +2,8 @@ system:
admin_group:
admin_ui_forms:
content_edit_form_templates:
- { template: '@ezdesign/content/imagemap_form_fields.html.twig', priority: 1 }
- { template: '@ibexadesign/content/imagemap_form_fields.html.twig', priority: 1 }
default:
field_templates:
- { template: '@ezdesign/fields/imagemap_content_fields.html.twig', priority: 0 }
- { template: '@ibexadesign/fields/imagemap_content_fields.html.twig', priority: 0 }

View File

@@ -1,77 +1,77 @@
services:
Onisep\IbexaImageMapBundle\FieldType\ImageMap\Type:
arguments:
- ['@ezpublish.fieldType.validator.black_list', '@ezpublish.fieldType.validator.image']
parent: ezpublish.fieldType
- [ '@Ibexa\Core\FieldType\Validator\FileExtensionBlackListValidator', '@Ibexa\Core\FieldType\Validator\ImageValidator' ]
parent: Ibexa\Core\FieldType\FieldType
tags:
- { name: ezplatform.field_type, alias: imagemap }
- { name: ibexa.field_type, alias: imagemap }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\Storage:
arguments:
- '@ezpublish.fieldType.ezimage.storage_gateway'
- '@ezpublish.fieldType.ezimage.io_service'
- '@ezpublish.fieldType.ezimage.pathGenerator'
- '@ezpublish.fieldType.metadataHandler.imagesize'
- '@ezpublish.utils.deprecation_warner'
- '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage'
- '@?ezpublish.image_alias.imagine.alias_cleaner'
- '@eZ\Publish\Core\IO\FilePathNormalizerInterface'
$gateway: '@Ibexa\Core\FieldType\Image\ImageStorage\Gateway\DoctrineStorage'
$ioService: '@Ibexa\Core\FieldType\Image\IO\Legacy'
$pathGenerator: '@Ibexa\Core\FieldType\Image\PathGenerator\LegacyPathGenerator'
$imageSizeMetadataHandler: '@Ibexa\Core\IO\MetadataHandler\ImageSize'
$aliasCleaner: '@Ibexa\Core\FieldType\Image\AliasCleanerInterface'
$filePathNormalizer: '@Ibexa\Core\IO\FilePathNormalizerInterface'
$fileExtensionBlackListValidator: '@Ibexa\Core\FieldType\Validator\FileExtensionBlackListValidator'
$imageMapGateway: '@Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage'
tags:
- { name: ezplatform.field_type.external_storage_handler, alias: imagemap }
- { name: ibexa.field_type.storage.external.handler, alias: imagemap }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\FieldValueConverter:
arguments:
- '@ezpublish.fieldType.ezimage.io_service'
- '@ezpublish.core.io.image_fieldtype.legacy_url_redecorator'
- '@ibexa.field_type.ezimage.io'
- '@Ibexa\Core\IO\UrlRedecorator'
tags:
- { name: ezplatform.field_type.legacy_storage.converter, alias: imagemap, lazy: true, callback: '::create' }
- { name: ibexa.field_type.storage.legacy.converter, alias: imagemap, lazy: true, callback: '::create' }
Onisep\IbexaImageMapBundle\FieldType\ImageMap\ImageMapStorage\Gateway\LegacyStorage:
arguments: ['@Onisep\IbexaImageMapBundle\Database\ImageMapRepository']
arguments: [ '@Onisep\IbexaImageMapBundle\Database\ImageMapRepository' ]
tags:
- { name: ezplatform.field_type.external_storage_handler.gateway, alias: imagemap, identifier: LegacyStorage }
- { name: ibexa.field_type.storage.external.handler.gateway, alias: imagemap, identifier: LegacyStorage }
Onisep\IbexaImageMapBundle\Database\ImageMapRepository:
arguments: ['@ezpublish.persistence.connection']
arguments: [ '@ibexa.persistence.connection' ]
Onisep\IbexaImageMapBundle\Twig\ImageMapExtension:
tags: ['twig.extension']
tags: [ 'twig.extension' ]
Onisep\IbexaImageMapBundle\Twig\ImageMapRuntime:
arguments:
$locationService: '@eZ\Publish\API\Repository\LocationService'
$contentService: '@eZ\Publish\API\Repository\ContentService'
tags: ['twig.runtime']
$locationService: '@Ibexa\Contracts\Core\Repository\LocationService'
$contentService: '@Ibexa\Contracts\Core\Repository\ContentService'
tags: [ 'twig.runtime' ]
Onisep\IbexaImageMapBundle\Form\LinkType:
arguments:
$contentService: '@eZ\Publish\API\Repository\ContentService'
tags: ['form.type']
$contentService: '@Ibexa\Contracts\Core\Repository\ContentService'
tags: [ 'form.type' ]
Onisep\IbexaImageMapBundle\Form\MapAreaType:
tags: ['form.type']
tags: [ 'form.type' ]
Onisep\IbexaImageMapBundle\Form\MapAreasType:
tags: ['form.type']
tags: [ 'form.type' ]
Onisep\IbexaImageMapBundle\Form\ImageMapType:
tags: ['form.type']
tags: [ 'form.type' ]
Onisep\IbexaImageMapBundle\FormMapper\ImageMapFormMapper:
arguments:
$contentTypeService: '@eZ\Publish\API\Repository\ContentTypeService'
$locationService: '@eZ\Publish\API\Repository\LocationService'
$fieldTypeService: '@eZ\Publish\API\Repository\FieldTypeService'
$contentTypeService: '@Ibexa\Contracts\Core\Repository\ContentTypeService'
$locationService: '@Ibexa\Contracts\Core\Repository\LocationService'
$fieldTypeService: '@Ibexa\Contracts\Core\Repository\FieldTypeService'
tags:
- { name: ezplatform.field_type.form_mapper.definition, fieldType: imagemap }
- { name: ezplatform.field_type.form_mapper.value, fieldType: imagemap }
- { name: ibexa.admin_ui.field_type.form.mapper.definition, fieldType: imagemap }
- { name: ibexa.admin_ui.field_type.form.mapper.value, fieldType: imagemap }
Onisep\IbexaImageMapBundle\Command\SchemaCommand:
arguments:
$connection: '@ezpublish.persistence.connection'
tags: ['console.command']
$connection: '@ibexa.persistence.connection'
tags: [ 'console.command' ]
onisep.imagemap.unindexed:
class: eZ\Publish\Core\FieldType\Unindexed
class: Ibexa\Core\FieldType\Unindexed
tags:
- { name: ezplatform.field_type.indexable, alias: imagemap }
- { name: ibexa.field_type.indexable, alias: imagemap }

View File

@@ -1,23 +1,23 @@
const path = require('path');
module.exports = (eZConfig, eZConfigManager) => {
eZConfigManager.add({
eZConfig,
entryName: 'ezplatform-admin-ui-content-edit-parts-js',
module.exports = (ibexaConfig, ibexaConfigManager) => {
ibexaConfigManager.add({
ibexaConfig,
entryName: 'ibexa-admin-ui-content-edit-parts-js',
newItems: [
path.resolve(__dirname, '../public/build/imagemap_edit.js'),
],
});
eZConfigManager.add({
eZConfig,
entryName: 'ezplatform-admin-ui-layout-js',
ibexaConfigManager.add({
ibexaConfig,
entryName: 'ibexa-admin-ui-layout-js',
newItems: [
path.resolve(__dirname, '../public/build/imagemap.js'),
],
});
eZConfigManager.add({
eZConfig,
entryName: 'ezplatform-admin-ui-layout-css',
ibexaConfigManager.add({
ibexaConfig,
entryName: 'ibexa-admin-ui-layout-css',
newItems: [
path.resolve(__dirname, '../public/build/imagemap_edit_styles.css'),
path.resolve(__dirname, '../public/build/imagemap_styles.css'),

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
.imagemap-area{border:2px dashed #dbdbdb;border-radius:.25rem;padding:1rem;position:relative}.imagemap-area .imagemap-handle{cursor:grabbing;height:25px;margin-right:10px;transform:rotate(45deg);width:25px}.imagemap-area .imagemap-area-buttons{padding-right:0}.imagemap-area .imagemap-popin{background:#fff;border:1px solid #000}.imagemap-area .imagemap-popin svg{fill:#17a2b8;height:40px;width:40px}.imagemap-area .imagemap-popin a:focus{outline:none}.imagemap-go-up{height:0;margin-left:-60px;position:sticky;top:10px}.imagemap-go-up svg{fill:#17a2b8;height:50px;width:50px}.imagemap-shape{cursor:pointer}
.imagemap-area{border:2px dashed #dbdbdb;border-radius:.25rem;padding:1rem;position:relative}.imagemap-area .imagemap-handle{cursor:grabbing;height:25px;margin-right:10px;transform:rotate(45deg);width:25px}.imagemap-area .imagemap-area-buttons{padding-right:0}.imagemap-area .imagemap-popin{background:#fff;border:1px solid #000}.imagemap-area .imagemap-popin svg{fill:#ae1164;height:40px;width:40px}.imagemap-area .imagemap-popin a:focus{outline:none}.imagemap-go-up{height:0;margin-left:-60px;position:sticky;top:10px}.imagemap-go-up svg{fill:#ae1164;height:50px;width:50px}.imagemap-shape{cursor:pointer}.imagemap-edit .ibexa-field-edit--with-preview .ibexa-field-edit-preview__visual{grid-template-columns:100% auto;grid-template-rows:40.125rem auto}.imagemap-edit .ibexa-field-edit--with-preview .ibexa-field-edit-preview__visual .ibexa-field-edit-preview__details{display:none}.imagemap-edit .ibexa-field-edit--with-preview .ibexa-field-edit-preview__visual .ibexa-field-edit-preview__media{max-height:40rem}.imagemap-areas{margin:1rem 0 1rem 2.5rem}.imagemap-add{margin-left:2.5rem}.imagemap-draw-buttons{margin-bottom:1rem}

View File

@@ -2,15 +2,15 @@
{% block imagemap_row %}
<div class="imagemap-edit" id="imagemap-container-{{ form.parent.vars.data.field.id }}">
{% set label_wrapper_attr = label_wrapper_attr|default({})|merge({'class': (label_wrapper_attr.class|default('') ~ 'ez-field-edit__label-wrapper')|trim}) %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' ez-field-edit__label')|trim}) %}
{% set label_wrapper_attr = label_wrapper_attr|default({})|merge({'class': (label_wrapper_attr.class|default('') ~ 'ibexa-field-edit__label-wrapper')|trim}) %}
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' ibexa-field-edit__label')|trim}) %}
<div{% with { attr: label_wrapper_attr } %}{{ block('attributes') }}{% endwith %}>
{{- block('form_label') }}
</div>
<div>
<button type="button" class="btn btn-info imagemap-draw-rect">{{ 'imagemap.button.draw.rect'|trans }}</button>
<button type="button" class="btn btn-info imagemap-draw-circle">{{ 'imagemap.button.draw.circle'|trans }}</button>
<button type="button" class="btn btn-info imagemap-draw-poly">{{ 'imagemap.button.draw.poly'|trans }}</button>
<div class="imagemap-draw-buttons">
<button type="button" class="ibexa-btn btn btn-info imagemap-draw-rect">{{ 'imagemap.button.draw.rect'|trans }}</button>
<button type="button" class="ibexa-btn btn btn-info imagemap-draw-circle">{{ 'imagemap.button.draw.circle'|trans }}</button>
<button type="button" class="ibexa-btn btn btn-info imagemap-draw-poly">{{ 'imagemap.button.draw.poly'|trans }}</button>
<div hidden class="imagemap-help-rect">{{ 'imagemap.help.rect'|trans }}</div>
<div hidden class="imagemap-help-circle">{{ 'imagemap.help.circle'|trans }}</div>
<div hidden class="imagemap-help-poly">{{ 'imagemap.help.poly'|trans }}</div>
@@ -18,7 +18,7 @@
{% set preview_block_name = 'ezimage_preview' %}
{% set max_file_size = max_upload_size|round %}
{% set attr = attr|merge({'accept': 'image/*'}) %}
{% set wrapper_attr = {'class': 'ez-field-edit--ezimage'} %}
{% set wrapper_attr = {'class': 'ibexa-field-edit--ezimage'} %}
{% set label_wrapper_attr = {'hidden': true} %}
{{ block('binary_base_row') }}
{{ form_row(form.map) }}
@@ -50,7 +50,7 @@
{{ form_row(child) }}
{% endfor %}
</div>
<button type="button" class="btn btn-primary imagemap-add">{{ 'imagemap.button.link.label'|trans }}</button>
<button type="button" class="ibexa-btn btn btn-primary imagemap-add">{{ 'imagemap.button.link.label'|trans }}</button>
</div>
{% endblock %}
@@ -59,8 +59,8 @@
<div class="row">
<div class="col-1">
<button class="btn btn-danger imagemap-remove" type="button" title="{{ 'imagemap.area.button.delete.label'|trans }}">
<svg class="ez-icon ez-icon--medium ez-icon--light">
<use xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#trash"></use>
<svg class="ibexa-icon ibexa-icon--medium ibexa-icon--light">
<use xlink:href="/bundles/ibexaadminui/img/ibexa-icons.svg#trash"></use>
</svg>
</button>
</div>
@@ -92,7 +92,7 @@
{% block imagemap_link_row %}
{% set internal = content is not null %}
<div class="imagemap-relation row" data-udw-config="{{ ez_udw_config('single', {
<div class="imagemap-relation row" data-udw-config="{{ ibexa_udw_config('single', {
'type': 'object_relation',
'allowed_content_types': form.parent.parent.parent.parent.vars.data.fieldDefinition.fieldSettings.selectionContentTypes
}) }}">
@@ -105,12 +105,12 @@
<div class="col-9">
<div class="imagemap-relation-internal" {{ not internal ? 'hidden' }}>
<button class="btn btn-info imagemap-relation-browse" type="button" title="{{ 'imagemap.link.select_content'|trans }}">
<svg class="ez-icon ez-icon--medium ez-icon--light">
<use xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#browse"></use>
<svg class="ibexa-icon ibexa-icon--medium ibexa-icon--light">
<use xlink:href="/bundles/ibexaadminui/img/ibexa-icons.svg#browse"></use>
</svg>
</button>
<span class="imagemap-relation-name">
{{ content ? ez_content_name(content) : 'imagemap.link.no_content'|trans }}
{{ content ? ibexa_content_name(content) : 'imagemap.link.no_content'|trans }}
</span>
</div>
<div class="imagemap-relation-external" {{ internal ? 'hidden' }}>

View File

@@ -1 +1 @@
{{ ez_render_content(content, {'viewType': 'embed'}) }}
{{ ibexa_render_content(content, {'viewType': 'embed'}) }}

View File

@@ -1 +1 @@
{{ ez_render_content(content, {'viewType': 'embed'}) }}
{{ ibexa_render_content(content, {'viewType': 'embed'}) }}

View File

@@ -23,7 +23,7 @@
{% elseif item.target == 'popin' %}
{% set link = '#imagemap-target-' ~ field.id ~ '-' ~ item.content.id %}
{% else %}
{% set link = path('ez_urlalias', {'contentId': item.content.id}) %}
{% set link = path('ibexa.url.alias', {'contentId': item.content.id}) %}
{% endif %}
{% endif %}
@@ -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'}) }}
{{ ibexa_render_content(item.content, {'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'}) }}
{{ ibexa_render_content(item.content, {'viewType': 'imagemap_popin'}) }}
<button class="imagemap__popins__item__close imagemap__popins__item__exit">X</button>
</div>
</div>

View File

@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace Onisep\IbexaImageMapBundle\Twig;
use eZ\Publish\API\Repository\ContentService;
use eZ\Publish\API\Repository\LocationService;
use eZ\Publish\API\Repository\Values\Content\Field;
use eZ\Publish\Core\Base\Exceptions\NotFoundException;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\LocationService;
use Ibexa\Contracts\Core\Repository\Values\Content\Field;
use Ibexa\Core\Base\Exceptions\NotFoundException;
use Twig\Extension\RuntimeExtensionInterface;
class ImageMapRuntime implements RuntimeExtensionInterface