Esempio n. 1
0
 /**
  * creates formatted output for calendar property x-prop, iCal format only
  *
  * @author Kjell-Inge Gustafsson <*****@*****.**>
  * @since 2.4.11 - 2008-11-03
  * @return string
  */
 function createXprop()
 {
     if ('xcal' == $this->format) {
         return false;
     }
     if (0 >= count($this->xprop)) {
         return;
     }
     $output = null;
     $toolbox = new calendarComponent();
     $toolbox->setConfig('language', $this->getConfig('language'));
     $toolbox->setConfig('nl', $this->getConfig('nl'));
     $toolbox->_createFormat($this->getConfig('format'));
     foreach ($this->xprop as $label => $xpropPart) {
         if (empty($xpropPart['value'])) {
             $output .= $toolbox->_createElement($label);
             continue;
         }
         $attributes = $toolbox->_createParams($xpropPart['params'], array('LANGUAGE'));
         if (is_array($xpropPart['value'])) {
             foreach ($xpropPart['value'] as $pix => $theXpart) {
                 $xpropPart['value'][$pix] = $toolbox->_strrep($theXpart);
             }
             $xpropPart['value'] = implode(',', $xpropPart['value']);
         } else {
             $xpropPart['value'] = $toolbox->_strrep($xpropPart['value']);
         }
         $output .= $toolbox->_createElement($label, $attributes, $xpropPart['value']);
     }
     return $output;
 }
Esempio n. 2
0
 /**
  * creates formatted output for calendar property x-prop, iCal format only
  *
  * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**>
  * @since 2.10.16 - 2011-11-01
  * @return string
  */
 function createXprop()
 {
     if (empty($this->xprop) || !is_array($this->xprop)) {
         return FALSE;
     }
     $output = null;
     $toolbox = new calendarComponent();
     $toolbox->setConfig($this->getConfig());
     foreach ($this->xprop as $label => $xpropPart) {
         if (!isset($xpropPart['value']) || empty($xpropPart['value']) && !is_numeric($xpropPart['value'])) {
             $output .= $toolbox->_createElement($label);
             continue;
         }
         $attributes = $toolbox->_createParams($xpropPart['params'], array('LANGUAGE'));
         if (is_array($xpropPart['value'])) {
             foreach ($xpropPart['value'] as $pix => $theXpart) {
                 $xpropPart['value'][$pix] = $toolbox->_strrep($theXpart);
             }
             $xpropPart['value'] = implode(',', $xpropPart['value']);
         } else {
             $xpropPart['value'] = $toolbox->_strrep($xpropPart['value']);
         }
         $output .= $toolbox->_createElement($label, $attributes, $xpropPart['value']);
         if (is_array($toolbox->xcaldecl) && 0 < count($toolbox->xcaldecl)) {
             foreach ($toolbox->xcaldecl as $localxcaldecl) {
                 $this->xcaldecl[] = $localxcaldecl;
             }
         }
     }
     return $output;
 }