[geeklog-cvs] Geeklog-1.x/system/classes story.class.php, 1.15, 1.16

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


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

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


Index: story.class.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/system/classes/story.class.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** story.class.php	30 Sep 2007 13:32:09 -0000	1.15
--- story.class.php	30 Sep 2007 15:59:41 -0000	1.16
***************
*** 1537,1541 ****
           * based on an array that defines how to COM_applyFilter them.
           */
!         while (list($key, $value) = each($this->_postFields)) {
              $varname = $value[1];
  
--- 1537,1542 ----
           * based on an array that defines how to COM_applyFilter them.
           */
!         foreach ($this->_postFields as $key => $value) {
!             $vartype = $value[0];
              $varname = $value[1];
  
***************
*** 1543,1549 ****
              if (array_key_exists($key, $array)) {
                  // And it's alphanumeric or numeric, filter it and use it.
!                 if (($value[0] == STORY_AL_ALPHANUM) || ($value[0] == STORY_AL_NUMERIC)) {
!                     $this->{$varname} = COM_applyFilter($array[$key], $value[0]);
!                 } elseif ($array[$key] === 'on') {
                      // If it's a checkbox that is on
                      $this->{$varname} = 1;
--- 1544,1550 ----
              if (array_key_exists($key, $array)) {
                  // And it's alphanumeric or numeric, filter it and use it.
!                 if (($vartype == STORY_AL_ALPHANUM) || ($vartype == STORY_AL_NUMERIC)) {
!                     $this->{$varname} = COM_applyFilter($array[$key], $vartype);
!                 } elseif (($array[$key] === 'on') || ($array[$key] === 1)) {
                      // If it's a checkbox that is on
                      $this->{$varname} = 1;
***************
*** 1552,1560 ****
                      $this->{$varname} = 0;
                  }
!             } elseif (($value[0] == STORY_AL_NUMERIC) || ($value[0] == STORY_AL_CHECKBOX)) {
                  // If we don't have a value, and have a numeric or text box, default to 0
                  $this->{$varname} = 0;
              }
          }
          // SID's are a special case:
          $sid = COM_sanitizeID($array['sid']);
--- 1553,1562 ----
                      $this->{$varname} = 0;
                  }
!             } elseif (($vartype == STORY_AL_NUMERIC) || ($vartype == STORY_AL_CHECKBOX)) {
                  // If we don't have a value, and have a numeric or text box, default to 0
                  $this->{$varname} = 0;
              }
          }
+ 
          // SID's are a special case:
          $sid = COM_sanitizeID($array['sid']);




More information about the geeklog-cvs mailing list