diff --git a/config/app_local.example.php b/config/app_local.example.php
index 928e59b15..e8708f584 100644
--- a/config/app_local.example.php
+++ b/config/app_local.example.php
@@ -269,6 +269,8 @@
* for a complete list of icons
* 'sidebar' - additional custom sidebar links added in modules index and single item view,
* defined as associative array with 'index' and 'view' keys
+ * 'dropupload' - custom dropupload element to use for this module, f.i. 'MyPlugin.Form/dropupload'
+ * 'multiupload' - custom multiupload element to use for this module, f.i. 'MyPlugin.Form/multiupload'
*/
// 'Modules' => [
// 'objects' => [
@@ -283,6 +285,12 @@
// ],
// 'documents' => [
// 'color' => '#cc4700',
+ // 'dropupload' => [
+ // '_element' => 'MyPlugin.Form/dropupload',
+ // ],
+ // 'multiupload' => [
+ // '_element' => 'MyPlugin.Form/multiupload',
+ // ],
// ],
// 'events' => [
// 'color' => '#09c',
diff --git a/resources/js/app/app.js b/resources/js/app/app.js
index e3c227423..5653c31b3 100644
--- a/resources/js/app/app.js
+++ b/resources/js/app/app.js
@@ -202,6 +202,7 @@ const _vueInstance = new Vue({
BEDITA.success = success;
BEDITA.prompt = prompt;
BEDITA.warning = warning;
+ BEDITA.formatDate = this.$helpers.formatDate;
this.selectedTypes = this.queryFilter?.filter?.type || [];
});
},
diff --git a/resources/js/app/helpers/view.js b/resources/js/app/helpers/view.js
index 1f3b46165..c07e419c1 100644
--- a/resources/js/app/helpers/view.js
+++ b/resources/js/app/helpers/view.js
@@ -224,6 +224,17 @@ export default {
return false;
},
+ getObjectTypeFromMime(mimeType) {
+ const mimes = BEDITA.uploadConfig?.accepted;
+ for (let type in mimes) {
+ if (this.checkAcceptedMime(mimes[type], mimeType)) {
+ return type;
+ }
+ }
+
+ return null;
+ },
+
titleFromFileName(filename) {
let title = filename;
title = title.replaceAll('-', ' ');
diff --git a/resources/js/app/mixins/paginated-content.js b/resources/js/app/mixins/paginated-content.js
index 77bbe7c1c..e552bf59d 100644
--- a/resources/js/app/mixins/paginated-content.js
+++ b/resources/js/app/mixins/paginated-content.js
@@ -158,7 +158,7 @@ export const PaginatedContentMixin = {
formattedObj.type = obj.type;
// search for meta.relation using this.formatObjectsFilter
- const metaRelation = obj.meta.relation;
+ const metaRelation = obj?.meta?.relation || {};
if (metaRelation) {
let formattedMeta = {};
this.formatObjectsFilter.forEach((filter) => {
diff --git a/resources/js/app/pages/modules/index.js b/resources/js/app/pages/modules/index.js
index b244ea557..ebe79c095 100644
--- a/resources/js/app/pages/modules/index.js
+++ b/resources/js/app/pages/modules/index.js
@@ -74,6 +74,9 @@ export default {
watch: {
selectedRows(val) {
+ if (!this.$refs.checkAllCB) {
+ return;
+ }
if (!val.length) {
this.$refs.checkAllCB.checked = false;
this.$refs.checkAllCB.indeterminate = false;
diff --git a/src/Controller/ModulesController.php b/src/Controller/ModulesController.php
index 88e1d3143..af074bbb1 100644
--- a/src/Controller/ModulesController.php
+++ b/src/Controller/ModulesController.php
@@ -588,9 +588,13 @@ public function setObjectType(?string $objectType): void
*/
private function setupViewRelations(array $relations): void
{
+ // setup relations schema
+ $relationsSchema = $this->Schema->getRelationsSchema();
+ $this->set('relationsSchema', $relationsSchema);
+
// setup relations metadata
$this->Modules->setupRelationsMeta(
- $this->Schema->getRelationsSchema(),
+ $relationsSchema,
$relations,
$this->Properties->relationsList($this->objectType),
$this->Properties->hiddenRelationsList($this->objectType),
diff --git a/src/View/Helper/ElementHelper.php b/src/View/Helper/ElementHelper.php
index bb46ac640..a3744d21d 100644
--- a/src/View/Helper/ElementHelper.php
+++ b/src/View/Helper/ElementHelper.php
@@ -47,6 +47,41 @@ public function custom(string $item, string $type = 'relation'): string
return (string)Configure::read($path);
}
+ /**
+ * Return dropupload element path by relation.
+ * This checks relation right types, and verify if there is a `Modules.