add new feature to donwload a calendar
This commit is contained in:
@@ -17,7 +17,8 @@ class Plugin extends PluginBase {
|
||||
public function registerComponents() {
|
||||
return [
|
||||
'NicoSt\GCalendar\Components\Upcoming' => 'upcoming',
|
||||
'NicoSt\GCalendar\Components\EmbeddedCalendar' => 'embeddedCalendar'
|
||||
'NicoSt\GCalendar\Components\EmbeddedCalendar' => 'embeddedCalendar',
|
||||
'NicoSt\GCalendar\Components\Download' => 'download'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +176,7 @@ class EmbeddedCalendar extends ComponentBase {
|
||||
$data += ['wkst' => 2];
|
||||
}
|
||||
|
||||
// Calenders from config
|
||||
$calendarList = $this->getCalendarsFromProperties();
|
||||
$dataParams = http_build_query($data);
|
||||
|
||||
@@ -220,9 +221,9 @@ class EmbeddedCalendar extends ComponentBase {
|
||||
$exp_key = explode($this->calPropSeparator, $key);
|
||||
if($exp_key[0] == 'cal' && $this->property($key) == true){
|
||||
$calendar = [];
|
||||
$calendar['src'] = $exp_key[2];
|
||||
$calendar['color'] = $exp_key[1];
|
||||
$calendars[] = $calendar;
|
||||
$calendar['src'] = $exp_key[2];
|
||||
array_push($calendars, $calendar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +231,6 @@ class EmbeddedCalendar extends ComponentBase {
|
||||
}
|
||||
|
||||
private function calendarProperties() {
|
||||
// ToDo: Add cache => https://octobercms.com/docs/services/cache
|
||||
$service = new GoogleCalendarService();
|
||||
$calendars = $service->calendarList();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class Upcoming extends ComponentBase {
|
||||
];
|
||||
}
|
||||
|
||||
public function events() {
|
||||
public function getEvents() {
|
||||
$connector = new GoogleCalendarService();
|
||||
$maxEvents = $this->property('maxEvents');
|
||||
$calendarEvents = $connector->allEventList($maxEvents);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% set events = upcoming.events %}
|
||||
{% set events = __SELF__.events %}
|
||||
|
||||
{% if not events.error and events is not empty %}
|
||||
<table>
|
||||
|
||||
34
composer.lock
generated
34
composer.lock
generated
@@ -136,16 +136,16 @@
|
||||
},
|
||||
{
|
||||
"name": "google/apiclient-services",
|
||||
"version": "v0.228.0",
|
||||
"version": "v0.232.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
||||
"reference": "ec64bbf1d6af9475bee7b1ce4fc0ed8a0a8d8889"
|
||||
"reference": "e671adddfd3d2b36a415e7bf22189b1626bc13f8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ec64bbf1d6af9475bee7b1ce4fc0ed8a0a8d8889",
|
||||
"reference": "ec64bbf1d6af9475bee7b1ce4fc0ed8a0a8d8889",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/e671adddfd3d2b36a415e7bf22189b1626bc13f8",
|
||||
"reference": "e671adddfd3d2b36a415e7bf22189b1626bc13f8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -174,9 +174,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.228.0"
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.232.0"
|
||||
},
|
||||
"time": "2021-12-21T12:26:12+00:00"
|
||||
"time": "2022-01-28T12:22:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/auth",
|
||||
@@ -720,16 +720,16 @@
|
||||
},
|
||||
{
|
||||
"name": "paragonie/constant_time_encoding",
|
||||
"version": "v2.4.0",
|
||||
"version": "v2.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/constant_time_encoding.git",
|
||||
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
|
||||
"reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
|
||||
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
|
||||
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/9229e15f2e6ba772f0c55dd6986c563b937170a8",
|
||||
"reference": "9229e15f2e6ba772f0c55dd6986c563b937170a8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -783,7 +783,7 @@
|
||||
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
|
||||
"source": "https://github.com/paragonie/constant_time_encoding"
|
||||
},
|
||||
"time": "2020-12-06T15:14:20+00:00"
|
||||
"time": "2022-01-17T05:32:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
@@ -837,16 +837,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "3.0.12",
|
||||
"version": "3.0.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb"
|
||||
"reference": "1443ab79364eea48665fa8c09ac67f37d1025f7e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb",
|
||||
"reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/1443ab79364eea48665fa8c09ac67f37d1025f7e",
|
||||
"reference": "1443ab79364eea48665fa8c09ac67f37d1025f7e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -928,7 +928,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.12"
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.13"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -944,7 +944,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-28T23:46:03+00:00"
|
||||
"time": "2022-01-30T08:50:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
|
||||
@@ -74,8 +74,14 @@
|
||||
],
|
||||
'showCalendarList' => [
|
||||
'title' => 'Kalender Liste Anzeigen'
|
||||
],
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
'download' => [
|
||||
'name' => 'Download Kalender',
|
||||
'description' => 'Kalender als "ICS-Datei" downloaden.',
|
||||
'groups' => [
|
||||
'calendars' => 'Kalender'
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
@@ -74,8 +74,14 @@
|
||||
],
|
||||
'showCalendarList' => [
|
||||
'title' => 'Show Calendar List'
|
||||
],
|
||||
|
||||
]
|
||||
]
|
||||
],
|
||||
'download' => [
|
||||
'name' => 'Download Calendar',
|
||||
'description' => 'Download calendar as "ICS-File".',
|
||||
'groups' => [
|
||||
'calendars' => 'Calendars'
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
1.0.0:
|
||||
- Initialize plugin.
|
||||
- Prepare for October marketplace.
|
||||
- Prepare for October marketplace.
|
||||
1.1.0
|
||||
- Add new "Download" component to display a list of calendars to be downloaded as ics-file.
|
||||
- Update dependencies
|
||||
- Fix some minor bugs
|
||||
Reference in New Issue
Block a user