1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

fix widget, wip on shortcut

This commit is contained in:
Daniel Waxweiler
2023-05-07 19:53:24 +02:00
parent e28cdb7158
commit e1898af935
6 changed files with 31 additions and 16 deletions

View File

@ -25,17 +25,21 @@ class EventsListWidget extends \WP_Widget {
echo $args['before_title'].apply_filters('widget_title', $options['title']).$args['after_title'];
}
$classNamePrefix = NAME;
$url = Settings::getUrl();
$eventsCount = $options['eventsCount'];
$locale = str_replace('_', '-', get_locale()); // TODO _ is okay too.
$groupName = isset($options['groupName']) ? $options['groupName'] : '';
if ($groupName) {
$data = GraphQlClient::get_upcoming_events_by_group_name($url, (int) $eventsCount, $groupName); // TODO wrap and put into shortcut as well
$data = GraphQlClient::get_upcoming_events_by_group_name($url, (int) $eventsCount, $groupName);
} else {
$data = GraphQlClient::get_upcoming_events($url, (int) $eventsCount);
}
$classNamePrefix = NAME;
$locale = get_locale();
$isShortOffsetNameShown = Settings::isShortOffsetNameShown();
$timeZone = wp_timezone_string();
require dirname(__DIR__) . '/view/events-list.php';
echo $args['after_widget'];