[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/horde/Horde/SyncML/Sync/ -> RefreshFromServerSync.php (source)

   1  <?php
   2  
   3  include_once 'Horde/SyncML/Sync.php';
   4  
   5  /**
   6   * $Horde: framework/SyncML/SyncML/Sync/RefreshFromServerSync.php,v 1.9 2004/07/03 15:21:15 chuck Exp $
   7   *
   8   * Copyright 2003-2004 Anthony Mills <amills@pyramid6.com>
   9   *
  10   * See the enclosed file COPYING for license information (LGPL). If you
  11   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  12   *
  13   * @author  Anthony Mills <amills@pyramid6.com>
  14   * @version $Revision: 18844 $
  15   * @since   Horde 3.0
  16   * @package Horde_SyncML
  17   */
  18  class Horde_SyncML_Sync_RefreshFromServerSync extends Horde_SyncML_Sync {
  19  
  20      function endSync($currentCmdID, &$output)
  21      {
  22          global $registry;
  23          $state = &$_SESSION['SyncML.state'];
  24          
  25          // counter for synced items
  26          $syncItems = 0;
  27  
  28      if(!$adds = &$state->getAddedItems($hordeType))
  29      {
  30          Horde::logMessage("SyncML: reading list of added items", __FILE__, __LINE__, PEAR_LOG_DEBUG);
  31          $adds = $registry->call($this->targetLocURI, '/list', array());
  32          $adds = &$state->getAddedItems($hordeType);
  33      }
  34      Horde::logMessage("SyncML: ....... ".count($adds).' items to send ..............', __FILE__, __LINE__, PEAR_LOG_DEBUG);
  35      
  36      #foreach ($add as $adds) {
  37      while($guid = array_shift($adds))
  38      {
  39              $locid = $this->_currentState->getLocID($this->targetLocURI, $guid);
  40              // Add a replace.
  41              $add = &new Horde_SyncML_Command_Sync_ContentSyncElement();
  42  
  43              $add->setContent($registry->call($this->targetLocURI . '/listByAction',
  44                                               array($this->_currentState->getPreferedContentType($this->targetLocURI))));
  45                                               
  46          $currentCmdID = $add->outputCommand($currentCmdID, $output, 'Add');
  47          
  48          $syncItems++;
  49          // return if we have to much data
  50          if($syncItems >= MAX_ENTRIES)
  51          {
  52              $state->setMoreDataPending();
  53              return $currentCmdID;
  54          }
  55      }
  56      
  57      // TODO deletes
  58      
  59      // TODO modifies
  60  
  61          return $currentCmdID;
  62      }
  63  
  64  }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7