forked from ezsystems/repository-forms
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 ezsystems#158 from webhdx/configurable-views
EZP-27884: Create extensibility point for views overriding in content edit and draft create
- Loading branch information
Showing
9 changed files
with
123 additions
and
24 deletions.
There are no files selected for viewing
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
66 changes: 66 additions & 0 deletions
66
bundle/DependencyInjection/Configuration/Parser/ContentEdit.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,66 @@ | ||
<?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. | ||
*/ | ||
namespace EzSystems\RepositoryFormsBundle\DependencyInjection\Configuration\Parser; | ||
|
||
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\AbstractParser; | ||
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\ContextualizerInterface; | ||
use Symfony\Component\Config\Definition\Builder\NodeBuilder; | ||
|
||
class ContentEdit extends AbstractParser | ||
{ | ||
/** | ||
* Adds semantic configuration definition. | ||
* | ||
* @param \Symfony\Component\Config\Definition\Builder\NodeBuilder $nodeBuilder Node just under ezpublish.system.<siteaccess> | ||
*/ | ||
public function addSemanticConfig(NodeBuilder $nodeBuilder) | ||
{ | ||
$nodeBuilder | ||
->arrayNode('content_edit') | ||
->info('Content edit configuration') | ||
->children() | ||
->arrayNode('templates') | ||
->info('Content edit templates.') | ||
->children() | ||
->scalarNode('edit') | ||
->info('Template to use for content edit form rendering.') | ||
->end() | ||
->scalarNode('create_draft') | ||
->info('Template to use for content draft creation rendering.') | ||
->end() | ||
->end() | ||
->end() | ||
->end() | ||
->end(); | ||
} | ||
|
||
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer) | ||
{ | ||
if (empty($scopeSettings['content_edit'])) { | ||
return; | ||
} | ||
|
||
$settings = $scopeSettings['content_edit']; | ||
|
||
if (!empty($settings['templates']['edit'])) { | ||
$contextualizer->setContextualParameter( | ||
'content_edit.templates.edit', | ||
$currentScope, | ||
$settings['templates']['edit'] | ||
); | ||
} | ||
|
||
if (!empty($settings['templates']['create_draft'])) { | ||
$contextualizer->setContextualParameter( | ||
'content_edit.templates.create_draft', | ||
$currentScope, | ||
$settings['templates']['create_draft'] | ||
); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace EzSystems\RepositoryForms\Content\View; | ||
|
||
use eZ\Publish\Core\MVC\Symfony\View\BaseView; | ||
use eZ\Publish\Core\MVC\Symfony\View\View; | ||
|
||
class ContentCreateDraftView extends BaseView implements View | ||
{ | ||
} |
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,13 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace EzSystems\RepositoryForms\Content\View; | ||
|
||
use eZ\Publish\Core\MVC\Symfony\View\BaseView; | ||
use eZ\Publish\Core\MVC\Symfony\View\View; | ||
|
||
class ContentEditView extends BaseView implements View | ||
{ | ||
} |