diff --git a/content/00-welcome/01-manage-access.md b/content/00-welcome/01-manage-access.md index fd28e7a..64c58e1 100644 --- a/content/00-welcome/01-manage-access.md +++ b/content/00-welcome/01-manage-access.md @@ -2,9 +2,6 @@ Typemill has a build-in system to restrict access to pages or to the whole websites. You can activate both features in the system settings under the section "access rights". If you activate one of the features, then Typemill will use session cookies on all frontend pages. Learn all the details in the following video tutorial: -```pagebreak -``` - ![youtube-video](media/live/youtube-uw-m-4g1kaa.jpeg "click to load video"){#UW_m-4g1kAA .youtube} ## Restrict Access for the Website diff --git a/system/Controllers/ControllerDownload.php b/system/Controllers/ControllerDownload.php index 81af2ee..7e9ce5e 100644 --- a/system/Controllers/ControllerDownload.php +++ b/system/Controllers/ControllerDownload.php @@ -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)); diff --git a/system/Models/Fields.php b/system/Models/Fields.php index 0f7b36d..1657b22 100644 --- a/system/Models/Fields.php +++ b/system/Models/Fields.php @@ -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); diff --git a/system/Plugin.php b/system/Plugin.php index c13ad28..e1da762 100644 --- a/system/Plugin.php +++ b/system/Plugin.php @@ -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(); diff --git a/system/author/partials/fields.twig b/system/author/partials/fields.twig index 38fce70..2b49483 100644 --- a/system/author/partials/fields.twig +++ b/system/author/partials/fields.twig @@ -54,7 +54,7 @@ {% elseif field.type == 'checkbox' %} -