function createFreebusy() {
    $cnt = count( $this->freebusy );
    if( 0 >= $cnt )
      return;
    $output = null;
    foreach( $this->freebusy as $freebusyPart ) {
      $attributes = $content = null;
      if( isset( $freebusyPart['value']['fbtype'] )) {
        $attributes .= $this->intAttrDelimiter.'FBTYPE='.$freebusyPart['value']['fbtype'];
        unset( $freebusyPart['value']['fbtype'] );
        $freebusyPart['value'] = array_values( $freebusyPart['value'] );
      }
      else
        $attributes .= $this->intAttrDelimiter.'FBTYPE=BUSY';
      $attributes .= $this->_createParams( $freebusyPart['params'] );
      $fno = 1;
      $cnt = count( $freebusyPart['value']);
      foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) {
        $formatted   = $this->_format_date_time( $freebusyPeriod[0] );
        $content .= $formatted;
        $content .= '/';
        $cnt2 = count( $freebusyPeriod[1]);
        if( array_key_exists( 'year', $freebusyPeriod[1] ))      // date-time
          $cnt2 = 7;
        elseif( array_key_exists( 'week', $freebusyPeriod[1] ))  // duration
          $cnt2 = 5;
        if(( 7 == $cnt2 )   &&    // period=  -> date-time
            isset( $freebusyPeriod[1]['year'] )  &&
            isset( $freebusyPeriod[1]['month'] ) &&
            isset( $freebusyPeriod[1]['day'] )) {
          $content .= $this->_format_date_time( $freebusyPeriod[1] );
        }
        else {                                  // period=  -> dur-time
          $content .= $this->_format_duration( $freebusyPeriod[1] );
        }
        if( $fno < $cnt )
          $content .= ',';
        $fno++;
      }
      $output .= $this->_createElement( 'FREEBUSY', $attributes, $content );
    }
    return $output;
  }
function createFreebusy() {
    $cnt = count( $this->freebusy );
    if( 0 >= $cnt )
      return;
    $output = null;
    foreach( $this->freebusy as $freebusyPart ) {
      $attributes = $content = null;
      if( isset( $freebusyPart['value']['fbtype'] )) {
        $attributes .= $this->intAttrDelimiter.'FBTYPE='.$freebusyPart['value']['fbtype'];
        unset( $freebusyPart['value']['fbtype'] );
        $freebusyPart['value'] = array_values( $freebusyPart['value'] );
      }
      else
        $attributes .= $this->intAttrDelimiter.'FBTYPE=BUSY';
      $attributes .= $this->_createParams( $freebusyPart['params'] );
      $fno = 1;
      $cnt = count( $freebusyPart['value']);
      foreach( $freebusyPart['value'] as $periodix => $freebusyPeriod ) {
        $formatted   = $this->_format_date_time( $freebusyPeriod[0] );
        $content .= $formatted;
        $content .= '/';
        $cnt2 = count( $freebusyPeriod[1]);
        if( array_key_exists( 'year', $freebusyPeriod[1] ))      // date-time
          $cnt2 = 7;
        elseif( array_key_exists( 'week', $freebusyPeriod[1] ))  // duration
          $cnt2 = 5;
        if(( 7 == $cnt2 )   &&    // period=  -> date-time
            isset( $freebusyPeriod[1]['year'] )  &&
            isset( $freebusyPeriod[1]['month'] ) &&
            isset( $freebusyPeriod[1]['day'] )) {
          $content .= $this->_format_date_time( $freebusyPeriod[1] );
        }
        else {                                  // period=  -> dur-time
          $content .= $this->_format_duration( $freebusyPeriod[1] );
        }
        if( $fno < $cnt )
          $content .= ',';
        $fno++;
      }
      $output .= $this->_createElement( 'FREEBUSY', $attributes, $content );
    }
    return $output;
  }
function createFreebusy ( ) { $ cnt = count ( $ this -> freebusy ) ; if ( 0 >= $ cnt ) return ; $ output = null ; foreach ( $ this -> freebusy as $ freebusyPart ) { $ attributes = $ content = null ; if ( isset ( $ freebusyPart [ 'value' ] [ 'fbtype' ] ) ) { $ attributes .= $ this -> intAttrDelimiter . 'FBTYPE=' . $ freebusyPart [ 'value' ] [ 'fbtype' ] ; unset ( $ freebusyPart [ 'value' ] [ 'fbtype' ] ) ; $ freebusyPart [ 'value' ] = array_values ( $ freebusyPart [ 'value' ] ) ; } else $ attributes .= $ this -> intAttrDelimiter . 'FBTYPE=BUSY' ; $ attributes .= $ this -> _createParams ( $ freebusyPart [ 'params' ] ) ; $ fno = 1 ; $ cnt = count ( $ freebusyPart [ 'value' ] ) ; foreach ( $ freebusyPart [ 'value' ] as $ periodix => $ freebusyPeriod ) { $ formatted = $ this -> _format_date_time ( $ freebusyPeriod [ 0 ] ) ; $ content .= $ formatted ; $ content .= '/' ; $ cnt2 = count ( $ freebusyPeriod [ 1 ] ) ; if ( array_key_exists ( 'year' , $ freebusyPeriod [ 1 ] ) ) // date-time $ cnt2 = 7 ; elseif ( array_key_exists ( 'week' , $ freebusyPeriod [ 1 ] ) ) // duration $ cnt2 = 5 ; if ( ( 7 == $ cnt2 ) && // period=  -> date-time isset ( $ freebusyPeriod [ 1 ] [ 'year' ] ) && isset ( $ freebusyPeriod [ 1 ] [ 'month' ] ) && isset ( $ freebusyPeriod [ 1 ] [ 'day' ] ) ) { $ content .= $ this -> _format_date_time ( $ freebusyPeriod [ 1 ] ) ; } else { // period=  -> dur-time $ content .= $ this -> _format_duration ( $ freebusyPeriod [ 1 ] ) ; } if ( $ fno < $ cnt ) $ content .= ',' ; $ fno ++ ; } $ output .= $ this -> _createElement ( 'FREEBUSY' , $ attributes , $ content ) ; } return $ output ; }
creates formatted output for calendar component property freebusy

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 1.x.x - 2007-05-16
@return string
creates formatted output for calendar component property freebusy