From f958508d05cedb10cc77af8100ee6cf4281856e9 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 10:26:04 -0400
Subject: [PATCH 01/17] updated directory structure
---
.../easy_ical => easy_ical}/README.md | 0
.../easy_ical => easy_ical}/pi.easy_ical.php | 24 +++++++++++++------
2 files changed, 17 insertions(+), 7 deletions(-)
rename {system/expressionengine/third_party/easy_ical => easy_ical}/README.md (100%)
rename {system/expressionengine/third_party/easy_ical => easy_ical}/pi.easy_ical.php (85%)
diff --git a/system/expressionengine/third_party/easy_ical/README.md b/easy_ical/README.md
similarity index 100%
rename from system/expressionengine/third_party/easy_ical/README.md
rename to easy_ical/README.md
diff --git a/system/expressionengine/third_party/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
similarity index 85%
rename from system/expressionengine/third_party/easy_ical/pi.easy_ical.php
rename to easy_ical/pi.easy_ical.php
index ed75665..213e297 100755
--- a/system/expressionengine/third_party/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -40,7 +40,7 @@
class Easy_ical
{
- const VERSION = '1.2';
+ const VERSION = '1.3';
public function calendar()
{
@@ -51,8 +51,8 @@ public function calendar()
$out .= "X-WR-TIMEZONE:".$this->escape(ee()->TMPL->fetch_param('timezone'))."\r\n";
}
- if (ee()->TMPL->fetch_param('calname') !== FALSE) {
- $out .= "X-WR-CALNAME:".$this->escape(ee()->TMPL->fetch_param('calname'))."\r\n";
+ if (ee()->TMPL->fetch_param('calendar_name') !== FALSE) {
+ $out .= "X-WR-CALNAME:".$this->escape(ee()->TMPL->fetch_param('calendar_name'))."\r\n";
}
// EE has probably put heaps of useless whitespace between each entry
@@ -63,10 +63,18 @@ public function calendar()
$out .= "END:VCALENDAR";
// print output directly with the correct content-type
- $content_type = ee()->TMPL->fetch_param('content_type');
+ $content_type = ee()->TMPL->fetch_param('content_type');
+ $filename = $this->escape(ee()->TMPL->fetch_param('filename'));
if (empty($content_type)) $content_type = 'text/calendar; charset=UTF-8';
-
- header('Content-Type: '.$content_type);
+ if (empty($filename)) $filename = 'save-the-date';
+
+ header('Content-Description: File Transfer');
+ header('Content-Type: ' . $content_type);
+ header('Content-Disposition: attachment; filename="' . $filename . '.ics"');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate');
+ header('Pragma: public');
+ // header('Content-Length: ' . filesize($file));
exit($out);
}
@@ -82,8 +90,10 @@ public function event()
$out .= "DTSTAMP:".$this->ical_time(ee()->TMPL->fetch_param('start_time'))."\r\n";
$out .= "DTSTART:".$this->ical_time(ee()->TMPL->fetch_param('start_time'))."\r\n";
- if (ee()->TMPL->fetch_param('end_time') !== FALSE) {
+ if (ee()->TMPL->fetch_param('end_time') != FALSE) {
$out .= "DTEND:".$this->ical_time(ee()->TMPL->fetch_param('end_time'))."\r\n";
+ } else {
+ $out .= "DTEND:".$this->ical_time(strtotime(ee()->TMPL->fetch_param('start_time')) + 3600)."\r\n";
}
if (ee()->TMPL->fetch_param('summary') !== FALSE) {
From 22b575e2c90ed11d6f70f8a17d6d82b0bade194d Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 10:27:15 -0400
Subject: [PATCH 02/17] relinked README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a8df510..2fcffc3 120000
--- a/README.md
+++ b/README.md
@@ -1 +1 @@
-system/expressionengine/third_party/easy_ical/README.md
\ No newline at end of file
+easy_ical/README.md
\ No newline at end of file
From 30a10f3ce0e6630a06be65df2e9a6662e0dae1cc Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 12:34:14 -0400
Subject: [PATCH 03/17] ExpressionEngine v3+ compatability
---
easy_ical/addon.setup.php | 28 ++++++++
easy_ical/config.php | 27 ++++++++
easy_ical/pi.easy_ical.php | 136 +++++++++++++++++++++----------------
3 files changed, 133 insertions(+), 58 deletions(-)
create mode 100755 easy_ical/addon.setup.php
create mode 100755 easy_ical/config.php
diff --git a/easy_ical/addon.setup.php b/easy_ical/addon.setup.php
new file mode 100755
index 0000000..85c424f
--- /dev/null
+++ b/easy_ical/addon.setup.php
@@ -0,0 +1,28 @@
+ EASY_ICAL_NAME,
+ 'version' => EASY_ICAL_VERSION,
+ 'author' => EASY_ICAL_AUTHOR,
+ 'author_url' => EASY_ICAL_AUTHOR_URL,
+ 'docs_url' => EASY_ICAL_DOCS,
+ 'description' => EASY_ICAL_DESC,
+ 'namespace' => EASY_ICAL_NAMESPACE,
+ 'settings_exist' => FALSE
+);
+
+/* End of file addon.setup.php */
+/* Location: /system/expressionengine/third_party/easy_ical/addon.setup.php */
\ No newline at end of file
diff --git a/easy_ical/config.php b/easy_ical/config.php
new file mode 100755
index 0000000..074504e
--- /dev/null
+++ b/easy_ical/config.php
@@ -0,0 +1,27 @@
+Create valid iCalendar ICS files in seconds.
Documentation and Usage:
Date: Wed, 11 Mar 2020 15:43:52 -0400
Subject: [PATCH 04/17] refactored methods
---
easy_ical/config.php | 2 +-
easy_ical/pi.easy_ical.php | 106 ++++++++++++++++---------------------
2 files changed, 46 insertions(+), 62 deletions(-)
diff --git a/easy_ical/config.php b/easy_ical/config.php
index 074504e..1cb3d77 100755
--- a/easy_ical/config.php
+++ b/easy_ical/config.php
@@ -17,7 +17,7 @@
define('EASY_ICAL_AUTHOR', 'Matthew Kirkpatrick');
define('EASY_ICAL_AUTHOR_URL', 'https://github.com/javashakes');
define('EASY_ICAL_DOCS', 'https://github.com/javashakes/easy_icalendar');
- define('EASY_ICAL_DESC', 'Create valid iCalendar ICS files in seconds.
Documentation and Usage: ' . EASY_ICAL_DOCS . '');
+ define('EASY_ICAL_DESC', 'ExpressionEngine Plugin that creates valid iCalendar ICS files.
Documentation and Usage: ' . EASY_ICAL_DOCS . '');
define('EASY_ICAL_PACKAGE', 'easy_ical');
define('EASY_ICAL_NAMESPACE', 'EasyiCal');
define('EASY_ICAL_CLASS_NAME', 'Easy_ical');
diff --git a/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
index 21ef8e8..049b9ea 100755
--- a/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -41,88 +41,72 @@ public function __construct()
}
/**
- * CALENDAR CREATION
+ * CALENDAR OBJECT
*
* @access public
* @return string
*/
public function calendar()
{
- $this->return_data = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n";
- $this->return_data .= "PRODID:-//ExpressionEngine Easy iCalendar plugin//NONSGML v". EASY_ICAL_VERSION ."//EN\r\n";
-
- if (ee()->TMPL->fetch_param('timezone') !== FALSE) {
- $this->return_data .= "X-WR-TIMEZONE:".$this->escape(ee()->TMPL->fetch_param('timezone'))."\r\n";
- }
-
- if (ee()->TMPL->fetch_param('calendar_name') !== FALSE) {
- $this->return_data .= "X-WR-CALNAME:".$this->escape(ee()->TMPL->fetch_param('calendar_name'))."\r\n";
- }
-
- // trim away whitespace between each entry
- $tagdata = trim(ee()->TMPL->tagdata);
- $tagdata = preg_replace('/END\:VEVENT\s*BEGIN\:VEVENT/', "END:VEVENT\r\nBEGIN:VEVENT", $tagdata);
- if (!empty($tagdata)) $this->return_data .= $tagdata."\r\n";
-
- $this->return_data .= "END:VCALENDAR";
-
- // print output directly with the correct content-type
- $content_type = ee()->TMPL->fetch_param('content_type');
- $filename = $this->escape(ee()->TMPL->fetch_param('filename'));
- if (empty($content_type)) $content_type = 'text/calendar; charset=UTF-8';
- if (empty($filename)) $filename = 'save-the-date';
-
+ // parameters
+ $timezone = $this->escape(ee()->TMPL->fetch_param('timezone', 'America/New_York'));
+ $calendar_name = $this->escape(ee()->TMPL->fetch_param('calendar_name', 'Save the Date!'));
+ $content_type = ee()->TMPL->fetch_param('content_type', 'text/calendar; charset=UTF-8');
+ $filename = $this->escape(ee()->TMPL->fetch_param('filename', 'save-the-date'));
+
+ // capture event tag adn trim away whitespace
+ $tagdata = trim(ee()->TMPL->tagdata);
+ $tagdata = preg_replace('/END\:VEVENT\s*BEGIN\:VEVENT/', "END:VEVENT\r\nBEGIN:VEVENT", $tagdata);
+
+ // build the calendar object
+ $this->return_data = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n" .
+ "PRODID:-//ExpressionEngine " . EASY_ICAL_NAME . " plugin//NONSGML v" . EASY_ICAL_VERSION . "//EN\r\n" .
+ "X-WR-TIMEZONE:" . $timezone . "\r\n" .
+ "X-WR-CALNAME:" . $calendar_name . "\r\n" .
+ ( (!empty($tagdata)) ? $tagdata . "\r\n" : '' ) .
+ "END:VCALENDAR";
+
+ // output headers
header('Content-Description: File Transfer');
header('Content-Type: ' . $content_type);
header('Content-Disposition: attachment; filename="' . $filename . '.ics"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
- // header('Content-Length: ' . filesize($file));
+
+ // output header
exit($this->return_data);
}
/**
- * CALENDAR EVENT CREATION
+ * EVENT OBJECT
*
* @access public
* @return string
*/
public function event()
{
- $this->return_data = "BEGIN:VEVENT\r\n".
- "UID:".$this->escape(ee()->TMPL->fetch_param('uid'))."\r\n";
-
- if (ee()->TMPL->fetch_param('location') !== FALSE) {
- $this->return_data .= "LOCATION:".$this->escape(ee()->TMPL->fetch_param('location'))."\r\n";
- }
-
- $this->return_data .= "DTSTAMP:".$this->ical_time(ee()->TMPL->fetch_param('start_time'))."\r\n";
- $this->return_data .= "DTSTART:".$this->ical_time(ee()->TMPL->fetch_param('start_time'))."\r\n";
-
- if (ee()->TMPL->fetch_param('end_time') != FALSE) {
- $this->return_data .= "DTEND:".$this->ical_time(ee()->TMPL->fetch_param('end_time'))."\r\n";
- } else {
- $this->return_data .= "DTEND:".$this->ical_time(strtotime(ee()->TMPL->fetch_param('start_time')) + 3600)."\r\n";
- }
-
- if (ee()->TMPL->fetch_param('summary') !== FALSE) {
- $this->return_data .= "SUMMARY:".$this->escape(ee()->TMPL->fetch_param('summary'))."\r\n";
- }
-
- if (ee()->TMPL->fetch_param('sequence') !== FALSE) {
- $this->return_data .= "SEQUENCE:".$this->escape(ee()->TMPL->fetch_param('sequence'))."\r\n";
- }
- if (ee()->TMPL->fetch_param('url') !== FALSE) {
- $this->return_data .= "URL:".$this->escape(ee()->TMPL->fetch_param('url'))."\r\n";
- }
-
- $description = trim(ee()->TMPL->tagdata);
- if (!empty($description)) {
- $this->return_data .= "DESCRIPTION:".$this->escape($description)."\r\n";
- }
-
- $this->return_data .= "END:VEVENT"."\r\n";
+ // parameters
+ $uid = $this->escape(ee()->TMPL->fetch_param('uid', ee()->localize->now));
+ $start_time = $this->ical_time(ee()->TMPL->fetch_param('start_time', $uid));
+ $end_time = $this->ical_time(ee()->TMPL->fetch_param('end_time', $start_time+(60*60*24)));
+ $summary = $this->escape(ee()->TMPL->fetch_param('summary', 'An event happening in New York, NY'));
+ $location = $this->escape(ee()->TMPL->fetch_param('location'), 'New York, NY');
+ $sequence = $this->escape(ee()->TMPL->fetch_param('sequence', 1));
+ $url = $this->escape(ee()->TMPL->fetch_param('url', ''));
+ $description = $this->escape(trim(ee()->TMPL->tagdata));
+
+ $this->return_data = "BEGIN:VEVENT\r\n" .
+ "UID:" . $uid . "\r\n" .
+ "DTSTAMP:" . $start_time . "\r\n" .
+ "DTSTART:" . $start_time . "\r\n" .
+ "DTEND:" . $end_time . "\r\n" .
+ "SUMMARY:" . $summary . "\r\n" .
+ "LOCATION:" . $location . "\r\n" .
+ ( (!empty($description)) ? "DESCRIPTION:" . $description . "\r\n" : '' ) .
+ ( (!empty($url)) ? "URL:" . $url . "\r\n" : '' ) .
+ "SEQUENCE:" . $sequence . "\r\n" .
+ "END:VEVENT"."\r\n";
return $this->return_data;
}
@@ -135,7 +119,7 @@ public function event()
*/
public function escape($str)
{
- // strip any html tags
+ // replace, then strip html tags
$str = preg_replace('/\/i', "\n\n", $str);
$str = preg_replace('/\
/i', "\n", $str);
$str = strip_tags($str);
From c4dd23cb2abee053fae068daa497a559eb258a93 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 15:47:15 -0400
Subject: [PATCH 05/17] fixed bad comment
---
easy_ical/pi.easy_ical.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
index 049b9ea..82aa31c 100755
--- a/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -74,7 +74,7 @@ public function calendar()
header('Cache-Control: must-revalidate');
header('Pragma: public');
- // output header
+ // output file content
exit($this->return_data);
}
@@ -108,6 +108,7 @@ public function event()
"SEQUENCE:" . $sequence . "\r\n" .
"END:VEVENT"."\r\n";
+ // return event object
return $this->return_data;
}
From 5afe361138b04c9306435b79cdf7d706712e91f8 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 15:48:26 -0400
Subject: [PATCH 06/17] fixed spelling in a comment
---
easy_ical/pi.easy_ical.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
index 82aa31c..d3b0af0 100755
--- a/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -54,7 +54,7 @@ public function calendar()
$content_type = ee()->TMPL->fetch_param('content_type', 'text/calendar; charset=UTF-8');
$filename = $this->escape(ee()->TMPL->fetch_param('filename', 'save-the-date'));
- // capture event tag adn trim away whitespace
+ // capture event tag and trim away whitespace
$tagdata = trim(ee()->TMPL->tagdata);
$tagdata = preg_replace('/END\:VEVENT\s*BEGIN\:VEVENT/', "END:VEVENT\r\nBEGIN:VEVENT", $tagdata);
From 7b6cad6b585f15d55a6d908ef0e406b5425d1acc Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 15:58:19 -0400
Subject: [PATCH 07/17] fixed default value for start_time
---
easy_ical/pi.easy_ical.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
index d3b0af0..6a93894 100755
--- a/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -88,7 +88,7 @@ public function event()
{
// parameters
$uid = $this->escape(ee()->TMPL->fetch_param('uid', ee()->localize->now));
- $start_time = $this->ical_time(ee()->TMPL->fetch_param('start_time', $uid));
+ $start_time = $this->ical_time(ee()->TMPL->fetch_param('start_time', ee()->localize->now));
$end_time = $this->ical_time(ee()->TMPL->fetch_param('end_time', $start_time+(60*60*24)));
$summary = $this->escape(ee()->TMPL->fetch_param('summary', 'An event happening in New York, NY'));
$location = $this->escape(ee()->TMPL->fetch_param('location'), 'New York, NY');
From a9bacd13de9a2d5b80e74f645c4f0398320665e8 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 17:01:47 -0400
Subject: [PATCH 08/17] reworked documentation
---
easy_ical/README.md | 136 +++++++++++++++++++++++++-------------------
1 file changed, 79 insertions(+), 57 deletions(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index 6fd6a40..95381a8 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -1,98 +1,120 @@
-Easy iCalendar ExpressionEngine Plugin
-======================================
+# Easy iCalendar
-Create valid iCalendars in seconds.
+ExpressionEngine plugin that builds valid iCalendar files.
+*Forked from https://github.com/expressodev/easy_icalendar/*
-Requirements
-------------
+## Requirements
-* ExpressionEngine 2.1.3+
+ExpressionEngine v2+
+*Compatible with EE v2-5*
-Installation
-------------
+## Installation
-To install Easy iCalendar, simply copy the entire `easy_ical` folder to
-`/system/expressionengine/third_party` on your server.
+- **EE v2:** Copy `easy_ical` directory into `/system/expressionengine/third_party/`
+- **EE v3:** Copy `easy_ical` directory into `/system/user/addons/`
+- **EE v4:** Copy `easy_ical` directory into `/system/user/addons/`
+- **EE v5:** Copy `easy_ical` directory into `/system/user/addons/`
-Complete Example
-----------------
+## Usage
- {exp:easy_ical:calendar timezone="Pacific/Auckland" name="My Simple Event Calendar"}
- {exp:channel:entries channel="events" show_future_entries="yes" show_expired="yes" limit="20"}
- {exp:easy_ical:event uid="{entry_id}" start_time="{entry_date}" end_time="{expiration_date}" location="{event_location}" summary="{title}"}
- {event_description}
- {/exp:easy_ical:event}
- {/exp:channel:entries}
- {/exp:easy_ical:calendar}
-
-All of the CRLF line endings and character escaping will be handled for you automatically.
+### `{exp:easy_ical:calendar}`
-**NOTE: Any code in your template outside of the {exp:easy_ical:calendar} tag will be ignored!**
+Along with `{exp:easy_ical:event}`, builds the iCalendar Core Object
-Calendar Tag Parameters
------------------------
+#### Parameters
-### timezone="Pacific/Auckland"
+##### `timezone` (*optional*)
-Specify the timezone for all dates
+Specify the timezone for all events
-### name="My Calendar"
+– **Type:** string
+- **Default:** `America/New_York`
+– **Options:** [PHP timezones](https://www.php.net/manual/en/timezones.php)
+
+##### `calendar_name` (*optional*)
Give your calendar a name
-### content_type="text/plain"
+– **Type:** string
+- **Default:** `Save the Date!`
-Force the specified content type (for debugging). Defaults to `text/calendar; charset=UTF-8`
+##### `content_type` (*optional*)
-Event Tag Parameters
---------------------
+Force the specified content type (for debugging)
-Any text inside the event tag will be used as the event description.
+– **Type:** string
+- **Default:** `text/calendar; charset=UTF-8`
+– **Options:** `text/plain`
-### uid="{entry_id}"
+##### `filename` (*optional*)
-A unique identifier for the event
+Name for the generated iCalendar file
-### start_time="{entry_date}"
+– **Type:** string
+- **Default:** `save-the-date`
-The event start time/date
+### `{exp:easy_ical:event}`
-### end_time="{expiration_date}"
+Along with `{exp:easy_ical:calendar}`, builds the iCalendar Core Object
-The event end time/date
+#### Parameters
-### location="{event_location}"
+##### `uid` (*optional*)
-The event location (text). You probably want to pull this from a custom channel field.
+A unique identifier for the event, typically `{entry_id}`
-### summary="{title}"
+– **Type:** string
+- **Default:** unix timestamp
-The event summary (title). You probably want to pull this from a custom channel field.
+##### `start_time` (*optional*)
-### url="{url_title_path='group/template'}"
+The event start date and time, typically `{entry_date}`
-Allows you to add a link to the event.
+– **Type:** int
+- **Default:** Current date and time (unix timestamp)
+
+##### `end_time` (*optional*)
+
+The event end date and time, typically `{expiration_date}` or custom channel field (date)
-### sequence="{event_sequence}"
+– **Type:** int
+- **Default:** Current date and time + 24 hours (unix timestamp)
-This adds a simple sequence number to the event. This is needed if you update an entry, otherwise
-iCal won't update the event. Use a simple counter custom field, like [Reevision](http://github.com/GDmac/Reevision.ee_addon)
+##### `location` (*optional*)
-Changelog
----------
+The event location, typically a custom channel field (text).
-**1.2** *(2013-07-08)*
+– **Type:** string
+- **Default:** `New York, NY`
-* ExpressionEngine 2.6 compatibility
+##### `summary` (*optional*)
-**1.1.1** *(2011-06-09)*
+The event summary, typically `{title}` or a custom channel field (text)
+
+– **Type:** string
+- **Default:** `An event happening in New York, NY`
+
+##### `url` (*optional*)
+
+Allows you to add a link to the event.
-* Adjusted the output slightly to fix compatibility issues with some versions of iCal
+– **Type:** string
+- **Default:** `{site_url}{url_title}` via current install
-**1.1** *(2011-05-05)*
+##### `sequence` (*optional*)
-* Added url="" and sequence="" parameters (thanks to [GDmac](http://github.com/GDmac))
+Needed if you update an entry with the same `uid`, otherwise iCal will not update the event.
-**1.0** *(2010-11-24)*
+– **Type:** int
+- **Default:** unix timestamp
-* Initial release
+#### Example Usage
+```
+{exp:easy_ical:calendar timezone="Pacific/Auckland" name="My Event Calendar"}
+ {exp:channel:entries channel="events" show_future_entries="yes" show_expired="yes" limit="20"}
+ {exp:easy_ical:event uid="{entry_id}" start_time="{entry_date}" end_time="{expiration_date}" location="{event_location}" summary="{title}"}
+ {event_description}
+ {/exp:easy_ical:event}
+ {/exp:channel:entries}
+{/exp:easy_ical:calendar}
+```
From 674f84f03029cac55ee40766c7df32f96d2f66c8 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 17:06:07 -0400
Subject: [PATCH 09/17] fixed README bullets
---
easy_ical/README.md | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index 95381a8..c0c1193 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -27,30 +27,30 @@ Along with `{exp:easy_ical:event}`, builds the
Date: Wed, 11 Mar 2020 17:24:43 -0400
Subject: [PATCH 10/17] updated changelog + added license and disclaimer
---
easy_ical/README.md | 51 ++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 48 insertions(+), 3 deletions(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index c0c1193..7da1801 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -1,11 +1,13 @@
# Easy iCalendar
ExpressionEngine plugin that builds valid iCalendar files.
-*Forked from https://github.com/expressodev/easy_icalendar/*
+
+*Forked from Expresso's Easy iCalendar ExpressionEngine Plugin*
## Requirements
ExpressionEngine v2+
+
*Compatible with EE v2-5*
## Installation
@@ -19,7 +21,7 @@ ExpressionEngine v2+
### `{exp:easy_ical:calendar}`
-Along with `{exp:easy_ical:event}`, builds the iCalendar Core Object
+Along with `{exp:easy_ical:event}`, builds the iCalendar Core Object
#### Parameters
@@ -29,7 +31,7 @@ Specify the timezone for all events
- **Type:** string
- **Default:** `America/New_York`
-- **Options:** [PHP timezones](https://www.php.net/manual/en/timezones.php)
+- **Options:** PHP timezones
##### `calendar_name` (*optional*)
@@ -118,3 +120,46 @@ Needed if you update an entry with the same `uid`, otherwise iCal will not updat
{/exp:channel:entries}
{/exp:easy_ical:calendar}
```
+
+## Changelog
+
+### 2.0.0 *(2020-03-11)*
+
+- ExpressionEngine 3+ compatibility
+- Refactored methods
+- Overhauled documentdation
+
+### 1.3.0 *(2013-07-08)*
+
+- Updated `name` attr to `calendar_name`
+- Fixed a few conditionals
+
+### 1.2.0 *(2013-07-08)*
+
+- ExpressionEngine 2.6 compatibility
+
+### 1.1.1 *(2011-06-09)*
+
+- Adjusted the output slightly to fix compatibility issues with some versions of iCal
+
+### 1.1.0 *(2011-05-05)*
+
+- Added url="" and sequence="" parameters (thanks to [GDmac](http://github.com/GDmac))
+
+### 1.0.0 *(2010-11-24)*
+
+- Initial release
+
+## License
+
+Copyright © Crescendo Multimedia Ltd and individual contributors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+3. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+## Disclaimer
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
From c108419eac4c1db1cfcb18c31b4d4411bc5d3f4f Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 17:26:14 -0400
Subject: [PATCH 11/17] formatting changes to README
---
easy_ical/README.md | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index 7da1801..c3ec3ca 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -25,7 +25,7 @@ Along with `{exp:easy_ical:event}`, builds the PHP timezones
-##### `calendar_name` (*optional*)
+##### `calendar_name` *(optional)*
Give your calendar a name
- **Type:** string
- **Default:** `Save the Date!`
-##### `content_type` (*optional*)
+##### `content_type` *(optional)*
Force the specified content type (for debugging)
@@ -48,7 +48,7 @@ Force the specified content type (for debugging)
- **Default:** `text/calendar; charset=UTF-8`
- **Options:** `text/plain`
-##### `filename` (*optional*)
+##### `filename` *(optional)*
Name for the generated iCalendar file
@@ -61,49 +61,49 @@ Along with `{exp:easy_ical:calendar}`, builds the PHP timezones
@@ -36,14 +34,12 @@ Specify the timezone for all events
##### `calendar_name` *(optional)*
Give your calendar a name
-
- **Type:** string
- **Default:** `Save the Date!`
##### `content_type` *(optional)*
Force the specified content type (for debugging)
-
- **Type:** string
- **Default:** `text/calendar; charset=UTF-8`
- **Options:** `text/plain`
@@ -51,7 +47,6 @@ Force the specified content type (for debugging)
##### `filename` *(optional)*
Name for the generated iCalendar file
-
- **Type:** string
- **Default:** `save-the-date`
@@ -64,49 +59,42 @@ Along with `{exp:easy_ical:calendar}`, builds the escape(ee()->TMPL->fetch_param('summary', 'An event happening in New York, NY'));
$location = $this->escape(ee()->TMPL->fetch_param('location'), 'New York, NY');
$sequence = $this->escape(ee()->TMPL->fetch_param('sequence', 1));
- $url = $this->escape(ee()->TMPL->fetch_param('url', ''));
+ $url = $this->escape(ee()->TMPL->fetch_param('url', '');
$description = $this->escape(trim(ee()->TMPL->tagdata));
$this->return_data = "BEGIN:VEVENT\r\n" .
From 3d9f2f1ddfc46ad977be0e1bae6cdb46e1243967 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 17:41:20 -0400
Subject: [PATCH 13/17] rolled back formatting changes in README
---
easy_ical/README.md | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index ddbc880..7ae9b52 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -11,6 +11,7 @@ ExpressionEngine v2+
*Compatible with EE v2-5*
## Installation
+
- **EE v2:** Copy `easy_ical` directory into `/system/expressionengine/third_party/`
- **EE v3:** Copy `easy_ical` directory into `/system/user/addons/`
- **EE v4:** Copy `easy_ical` directory into `/system/user/addons/`
@@ -27,6 +28,7 @@ Along with `{exp:easy_ical:event}`, builds the PHP timezones
@@ -34,12 +36,14 @@ Specify the timezone for all events
##### `calendar_name` *(optional)*
Give your calendar a name
+
- **Type:** string
- **Default:** `Save the Date!`
##### `content_type` *(optional)*
Force the specified content type (for debugging)
+
- **Type:** string
- **Default:** `text/calendar; charset=UTF-8`
- **Options:** `text/plain`
@@ -47,6 +51,7 @@ Force the specified content type (for debugging)
##### `filename` *(optional)*
Name for the generated iCalendar file
+
- **Type:** string
- **Default:** `save-the-date`
@@ -59,42 +64,49 @@ Along with `{exp:easy_ical:calendar}`, builds the
Date: Wed, 11 Mar 2020 17:54:58 -0400
Subject: [PATCH 14/17] updated README to reflect actual 'url' default value
---
easy_ical/README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index 7ae9b52..660831a 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -101,7 +101,6 @@ The event summary, typically `{title}` or a custom channel field (text)
Allows you to add a link to the event.
- **Type:** string
-- **Default:** `{site_url}{url_title}` via current install
##### `sequence` *(optional)*
From 09c298f5b118eab0dbc9a5147b3b9e5617da3ece Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Wed, 11 Mar 2020 18:17:13 -0400
Subject: [PATCH 15/17] bug fix on line 96
---
easy_ical/pi.easy_ical.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/easy_ical/pi.easy_ical.php b/easy_ical/pi.easy_ical.php
index a399c89..77b5de6 100755
--- a/easy_ical/pi.easy_ical.php
+++ b/easy_ical/pi.easy_ical.php
@@ -91,9 +91,9 @@ public function event()
$start_time = $this->ical_time(ee()->TMPL->fetch_param('start_time', ee()->localize->now));
$end_time = $this->ical_time(ee()->TMPL->fetch_param('end_time', $start_time+(60*60*24)));
$summary = $this->escape(ee()->TMPL->fetch_param('summary', 'An event happening in New York, NY'));
- $location = $this->escape(ee()->TMPL->fetch_param('location'), 'New York, NY');
+ $location = $this->escape(ee()->TMPL->fetch_param('location', 'New York, NY'));
$sequence = $this->escape(ee()->TMPL->fetch_param('sequence', 1));
- $url = $this->escape(ee()->TMPL->fetch_param('url', '');
+ $url = $this->escape(ee()->TMPL->fetch_param('url', ''));
$description = $this->escape(trim(ee()->TMPL->tagdata));
$this->return_data = "BEGIN:VEVENT\r\n" .
From 1b64260d938c2b9343e45863a3fbb8ddfb076863 Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Thu, 12 Mar 2020 10:38:09 -0400
Subject: [PATCH 16/17] header change in README
---
easy_ical/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/easy_ical/README.md b/easy_ical/README.md
index 660831a..fbb2d58 100755
--- a/easy_ical/README.md
+++ b/easy_ical/README.md
@@ -109,7 +109,7 @@ Needed if you update an entry with the same `uid`, otherwise iCal will not updat
- **Type:** int
- **Default:** unix timestamp
-#### Example Usage
+### Example
```
{exp:easy_ical:calendar timezone="Pacific/Auckland" name="My Event Calendar"}
{exp:channel:entries channel="events" show_future_entries="yes" show_expired="yes" limit="20"}
From 2bbc05e530f7c7e33c16101cb267a2984126f1ee Mon Sep 17 00:00:00 2001
From: Matthew Kirkpatrick
Date: Fri, 4 Sep 2020 16:31:48 -0400
Subject: [PATCH 17/17] updated namespace
---
easy_ical/config.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/easy_ical/config.php b/easy_ical/config.php
index 1cb3d77..de30c75 100755
--- a/easy_ical/config.php
+++ b/easy_ical/config.php
@@ -19,7 +19,7 @@
define('EASY_ICAL_DOCS', 'https://github.com/javashakes/easy_icalendar');
define('EASY_ICAL_DESC', 'ExpressionEngine Plugin that creates valid iCalendar ICS files.
Documentation and Usage: ' . EASY_ICAL_DOCS . '');
define('EASY_ICAL_PACKAGE', 'easy_ical');
- define('EASY_ICAL_NAMESPACE', 'EasyiCal');
+ define('EASY_ICAL_NAMESPACE', 'javashakes\EasyiCal');
define('EASY_ICAL_CLASS_NAME', 'Easy_ical');
}