/** * Copy characteristic * * @param * @return */ function copyCharacteristic($a_from_style_id, $a_from_type, $a_from_char, $a_to_char) { global $ilDB; if (!$this->characteristicExists($a_to_char, $a_from_type)) { $this->addCharacteristic($a_from_type, $a_to_char); } $this->deleteStyleParOfChar($a_from_type, $a_to_char); $from_style = new ilObjStyleSheet($a_from_style_id); $pars = $from_style->getParametersOfClass($a_from_type, $a_from_char); $colors = array(); foreach ($pars as $p => $v) { if (substr($v, 0, 1) == "!") { $colors[] = substr($v, 1); } $this->replaceStylePar(ilObjStyleSheet::_determineTag($a_from_type), $a_to_char, $p, $v, $a_from_type); } // copy colors foreach ($colors as $c) { if (!$this->colorExists($c)) { $this->addColor($c, $from_style->getColorCodeForName($c)); } } }