/** * Get characteristics */ static function _getCharacteristics($a_style_id) { $st_chars = ilPCParagraphGUI::_getStandardCharacteristics(); $chars = ilPCParagraphGUI::_getStandardCharacteristics(); if ($a_style_id > 0 && ilObject::_lookupType($a_style_id) == "sty") { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet($a_style_id); $types = array("text_block", "heading1", "heading2", "heading3"); $chars = array(); foreach ($types as $t) { $chars = array_merge($chars, $style->getCharacteristics($t)); } $new_chars = array(); foreach ($chars as $char) { if ($st_chars[$char] != "") { $new_chars[$char] = $st_chars[$char]; } else { $new_chars[$char] = $char; } asort($new_chars); } $chars = $new_chars; } return $chars; }
/** * Get characteristics */ static function _getCharacteristics($a_style_id) { $chars = ilPCSectionGUI::_getStandardCharacteristics(); if ($a_style_id > 0 && ilObject::_lookupType($a_style_id) == "sty") { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet($a_style_id); $chars = $style->getCharacteristics("section"); $new_chars = array(); foreach ($chars as $char) { if ($chars[$char] != "") { $new_chars[$char] = $chars[$char]; } else { $new_chars[$char] = $char; } asort($new_chars); } $chars = $new_chars; } return $chars; }
/** * Get characteristics of current style */ protected function getCharacteristicsOfCurrentStyle($a_type) { if ($this->getStyleId() > 0 && ilObject::_lookupType($this->getStyleId()) == "sty") { include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $style = new ilObjStyleSheet($this->getStyleId()); $chars = array(); if (!is_array($a_type)) { $a_type = array($a_type); } foreach ($a_type as $at) { $chars = array_merge($chars, $style->getCharacteristics($at, true)); } $new_chars = array(); if (is_array($chars)) { foreach ($chars as $char) { if ($this->chars[$char] != "") { $new_chars[$char] = $this->chars[$char]; } else { $new_chars[$char] = $char; } asort($new_chars); } } $this->setCharacteristics($new_chars); } }