[geeklog-cvs] Geeklog-1.x/system lib-story.php, 1.108, 1.109 lib-webservices.php, 1.11, 1.12

Dirk Haun dhaun at qs1489.pair.com
Sun Sep 30 11:59:43 EDT 2007


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

Modified Files:
	lib-story.php lib-webservices.php 
Log Message:
Handle app:draft <-> draft_flag translation in lib-webservices; minor hack to handle checkbox-values when using the webservices API


Index: lib-webservices.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-webservices.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** lib-webservices.php	17 Sep 2007 20:11:52 -0000	1.11
--- lib-webservices.php	30 Sep 2007 15:59:41 -0000	1.12
***************
*** 3,7 ****
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Geeklog 1.4                                                               |
  // +---------------------------------------------------------------------------+
  // | lib-webservices.php                                                       |
--- 3,7 ----
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Geeklog 1.5                                                               |
  // +---------------------------------------------------------------------------+
  // | lib-webservices.php                                                       |
***************
*** 482,494 ****
          }
  
! 	if (empty($args['updated'])) {
! 		$args['updated'] = date('c');
! 	}
! 	$args['publish_month'] = date('m', strtotime($args['updated']));
! 	$args['publish_year'] = date('Y', strtotime($args['updated']));
! 	$args['publish_day'] = date('d', strtotime($args['updated']));
! 	$args['publish_hour'] = date('H', strtotime($args['updated']));
! 	$args['publish_minute'] = date('i', strtotime($args['updated']));
! 	$args['publish_second'] = date('s', strtotime($args['updated']));
  
          if (empty($args['uid'])) {
--- 482,503 ----
          }
  
!         if (empty($args['updated'])) {
!             $args['updated'] = date('c');
!         }
!         $args['publish_month'] = date('m', strtotime($args['updated']));
!         $args['publish_year'] = date('Y', strtotime($args['updated']));
!         $args['publish_day'] = date('d', strtotime($args['updated']));
!         $args['publish_hour'] = date('H', strtotime($args['updated']));
!         $args['publish_minute'] = date('i', strtotime($args['updated']));
!         $args['publish_second'] = date('s', strtotime($args['updated']));
! 
!         if (isset($args['control'])) {
!             foreach ($args['control'] as $key => $value) {
!                 if ($key == 'draft') {
!                     $args['draft_flag'] = ($value == 'yes' ? 1 : 0);
!                     break;
!                 }
!             }
!         }
  
          if (empty($args['uid'])) {
***************
*** 549,553 ****
      $entry_elem->appendChild($author);
  
!     /* Geeklog-specific elements */
  
      foreach ($extn_elements as $elem) {
--- 558,574 ----
      $entry_elem->appendChild($author);
  
!     // if there's a draft flag and it's == 1, export it as <app:draft>
!     $draft = 0;
!     if (isset($arr['draft_flag']) && ($arr['draft_flag'] == 1)) {
!         $draft = 1;
!     }
!     if ($draft == 1) {
!         $control = $atom_doc->createElement('app:control');
!         $draft = $atom_doc->createElement('app:draft', 'yes');
!         $control->appendChild($draft);
!         $entry_elem->appendChild($control);
!     }
! 
!     // Geeklog-specific elements
  
      foreach ($extn_elements as $elem) {

Index: lib-story.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/lib-story.php,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** lib-story.php	30 Sep 2007 13:32:08 -0000	1.108
--- lib-story.php	30 Sep 2007 15:59:41 -0000	1.109
***************
*** 1109,1122 ****
          }
  
-         // FIXME: move this to lib-webservices.php
-         if (isset($args['control'])) {
-             foreach ($args['control'] as $key => $value) {
-                 if ($key == 'draft') { // == 'app:draft'
-                     $args['draft_flag'] = ($value == 'yes' ? 1 : 0);
-                     break;
-                 }
-             }
-         }
- 
          if (!isset($args['draft_flag'])) {
              $args['draft_flag'] = $_CONF['draft_flag'];
--- 1109,1112 ----
***************
*** 1131,1135 ****
          }
      }
- 
      /* - END: Set all the defaults - */
  
--- 1121,1124 ----
***************
*** 1209,1214 ****
      }
  
-     /* STARTOFTESTCODE */
- 
      /* Image upload is not supported by the web-service at present */
      if (!$args['gl_svc']) {
--- 1198,1201 ----
***************
*** 1337,1341 ****
          }
      }
-     /* ENDOFTESTCODE */
  
      $result = $story->saveToDatabase();
--- 1324,1327 ----




More information about the geeklog-cvs mailing list