packages: dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec, dokuw...

glen glen at pld-linux.org
Mon Dec 6 13:14:05 CET 2010


Author: glen                         Date: Mon Dec  6 12:14:05 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- allow $from to take any param that strtotime supports

---- Files affected:
packages/dokuwiki-plugin-icalevents:
   dokuwiki-plugin-icalevents.spec (1.4 -> 1.5) , relative-dates.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec
diff -u packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec:1.4 packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec:1.5
--- packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec:1.4	Sun Dec  5 21:47:08 2010
+++ packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec	Mon Dec  6 13:14:00 2010
@@ -14,6 +14,7 @@
 Patch0:		dformat.patch
 Patch1:		reset-error.patch
 Patch2:		allow-params.patch
+Patch3:		relative-dates.patch
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.553
 Requires:	dokuwiki >= 20080505
@@ -40,6 +41,7 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php)
 if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
@@ -69,6 +71,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.5  2010/12/06 12:14:00  glen
+- allow $from to take any param that strtotime supports
+
 Revision 1.4  2010/12/05 20:47:08  glen
 - allow more params via wiki syntax
 

================================================================
Index: packages/dokuwiki-plugin-icalevents/relative-dates.patch
diff -u /dev/null packages/dokuwiki-plugin-icalevents/relative-dates.patch:1.1
--- /dev/null	Mon Dec  6 13:14:06 2010
+++ packages/dokuwiki-plugin-icalevents/relative-dates.patch	Mon Dec  6 13:14:00 2010
@@ -0,0 +1,40 @@
+--- 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); 
+     }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list