Horde_SyncMl_Device_sync4j::sif2vnote PHP Méthode

sif2vnote() public méthode

public sif2vnote ( $sif )
    public function sif2vnote($sif)
    {
        $a = Horde_SyncMl_Device_sync4j::sif2array($sif);
        $iCal = new Horde_Icalendar();
        $iCal->setAttribute('VERSION', '1.1');
        $iCal->setAttribute('PRODID', '-//The Horde Project//SyncML//EN');
        $iCal->setAttribute('METHOD', 'PUBLISH');
        $vnote = Horde_Icalendar::newComponent('vnote', $iCal);
        $vnote->setAttribute('BODY', isset($a['Body']) ? $a['Body'] : '');
        if (isset($a['Subject'])) {
            $vnote->setAttribute('SUMMARY', $a['Subject']);
        }
        if (isset($a['Categories'])) {
            $vnote->setAttribute('CATEGORIES', $a['Categories']);
        }
        return $vnote->exportvCalendar();
    }

Usage Example

Exemple #1
0
 /**
  * Convert the content.
  */
 public function convertClient2Server($content, $contentType)
 {
     list($content, $contentType) = parent::convertClient2Server($content, $contentType);
     switch ($contentType) {
         case 'text/x-s4j-sifn':
         case 'text/x-sifn':
             $content = Horde_SyncMl_Device_sync4j::sif2vnote($content);
             $contentType = 'text/x-vnote';
             break;
         case 'text/x-s4j-sifc':
         case 'text/x-sifc':
             $content = Horde_SyncMl_Device_sync4j::sif2vcard($content);
             $contentType = 'text/x-vcard';
             break;
         case 'text/x-s4j-sife':
         case 'text/x-sife':
             $content = Horde_SyncMl_Device_sync4j::sif2vevent($content);
             $contentType = 'text/calendar';
             break;
         case 'text/x-s4j-sift':
         case 'text/x-sift':
             $content = Horde_SyncMl_Device_sync4j::sif2vtodo($content);
             $contentType = 'text/calendar';
             break;
         case 'text/calendar':
         case 'text/x-vcalendar':
             $si = $GLOBALS['backend']->state->sourceURI;
             if (stristr($si, 'fol-') !== false) {
                 // The Funambol Outlook connector uses invalid STATUS
                 // values. Actually it maps MeetingStatus values of the
                 // Outlook event to the STATUS property, which is
                 // completely useless. So drop the STATUS altogether.
                 $content = preg_replace('/^STATUS:.*\\r?\\n/im', '', $content);
             }
             break;
     }
     $GLOBALS['backend']->logFile(Horde_SyncMl_Backend::LOGFILE_DATA, "\nInput converted for server ({$contentType}):\n{$content}\n");
     return array($content, $contentType);
 }
All Usage Examples Of Horde_SyncMl_Device_sync4j::sif2vnote