Skip to content

Commit

Permalink
Merge pull request #190 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rvdforst authored Feb 19, 2024
2 parents 26f20ba + 3a5538e commit 7b09817
Show file tree
Hide file tree
Showing 67 changed files with 862 additions and 401 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"require": {
"php": "^8.1.0",
"rrze/wp": "^2.0",
"johngrogg/ics-parser": "^3.3.1",
"rlanvin/php-rrule": "^2.4.1",
"cmb2/cmb2": "^2.10.1"
Expand Down
2 changes: 2 additions & 0 deletions includes/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function __construct()
add_action('admin_enqueue_scripts', [$this, 'adminEnqueueScripts']);
add_action('wp_enqueue_scripts', [$this, 'wpEnqueueScripts']);

settings()->loaded();

CalendarEvent::init();
CalendarFeed::init();

Expand Down
10 changes: 0 additions & 10 deletions includes/Options/Fields/ButtonLink.php

This file was deleted.

20 changes: 0 additions & 20 deletions includes/Options/Fields/Checkbox.php

This file was deleted.

22 changes: 0 additions & 22 deletions includes/Options/Fields/CheckboxMultiple.php

This file was deleted.

10 changes: 0 additions & 10 deletions includes/Options/Fields/Choices.php

This file was deleted.

22 changes: 0 additions & 22 deletions includes/Options/Fields/SelectMultiple.php

This file was deleted.

28 changes: 0 additions & 28 deletions includes/Options/Fields/TextSecure.php

This file was deleted.

26 changes: 0 additions & 26 deletions includes/Options/Template.php

This file was deleted.

28 changes: 0 additions & 28 deletions includes/Options/Utils.php

This file was deleted.

23 changes: 0 additions & 23 deletions includes/Options/templates/fields/button-link.php

This file was deleted.

27 changes: 0 additions & 27 deletions includes/Options/templates/fields/choices.php

This file was deleted.

22 changes: 0 additions & 22 deletions includes/Options/templates/fields/text-secure.php

This file was deleted.

20 changes: 16 additions & 4 deletions includes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

defined('ABSPATH') || exit;

use RRZE\Calendar\Options\Settings as OptionsSettings;
use RRZE\WP\Settings\Settings as OptionsSettings;

class Settings
{
Expand All @@ -13,6 +13,11 @@ class Settings
protected $settings;

public function __construct()
{
add_action('rrze_wp_settings_after_update_option', [$this, 'flushRewriteRules']);
}

public function loaded()
{
$this->settings = new OptionsSettings(__('Calendar Settings', 'rrze-calendar'), 'rrze-calendar');

Expand Down Expand Up @@ -59,12 +64,19 @@ public function __construct()
$this->settings->build();
}

public function flushRewriteRules($optionName)
{
if ($optionName === self::OPTION_NAME) {
flush_rewrite_rules(false);
}
}

public function validateEndpointSlug($value)
{
if ($validation = strlen(sanitize_title($value)) > 4) {
flush_rewrite_rules();
if (mb_strlen(sanitize_title($value)) < 4) {
return false;
}
return $validation;
return true;
}

public function getOption($option)
Expand Down
14 changes: 7 additions & 7 deletions languages/rrule/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
],
'byweekday' => ' %{weekdays}',
'weekdays' => [
1 => 'montags',
2 => 'dienstags',
3 => 'mittwochs',
4 => 'donnerstags',
5 => 'freitags',
6 => 'samstags',
7 => 'sonntags',
1 => 'Montag',
2 => 'Dienstag',
3 => 'Mittwoch',
4 => 'Donnerstag',
5 => 'Freitag',
6 => 'Samstag',
7 => 'Sonntag',
],
'nth_weekday' => [
'1' => 'der erste %{weekday}', // e.g. the first Monday
Expand Down
Binary file modified languages/rrze-calendar-de_DE.mo
Binary file not shown.
Loading

0 comments on commit 7b09817

Please sign in to comment.