/** * creates formatted output for calendar component property tzname * * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**> * @since 2.16.2 - 2012-12-18 * @uses calendarComponent::$tzname * @uses calendarComponent::_createParams() * @uses calendarComponent::_createElement() * @uses iCalUtilityFunctions::_strrep( * @uses calendarComponent::$format * @uses calendarComponent::$nl * @uses calendarComponent::getConfig() * @return string */ function createTzname() { if (empty($this->tzname)) { return FALSE; } $output = null; foreach ($this->tzname as $theName) { if (!empty($theName['value'])) { $attributes = $this->_createParams($theName['params'], array('LANGUAGE')); $output .= $this->_createElement('TZNAME', $attributes, iCalUtilityFunctions::_strrep($theName['value'], $this->format, $this->nl)); } elseif ($this->getConfig('allowEmpty')) { $output .= $this->_createElement('TZNAME'); } } return $output; }
/** * creates formatted output for calendar component property x-prop * * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**> * @since 2.16.2 - 2012-12-18 * @return string */ function createXprop() { if (empty($this->xprop)) { return FALSE; } $output = null; foreach ($this->xprop as $label => $xpropPart) { if (!isset($xpropPart['value']) || empty($xpropPart['value']) && !is_numeric($xpropPart['value'])) { if ($this->getConfig('allowEmpty')) { $output .= $this->_createElement($label); } continue; } $attributes = $this->_createParams($xpropPart['params'], array('LANGUAGE')); if (is_array($xpropPart['value'])) { foreach ($xpropPart['value'] as $pix => $theXpart) { $xpropPart['value'][$pix] = iCalUtilityFunctions::_strrep($theXpart, $this->format, $this->format); } $xpropPart['value'] = implode(',', $xpropPart['value']); } else { $xpropPart['value'] = iCalUtilityFunctions::_strrep($xpropPart['value'], $this->format, $this->nl); } $output .= $this->_createElement($label, $attributes, $xpropPart['value']); } return $output; }