Ejemplo n.º 1
0
 /**
  * creates formatted output for calendar component property trigger
  *
  * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**>
  * @since 2.4.16 - 2008-10-21
  * @return string
  */
 function createTrigger()
 {
     if (empty($this->trigger)) {
         return FALSE;
     }
     if (empty($this->trigger['value'])) {
         return $this->getConfig('allowEmpty') ? $this->_createElement('TRIGGER') : FALSE;
     }
     $content = $attributes = null;
     if (isset($this->trigger['value']['year']) && isset($this->trigger['value']['month']) && isset($this->trigger['value']['day'])) {
         $content .= iCal_UtilityFunctions::_format_date_time($this->trigger['value']);
     } else {
         if (TRUE !== $this->trigger['value']['relatedStart']) {
             $attributes .= $this->intAttrDelimiter . 'RELATED=END';
         }
         if ($this->trigger['value']['before']) {
             $content .= '-';
         }
         $content .= iCal_UtilityFunctions::_format_duration($this->trigger['value']);
     }
     $attributes .= $this->_createParams($this->trigger['params']);
     return $this->_createElement('TRIGGER', $attributes, $content);
 }