/** * 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; }
/** * Init map creation/update form */ function initCharacteristicForm($a_target, $a_types) { global $ilCtrl, $lng; // edit form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTitle($this->lng->txt("cont_choose_characteristic")); if ($a_types["par"] == "par") { $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_text"), "char_par"); include_once "./Services/COPage/classes/class.ilPCParagraphGUI.php"; $options = ilPCParagraphGUI::_getCharacteristics($this->page_gui->getStyleId()); $select_prop->setOptions($options); $this->form->addItem($select_prop); } if ($a_types["sec"] == "sec") { $select_prop = new ilSelectInputGUI($this->lng->txt("cont_choose_characteristic_section"), "char_sec"); include_once "./Services/COPage/classes/class.ilPCSectionGUI.php"; $options = ilPCSectionGUI::_getCharacteristics($this->page_gui->getStyleId()); $select_prop->setOptions($options); $this->form->addItem($select_prop); } foreach ($a_target as $t) { $hidden = new ilHiddenInputGUI("target[]"); $hidden->setValue($t); $this->form->addItem($hidden); } $this->form->setFormAction($ilCtrl->getFormAction($this)); $this->form->addCommandButton("assignCharacteristic", $lng->txt("save")); $this->form->addCommandButton("showPage", $lng->txt("cancel")); }