diff --git a/content/.yaml b/content/.yaml new file mode 100644 index 0000000..604c82e --- /dev/null +++ b/content/.yaml @@ -0,0 +1,8 @@ +meta: + title: Typemill + description: 'Typemill is a user-friendly and lightweight open source CMS for publishing text-works like prose, lyrics, manuals, documentations, studies and more. Just download and start.' + author: 'Sebastian Schürmanns' + created: '2020-04-27' + time: 14-20-18 + navtitle: null + modified: '2020-04-27' diff --git a/media/files/neue-datei.tx6t b/media/files/neue-datei.tx6t new file mode 100644 index 0000000..01dba91 --- /dev/null +++ b/media/files/neue-datei.tx6t @@ -0,0 +1,13 @@ +Hallo Frau Zarth, + +vielleicht sagt Ihnen als Leiterin Com & Tech die Fachseite CMSstash.de etwas? Wir behandeln ausschließlich CMS und bieten seit letzter Woche auch ein Dienstleisterverzeichnis an. Ist das interessant für Nexum als Tech-Partner von Magnolia, Typo3 und Co? + +Herzliche Grüße + + +Hallo Herr Timm, + +ich kenne unitb vor allem als Spezialist für AEM, Magnolia oder Drupal. Vielleicht ist für Ihre Agentur die wachsende Zielgruppe von CMSstash interessant? Wir bieten seit letzter Woche ein Dienstleisterverzeichnis an, in dem sich CMS-Experten präsentieren können. + +Herzliche Grüße +octet-stream \ No newline at end of file diff --git a/system/Controllers/ArticleApiController.php b/system/Controllers/ArticleApiController.php index 034260a..1031ab7 100644 --- a/system/Controllers/ArticleApiController.php +++ b/system/Controllers/ArticleApiController.php @@ -84,9 +84,9 @@ class ArticleApiController extends ContentController # dispatch event $page = ['content' => $this->content, 'meta' => $meta, 'item' => $this->item]; - $this->c->dispatcher->dispatch('onPagePublished', new OnPagePublished($page)); + $page = $this->c->dispatcher->dispatch('onPagePublished', new OnPagePublished($page))->getData(); - return $response->withJson(['success' => true, 'meta' => $meta], 200); + return $response->withJson(['success' => true, 'meta' => $page['meta']], 200); } else { diff --git a/system/Controllers/MediaApiController.php b/system/Controllers/MediaApiController.php index 5b0ec9b..0cccfde 100644 --- a/system/Controllers/MediaApiController.php +++ b/system/Controllers/MediaApiController.php @@ -108,6 +108,11 @@ class MediaApiController extends ContentController if($imageProcessor->createImage($this->params['image'], $this->params['name'], $this->settings['images'])) { + # publish image directly, used for example by image field for meta-tabs + if($this->params['publish']) + { + $imageProcessor->publishImage(); + } return $response->withJson(['name' => 'media/live/' . $imageProcessor->getFullName(),'errors' => false]); } diff --git a/system/Controllers/MetaApiController.php b/system/Controllers/MetaApiController.php index 30c6df9..b05dffc 100644 --- a/system/Controllers/MetaApiController.php +++ b/system/Controllers/MetaApiController.php @@ -272,10 +272,10 @@ class MetaApiController extends ContentController } # add the new/edited metadata - $meta[$tab] = $metaInput; + $metaPage[$tab] = $metaInput; # store the metadata - $writeMeta->updateYaml($this->settings['contentFolder'], $this->item->pathWithoutType . '.yaml', $meta); + $writeMeta->updateYaml($this->settings['contentFolder'], $this->item->pathWithoutType . '.yaml', $metaPage); if($structure) { diff --git a/system/Models/ProcessImage.php b/system/Models/ProcessImage.php index e6a1d18..1f70938 100644 --- a/system/Models/ProcessImage.php +++ b/system/Models/ProcessImage.php @@ -333,6 +333,8 @@ class ProcessImage extends ProcessAssets # generate images from live folder to 'tmthumbs' $liveImages = scandir($this->liveFolder); + $result = false; + foreach ($liveImages as $key => $name) { if (!in_array($name, array(".",".."))) diff --git a/system/Models/Validation.php b/system/Models/Validation.php index d5ed19a..be68110 100644 --- a/system/Models/Validation.php +++ b/system/Models/Validation.php @@ -342,7 +342,7 @@ class Validation */ public function objectField($fieldName, $fieldValue, $objectName, $fieldDefinitions, $skiprequired = NULL) - { + { $v = new Validator(array($fieldName => $fieldValue)); if(isset($fieldDefinitions['required']) && !$skiprequired) @@ -412,8 +412,16 @@ class Validation # $v->rule('regex', $fieldName, '/^[\pL0-9_ \-\.\?\!\/\:]*$/u'); break; case "textarea": - $v->rule('noHTML', $fieldName); - $v->rule('lengthMax', $fieldName, 1000); + # it understands array, json, yaml + if(is_array($fieldValue)) + { + $v = $this->checkArray($fieldValue, $v); + } + else + { + $v->rule('noHTML', $fieldName); + $v->rule('lengthMax', $fieldName, 1000); + } break; case "paragraph": $v->rule('noHTML', $fieldName); @@ -422,9 +430,13 @@ class Validation case "password": $v->rule('lengthMax', $fieldName, 100); break; + case "image": + $v->rule('noHTML', $fieldName); + $v->rule('lengthMax', $fieldName, 1000); + break; default: $v->rule('lengthMax', $fieldName, 1000); - $v->rule('regex', $fieldName, '/^[\pL0-9_ \-]*$/u'); + $v->rule('regex', $fieldName, '/^[\pL0-9_ \-]*$/u'); } return $this->validationResult($v, $objectName); } @@ -435,6 +447,20 @@ class Validation * @param obj $v the validation object. * @return bool */ + + public function checkArray($arrayvalues, $v) + { + foreach($arrayvalues as $key => $value) + { + if(is_array($value)) + { + $this->checkArray($value, $v); + } + $v->rule('noHTML', $value); + $v->rule('lengthMax', $value, 1000); + } + return $v; + } public function validationResult($v, $name = false) { diff --git a/system/author/css/style.css b/system/author/css/style.css index b4f6c00..a4f02ff 100644 --- a/system/author/css/style.css +++ b/system/author/css/style.css @@ -141,7 +141,7 @@ a.tm-download::before{ width: 30px; height: 30px; line-height: 30px; - font-family: "Comic Sans MS",cursive,sans-serif; + font-family: Calibri, "Segoe UI", Roboto, Courier, Helvetica, -apple-system, BlinkMacSystemFont, sans-serif, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 1.3em; font-weight: 900; border: 2px solid #e0474c; diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index e7b4139..d174419 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -2073,7 +2073,7 @@ const medialib = Vue.component('medialib', { this.$parent.showmedialib = false; - this.$parent.updatemarkdown(imgmarkdown); + this.$parent.updatemarkdown(imgmarkdown, image.src_live); } if(this.parentcomponent == 'files') { @@ -2084,7 +2084,7 @@ const medialib = Vue.component('medialib', { this.$parent.showmedialib = false; - this.$parent.updatemarkdown(filemarkdown); + this.$parent.updatemarkdown(filemarkdown, image.src_live); } }, selectFile: function(file) @@ -2106,7 +2106,7 @@ const medialib = Vue.component('medialib', { this.$parent.showmedialib = false; - this.$parent.updatemarkdown(imgmarkdown); + this.$parent.updatemarkdown(imgmarkdown, file.url); } if(this.parentcomponent == 'files') { @@ -2117,7 +2117,7 @@ const medialib = Vue.component('medialib', { this.$parent.filemeta = true; this.$parent.filetitle = file.info.filename + ' (' + file.info.extension.toUpperCase() + ')'; - this.$parent.updatemarkdown(filemarkdown); + this.$parent.updatemarkdown(filemarkdown, file.url); } this.showFiles(); }, diff --git a/system/author/js/vue-meta.js b/system/author/js/vue-meta.js index e544997..35c5f6b 100644 --- a/system/author/js/vue-meta.js +++ b/system/author/js/vue-meta.js @@ -2,12 +2,12 @@ const FormBus = new Vue(); Vue.filter('translate', function (value) { if (!value) return '' - value = value.replace(/[ ]/g,"_").replace(/[.]/g, "_").replace(/[-]/g, "_").replace(/[,]/g,"_").replace(/[(]/g,"_").replace(/[)]/g,"_").toUpperCase() - translated_string = labels[value] + transvalue = value.replace(/[ ]/g,"_").replace(/[.]/g, "_").replace(/[-]/g, "_").replace(/[,]/g,"_").replace(/[(]/g,"_").replace(/[)]/g,"_").toUpperCase() + translated_string = labels[transvalue] if(!translated_string || translated_string.length === 0){ - return value + '?' + return value } else { - return labels[value] + return labels[transvalue] } }) @@ -37,18 +37,42 @@ Vue.component('component-text', { }, }) +Vue.component('component-hidden', { + props: ['class', 'id', 'maxlength', 'required', 'disabled', 'name', 'type', 'value', 'errors'], + template: '
upload an image
'+ + '{{ description|translate }}
upload an image
+