Skip to content

Commit 41c4530

Browse files
author
Yassine HANINI
authored
ProtectedContent Bundle compatibility for ibexa 4 (#112)
* ProtectedContent Bundle compatibility for ibexa 4
1 parent 15b7365 commit 41c4530

13 files changed

Lines changed: 58 additions & 55 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Once a Password is set, the Content becomes Protected. In this situation you wil
2525
Allowing you do:
2626

2727
```twig
28-
<h2>{{ ez_content_name(content) }}</h2>
28+
<h2>{{ ibexa_content_name(content) }}</h2>
2929
{% if not canReadProtectedContent %}
3030
<p>This content has been protected by a password</p>
3131
<div class="protected-content-form">

bundle/Controller/Admin/ProtectedAccessController.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ public function handle(
6464
}
6565

6666
return new RedirectResponse(
67-
$router->generate('_ez_content_view', ['contentId' => $location->contentId, 'locationId' => $location->id]).
68-
'#ez-tab-location-view-protect-content#tab'
67+
$router->generate('ibexa.content.view', ['contentId' => $location->contentId,
68+
'locationId' => $location->id,
69+
]).
70+
'#ibexa-tab-location-view-protect-content#tab'
6971
);
7072
}
7173

@@ -90,8 +92,10 @@ public function remove(
9092
);
9193

9294
return new RedirectResponse(
93-
$router->generate('_ez_content_view', ['contentId' => $location->contentId, 'locationId' => $location->id]).
94-
'#ez-tab-location-view-protect-content#tab'
95+
$router->generate('ibexa.content.view', ['contentId' => $location->contentId,
96+
'locationId' => $location->id,
97+
]).
98+
'#ibexa-tab-location-view-protect-content#tab'
9599
);
96100
}
97101
}

bundle/Core/SiteAccessAwareEntityManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use Doctrine\ORM\EntityManagerInterface;
2020
use Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
2121
use Doctrine\Persistence\ManagerRegistry as Registry;
22-
use eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider;
22+
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
2323

2424
class SiteAccessAwareEntityManagerFactory
2525
{

bundle/Core/Tab/ProtectContent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
namespace Novactive\Bundle\eZProtectedContentBundle\Core\Tab;
1616

17-
use EzSystems\EzPlatformAdminUi\Tab\AbstractTab;
18-
use EzSystems\EzPlatformAdminUi\Tab\OrderedTabInterface;
17+
use Ibexa\Contracts\AdminUi\Tab\AbstractTab;
18+
use Ibexa\Contracts\AdminUi\Tab\OrderedTabInterface;
1919
use Novactive\Bundle\eZProtectedContentBundle\Core\Compose\EntityManager;
2020
use Novactive\Bundle\eZProtectedContentBundle\Entity\ProtectedAccess;
2121
use Novactive\Bundle\eZProtectedContentBundle\Form\ProtectedAccessType;
@@ -66,7 +66,7 @@ public function renderView(array $parameters): string
6666
$items = $this->entityManager->getRepository(ProtectedAccess::class)->findByContent($content);
6767

6868
return $this->twig->render(
69-
'@NovaeZProtectedContent/tabs/protected_content.html.twig',
69+
'@ibexadesign/tabs/protected_content.html.twig',
7070
[
7171
'form' => $form->createView(),
7272
'items' => $items,

bundle/Entity/eZ/Content.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
namespace Novactive\Bundle\eZProtectedContentBundle\Entity\eZ;
1616

1717
use Doctrine\ORM\Mapping as ORM;
18-
use eZ\Publish\API\Repository\Values\Content\Content as eZContent;
19-
use eZ\Publish\API\Repository\Values\Content\Location as eZLocation;
18+
use Ibexa\Contracts\Core\Repository\Values\Content\Content as eZContent;
19+
use Ibexa\Contracts\Core\Repository\Values\Content\Location as eZLocation;
2020
use Symfony\Component\Validator\Constraints as Assert;
2121

2222
trait Content

bundle/Entity/eZ/ContentInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
namespace Novactive\Bundle\eZProtectedContentBundle\Entity\eZ;
1616

17-
use eZ\Publish\API\Repository\Values\Content\Content as eZContent;
18-
use eZ\Publish\API\Repository\Values\Content\Location as eZLocation;
17+
use Ibexa\Contracts\Core\Repository\Values\Content\Content as eZContent;
18+
use Ibexa\Contracts\Core\Repository\Values\Content\Location as eZLocation;
1919

2020
interface ContentInterface
2121
{

bundle/Listener/EntityContentLink.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
use Doctrine\ORM\Event\LifecycleEventArgs;
1818
use Doctrine\ORM\Mapping\PostLoad;
19-
use eZ\Publish\API\Repository\Repository;
19+
use Ibexa\Contracts\Core\Repository\Repository;
2020
use Novactive\Bundle\eZProtectedContentBundle\Entity\eZ\ContentInterface;
2121

2222
/**

bundle/Listener/PreContentView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
namespace Novactive\Bundle\eZProtectedContentBundle\Listener;
1616

1717
use Doctrine\ORM\EntityManagerInterface;
18-
use eZ\Publish\API\Repository\PermissionResolver;
19-
use eZ\Publish\Core\MVC\Symfony\Event\PreContentViewEvent;
20-
use eZ\Publish\Core\MVC\Symfony\View\ContentView;
18+
use Ibexa\Contracts\Core\Repository\PermissionResolver;
19+
use Ibexa\Core\MVC\Symfony\Event\PreContentViewEvent;
20+
use Ibexa\Core\MVC\Symfony\View\ContentView;
2121
use Novactive\Bundle\eZProtectedContentBundle\Entity\ProtectedAccess;
2222
use Novactive\Bundle\eZProtectedContentBundle\Form\RequestProtectedAccessType;
2323
use Symfony\Component\Form\FormFactoryInterface;

bundle/NovaeZProtectedContentBundle.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NovaeZProtectedContentBundle extends Bundle
3030
public function build(ContainerBuilder $container): void
3131
{
3232
parent::build($container);
33-
$eZExtension = $container->getExtension('ezpublish');
33+
$eZExtension = $container->getExtension('ibexa');
3434
$eZExtension->addPolicyProvider(new PolicyProvider());
3535
}
3636

@@ -51,8 +51,7 @@ public function getContainerExtension(): ?ExtensionInterface
5151
$this->extension = false;
5252
}
5353
}
54-
if ($this->extension) {
55-
return $this->extension;
56-
}
54+
55+
return $this->extension;
5756
}
5857
}

bundle/Repository/ProtectedAccessRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
namespace Novactive\Bundle\eZProtectedContentBundle\Repository;
1616

17-
use eZ\Publish\API\Repository\Repository;
18-
use eZ\Publish\API\Repository\Values\Content\Content;
19-
use eZ\Publish\API\Repository\Values\Content\Location;
17+
use Ibexa\Contracts\Core\Repository\Repository;
18+
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
19+
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
2020
use Novactive\Bundle\eZProtectedContentBundle\Entity\ProtectedAccess;
2121

2222
class ProtectedAccessRepository extends EntityRepository

0 commit comments

Comments
 (0)