diff --git a/src/admin/class-tainacan-admin.php b/src/admin/class-tainacan-admin.php index 2b1e09a89..116083cf8 100644 --- a/src/admin/class-tainacan-admin.php +++ b/src/admin/class-tainacan-admin.php @@ -207,38 +207,41 @@ class Admin { $settings['form_hooks'] = [ 'form-collection' => [ - 'begin-left' => '', - 'end-left' => '', - 'begin-right' => '', - 'end-right' => '' + 'begin-left' => [ + '', + '' + ], + 'end-left' => [''], + 'begin-right' => [''], + 'end-right' => [''] ], 'form-item' => [ - 'begin-left' => '', - 'end-left' => '', - 'begin-right' => '', - 'end-right' => '' + 'begin-left' => [''], + 'end-left' => [''], + 'begin-right' => [''], + 'end-right' => [''] ], 'view-item' => [ - 'begin-left' => '
blue
', - 'end-left' => 'black
', - 'begin-right' => 'red
', - 'end-right' => 'green
', + 'begin-left' => ['blue
'], + 'end-left' => ['black
'], + 'begin-right' => ['red
'], + 'end-right' => ['green
'], ], 'form-taxonomy' => [ - 'begin' => '', - 'end' => '' + 'begin' => [''], + 'end' => [''] ], 'form-term' => [ - 'begin' => '', - 'end' => '' + 'begin' => [''], + 'end' => [''] ], 'form-metadatum' => [ - 'begin' => '', - 'end' => '' + 'begin' => [''], + 'end' => [''] ], 'form-filter' => [ - 'begin' => '', - 'end' => '' + 'begin' => [''], + 'end' => [''] ] ]; diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index 5ec545acb..78023429d 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -34,7 +34,7 @@ formHooks['form-collection']['begin-left'] != undefined"> + v-html="this.formHooks['form-collection']['begin-left'].join('')"/> @@ -238,7 +238,7 @@ formHooks['form-collection']['end-left'] != undefined"> + v-html="formHooks['form-collection']['end-left'].join('')"/> @@ -252,7 +252,7 @@ formHooks['form-collection']['begin-right'] != undefined"> + v-html="formHooks['form-collection']['begin-right'].join('')"/> @@ -423,7 +423,7 @@ formHooks['form-collection']['end-right'] != undefined"> + v-html="formHooks['form-collection']['end-right'].join('')"/> @@ -593,6 +593,9 @@ export default { this.collection = updatedCollection; + // Fills hook forms with it's real values + this.updateExtraFormData('collection', this.collection); + // Fill this.form data with current data. this.form.name = this.collection.name; this.form.slug = this.collection.slug; @@ -608,10 +611,10 @@ export default { this.formErrorMessage = ''; this.editFormErrors = {}; - if (this.fromImporter) - this.$router.go(-1); - else - this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId)); + // if (this.fromImporter) + // this.$router.go(-1); + // else + // this.$router.push(this.$routerHelper.getCollectionPath(this.collectionId)); }) .catch((errors) => { for (let error of errors.errors) { @@ -638,7 +641,7 @@ export default { // Initializes Media Frames now that collectonId exists this.initializeMediaFrames(); - + // Fill this.form data with current data. this.form.name = this.collection.name; this.form.description = this.collection.description; @@ -825,6 +828,9 @@ export default { // Initializes Media Frames now that collectonId exists this.initializeMediaFrames(); + // Fills hook forms with it's real values + this.updateExtraFormData('collection', this.collection); + // Fill this.form data with current data. this.form.name = this.collection.name; this.form.description = this.collection.description; diff --git a/src/admin/components/edition/filter-edition-form.vue b/src/admin/components/edition/filter-edition-form.vue index 83be68971..73dfb2626 100644 --- a/src/admin/components/edition/filter-edition-form.vue +++ b/src/admin/components/edition/filter-edition-form.vue @@ -11,7 +11,7 @@ formHooks['form-filter']['begin'] != undefined"> + v-html="formHooks['form-filter']['begin'].join('')"/>