{
$title = $request["title"];
$location = $request["location"];
- $categories = isset($request["categories"]) ? $request["categories"] : null;
+ $categories = isset($request["categories"]) ? $request["categories"] : array();
$allday = isset($request["allday"]);
$from = $request["from"];
$to = $request["to"];
}
unset($vevent->DURATION);
-
$vevent->setString('LOCATION', $location);
-
- if($description != ""){
- $vevent->DESCRIPTION = $description;
- }else{
- unset($vevent->DESCRIPTION);
- }
-
- if(!empty($categories)){
- $vevent->CATEGORIES = join(',', $categories);
- }else{
- unset($vevent->CATEGORIES);
- }
+ $vevent->setString('DESCRIPTION', $description);
+ $vevent->setString('CATEGORIES', join(',', $categories));
/*if($repeat == "true"){
$vevent->RRULE = $repeat;
}
return $vobject;
} catch (Exception $e) {
+ OC_Log::write('vobject', $e->getMessage(), OC_Log::ERROR);
return null;
}
}
public function setString($name, $string){
if ($string != ''){
+ $string = strtr($string, array("\r\n"=>"\n"));
$this->vobject->__set($name, $string);
}else{
$this->vobject->__unset($name);
return $this->vobject->__unset($name);
}
+ public function __isset($name){
+ return $this->vobject->__isset($name);
+ }
+
public function __call($function,$arguments){
return call_user_func_array(array($this->vobject, $function), $arguments);
}