Skip to content

Commit

Permalink
merged release/2.0.0 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
baschny committed May 16, 2018
2 parents 4b6ce3c + fd08de3 commit e37e1c3
Show file tree
Hide file tree
Showing 18 changed files with 171 additions and 94 deletions.
8 changes: 4 additions & 4 deletions Classes/CRON/FormBuilder/Controller/FormBuilderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* *
* */

use TYPO3\Flow\Annotations as Flow;
use TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository;
use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Domain\Repository\NodeDataRepository;
use CRON\FormBuilder\Utils\EmailMessage;
use TYPO3\Flow\Mvc\Controller\ActionController;
use Neos\Flow\Mvc\Controller\ActionController;
use CRON\FormBuilder\Service\SiteService;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
use Neos\ContentRepository\Domain\Model\NodeInterface;

class FormBuilderController extends ActionController
{
Expand Down
12 changes: 6 additions & 6 deletions Classes/CRON/FormBuilder/Service/SiteService.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace CRON\FormBuilder\Service;

use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
use TYPO3\Flow\Annotations as Flow;
use Neos\ContentRepository\Domain\Model\NodeInterface;
use Neos\Flow\Annotations as Flow;

/**
* Validator for not empty values.
Expand All @@ -14,13 +14,13 @@ class SiteService

/**
* @Flow\Inject
* @var \TYPO3\TYPO3CR\Domain\Service\ContextFactoryInterface
* @var \Neos\ContentRepository\Domain\Service\ContextFactoryInterface
*/
protected $contextFactory;

/**
* @Flow\Inject
* @var \TYPO3\Neos\Domain\Repository\SiteRepository
* @var \Neos\Neos\Domain\Repository\SiteRepository
*/
protected $siteRepository;

Expand All @@ -32,7 +32,7 @@ class SiteService
/**
* Get the root site node
*
* @return \TYPO3\TYPO3CR\Domain\Model\NodeInterface
* @return \Neos\ContentRepository\Domain\Model\NodeInterface
*/
public function getSiteNode()
{
Expand All @@ -49,7 +49,7 @@ public function getSiteNode()
* @param bool $showInvisibleAndInaccessibleContent
*
* @throws \Exception
* @return \TYPO3\Neos\Domain\Service\ContentContext
* @return \Neos\Neos\Domain\Service\ContentContext
*/
public function createContext($workspace = 'live', $showInvisibleAndInaccessibleContent = true)
{
Expand Down
8 changes: 4 additions & 4 deletions Classes/CRON/FormBuilder/Utils/EmailMessage.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
namespace CRON\FormBuilder\Utils;

use TYPO3\Flow\Annotations as Flow;
use TYPO3\SwiftMailer\Message;
use TYPO3\TYPO3CR\Domain\Model\NodeInterface;
use Neos\Flow\Annotations as Flow;
use Neos\SwiftMailer\Message;
use Neos\ContentRepository\Domain\Model\NodeInterface;

/**
* @property string viewName
Expand All @@ -13,7 +13,7 @@ class EmailMessage

/**
* @Flow\Inject
* @var \TYPO3\Fluid\View\StandaloneView
* @var \Neos\FluidAdaptor\View\StandaloneView
*/
public $fluidView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
namespace CRON\FormBuilder\Validation\Validator;

use TYPO3\Flow\Annotations as Flow;
use Neos\Flow\Annotations as Flow;
use CRON\FormBuilder\Service\SiteService;
use TYPO3\Flow\Error\Error;
use TYPO3\Flow\Validation\Validator\CollectionValidator;
use TYPO3\TYPO3CR\Domain\Repository\NodeDataRepository;
use Neos\Error\Messages\Error;
use Neos\Flow\Validation\Validator\CollectionValidator;
use Neos\ContentRepository\Domain\Repository\NodeDataRepository;

class FormBuilderValidator extends CollectionValidator
{
Expand Down
28 changes: 14 additions & 14 deletions Configuration/NodeTypes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'CRON.FormBuilder:Plugin':
superTypes:
'TYPO3.Neos:Plugin': true
'Neos.Neos:Plugin': true
'CRON.FormBuilder:FormElementContainerMixin': true
ui:
label: i18n
Expand All @@ -19,7 +19,7 @@
inspector:
group: advanced
validation:
'TYPO3.Neos/Validation/NotEmptyValidator': []
'Neos.Neos/Validation/NotEmptyValidator': []
subject:
type: string
ui:
Expand All @@ -28,7 +28,7 @@
inspector:
group: advanced
validation:
'TYPO3.Neos/Validation/NotEmptyValidator': []
'Neos.Neos/Validation/NotEmptyValidator': []
submitButtonLabel:
type: string
defaultValue: Absenden
Expand All @@ -38,24 +38,24 @@
inspector:
group: advanced
validation:
'TYPO3.Neos/Validation/NotEmptyValidator': []
'Neos.Neos/Validation/NotEmptyValidator': []
childNodes:
elements:
constraints:
nodeTypes:
'CRON.FormBuilder:FieldSet': true
responseElements:
type: 'TYPO3.Neos:ContentCollection'
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'TYPO3.Neos.NodeTypes:Headline': true
'TYPO3.Neos.NodeTypes:Text': true
'Neos.NodeTypes:Headline': true
'Neos.NodeTypes:Text': true
'*': false


'CRON.FormBuilder:FieldSet':
superTypes:
'TYPO3.Neos:Content': true
'Neos.Neos:Content': true
'CRON.FormBuilder:FormElementContainerMixin': true
'CRON.FormBuilder:FormElementLabelMixin': true
ui:
Expand All @@ -68,7 +68,7 @@
abstract: true
childNodes:
elements:
type: 'TYPO3.Neos:ContentCollection'
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'CRON.FormBuilder:Input': true
Expand All @@ -81,7 +81,7 @@

'CRON.FormBuilder:FormElementLabelMixin':
superTypes:
'TYPO3.Neos:Content': true
'Neos.Neos:Content': true
abstract: true
ui:
icon: 'icon-edit-sign'
Expand All @@ -99,7 +99,7 @@
inspector:
group: options
validation:
'TYPO3.Neos/Validation/NotEmptyValidator': []
'Neos.Neos/Validation/NotEmptyValidator': []

'CRON.FormBuilder:FormElementRequiredMixin':
abstract: true
Expand Down Expand Up @@ -178,7 +178,7 @@
label: CRON.FormBuilder:NodeTypes.Plugin:fields.select
childNodes:
elements:
type: 'TYPO3.Neos:ContentCollection'
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'CRON.FormBuilder:Option': true
Expand All @@ -195,7 +195,7 @@

'CRON.FormBuilder:Option':
superTypes:
'TYPO3.Neos:Content': true
'Neos.Neos:Content': true
'CRON.FormBuilder:FormElementValueMixin': true
ui:
label: CRON.FormBuilder:NodeTypes.Plugin:fields.select.options
Expand Down Expand Up @@ -228,7 +228,7 @@
label: CRON.FormBuilder:NodeTypes.Plugin:fields.checkbox.group
childNodes:
elements:
type: 'TYPO3.Neos:ContentCollection'
type: 'Neos.Neos:ContentCollection'
constraints:
nodeTypes:
'CRON.FormBuilder:CheckBox': true
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Policy.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

privilegeTargets:
TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilege:
Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege:
CRON_FormBuilder_Plugin:
matcher: 'method(CRON\FormBuilder\Controller\FormBuilderController->.*Action())'
roles:
'TYPO3.Flow:Everybody':
'Neos.Flow:Everybody':
privileges:
-
privilegeTarget: CRON_FormBuilder_Plugin
Expand Down
29 changes: 15 additions & 14 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
TYPO3:
Neos:
typoScript:
autoInclude:
'CRON.FormBuilder': TRUE

userInterface:
translation:
autoInclude:
'CRON.FormBuilder': ['NodeTypes/*']
CRON:
FormBuilder:
Email:
layoutRootPath: 'resource://CRON.FormBuilder/Private/Templates/Email/Layouts'
templatePathAndFilenameFormat: 'resource://CRON.FormBuilder/Private/Templates/Email/%s.txt'
defaults:
from: [email protected]
subject: New Message from FormBuilder
subject: 'New Message from FormBuilder'
Controller:
useForward: true
View:
useRequiredAttribute: true
Upload:
maxFileSize: 10000000
allowedMimeTypes:
- 'application/pdf'
- 'image/bmp'
- 'image/jpeg'
- 'image/png'
- application/pdf
- image/bmp
- image/jpeg
- image/png
Neos:
Neos:
userInterface:
translation:
autoInclude:
CRON.FormBuilder:
- 'NodeTypes/*'
fusion:
autoInclude:
CRON.FormBuilder: true
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include: resource://TYPO3.TypoScript/Private/TypoScript/*
include: resource://TYPO3.Neos/Private/TypoScript/*
include: resource://Neos.Fusion/Private/Fusion/*
include: resource://Neos.Neos/Private/Fusion/*

prototype(CRON.FormBuilder:FormElement) < prototype(TYPO3.Neos:Content) {
prototype(CRON.FormBuilder:FormElement) < prototype(Neos.Neos:Content) {
templatePath = ${'resource://CRON.FormBuilder/Private/Templates/NodeTypes/' + String.replace(node.nodeData.nodeType, 'CRON.FormBuilder:', '') + '.html'}

layoutName = 'Wrapper'

layoutAttributes = TYPO3.TypoScript:Attributes
layoutAttributes = Neos.Fusion:Attributes
layoutAttributes.class = ${'form-group' + (q(node).property('required') ? ' required' : '')}
[email protected] = TYPO3.TypoScript:Case {
[email protected] = Neos.Fusion:Case {
@context.nodeTypeClassName = ${String.toLowerCase(String.pregReplace(q(node).property('_nodeType.name'), '/[[:^alnum:]]/', '-')) + '-layout'}

classIsString {
Expand Down Expand Up @@ -48,7 +48,7 @@ prototype(CRON.FormBuilder:CheckBoxGroup) < prototype(CRON.FormBuilder:FormEleme
attributes.name >
attributes.class >

elements = TYPO3.Neos:ContentCollection {
elements = Neos.Neos:ContentCollection {
nodePath = 'elements'

prototype(CRON.FormBuilder:CheckBox) {
Expand All @@ -72,7 +72,7 @@ prototype(CRON.FormBuilder:Select) < prototype(CRON.FormBuilder:FormElement) {
@context.selectValue = ${this.value}
@context.selectMultiple = ${this.multiple}

elements = TYPO3.Neos:ContentCollection {
elements = Neos.Neos:ContentCollection {
nodePath = 'elements'

prototype(CRON.FormBuilder:Option) {
Expand All @@ -89,7 +89,7 @@ prototype(CRON.FormBuilder:FieldSet) < prototype(CRON.FormBuilder:FormElement) {
attributes.name >
attributes.class >

elements = TYPO3.Neos:ContentCollection {
elements = Neos.Neos:ContentCollection {
nodePath = 'elements'
}
}
Expand All @@ -99,17 +99,17 @@ prototype(CRON.FormBuilder:FileUpload) < prototype(CRON.FormBuilder:FormElement)
}


prototype(CRON.FormBuilder:Plugin) < prototype(TYPO3.Neos:Plugin) {
prototype(CRON.FormBuilder:Plugin) < prototype(Neos.Neos:Plugin) {
package = 'CRON.FormBuilder'
controller = 'FormBuilder'
action = 'index'

attributes = TYPO3.TypoScript:RawArray
attributes = Neos.Fusion:RawArray
attributes.role = 'form'

elements = ${q(node).children('elements').get(0)}

responseElements = TYPO3.Neos:ContentCollection {
responseElements = Neos.Neos:ContentCollection {
nodePath = 'responseElements'
}

Expand All @@ -118,6 +118,6 @@ prototype(CRON.FormBuilder:Plugin) < prototype(TYPO3.Neos:Plugin) {
hasUploadElement = ${q(node).find('[instanceof CRON.FormBuilder:FileUpload]').count() > 0}
}

elements = TYPO3.Neos:ContentCollection {
elements = Neos.Neos:ContentCollection {
nodePath = 'elements'
}
4 changes: 2 additions & 2 deletions Resources/Private/Templates/FormBuilder/Index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace ts=TYPO3\TypoScript\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}
{namespace ts=Neos\Fusion\ViewHelpers}

<f:layout name="Default" />
<f:section name="Content">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/NodeTypes/CheckBox.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="{layoutName}" />
<f:section name="Content">
<div class="checkbox {f:if(condition: validationResults.flattenedErrors, then: 'has-error')}">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/NodeTypes/CheckBoxGroup.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="{layoutName}" />
<f:section name="Content">
<f:if condition="{neos:rendering.inBackend()}">
Expand Down
25 changes: 13 additions & 12 deletions Resources/Private/Templates/NodeTypes/FieldSet.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace ts=TYPO3\TypoScript\ViewHelpers}

<fieldset {attributes -> f:format.raw()}>
<f:if condition="{node.properties.label}">
<legend>{node.properties.label}</legend>
</f:if>
<f:if condition="{neos:rendering.inBackend()}">
<strong><f:translate id="formBuilder.index.backend.addFormElements" package="CRON.FormBuilder" /></strong>
</f:if>
{elements -> f:format.raw()}
</fieldset>
{namespace neos=Neos\Neos\ViewHelpers}
{namespace ts=Neos\Fusion\ViewHelpers}
<f:section name="Content">
<fieldset {attributes -> f:format.raw()}>
<f:if condition="{node.properties.label}">
<legend>{node.properties.label}</legend>
</f:if>
<f:if condition="{neos:rendering.inBackend()}">
<strong><f:translate id="formBuilder.index.backend.addFormElements" package="CRON.FormBuilder" /></strong>
</f:if>
{elements -> f:format.raw()}
</fieldset>
</f:section>
2 changes: 1 addition & 1 deletion Resources/Private/Templates/NodeTypes/FileUpload.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace neos=Neos\Neos\ViewHelpers}
<f:layout name="{layoutName}" />
<f:section name="Content">
<f:if condition="{neos:rendering.inBackend()}">
Expand Down
Loading

0 comments on commit e37e1c3

Please sign in to comment.