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

glen glen at pld-linux.org
Sun Dec 5 21:47:13 CET 2010


Author: glen                         Date: Sun Dec  5 20:47:13 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- allow more params via wiki syntax

---- Files affected:
packages/dokuwiki-plugin-icalevents:
   dokuwiki-plugin-icalevents.spec (1.3 -> 1.4) , allow-params.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.3 packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec:1.4
--- packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec:1.3	Sun Dec  5 21:34:04 2010
+++ packages/dokuwiki-plugin-icalevents/dokuwiki-plugin-icalevents.spec	Sun Dec  5 21:47:08 2010
@@ -5,7 +5,7 @@
 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
@@ -13,6 +13,7 @@
 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
@@ -38,6 +39,7 @@
 %undos -f php
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 version=$(awk -F"'" '/date/&&/=>/{print $4}' syntax.php)
 if [ "$(echo "$version" | tr -d -)" != %{version} ]; then
@@ -67,6 +69,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.4  2010/12/05 20:47:08  glen
+- allow more params via wiki syntax
+
 Revision 1.3  2010/12/05 20:34:04  glen
 - reset error state when fetching next calendar
 

================================================================
Index: packages/dokuwiki-plugin-icalevents/allow-params.patch
diff -u /dev/null packages/dokuwiki-plugin-icalevents/allow-params.patch:1.1
--- /dev/null	Sun Dec  5 21:47:14 2010
+++ packages/dokuwiki-plugin-icalevents/allow-params.patch	Sun Dec  5 21:47:08 2010
@@ -0,0 +1,69 @@
+--- 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/';
================================================================

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



More information about the pld-cvs-commit mailing list