1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00
This commit is contained in:
Daniel Waxweiler
2022-05-19 07:50:18 +02:00
parent 367a1c97b2
commit 7322f196e9
12 changed files with 2412 additions and 5 deletions

View File

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