+++ /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/';
+++ /dev/null
-use dformat from dokuwiki by default
-
---- icalevents/conf/default.php~ 2010-04-26 15:48:52.000000000 +0300
-+++ icalevents/conf/default.php 2010-12-05 22:15:22.486210482 +0200
-@@ -3,9 +3,7 @@
-
- # Date format that is used to display the from and to values
- # If you leave this empty '', then the default dformat from /conf/dokuwiki.php will be used.
--$conf['dformat'] = '%d.%m.%Y';
-+$conf['dformat'] = '';
-
- # should the end dates for each event be shown?
- $conf['showEndDates'] = 0;
--
--?>
-\ No newline at end of file
-%define plugin iCalEvents
+%define plugin icalevents
%define php_min_version 5.0.0
%include /usr/lib/rpm/macros.php
Summary: Parses an iCal calendar .ics file and renders it as an HTML table
-Name: dokuwiki-plugin-icalevents
-Version: 20100501
-Release: 7
+Name: dokuwiki-plugin-%{plugin}
+Version: 20120909
+Release: 1
License: GPL v2
Group: Applications/WWW
-Source0: http://public.doogie.de/projects/dokuwiki/plugin_iCalEvents_2.0.zip
-# Source0-md5: abef6798132ba03b74afd72ea62678ca
+Source0: https://github.com/glensc/dokuwiki-plugin-icalevents/tarball/2012-09-09/%{name}-%{version}.tgz
+# Source0-md5: f06f7df14b65359ff83096c1cec11e02
URL: http://www.dokuwiki.org/plugin:icalevents
-Patch0: dformat.patch
-Patch1: reset-error.patch
-Patch2: allow-params.patch
-Patch3: relative-dates.patch
-Patch4: showCurrentWeek.patch
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.553
BuildRequires: unzip
%prep
%setup -qc
-mv iCalEvents/* .
-%undos -f php
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
+mv *icalevents-*/* .
-version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php)
+version=$(awk '/^date/{print $2}' plugin.info.txt)
if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
: %%{version} mismatch
-# exit 1
+ exit 1
fi
%install
%defattr(644,root,root,755)
%dir %{plugindir}
%{plugindir}/*.php
+%{plugindir}/*.txt
%{plugindir}/conf
+++ /dev/null
---- dokuwiki-plugin-icalevents-20100501/syntax.php 2010-12-06 14:11:46.422763640 +0200
-+++ iCalEvents/syntax.php 2010-12-06 14:12:11.466106772 +0200
-@@ -59,16 +59,19 @@
- $match = substr($match, 13, -2); // strip {{iCalEvents> from start and }} from end
- list($icsURL, $flagStr) = explode('#', $match);
- parse_str($flagStr, $params);
--
-- if ($params['from'] == 'today') {
-- $from = time();
-- } else if (preg_match('#(\d\d)/(\d\d)/(\d\d\d\d)#', $params['from'], $fromDate)) {
-- # must be MM/dd/yyyy
-- $from = mktime(0, 0, 0, $fromDate[1], $fromDate[2], $fromDate[3]);
-- } else if (preg_match('/\d+/', $params['from'])) {
-- $from = $params['from'];
-+
-+ $from = null;
-+ if (!empty($params['from'])) {
-+ // unix timestamp: handle specially for backward compatability
-+ if (preg_match('/^\d+$/', $params['from'])) {
-+ $from = (int )$params['from'];
-+ } else {
-+ // anything that strtotime can parse: 'today', '1 week ago', etc
-+ $from = strtotime($params['from']);
-+ }
- }
-- if ($params['previewDays']) {
-+
-+ if (!empty($params['previewDays'])) {
- $previewSec = $params['previewDays']*24*3600;
- } else {
- $previewSec = 60*24*3600; # two month
-@@ -86,7 +89,7 @@
-
- $showEndDates = !empty($params['showEndDates']);
-
-- #echo "url=$icsURL from = $from previewSec = $previewSec<br>";
-+ #echo "url=$icsURL flags=$flagStr; from = $from; previewSec = $previewSec; dateFormat=$dateFormat;<br/>";
-
- return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates);
- }
+++ /dev/null
---- iCalEvents/syntax.php~ 2010-12-05 22:32:32.000000000 +0200
-+++ iCalEvents/syntax.php 2010-12-05 22:32:57.535271298 +0200
-@@ -132,7 +132,10 @@
- */
- function _parseIcs($url, $from, $previewSec) {
- global $conf;
--
-+
-+ // must reset error in case we have multiple calendars on page
-+ $this->error = false;
-+
- $http = new DokuHTTPClient();
- if (!$http->get($url)) {
- $this->error = "Could not get '$url': ".$http->status;
+++ /dev/null
-Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/: .syntax.php.swo
-Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/: .syntax.php.swp
-Only in /usr/share/dokuwiki/lib/plugins/iCalEvents/conf: default.php~
-Only in .: iCalEvents
-Only in ./lang: de
-diff -ur -x .svn -x .git -x .bzr -x CVS ./syntax.php /usr/share/dokuwiki/lib/plugins/iCalEvents/syntax.php
---- ./syntax.php 2011-05-24 07:10:51.275958659 +0300
-+++ /usr/share/dokuwiki/lib/plugins/iCalEvents/syntax.php 2011-05-23 12:38:52.386695372 +0300
-@@ -88,17 +88,18 @@
- }
-
- $showEndDates = !empty($params['showEndDates']);
-+ $showCurrentWeek = !empty($params['showCurrentWeek']);
-
-- #echo "url=$icsURL flags=$flagStr; from = $from; previewSec = $previewSec; dateFormat=$dateFormat;<br/>";
-+ #echo "url=$icsURL flags=$flagStr; from = $from; previewSec = $previewSec; dateFormat=$dateFormat; showCurrentWeek=$showCurrentWeek<br/>";
-
-- return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates);
-+ return array($icsURL, $from, $previewSec, $dateFormat, $showEndDates, $showCurrentWeek);
- }
-
- /**
- * loads the ics file via HTTP, parses it and renders an HTML table.
- */
- function render($mode, &$renderer, $data) {
-- list($url, $from, $previewSec, $dateFormat, $showEndDates) = $data;
-+ list($url, $from, $previewSec, $dateFormat, $showEndDates, $showCurrentWeek) = $data;
- $ret = '';
- if($mode == 'xhtml'){
- # parse the ICS file
-@@ -113,10 +114,16 @@
- '<th>'.$this->getLang('what').'</th>'.
- '<th>'.$this->getLang('description').'</th>'.
- '<th>'.$this->getLang('where').'</th>'.
- '</tr>'.NL;
-+ $weekStart = strtotime("0 week ago 12:00");
-+ $weekEnd = strtotime("1 weeks 12:00");
- foreach ($entries as $entry) {
- $rowCount++;
-- $ret .= '<tr>';
-+ $ret .= '<tr';
-+ if ($showCurrentWeek && ($entry['startunixdate'] >= $weekStart && $entry['endunixdate'] <= $weekEnd)) {
-+ $ret .= ' style="background-color: red !important"';
-+ }
-+ $ret .= '>';
- if ($showEndDates || $this->getConf('showEndDates')) {
- $ret .= '<td>'.$entry['startdate'].' - '.$entry['enddate'].'</td>';
- } else {