Commit e239b3d4 authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

[BUGFIX] Fix crash and backend layout of the editor

parent 25009e3d
......@@ -146,7 +146,7 @@ class TemplateRepository extends AbstractRepository {
$template->setLayout($templateData['layout']);
}
$template->setContent($templateData['content']);
$template->setContent((string) $templateData['content']);
$template->setSubject($templateData['subject']);
if ($templateData['fromName']) {
$template->setFromName($templateData['fromName']);
......
......@@ -31,7 +31,7 @@
<f:flashMessages />
<f:if condition="{selectedTemplate}">
<f:then>
<div class="row form-group col-md-12 ">
<div class="row">
<div class="editor-description col-md-6">
<p>{templateDescription}</p>
</div>
......@@ -42,243 +42,246 @@
{f:translate(key:'backend.button_reset_all')}
</f:link.action>
</div>
<div style="clear:both;">&nbsp;</div>
</div>
<div class="col-md-12 row">
<div class="form-group">
<f:if condition="{deprecationWarnings}">
<div class="panel panel-danger">
<div class="panel-heading">
<f:translate key="backend.deprecationInfo" /> <br/>
<a style="text-decoration: underline;" href="#" data-toggle="collapse" data-target="#deprecationPanel">
<f:translate key="backend.showDeprecation" />
</a>
</div>
<div id="deprecationPanel" class="collapse">
<div class="panel-body">
<f:for each="{deprecationWarnings}" as="warning">
<small>{warning.code}</small>
<br>
</f:for>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<f:if condition="{deprecationWarnings}">
<div class="panel panel-danger">
<div class="panel-heading">
<f:translate key="backend.deprecationInfo" /> <br/>
<a style="text-decoration: underline;" href="#" data-toggle="collapse" data-target="#deprecationPanel">
<f:translate key="backend.showDeprecation" />
</a>
</div>
</div>
</div>
</f:if>
<div class="accordion">
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="accordion-header-toggle collapsed"
role="button"
data-toggle="collapse"
data-parent="#accordion"
href="#markers-container"
aria-expanded="true"
aria-controls="markers-container">
<f:translate key="backend.marker.usage_information_header" />
<i class="fa fa-caret-up"></i>
<i class="fa fa-caret-down"></i>
</a>
</h4>
<div id="deprecationPanel" class="collapse">
<div class="panel-body">
<f:for each="{deprecationWarnings}" as="warning">
<small>{warning.code}</small>
<br>
</f:for>
</div>
<div class="collapse" id="markers-container">
<div class="panel-body">
<p>
<f:translate key="bachend.markerUsage" />
</p>
</div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th><f:translate key="backend.marker" /></th>
<th><f:translate key="backend.type" /></th>
<th><f:translate key="backend.value" /></th>
<th><f:translate key="backend.description" /></th>
</tr>
</thead>
</div>
</f:if>
<div class="accordion">
<div class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<a class="accordion-header-toggle collapsed"
role="button"
data-toggle="collapse"
data-parent="#accordion"
href="#markers-container"
aria-expanded="true"
aria-controls="markers-container">
<f:translate key="backend.marker.usage_information_header" />
<i class="fa fa-caret-up"></i>
<i class="fa fa-caret-down"></i>
</a>
</h4>
</div>
<div class="collapse" id="markers-container">
<div class="panel-body">
<p>
<f:translate key="bachend.markerUsage" />
</p>
</div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th><f:translate key="backend.marker" /></th>
<th><f:translate key="backend.type" /></th>
<th><f:translate key="backend.value" /></th>
<th><f:translate key="backend.description" /></th>
</tr>
</thead>
<tr>
<td>all_fields</td>
<td><f:translate key="backend.marker.type.string" /></td>
<td>-</td>
<td>
<f:translate key="backend.marker.allFields">
{backend.marker.allFields}
</f:translate>
</td>
</tr>
<f:for each="{selectedTemplate.marker}" as="marker">
<tr>
<td>{marker.marker}</td>
<td>
<f:if condition="{marker.type}">
<f:then>
<f:translate key="{marker.type}">{marker.type}</f:translate>
</f:then>
<f:else>
<f:translate key="backend.marker.type.string" />
</f:else>
</f:if>
</td>
<td>all_fields</td>
<td><f:translate key="backend.marker.type.string" /></td>
<td>-</td>
<td>
<f:if condition="{sgm:isArray(value: '{marker.value}')}">
<f:then>
<f:for each="{marker.value}" as="value" key="key">
{key}: {value}
<br>
</f:for>
</f:then>
<f:else>
<f:if condition="{marker.value}">
<f:translate key="{marker.value}">
{marker.value}
</f:translate>
</f:if>
</f:else>
</f:if>
</td>
<td>
<f:if condition="{marker.description}">
<f:translate key="{marker.description}">
{marker.description}
</f:translate>
</f:if>
<f:translate key="backend.marker.allFields">
{backend.marker.allFields}
</f:translate>
</td>
</tr>
</f:for>
</table>
<f:for each="{selectedTemplate.marker}" as="marker">
<tr>
<td>{marker.marker}</td>
<td>
<f:if condition="{marker.type}">
<f:then>
<f:translate key="{marker.type}">{marker.type}</f:translate>
</f:then>
<f:else>
<f:translate key="backend.marker.type.string" />
</f:else>
</f:if>
</td>
<td>
<f:if condition="{sgm:isArray(value: '{marker.value}')}">
<f:then>
<f:for each="{marker.value}" as="value" key="key">
{key}: {value}
<br>
</f:for>
</f:then>
<f:else>
<f:if condition="{marker.value}">
<f:translate key="{marker.value}">
{marker.value}
</f:translate>
</f:if>
</f:else>
</f:if>
</td>
<td>
<f:if condition="{marker.description}">
<f:translate key="{marker.description}">
{marker.description}
</f:translate>
</f:if>
</td>
</tr>
</f:for>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row col-md-12 form-group">
<f:form method="post" controller="Mail" action="sendTestMail">
<f:for each="{templates}" as="template" key="key">
<f:variable name="languageId">{template.siteLanguage.languageId}</f:variable>
<div class="template-col col-md-{colspace}">
<div class="panel panel-default row">
<div class="panel-body">
<f:form.hidden name="parameters[templates][{languageId}][uid]" value="{template.uid}" />
<f:form.hidden name="parameters[templates][{languageId}][pid]" value="{template.pid}" />
<f:form.hidden name="parameters[templates][{languageId}][sys_language_uid]" value="{languageId}" />
<f:form.hidden name="parameters[templates][{languageId}][extensionKey]" value="{template.extensionKey}" />
<f:form.hidden name="parameters[templates][{languageId}][templateName]" value="{template.templateName}" />
<h3>
{template.siteLanguage.title}
<f:if condition="{template.isOverwritten}">
<f:translate key="backend.is_overwritten" />
</f:if>
</h3>
<div class="col-md-12">
<div class="row form-group">
<label for="parameters-templates-{languageId}-layout">
{f:translate(key:'backend.layout')}
</label>
<f:form.select id="parameters-templates-{languageId}-layout"
class="form-control"
value="{template.layout}"
options="{layoutOptions}"
name="parameters[templates][{languageId}][layout]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-fromName">
{f:translate(key:'backend.fromName')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-fromName"
class="form-control"
value="{template.fromName}"
name="parameters[templates][{languageId}][fromName]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-fromMail">
{f:translate(key:'backend.fromMail')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-fromMail"
class="form-control"
value="{template.fromMail}"
name="parameters[templates][{languageId}][fromMail]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-toAddress">
{f:translate(key:'backend.to_form')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-toAddress"
class="form-control"
value="{template.toAddress}"
name="parameters[templates][{languageId}][toAddress]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-cc">
{f:translate(key:'backend.cc')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-cc"
class="form-control"
value="{template.cc}"
name="parameters[templates][{languageId}][cc]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-bcc">
{f:translate(key:'backend.bcc')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-bcc"
class="form-control"
value="{template.bcc}"
name="parameters[templates][{languageId}][bcc]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-replyTo">
{f:translate(key:'backend.replyTo')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-replyTo"
class="form-control"
value="{template.replyTo}"
name="parameters[templates][{languageId}][replyTo]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-subject">
{f:translate(key:'backend.subject')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-subject"
class="form-control"
value="{template.subject}"
name="parameters[templates][{languageId}][subject]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-content">
{f:translate(key:'backend.content')}
</label>
<f:form.textarea id="parameters-templates-{languageId}-content"
class="form-control"
rows="15"
name="parameters[templates][{languageId}][content]"
value="{template.content}" />
<div class="row">
<div class="col-md-12 form-group">
<f:form method="post" controller="Mail" action="sendTestMail">
<f:render section="formActions" arguments="{_all}" />
<f:for each="{templates}" as="template" key="key" iteration="iterator">
<f:variable name="languageId">{template.siteLanguage.languageId}</f:variable>
<f:if condition="{iterator.isFirst}">
<div class="row">
</f:if>
<f:if condition="{iterator.cycle} % 4">
<f:else>
</div><div class="row">
</f:else>
</f:if>
<div class="template-col col-md-{colspace}">
<div class="panel panel-default">
<div class="panel-body">
<f:form.hidden name="parameters[templates][{languageId}][uid]" value="{template.uid}" />
<f:form.hidden name="parameters[templates][{languageId}][pid]" value="{template.pid}" />
<f:form.hidden name="parameters[templates][{languageId}][sys_language_uid]" value="{languageId}" />
<f:form.hidden name="parameters[templates][{languageId}][extensionKey]" value="{template.extensionKey}" />
<f:form.hidden name="parameters[templates][{languageId}][templateName]" value="{template.templateName}" />
<h3>
{template.siteLanguage.title}
<f:if condition="{template.isOverwritten}">
<f:translate key="backend.is_overwritten" />
</f:if>
</h3>
<div class="col-md-12">
<div class="row form-group">
<label for="parameters-templates-{languageId}-layout">
{f:translate(key:'backend.layout')}
</label>
<f:form.select id="parameters-templates-{languageId}-layout"
class="form-control"
value="{template.layout}"
options="{layoutOptions}"
name="parameters[templates][{languageId}][layout]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-fromName">
{f:translate(key:'backend.fromName')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-fromName"
class="form-control"
value="{template.fromName}"
name="parameters[templates][{languageId}][fromName]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-fromMail">
{f:translate(key:'backend.fromMail')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-fromMail"
class="form-control"
value="{template.fromMail}"
name="parameters[templates][{languageId}][fromMail]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-toAddress">
{f:translate(key:'backend.to_form')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-toAddress"
class="form-control"
value="{template.toAddress}"
name="parameters[templates][{languageId}][toAddress]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-cc">
{f:translate(key:'backend.cc')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-cc"
class="form-control"
value="{template.cc}"
name="parameters[templates][{languageId}][cc]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-bcc">
{f:translate(key:'backend.bcc')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-bcc"
class="form-control"
value="{template.bcc}"
name="parameters[templates][{languageId}][bcc]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-replyTo">
{f:translate(key:'backend.replyTo')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-replyTo"
class="form-control"
value="{template.replyTo}"
name="parameters[templates][{languageId}][replyTo]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-subject">
{f:translate(key:'backend.subject')}
</label>
<f:form.textfield id="parameters-templates-{languageId}-subject"
class="form-control"
value="{template.subject}"
name="parameters[templates][{languageId}][subject]" />
</div>
<div class="row form-group">
<label for="parameters-templates-{languageId}-content">
{f:translate(key:'backend.content')}
</label>
<f:form.textarea id="parameters-templates-{languageId}-content"
class="form-control"
rows="15"
name="parameters[templates][{languageId}][content]"
value="{template.content}" />
</div>
</div>
</div>
</div>
</div>
</div>
</f:for>
<div class="form-group">
<f:form.submit name="saveOnly"
class="btn-success btn form-group"
value="{f:translate(key:'backend.save_template')}" />
<f:form.submit class="btn-primary btn form-group"
value="{f:translate(key:'backend.send_test')}" />
<f:form.textfield name="parameters[emailAddress]"
class="email-input form-group"
value="{beUserMail}" />
<f:form.hidden name="parameters[selectedTemplate]"
value="{selectedTemplateKey}" />
<f:form.hidden name="parameters[selectedExtensionKey]"
value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedExtension]"
value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedTemplateKey]"
value="{selectedTemplateKey}" />
</div>
</f:form>
<f:if condition="{iterator.isLast}">
</div>
</f:if>
</f:for>
<f:render section="formActions" arguments="{_all}" />
</f:form>
</div>
</div>
</f:then>
<f:else>
......@@ -286,3 +289,26 @@
</f:else>
</f:if>
</f:section>
<f:section name="formActions">
<div class="row">
<div class="col-md-12 form-group form-actions">
<f:form.submit name="saveOnly"
class="btn-success btn form-group"
value="{f:translate(key:'backend.save_template')}" />
<f:form.submit class="btn-primary btn form-group"
value="{f:translate(key:'backend.send_test')}" />
<f:form.textfield name="parameters[emailAddress]"
class="email-input form-group"
value="{beUserMail}" />
<f:form.hidden name="parameters[selectedTemplate]"
value="{selectedTemplateKey}" />
<f:form.hidden name="parameters[selectedExtensionKey]"
value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedExtension]"
value="{selectedTemplate.extension}" />
<f:form.hidden name="parameters[selectedTemplateKey]"
value="{selectedTemplateKey}" />
</div>
</div>
</f:section>
......@@ -96,12 +96,12 @@
.markers-card {
border: none;
margin-bottom: 0px;
margin-bottom: 0;
box-shadow: none;
}
a.accordion-header-toggle .fa-caret-down {
display: none;
display: none;
}
a.accordion-header-toggle.collapsed .fa-caret-down {
......@@ -109,5 +109,10 @@ a.accordion-header-toggle.collapsed .fa-caret-down {
}
a.accordion-header-toggle.collapsed .fa-caret-up {
display: none;
display: none;
}
.form-actions {
margin-bottom: 5px;
clear: both;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment