/** * check index and set (an indexed) content in multiple value array * * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**> * @since 2.6.12 - 2011-01-03 * @param array $valArr * @param mixed $value * @param array $params * @param array $defaults * @param int $index * @return void */ public static function _setMval(&$valArr, $value, $params = FALSE, $defaults = FALSE, $index = FALSE) { if (!is_array($valArr)) { $valArr = array(); } if ($index) { $index = $index - 1; } elseif (0 < count($valArr)) { $keys = array_keys($valArr); $index = end($keys) + 1; } else { $index = 0; } $valArr[$index] = array('value' => $value, 'params' => iCal_UtilityFunctions::_setParams($params, $defaults)); ksort($valArr); }
/** * set calendar property x-prop * * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**> * @since 2.9.3 - 2011-05-14 * @param string $label * @param string $value * @param array $params optional * @return bool */ function setXprop($label, $value, $params = FALSE) { if (empty($label)) { return FALSE; } if (empty($value) && !is_numeric($value)) { if ($this->getConfig('allowEmpty')) { $value = null; } else { return FALSE; } } $xprop = array('value' => $value); $xprop['params'] = iCal_UtilityFunctions::_setParams($params); if (!is_array($this->xprop)) { $this->xprop = array(); } $this->xprop[strtoupper($label)] = $xprop; return TRUE; }