From 9f2d2ae25a9818db498d912ad5aae2d852275026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Fri, 19 Mar 2021 13:01:14 +0100 Subject: [PATCH 1/2] Fix translations --- js/gutenberg/ss-gutenberg.js | 2 +- js/tiny-mce/tiny-mce.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/gutenberg/ss-gutenberg.js b/js/gutenberg/ss-gutenberg.js index 38b3e7f..539586b 100644 --- a/js/gutenberg/ss-gutenberg.js +++ b/js/gutenberg/ss-gutenberg.js @@ -235,7 +235,7 @@ const EditSimpleShop = (props) => { } return (
-
SimpleShop Form {attributes.ssFormId}
+
{__('SimpleShop Form', 'simpleshop-cz')} {attributes.ssFormId}
diff --git a/js/tiny-mce/tiny-mce.js b/js/tiny-mce/tiny-mce.js index 74fa4fa..8345606 100644 --- a/js/tiny-mce/tiny-mce.js +++ b/js/tiny-mce/tiny-mce.js @@ -25,7 +25,7 @@ var win = ed.windowManager.open({ width: 600, height: 300, - title: 'SimpleShop Formulář', + title: 'SimpleShop formulář', body: [ { type: 'listbox', @@ -72,21 +72,21 @@ var selectedText = ed.selection.getContent({format: 'html'}); var win = ed.windowManager.open({ - width: 600, + width: 620, height: 300, title: 'SimpleShop zabezpečený obsah', body: [ { type: 'listbox', name: 'sscContentGroupID', - label: 'Skupina', + label: 'Členská sekce', values: sscContentGroups, - value: 'test2' // Sets the default + value: '' }, { type: 'listbox', name: 'sscContentIsMember', - label: 'Je členem skupiny?', + label: 'Je členem členské sekce?', values: [ { text: 'Ano', @@ -122,7 +122,7 @@ { type: 'textbox', name: 'sscContentDaysToView', - label: 'Povolit přístup po X dnech od přiřazení do skupiny', + label: 'Povolit přístup po X dnech od přiřazení do členské sekce', minWidth: 200, value: '' }, From 40f0e812eeb3d7d185d511f4aa3bebb459fc8b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Fri, 19 Mar 2021 13:02:18 +0100 Subject: [PATCH 2/2] Admin: Fix XSS in generated JS --- src/Admin.php | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/Admin.php b/src/Admin.php index 10dc3ce..ae917fa 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -154,34 +154,30 @@ public function remove_quick_edit( $actions, $post ) { public function publishing_actions() { $mg_post_type = 'ssc_group'; global $post; - if ( $post && $post->post_type == $mg_post_type ) { - echo ''; - } ?> + + $group = new Group(); + $groups = $group->get_groups(); + + $outputGroups = [[ 'text' => __( 'Doesn\'t matter', 'simpleshop-cz' ), 'value' => '' ]]; + + foreach ( $groups as $value => $text ) { + $outputGroups[] = [ 'text' => $text, 'value' => (string)$value ]; + } + ?> + + post_type === $mg_post_type ) : ?> + + - id || 'user-edit' === $current_screen->id) { + if ( 'profile' === $current_screen->id || 'user-edit' === $current_screen->id ) { wp_enqueue_script( 'jquery-ui-datepicker' ); } }