[geeklog-cvs] Geeklog-1.x/system lib-webservices.php,1.39,1.40

Dirk Haun dhaun at qs1489.pair.com
Sat Jul 26 03:41:31 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/system
In directory qs1489.pair.com:/tmp/cvs-serv73897/system

Modified Files:
	lib-webservices.php 
Log Message:
More compatibility improvements, mostly for <app:control> (draft flag)


Index: lib-webservices.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-webservices.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** lib-webservices.php	23 Jul 2008 19:34:13 -0000	1.39
--- lib-webservices.php	26 Jul 2008 07:41:29 -0000	1.40
***************
*** 41,44 ****
--- 41,45 ----
  $WS_ATOM_NS = 'http://www.w3.org/2005/Atom';
  $WS_APP_NS  = 'http://www.w3.org/2007/app';
+ $WS_APP_NS2 = 'http://purl.org/atom/app#';
  $WS_EXTN_NS = 'http://www.geeklog.net/xmlns/app/gl';
  
***************
*** 538,542 ****
  
              if (($node->namespaceURI != $WS_ATOM_NS) &&
!                 ($node->namespaceURI != $WS_APP_NS ) &&
                  ($node->namespaceURI != $WS_EXTN_NS)) {
                  continue;
--- 539,544 ----
  
              if (($node->namespaceURI != $WS_ATOM_NS) &&
!                 ($node->namespaceURI != $WS_APP_NS) &&
!                 ($node->namespaceURI != $WS_APP_NS2) &&
                  ($node->namespaceURI != $WS_EXTN_NS)) {
                  continue;
***************
*** 563,566 ****
--- 565,587 ----
                  WS_getContent($args, $atom_doc, $node);
                  break;
+             case 'control':
+                 if ($node->nodeType == XML_ELEMENT_NODE) {
+                     $child_nodes = $node->childNodes;
+                     if ($child_nodes == null) {
+                         continue;
+                     }
+                     $args[$node->localName] = array();
+                     for ($i = 0; $i < $child_nodes->length; $i++) {
+                         $child_node = $child_nodes->item($i);
+                         if ($child_node->nodeType == XML_ELEMENT_NODE) {
+                             if ($child_node->firstChild->nodeType == XML_TEXT_NODE) {
+                                 $args[$node->localName][$child_node->localName]
+                                         = $child_node->firstChild->nodeValue;
+                                 break;
+                             }
+                         }
+                     }
+                 }
+                 break;
              default:
                  if ($node->nodeType == XML_ELEMENT_NODE) {
***************
*** 598,602 ****
          $args['publish_second'] = date('s', strtotime($args['updated']));
  
!         if (isset($args['control'])) {
              foreach ($args['control'] as $key => $value) {
                  if ($key == 'draft') {
--- 619,623 ----
          $args['publish_second'] = date('s', strtotime($args['updated']));
  
!         if (isset($args['control']) && is_array($args['control'])) {
              foreach ($args['control'] as $key => $value) {
                  if ($key == 'draft') {




More information about the geeklog-cvs mailing list