Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opravy překladů a oprava XSS v JS #81

Merged
merged 2 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/gutenberg/ss-gutenberg.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ const EditSimpleShop = (props) => {
}
return (
<div className={className}>
<div>SimpleShop Form {attributes.ssFormId}</div>
<div>{__('SimpleShop Form', 'simpleshop-cz')} {attributes.ssFormId}</div>

<InspectorControls key="inspector">
<PanelBody>
Expand Down
12 changes: 6 additions & 6 deletions js/tiny-mce/tiny-mce.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var win = ed.windowManager.open({
width: 600,
height: 300,
title: 'SimpleShop Formulář',
title: 'SimpleShop formulář',
body: [
{
type: 'listbox',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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: ''
},
Expand Down
46 changes: 21 additions & 25 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<style type="text/css">
.misc-pub-section.misc-pub-visibility,
.misc-pub-section.curtime
{
display:none;
}
</style>';
} ?>

$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 ];
}
?>

<?php if ( $post && $post->post_type === $mg_post_type ) : ?>
<style type="text/css">
.misc-pub-section.misc-pub-visibility,
.misc-pub-section.curtime {
display: none;
}
</style>
<?php endif; ?>

<!-- SSC TinyMCE Shortcode Plugin -->
<script type='text/javascript'>
var sscContentGroups = [];
sscContentGroups.push({
text: '<?= esc_js( __( 'Doesn\'t matter', 'simpleshop-cz' ) )?>',
value: ''
});
<?php
$group = new Group();
$groups = $group->get_groups();
foreach ($groups as $key => $group) { ?>
sscContentGroups.push({
text: '<?= esc_js( $group ) ?>',
value: '<?= esc_js( $key ) ?>'
});
<?php } ?>
var sscContentGroups = <?= wp_json_encode( $outputGroups ) ?>;
</script>

<?php
}

Expand Down Expand Up @@ -319,7 +315,7 @@ public function enqueue_admin_scripts() {
wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css' );
wp_enqueue_style( 'jquery-ui' );

if ( 'profile' === $current_screen->id || 'user-edit' === $current_screen->id) {
if ( 'profile' === $current_screen->id || 'user-edit' === $current_screen->id ) {
wp_enqueue_script( 'jquery-ui-datepicker' );
}
}
Expand Down