Commit a283770d authored by Robert Rollins's avatar Robert Rollins

Date iCal now supports iCalcreator v2.22+.

parent e45f7aab
...@@ -16,10 +16,10 @@ Date iCal has several required dependencies, and an optional one: ...@@ -16,10 +16,10 @@ Date iCal has several required dependencies, and an optional one:
- The Feeds module is optional. It's needed only if you you wish to import iCal - The Feeds module is optional. It's needed only if you you wish to import iCal
feeds from other sites. feeds from other sites.
To install the iCalcreator library, download the project's v2.20.2 zip file: To install the iCalcreator library, download the latest release from ths url:
https://github.com/iCalcreator/iCalcreator/archive/e3dbec2cb3bb91a8bde989e467567ae8831a4026.zip https://github.com/iCalcreator/iCalcreator/archive/master.zip
Extract it, and copy iCalcreator.class.php to a folder in your Drupal site Extract it, and copy the contents to a folder in your Drupal site named
named sites/all/libraries/iCalcreator (you'll need to create that folder). sites/all/libraries/iCalcreator (you'll need to create that folder).
Or, if you have drush, you can install iCalcreator by running this command from Or, if you have drush, you can install iCalcreator by running this command from
your site's root directory: your site's root directory:
...@@ -243,6 +243,5 @@ The libraries/windowsZones.json file, which Date iCal uses to map Windows-style ...@@ -243,6 +243,5 @@ The libraries/windowsZones.json file, which Date iCal uses to map Windows-style
timezone names to real timezone IDs, is from Version24 of the Unicode CLDR: timezone names to real timezone IDs, is from Version24 of the Unicode CLDR:
http://cldr.unicode.org/. http://cldr.unicode.org/.
The author of iCalcreator made backwards incompatible changes to the library For some time, Date iCal did not support the 2.22+ of the iCalcreator library.
in the v2.22 release. Thus Date iCal does not currently support any version of This has been corrected, and any version should now function normally.
iCalcreator after v2.20.2.
...@@ -2,6 +2,6 @@ core = 7.x ...@@ -2,6 +2,6 @@ core = 7.x
api = 2 api = 2
libraries[iCalcreator][download][type] = "get" libraries[iCalcreator][download][type] = "get"
libraries[iCalcreator][download][url] = "https://github.com/iCalcreator/iCalcreator/archive/e3dbec2cb3bb91a8bde989e467567ae8831a4026.zip" libraries[iCalcreator][download][url] = "https://github.com/iCalcreator/iCalcreator/archive/master.zip"
libraries[iCalcreator][directory_name] = "iCalcreator" libraries[iCalcreator][directory_name] = "iCalcreator"
libraries[iCalcreator][destination] = "libraries" libraries[iCalcreator][destination] = "libraries"
...@@ -165,13 +165,18 @@ function date_ical_libraries_info() { ...@@ -165,13 +165,18 @@ function date_ical_libraries_info() {
'name' => 'iCalcreator', 'name' => 'iCalcreator',
'vendor url' => 'http://github.com/iCalcreator/iCalcreator', 'vendor url' => 'http://github.com/iCalcreator/iCalcreator',
'download url' => 'http://github.com/iCalcreator/iCalcreator', 'download url' => 'http://github.com/iCalcreator/iCalcreator',
'version arguments' => array( 'version callback' => '_date_ical_detect_icalcreator_version',
'file' => 'iCalcreator.class.php', 'versions' => array(
'pattern' => "/define.*?ICALCREATOR_VERSION.*?([\d\.]+)/", '2.20' => array(
'lines' => 100, 'files' => array(
), 'php' => array('iCalcreator.class.php'),
'files' => array( ),
'php' => array('iCalcreator.class.php'), ),
'2.22+' => array(
'files' => array(
'php' => array('iCalcreator.php'),
),
),
), ),
); );
...@@ -492,3 +497,16 @@ function _date_ical_convert_rrule_for_icalcreator($rrule) { ...@@ -492,3 +497,16 @@ function _date_ical_convert_rrule_for_icalcreator($rrule) {
} }
return $new_rrule; return $new_rrule;
} }
function _date_ical_detect_icalcreator_version() {
$path = libraries_get_path('iCalcreator');
if (file_exists(DRUPAL_ROOT . "/$path/iCalcreator.class.php")) {
return '2.20';
}
else if (file_exists(DRUPAL_ROOT . "/$path//iCalcreator.php")) {
return '2.22+';
}
else {
return FALSE;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment