mirror of
https://github.com/typemill/typemill.git
synced 2025-08-01 11:50:28 +02:00
Fixed download controller and errors with publicfielddefinitions
This commit is contained in:
@@ -137,7 +137,7 @@ class ControllerDownload extends ControllerShared
|
||||
header_remove("Last-Modified");
|
||||
header('Cache-Control: max-age=0, no-cache, no-store, must-revalidate');
|
||||
header('Cache-Control: private', false); # required for some browsers
|
||||
header('Content-Type: application/zip');
|
||||
header('Content-Type: ' . $mimetype);
|
||||
header('Content-Disposition: attachment; filename="'.basename($file).'";'); # Make the browser display the Save As dialog
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Content-Length: '.filesize($file));
|
||||
|
@@ -91,6 +91,10 @@ class Fields
|
||||
# Now prepopulate the field object with the value */
|
||||
if($field->getType() == "textarea")
|
||||
{
|
||||
if($fieldName == "publicformdefinitions" && $userValue == '')
|
||||
{
|
||||
$userValue = $objectSettings['settings'][$fieldName];
|
||||
}
|
||||
if($userValue)
|
||||
{
|
||||
$field->setContent($userValue);
|
||||
|
@@ -257,11 +257,16 @@ abstract class Plugin implements EventSubscriberInterface
|
||||
|
||||
# get settings and start validation
|
||||
$originalSettings = \Typemill\Settings::getObjectSettings('plugins', $pluginName);
|
||||
if(isset($settings['plugins'][$pluginName]['publicformdefinitions']))
|
||||
if(isset($settings['plugins'][$pluginName]['publicformdefinitions']) && $settings['plugins'][$pluginName]['publicformdefinitions'] != '')
|
||||
{
|
||||
$arrayFromYaml = \Symfony\Component\Yaml\Yaml::parse($settings['plugins'][$pluginName]['publicformdefinitions']);
|
||||
$originalSettings['public']['fields'] = $arrayFromYaml;
|
||||
}
|
||||
elseif(isset($originalSettings['settings']['publicformdefinitions']))
|
||||
{
|
||||
$arrayFromYaml = \Symfony\Component\Yaml\Yaml::parse($originalSettings['settings']['publicformdefinitions']);
|
||||
$originalSettings['public']['fields'] = $arrayFromYaml;
|
||||
}
|
||||
|
||||
$validate = new Validation();
|
||||
|
||||
|
@@ -54,7 +54,7 @@
|
||||
|
||||
{% elseif field.type == 'checkbox' %}
|
||||
|
||||
<label class="control-group">{{ __( field.getCheckboxLabel() ) }}
|
||||
<label class="control-group">{{ markdown( field.getCheckboxLabel() ) }}
|
||||
<input type="checkbox" id="{{ itemName}}[{{ field.name }}]" name="{{ itemName}}[{{ field.name }}]"{{ field.getAttributeValues() }}{{ field.getAttributes() }}>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
{% for value,label in options %}
|
||||
|
||||
<label class="control-group">{{ __( label ) }}
|
||||
<label class="control-group">{{ markdown( label ) }}
|
||||
<input type="checkbox" id="{{ itemName }}[{{ field.name }}][{{value}}]" name="{{ itemName }}[{{ field.name }}][{{value}}]" {{ settings[object][itemName][field.name][value] ? ' checked' : '' }}>
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
{% for value,label in options %}
|
||||
|
||||
<label class="control-group">{{ __(label) }}
|
||||
<label class="control-group">{{ markdown(label) }}
|
||||
<input type="radio" id="{{ itemName }}[{{ field.name }}]" name="{{ itemName }}[{{ field.name }}]" value="{{ value }}" {{ (value == settings[object][itemName][field.name]) ? ' checked' : '' }}>
|
||||
<span class="radiomark"></span>
|
||||
</label>
|
||||
|
Reference in New Issue
Block a user