public function getLine() { $cl = new File_iCal_ContentLine($this); $r = $cl->getLine(); unset($cl); return $r; }
public function getCalendar($fold = true, $wrap_length = 72) { $r = array(); require_once 'File/iCal/ContentLine.php'; $header = new File_iCal_ContentLine("BEGIN:VCALENDAR"); $footer = new File_iCal_ContentLine("END:VCALENDAR"); //add the header first thing $r[] = $header->getProperty(); //add on all calendar properties foreach ($this->_properties as $prop) { $r[] = $prop; } //echo '<PRE>'; print_r($this->_components); //add on all calendar components foreach ($this->_components as $v) { $r = array_merge($r, $v->getPropertyArray()); } //finally add the footer $r[] = $footer->getProperty(); $s = ""; foreach ($r as $prop) { if (!is_a($prop, "File_iCal_Property")) { //print_r($prop); } else { $line = $prop->getLine(); if ($fold) { $arr = array(); for ($i = 0; $i <= strlen($line) / $wrap_length; $i++) { $arr[] = substr($line, $i * $wrap_length, $wrap_length); } for ($i = 0; $i < count($arr) - 1; $i++) { $s .= $arr[$i] . "\r\n "; } $s .= $arr[count($arr) - 1] . "\r\n"; } else { $s .= $line; } } } return $s; }