Update of /cvsroot/phpicalendar/phpicalendar/lib/HTTP/CalDAV/Tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18717/lib/HTTP/CalDAV/Tools
Modified Files:
ReportParser.php
Log Message:
* Half way through filter support for calendar-query REPORTs
* About to normalize report_response_helper with propfind_response_helper
Index: ReportParser.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/lib/HTTP/CalDAV/Tools/ReportParser.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ReportParser.php 13 Apr 2006 05:10:24 -0000 1.1
--- ReportParser.php 13 Apr 2006 21:14:17 -0000 1.2
***************
*** 67,70 ****
--- 67,78 ----
/**
+ * Found filters are collected here
+ *
+ * @var array
+ * @access public
+ */
+ var $filters = array();
+
+ /**
* Stack of ancestor tag names
*
***************
*** 206,209 ****
--- 214,256 ----
}
+ if (count($this->_names) == 1 && $name == 'filter') {
+ $this->_comps[] =& $this->filters;
+ $this->_names[] = $name;
+ return;
+ }
+
+ if ($name == 'comp-filter') {
+ end($this->_comps);
+
+ // Gross - end returns a copy of the last value
+ $comp =& $this->_comps[key($this->_comps)];
+
+ if (!is_array($comp['comps'])) {
+ $comp['comps'] = array();
+ }
+
+ $comp['comps'][$attrs['name']] = array();
+ $this->_comps[] =& $comp['comps'][$attrs['name']];
+ $this->_names[] = $name;
+ return;
+ }
+
+ if (end($this->_names) == 'comp-filter') {
+ end($this->_comps);
+
+ // Gross - end returns a copy of the last value
+ $comp =& $this->_comps[key($this->_comps)];
+
+ if (!is_array($comp['filters'])) {
+ $comp['filters'] = array();
+ }
+
+ $filter = array('name' => $name, 'value' => $attrs);
+
+ $comp['filters'][] = $filter;
+ $this->_names[] = $name;
+ return;
+ }
+
$this->_names[] = $name;
}
***************
*** 233,237 ****
// Any need to pop at end of calendar-data?
! if ($name == 'comp') {
array_pop($this->_comps);
}
--- 280,286 ----
// Any need to pop at end of calendar-data?
! // Yes - $this->_comps is re-used for parsing filters
! if ($name == 'comp' || $name == 'calendar-data' ||
! $name == 'comp-filter' || $name == 'filter') {
array_pop($this->_comps);
}
|