Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from ezsystems/EZP-24713_policy_limitations
Fix EZP-24713: Policy limitations edition
- Loading branch information
Showing
23 changed files
with
723 additions
and
13 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
bundle/DependencyInjection/Compiler/LimitationFormMapperPass.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the eZ RepositoryForms package. | ||
* | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
* | ||
* @version //autogentag// | ||
*/ | ||
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Compiler; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use LogicException; | ||
use Symfony\Component\DependencyInjection\Reference; | ||
|
||
/** | ||
* Compiler pass to register Limitation form mappers. | ||
*/ | ||
class LimitationFormMapperPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
if (!$container->hasDefinition('ezrepoforms.limitation_form_mapper.registry')) { | ||
return; | ||
} | ||
|
||
$registry = $container->findDefinition('ezrepoforms.limitation_form_mapper.registry'); | ||
|
||
foreach ($container->findTaggedServiceIds('ez.limitation.formMapper') as $id => $attributes) { | ||
foreach ($attributes as $attribute) { | ||
if (!isset($attribute['limitationType'])) { | ||
throw new LogicException( | ||
'ez.limitation.formMapper service tag needs a "limitationType" attribute to identify which LimitationType the mapper is for. None given.' | ||
); | ||
} | ||
|
||
$registry->addMethodCall('addMapper', [new Reference($id), $attribute['limitationType']]); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
bundle/Resources/views/Limitation/base_limitation_values.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ form_label(form.limitationValues) }} | ||
{{ form_errors(form.limitationValues) }} | ||
{{ form_widget(form.limitationValues) }} |
3 changes: 3 additions & 0 deletions
3
bundle/Resources/views/Limitation/null_limitation_values.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% do form.setRendered() %} | ||
{{ form_label(form) }} | ||
<em>{{ "role.policy.limitation.not_implemented"|trans({"%limitationTypeIdentifier%": form.vars.data.identifier}, 'ezrepoforms_role') }}</em> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.