--- /dev/null
+--- dokuwiki-plugin-icalevents-20100501/syntax.php 2010-12-05 22:33:33.062976306 +0200
++++ iCalEvents/syntax.php 2010-12-05 22:44:54.218325084 +0200
+@@ -74,20 +74,32 @@
+ $previewSec = 60*24*3600; # two month
+ }
+
++ # Take dateformat from params, or
++ # If dateformat is set in plugin configuration ('dformat'), then use it.
++ # Otherwise fall back to dokuwiki's default dformat from the global /conf/dokuwiki.php.
++ if (!empty($params['dformat'])) {
++ $dateFormat = $params['dformat'];
++ } else {
++ global $conf;
++ $dateFormat = $this->getConf('dformat') ? $this->getConf('dformat') : $conf['dformat'];
++ }
++
++ $showEndDates = !empty($params['showEndDates']);
++
+ #echo "url=$icsURL from = $from previewSec = $previewSec<br>";
+
+- return array($icsURL, $from, $previewSec);
++ return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates);
+ }
+
+ /**
+ * loads the ics file via HTTP, parses it and renders an HTML table.
+ */
+ function render($mode, &$renderer, $data) {
+- list($url, $from, $previewSec) = $data;
++ list($url, $from, $previewSec, $dateFormat, $showEndDates) = $data;
+ $ret = '';
+ if($mode == 'xhtml'){
+ # parse the ICS file
+- $entries = $this->_parseIcs($url, $from, $previewSec);
++ $entries = $this->_parseIcs($url, $from, $previewSec, $dateFormat);
+ if ($this->error) {
+ $renderer->doc .= "Error in Plugin iCalEvents: ".$this->error;
+ return true;
+@@ -103,7 +115,7 @@
+ foreach ($entries as $entry) {
+ $rowCount++;
+ $ret .= '<tr>';
+- if ($this->getConf('showEndDates')) {
++ if ($showEndDates || $this->getConf('showEndDates')) {
+ $ret .= '<td>'.$entry['startdate'].' - '.$entry['enddate'].'</td>';
+ } else {
+ $ret .= '<td>'.$entry['startdate'];
+@@ -130,9 +142,7 @@
+ * @param previewSec preview range also in seconds
+ * @return an array of entries sorted by their startdate
+ */
+- function _parseIcs($url, $from, $previewSec) {
+- global $conf;
+-
++ function _parseIcs($url, $from, $previewSec, $dateFormat) {
+ // must reset error in case we have multiple calendars on page
+ $this->error = false;
+
+@@ -144,10 +154,6 @@
+ $content = $http->resp_body;
+ $entries = array();
+
+- # If dateformat is set in plugin configuration ('dformat'), then use it.
+- # Otherwise fall back to dokuwiki's default dformat from the global /conf/dokuwiki.php.
+- $dateFormat = $this->getConf('dformat') ? $this->getConf('dformat') : $conf['dformat'];
+-
+ # regular expressions for items that we want to extract from the iCalendar file
+ $regex_vevent = '/BEGIN:VEVENT(.*?)END:VEVENT/s';
+ $regex_summary = '/SUMMARY:(.*?)\n/';
Summary: Parses an iCal calendar .ics file and renders it as an HTML table
Name: dokuwiki-plugin-icalevents
Version: 20100501
-Release: 0.6
+Release: 1
License: GPL v2
Group: Applications/WWW
Source0: http://public.doogie.de/projects/dokuwiki/plugin_iCalEvents_2.0.zip
URL: http://www.dokuwiki.org/plugin:icalevents
Patch0: dformat.patch
Patch1: reset-error.patch
+Patch2: allow-params.patch
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.553
Requires: dokuwiki >= 20080505
%undos -f php
%patch0 -p1
%patch1 -p1
+%patch2 -p1
version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php)
if [ "$(echo "$version" | tr -d -)" != %{version} ]; then