Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75583089a6 | |||
| e623c8cb69 | |||
| 07ae847443 | |||
| c392ffde0d | |||
| 9c9bf61c7e | |||
| 0a7a57affa | |||
| 8193d8240c | |||
| c0ece61c28 | |||
| d08de624ea | |||
| d84f5d6803 | |||
| 6c08d2462a | |||
| 50a88a8af8 | |||
| ee351b44b1 |
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
DOCUMENTATION.md
Normal file → Executable file
0
DOCUMENTATION.md
Normal file → Executable file
0
LICENCE.md
Normal file → Executable file
0
LICENCE.md
Normal file → Executable file
0
Plugin.php
Normal file → Executable file
0
Plugin.php
Normal file → Executable file
15
classes/EventEntity.php
Normal file → Executable file
15
classes/EventEntity.php
Normal file → Executable file
@@ -3,6 +3,7 @@
|
||||
class EventEntity {
|
||||
|
||||
var $calendar_name;
|
||||
var $calendar_description;
|
||||
var $event_name;
|
||||
var $location;
|
||||
var $description;
|
||||
@@ -24,6 +25,20 @@ class EventEntity {
|
||||
$this->calendar_name = $calendar_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCalendarDescription() {
|
||||
return $this->calendar_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $calendar_description
|
||||
*/
|
||||
public function setCalendarDescription($calendar_description) {
|
||||
$this->calendar_description = $calendar_description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
22
classes/GoogleCalendarClient.php
Normal file → Executable file
22
classes/GoogleCalendarClient.php
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
<?php namespace NicoSt\GCalendar\Classes;
|
||||
|
||||
use Google_Client;
|
||||
use Google_Service_Calendar;
|
||||
use Google\Client as Google_Client;
|
||||
use Google\Service\Calendar as Google_Service_Calendar;
|
||||
use Log;
|
||||
|
||||
use NicoSt\GCalendar\Models\Settings;
|
||||
@@ -19,26 +19,25 @@ class GoogleCalendarClient {
|
||||
|
||||
$this->client->setAccessType('offline');
|
||||
$this->client->setRedirectUri(url('/gcalendar/oauth2callback'));
|
||||
$this->client->addScope(Google_Service_Calendar::CALENDAR);
|
||||
$this->client->addScope([Google_Service_Calendar::CALENDAR_READONLY , Google_Service_Calendar::CALENDAR_EVENTS_READONLY]);
|
||||
|
||||
// Set access toke on client if exist.
|
||||
$accessToken = Settings::get('access_token');
|
||||
$accessToken = Settings::get('access_token', []);
|
||||
if (!empty($accessToken)) {
|
||||
$this->client->setAccessToken($accessToken);
|
||||
}
|
||||
|
||||
// If there is no previous token or it's expired.
|
||||
// Ensure valid access token.
|
||||
if ($tryRefreshToken && $this->client->isAccessTokenExpired()) {
|
||||
// Refresh the token if possible.
|
||||
if ($this->client->getRefreshToken()) {
|
||||
|
||||
if (!empty($this->client->getRefreshToken())) {
|
||||
$this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());
|
||||
// Save new access token
|
||||
Settings::set('access_token', $this->client->getAccessToken());
|
||||
// Merge access token
|
||||
Settings::set('access_token', array_merge($accessToken, $this->client->getAccessToken()));
|
||||
} else {
|
||||
Log::warning('G-Calendar: No valid access token given.');
|
||||
Log::warning('G-Calendar: No valid refresh token given.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getClient() {
|
||||
@@ -49,5 +48,4 @@ class GoogleCalendarClient {
|
||||
|
||||
return new Google_Service_Calendar($this->client);
|
||||
}
|
||||
|
||||
}
|
||||
19
classes/GoogleCalendarService.php
Normal file → Executable file
19
classes/GoogleCalendarService.php
Normal file → Executable file
@@ -2,11 +2,12 @@
|
||||
|
||||
use Log;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
|
||||
use NicoSt\GCalendar\Models\Settings;
|
||||
|
||||
class GoogleCalendarService {
|
||||
private $cacheTimeDefault = 15;
|
||||
private $cacheTimeMinutesDefault = 15;
|
||||
|
||||
private $cacheKeyCalendarList = 'GCalendar-CalendarList';
|
||||
private $cacheKeyCalendarGet = 'GCalendar-CalendarGet#';
|
||||
@@ -20,9 +21,9 @@ class GoogleCalendarService {
|
||||
|
||||
public function getCalendar($calendarId, $maxEvents = '10') {
|
||||
$cachedCalendarGet = Cache::get($this->cacheKeyCalendarGet.$calendarId);
|
||||
$cacheTime = Settings::get('cache_time', $this->cacheTimeDefault);
|
||||
$cacheTimeMinutes = Settings::get('cache_time', $this->cacheTimeMinutesDefault);
|
||||
|
||||
if(!isset($cachedCalendarGet) || $cacheTime == 0) {
|
||||
if(!isset($cachedCalendarGet) || $cacheTimeMinutes == 0) {
|
||||
// "timeMin" -> Set param to only get upcoming events
|
||||
// "singleEvents" -> Split recurring events into single events
|
||||
// "orderBy" -> Order events by startTime
|
||||
@@ -35,10 +36,11 @@ class GoogleCalendarService {
|
||||
);
|
||||
|
||||
try {
|
||||
Log::debug('G-Calendar: Call google with #getCalendar.');
|
||||
Log::debug('G-Calendar: Call google with #getCalendar for calendar with id: ' . $calendarId);
|
||||
$response = $this->service->events->listEvents($calendarId, $params);
|
||||
|
||||
Cache::put($this->cacheKeyCalendarGet.$calendarId, $response, $cacheTime);
|
||||
$expiresAt = Carbon::now()->addMinutes($cacheTimeMinutes);
|
||||
Cache::put($this->cacheKeyCalendarGet.$calendarId, $response, $expiresAt);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
$json = json_decode($e->getMessage(), true);
|
||||
@@ -52,14 +54,15 @@ class GoogleCalendarService {
|
||||
|
||||
public function calendarList() {
|
||||
$cachedCalendarList = Cache::get($this->cacheKeyCalendarList);
|
||||
$cacheTime = Settings::get('cache_time', $this->cacheTimeDefault);
|
||||
$cacheTimeMinutes = Settings::get('cache_time', $this->cacheTimeMinutesDefault);
|
||||
|
||||
if(!isset($cachedCalendarList) || $cacheTime == 0) {
|
||||
if(!isset($cachedCalendarList) || $cacheTimeMinutes == 0) {
|
||||
try {
|
||||
Log::debug('G-Calendar: Call google with #calendarList.');
|
||||
$response = $this->service->calendarList->listCalendarList()->getItems();
|
||||
|
||||
Cache::put($this->cacheKeyCalendarList, $response, $cacheTime);
|
||||
$expiresAt = Carbon::now()->addMinutes($cacheTimeMinutes);
|
||||
Cache::put($this->cacheKeyCalendarList, $response, $expiresAt);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
$json = json_decode($e->getMessage(), true);
|
||||
|
||||
6
components/EmbeddedCalendar.php
Normal file → Executable file
6
components/EmbeddedCalendar.php
Normal file → Executable file
@@ -2,9 +2,7 @@
|
||||
|
||||
use Cms\Classes\ComponentBase;
|
||||
use NicoSt\GCalendar\Classes\GoogleCalendarService;
|
||||
use Mobile_Detect;
|
||||
|
||||
use Log;
|
||||
use Detection\MobileDetect;
|
||||
|
||||
class EmbeddedCalendar extends ComponentBase {
|
||||
private $calPropSeparator = '§§';
|
||||
@@ -158,7 +156,7 @@ class EmbeddedCalendar extends ComponentBase {
|
||||
} else if($viewMode == 'week') {
|
||||
$data += ['mode' => 'WEEK'];
|
||||
} else if($viewMode == 'dynamic') {
|
||||
$detect = new Mobile_Detect;
|
||||
$detect = new MobileDetect();
|
||||
if($detect->isMobile()) {
|
||||
$data += ['mode' => 'AGENDA'];
|
||||
} else {
|
||||
|
||||
1
components/Upcoming.php
Normal file → Executable file
1
components/Upcoming.php
Normal file → Executable file
@@ -71,6 +71,7 @@ class Upcoming extends ComponentBase {
|
||||
$eventObject = new EventEntity();
|
||||
$eventObject->setCalendarName($calendarEvent->summary);
|
||||
$eventObject->setEventName($event->summary);
|
||||
$eventObject->setCalendarDescription($calendarEvent->description);
|
||||
$eventObject->setLocation($event->location);
|
||||
$eventObject->setDescription($event->description);
|
||||
$eventObject->setStartTime($event->start->dateTime);
|
||||
|
||||
0
components/embeddedcalendar/default.htm
Normal file → Executable file
0
components/embeddedcalendar/default.htm
Normal file → Executable file
0
components/upcoming/default.htm
Normal file → Executable file
0
components/upcoming/default.htm
Normal file → Executable file
21
composer.json
Normal file → Executable file
21
composer.json
Normal file → Executable file
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "nicost/oc-gcalendar-plugin",
|
||||
"name": "nicost/gcalendar-plugin",
|
||||
"type": "october-plugin",
|
||||
"description": "OctoberCMS calendar plugin which uses the Google Calendar API to provide event data.",
|
||||
"keywords": ["october", "cms", "google", "calendar", "events", "schedule", "kalender"],
|
||||
@@ -10,8 +10,23 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"php": ">=8.1",
|
||||
"composer/installers": "~1.0",
|
||||
"google/apiclient": "^2.0",
|
||||
"mobiledetect/mobiledetectlib": "^2.8"
|
||||
"mobiledetect/mobiledetectlib": "^4.8"
|
||||
},
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"composer/installers": true
|
||||
},
|
||||
"cache-read-only": true
|
||||
},
|
||||
"scripts": {
|
||||
"pre-autoload-dump": "Google\\Task\\Composer::cleanup"
|
||||
},
|
||||
"extra": {
|
||||
"google/apiclient-services": [
|
||||
"Calendar"
|
||||
]
|
||||
}
|
||||
}
|
||||
1090
composer.lock
generated
Normal file → Executable file
1090
composer.lock
generated
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
2
controllers/GoogleCallback.php
Normal file → Executable file
2
controllers/GoogleCallback.php
Normal file → Executable file
@@ -31,7 +31,7 @@ class GoogleCallback extends Controller {
|
||||
$accessToken = $client->fetchAccessTokenWithAuthCode($code);
|
||||
$client->setAccessToken($accessToken);
|
||||
|
||||
Log::info('G-Calendar: Set access-token ['. print_r($client->getAccessToken(), true) .'].');
|
||||
Log::info('G-Calendar: Set access_token ['. print_r($client->getAccessToken(), true) .'].');
|
||||
Settings::set('access_token', $client->getAccessToken());
|
||||
|
||||
return Redirect::to('/backend/system/settings/update/nicost/gcalendar/settings');
|
||||
|
||||
0
formwidgets/CalendarSelector.php
Normal file → Executable file
0
formwidgets/CalendarSelector.php
Normal file → Executable file
35
formwidgets/ClearCacheButton.php
Executable file
35
formwidgets/ClearCacheButton.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php namespace NicoSt\GCalendar\FormWidgets;
|
||||
|
||||
use Backend\Classes\FormWidgetBase;
|
||||
use Cache;
|
||||
use Log;
|
||||
use Flash;
|
||||
use Lang;
|
||||
|
||||
use NicoSt\GCalendar\Models\Settings;
|
||||
|
||||
class ClearCacheButton extends FormWidgetBase {
|
||||
|
||||
protected $defaultAlias = 'clearCacheButton';
|
||||
|
||||
private $cacheKeyCalendarList = 'GCalendar-CalendarList';
|
||||
private $cacheKeyCalendarGet = 'GCalendar-CalendarGet#';
|
||||
|
||||
public function render() {
|
||||
return $this->makePartial('clearCacheButton');
|
||||
}
|
||||
|
||||
// Clear cache for all saved calendars
|
||||
public function onClearCache() {
|
||||
$calendarSelectors = Settings::get('calendar_selector', []);
|
||||
|
||||
foreach ($calendarSelectors as &$selector) {
|
||||
Cache::forget($this->cacheKeyCalendarGet.$selector['id']);
|
||||
}
|
||||
Cache::forget($this->cacheKeyCalendarList);
|
||||
|
||||
Log::info('G-Calendar: Cache cleared!');
|
||||
Flash::success(Lang::get('nicost.gcalendar::lang.widget.clearCacheButton.success'));
|
||||
}
|
||||
|
||||
}
|
||||
21
formwidgets/OAuth.php
Normal file → Executable file
21
formwidgets/OAuth.php
Normal file → Executable file
@@ -21,7 +21,6 @@ class OAuth extends FormWidgetBase {
|
||||
$this->vars['redirectUrl'] = $client->getRedirectUri();
|
||||
$this->vars['isAccessTokenExpired'] = $client->isAccessTokenExpired() ? '1' : '0';
|
||||
$this->vars['clientIdExist'] = null != Settings::get('client_id', null) ? '1' : '0';
|
||||
$this->vars['accessToken'] = print_r(Settings::get('access_token'), true);
|
||||
|
||||
return $this->makePartial('oauth');
|
||||
}
|
||||
@@ -30,28 +29,34 @@ class OAuth extends FormWidgetBase {
|
||||
|
||||
$class = new GoogleCalendarClient(true);
|
||||
$client = $class->getClient();
|
||||
$client->setPrompt('consent');
|
||||
|
||||
if ($client->isAccessTokenExpired()) {
|
||||
// Request authorization from the user.
|
||||
$authUrl = $client->createAuthUrl();
|
||||
Log::info('G-Calendar: Request authorization with URL ['. $authUrl .'].');
|
||||
//Log::info('G-Calendar: Request authorization with URL ['. $authUrl .'].');
|
||||
|
||||
$this->vars['auth_url'] = $authUrl;
|
||||
|
||||
return $this->makePartial('gaccess');
|
||||
return $this->makePartial('gaccess');
|
||||
}
|
||||
|
||||
Log::info('G-Calendar: Access token not expired.');
|
||||
Flash::error(Lang::get('nicost.gcalendar::lang.message.accessTokenNotExpired'));
|
||||
Flash::info(Lang::get('nicost.gcalendar::lang.message.accessTokenNotExpired'));
|
||||
}
|
||||
|
||||
public function onClearAccessToken() {
|
||||
Settings::set('access_token', '');
|
||||
Settings::set('access_token', []);
|
||||
Flash::success(Lang::get('nicost.gcalendar::lang.message.accessTokenRemoved'));
|
||||
|
||||
$this->vars['isAccessTokenExpired'] = '1';
|
||||
return $this->refreshTokenStatus();
|
||||
}
|
||||
|
||||
private function refreshTokenStatus() {
|
||||
$class = new GoogleCalendarClient(true);
|
||||
$client = $class->getClient();
|
||||
|
||||
$this->vars['isAccessTokenExpired'] = $client->isAccessTokenExpired() ? '1' : '0';
|
||||
|
||||
return Redirect::refresh();
|
||||
}
|
||||
|
||||
}
|
||||
4
formwidgets/calendarselector/partials/_selector.htm
Normal file → Executable file
4
formwidgets/calendarselector/partials/_selector.htm
Normal file → Executable file
@@ -3,7 +3,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="list-checkbox">
|
||||
<div class="checkbox custom-checkbox nolabel">
|
||||
<div class="checkbox nolabel">
|
||||
<input type="checkbox" id="checkboxAll" />
|
||||
<label for="checkboxAll"></label>
|
||||
</div>
|
||||
@@ -27,7 +27,7 @@
|
||||
<?php foreach ($calendars as $key=>$calendar): ?>
|
||||
<tr>
|
||||
<td class="list-checkbox nolink">
|
||||
<div class="checkbox custom-checkbox nolabel">
|
||||
<div class="checkbox nolabel">
|
||||
<input id="checkbox_<?= $key ?>"
|
||||
type="checkbox"
|
||||
name="Settings[calendar_selector][<?= $key ?>][checked]"
|
||||
|
||||
5
formwidgets/clearcachebutton/partials/_clearcachebutton.htm
Executable file
5
formwidgets/clearcachebutton/partials/_clearcachebutton.htm
Executable file
@@ -0,0 +1,5 @@
|
||||
<button type="button"
|
||||
data-request="onClearCache"
|
||||
class="btn btn-default">
|
||||
<?= e(trans('nicost.gcalendar::lang.widget.clearCacheButton.buttonText')) ?>
|
||||
</button>
|
||||
0
formwidgets/oauth/partials/_gaccess.htm
Normal file → Executable file
0
formwidgets/oauth/partials/_gaccess.htm
Normal file → Executable file
0
formwidgets/oauth/partials/_oauth.htm
Normal file → Executable file
0
formwidgets/oauth/partials/_oauth.htm
Normal file → Executable file
153
lang/de/lang.php
Normal file → Executable file
153
lang/de/lang.php
Normal file → Executable file
@@ -3,8 +3,159 @@
|
||||
'name' => 'G-Calendar',
|
||||
'description' => 'Kalender Plugin basierend auf der Google API.',
|
||||
],
|
||||
|
||||
'component' => [
|
||||
'upcoming' => [
|
||||
'name' => 'Bevorstehende Termine',
|
||||
'description' => 'Listet alle bevorstehenden Termine.'
|
||||
],
|
||||
'embeddedCalendar' => [
|
||||
'name' => 'Eingebetteter Kalender',
|
||||
'description' => 'Eingebetteter Google Kalender.',
|
||||
'groups' => [
|
||||
'calendars' => 'Kalender',
|
||||
'toggleElements' => 'Toggle Elements'
|
||||
],
|
||||
'properties' => [
|
||||
'calendarTitle' => [
|
||||
'title' => 'Kalender Title'
|
||||
],
|
||||
'width' => [
|
||||
'title' => 'Breite',
|
||||
'validationMessage' => 'Die Breite muss Numerisch sein und darf nicht mehr als vier Ziffern umfassen.'
|
||||
],
|
||||
'height' => [
|
||||
'title' => 'Höhe',
|
||||
'validationMessage' => 'Die Höhe muss Numerisch sein und darf nicht mehr als vier Ziffern umfassen.'
|
||||
],
|
||||
'timezone' => [
|
||||
'title' => 'Zeitzone'
|
||||
],
|
||||
'language' => [
|
||||
'title' => 'Sprache'
|
||||
],
|
||||
'viewMode' => [
|
||||
'title' => 'Anzeigemodus',
|
||||
'placeholder' => 'Wähle einen Anzeigemodus',
|
||||
'description' => 'Wähle "Dynamisch" um die "Agenda Ansicht" für Mobile Geräte und die "Monatsansicht" für Desktop zu nutzen.',
|
||||
'month' => 'Monatsansicht',
|
||||
'week' => 'Wochenansicht',
|
||||
'agenda' => 'Agenda Ansicht',
|
||||
'dynamic' => 'Dynamisch'
|
||||
],
|
||||
'weekStart' => [
|
||||
'title' => 'Woche starte am:',
|
||||
'sat' => 'Samstag',
|
||||
'sun' => 'Sonntag',
|
||||
'mon' => 'Montag'
|
||||
],
|
||||
'bgcolor' => [
|
||||
'title' => 'Hintergrundfarbe',
|
||||
'description' => 'Definiert die Hintergrundfarbe des Kopfbereichs.',
|
||||
'validationMessage' => 'Hintergrundfarbe muss als Hexadecimal Code angegeben werden.'
|
||||
],
|
||||
'showTitle' => [
|
||||
'title' => 'Titel Anzeigen'
|
||||
],
|
||||
'showPrint' => [
|
||||
'title' => 'Drucker Optionen Anzeigen'
|
||||
],
|
||||
'showTimezone' => [
|
||||
'title' => 'Zeitzone Anzeigen'
|
||||
],
|
||||
'showNav' => [
|
||||
'title' => 'Navigation Anzeigen'
|
||||
],
|
||||
'showDate' => [
|
||||
'title' => 'Datum Anzeigen'
|
||||
],
|
||||
'showTabs' => [
|
||||
'title' => 'Tabs Anzeigen'
|
||||
],
|
||||
'showCalendarList' => [
|
||||
'title' => 'Kalender Liste Anzeigen'
|
||||
],
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
'widget' => [
|
||||
'clearCacheButton' => [
|
||||
'buttonText' => 'Cache löschen',
|
||||
'success' => 'Cache wurde gelöscht!'
|
||||
]
|
||||
],
|
||||
|
||||
'settings' => [
|
||||
'label' => 'G-Calendar',
|
||||
'description' => 'Einstellungen für das G-Kalender Plugin'
|
||||
'description' => 'Einstellungen für das G-Calendar Plugin.',
|
||||
|
||||
'tab' => [
|
||||
'client' => 'Client Konfiguration',
|
||||
'calendars' => 'Kalender',
|
||||
'settings' => 'Einstellungen'
|
||||
],
|
||||
'fields' => [
|
||||
'applicationName' => [
|
||||
'label' => 'Anzeigename',
|
||||
'comment' => 'Optional.'
|
||||
],
|
||||
'clientId' => [
|
||||
'label' => 'Client ID',
|
||||
'comment' => 'Die "Client ID" steht in den "OAuth Credentials". (https://console.cloud.google.com/apis/credentials)'
|
||||
],
|
||||
'clientSecret' => [
|
||||
'label' => 'Client Secret',
|
||||
'comment' => 'Der "Client Secret" code steht in den "OAuth Credentials". (https://console.cloud.google.com/apis/credentials)'
|
||||
],
|
||||
'accessToken' => [
|
||||
'label' => 'Access Token',
|
||||
'comment' => 'Wird automatisch beim Speichern der "Client ID" und "Client Secret" generiert.'
|
||||
],
|
||||
'cacheTime' => [
|
||||
'label' => 'Google Calendar API Cache.',
|
||||
'comment' => 'Anfragen an die Google Calendar API werden zwischengespeichert um die Anzahl der Anfragen zu reduzieren. (\'0\') um den Cache zu deaktivieren. (Angabe in Minuten)'
|
||||
],
|
||||
'section' => [
|
||||
'accessToken' => 'Access Token',
|
||||
'cacheControl' => 'Cache Einstellungen',
|
||||
'notification' => 'Benachrichtigung'
|
||||
],
|
||||
'notification' => [
|
||||
'switch' => [
|
||||
'label' => 'Benachrichtigung Einblenden',
|
||||
'on' => 'An',
|
||||
'off' => 'Aus'
|
||||
],
|
||||
'text' => [
|
||||
'label' => 'Nachricht'
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
'button' => [
|
||||
'requestToken' => 'Access Token Anfragen',
|
||||
'clearToken' => 'Access Token Löschen'
|
||||
],
|
||||
'calendarList' => [
|
||||
'emptyList' => 'Kein Kalender gefunden. Verbinde G-Calendar mit deinem Google Account um deine Kalender hier anzuzeigen.',
|
||||
'columnName' => 'Name',
|
||||
'columnRole' => 'Rolle',
|
||||
'columnId' => 'ID'
|
||||
],
|
||||
'gaccess' => [
|
||||
'text' => 'Klicke auf den unten stehenden Link um G-Calendar zugriff auch deine Kalender zu gewähren.',
|
||||
'button' => 'Zugriff Gewähren.'
|
||||
],
|
||||
'oauth' => [
|
||||
'tokenNotValid' => 'Access Token <b>ungültig</b>.',
|
||||
'tokenValid' => 'Access Token gültig.'
|
||||
]
|
||||
],
|
||||
|
||||
'message' => [
|
||||
'accessTokenNotExpired' => 'Access Token nicht abgelaufen.',
|
||||
'accessTokenRemoved' => 'Access Token erfolgreich entfernt.'
|
||||
]
|
||||
];
|
||||
51
lang/en/lang.php
Normal file → Executable file
51
lang/en/lang.php
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
<?php return [
|
||||
'plugin' => [
|
||||
'name' => 'G-Calendar',
|
||||
'description' => 'Calendar plugin which uses the google API.',
|
||||
'description' => 'Calendar plugin which uses the google API.'
|
||||
],
|
||||
|
||||
'component' => [
|
||||
@@ -18,21 +18,21 @@
|
||||
],
|
||||
'properties' => [
|
||||
'calendarTitle' => [
|
||||
'title' => 'Calendar Title',
|
||||
'title' => 'Calendar Title'
|
||||
],
|
||||
'width' => [
|
||||
'title' => 'Width',
|
||||
'validationMessage' => 'The width must be numeric and not longer than 4 characters.',
|
||||
'validationMessage' => 'The width must be numeric and not longer than 4 characters.'
|
||||
],
|
||||
'height' => [
|
||||
'title' => 'Height',
|
||||
'validationMessage' => 'The height must be numeric and not longer than 4 characters.',
|
||||
'validationMessage' => 'The height must be numeric and not longer than 4 characters.'
|
||||
],
|
||||
'timezone' => [
|
||||
'title' => 'Timezone',
|
||||
'title' => 'Timezone'
|
||||
],
|
||||
'language' => [
|
||||
'title' => 'Language Code',
|
||||
'title' => 'Language Code'
|
||||
],
|
||||
'viewMode' => [
|
||||
'title' => 'View Mode',
|
||||
@@ -55,31 +55,38 @@
|
||||
'validationMessage' => 'Background color must be a hexadecimal color code.'
|
||||
],
|
||||
'showTitle' => [
|
||||
'title' => 'Show Title',
|
||||
'title' => 'Show Title'
|
||||
],
|
||||
'showPrint' => [
|
||||
'title' => 'Show Print Option',
|
||||
'title' => 'Show Print Option'
|
||||
],
|
||||
'showTimezone' => [
|
||||
'title' => 'Show Timezone',
|
||||
'title' => 'Show Timezone'
|
||||
],
|
||||
'showNav' => [
|
||||
'title' => 'Show Navigation',
|
||||
'title' => 'Show Navigation'
|
||||
],
|
||||
'showDate' => [
|
||||
'title' => 'Show Date',
|
||||
'title' => 'Show Date'
|
||||
],
|
||||
'showTabs' => [
|
||||
'title' => 'Show Tabs',
|
||||
'title' => 'Show Tabs'
|
||||
],
|
||||
'showCalendarList' => [
|
||||
'title' => 'Show Calendar List',
|
||||
'title' => 'Show Calendar List'
|
||||
],
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
'widget' => [
|
||||
'clearCacheButton' => [
|
||||
'buttonText' => 'Clear Cache',
|
||||
'success' => 'Cache cleared!'
|
||||
]
|
||||
],
|
||||
|
||||
'settings' => [
|
||||
'label' => 'G-Calendar',
|
||||
'description' => 'Settings for G-Calendar plugin',
|
||||
@@ -96,11 +103,11 @@
|
||||
],
|
||||
'clientId' => [
|
||||
'label' => 'Client ID',
|
||||
'comment' => 'The Client ID can be found in the OAuth Credentials under Service Account.'
|
||||
'comment' => 'The Client ID can be found in the OAuth Credentials under Service Account. (https://console.cloud.google.com/apis/credentials)'
|
||||
],
|
||||
'clientSecret' => [
|
||||
'label' => 'Client Secret',
|
||||
'comment' => 'The Client Secret key can be found in the OAuth Credentials.'
|
||||
'comment' => 'The Client Secret can be found in the OAuth Credentials. (https://console.cloud.google.com/apis/credentials)'
|
||||
],
|
||||
'accessToken' => [
|
||||
'label' => 'Access Token',
|
||||
@@ -111,8 +118,20 @@
|
||||
'comment' => 'Cache Google Calendar API requests in minutes. Enter \'0\' to disable caching.'
|
||||
],
|
||||
'section' => [
|
||||
'accessToken' => 'Access Token'
|
||||
'accessToken' => 'Access Token',
|
||||
'cacheControl' => 'Cache control',
|
||||
'notification' => 'Notification'
|
||||
],
|
||||
'notification' => [
|
||||
'switch' => [
|
||||
'label' => 'Display Notification',
|
||||
'on' => 'On',
|
||||
'off' => 'Off'
|
||||
],
|
||||
'text' => [
|
||||
'label' => 'Notification Content'
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
'button' => [
|
||||
|
||||
0
models/Settings.php
Normal file → Executable file
0
models/Settings.php
Normal file → Executable file
33
models/settings/fields.yaml
Normal file → Executable file
33
models/settings/fields.yaml
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
tabs:
|
||||
fields:
|
||||
|
||||
# Tab: Google Client
|
||||
# Tab: Client Configuration
|
||||
application_name:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.applicationName.label'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.client'
|
||||
@@ -14,12 +14,14 @@ tabs:
|
||||
type: text
|
||||
comment: 'nicost.gcalendar::lang.settings.fields.clientId.comment'
|
||||
span: left
|
||||
required: true
|
||||
client_secret:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.clientSecret.label'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.client'
|
||||
type: text
|
||||
comment: 'nicost.gcalendar::lang.settings.fields.clientSecret.comment'
|
||||
span: left
|
||||
required: true
|
||||
google_oauth:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.section.accessToken'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.client'
|
||||
@@ -28,10 +30,16 @@ tabs:
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.client'
|
||||
type: NicoSt\GCalendar\FormWidgets\OAuth
|
||||
|
||||
# Tab: Calendars
|
||||
calendar_selector:
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.calendars'
|
||||
type: NicoSt\GCalendar\FormWidgets\CalendarSelector
|
||||
|
||||
# Tab: Settings
|
||||
cache_control:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.section.cacheControl'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
type: section
|
||||
cache_time:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.cacheTime.label'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
@@ -39,3 +47,26 @@ tabs:
|
||||
type: number
|
||||
span: left
|
||||
default: 15
|
||||
clear_cache:
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
type: NicoSt\GCalendar\FormWidgets\ClearCacheButton
|
||||
notification:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.section.notification'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
type: section
|
||||
notification_show:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.notification.switch.label'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
type: switch
|
||||
on: nicost.gcalendar::lang.settings.fields.notification.switch.on
|
||||
off: nicost.gcalendar::lang.settings.fields.notification.switch.off
|
||||
notification_text:
|
||||
label: 'nicost.gcalendar::lang.settings.fields.notification.text.label'
|
||||
tab: 'nicost.gcalendar::lang.settings.tab.settings'
|
||||
type: richeditor
|
||||
size: huge
|
||||
toolbarButtons: bold|italic|underline||insertLink||undo|redo||html
|
||||
trigger:
|
||||
action: show
|
||||
field: notification_show
|
||||
condition: checked
|
||||
0
resources/calendar_language.json
Normal file → Executable file
0
resources/calendar_language.json
Normal file → Executable file
0
resources/calendar_timezone.json
Normal file → Executable file
0
resources/calendar_timezone.json
Normal file → Executable file
1
routes.php
Normal file → Executable file
1
routes.php
Normal file → Executable file
@@ -6,4 +6,3 @@ Route::group(['prefix' => 'gcalendar'], function () {
|
||||
'uses' => 'NicoSt\GCalendar\Controllers\GoogleCallback@oauth2callback'
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
10
updates/version.yaml
Normal file → Executable file
10
updates/version.yaml
Normal file → Executable file
@@ -1,3 +1,13 @@
|
||||
1.0.0:
|
||||
- Initialize plugin.
|
||||
- Prepare for October marketplace.
|
||||
1.0.1:
|
||||
- Compatibility with October CMS 2
|
||||
1.0.2:
|
||||
- Fix missing checkboxes at the calendar selector in the backend
|
||||
1.1.0:
|
||||
- Update scopes for Calendar API to read only.
|
||||
- Fix bug about missing refresh token after the update to the latest google client api version
|
||||
- Remove unnecessary logging
|
||||
1.1.1:
|
||||
- Updated dependencies
|
||||
|
||||
Reference in New Issue
Block a user