/** * clone style sheet (note: styles have no ref ids and return an object id) * * @access public * @return integer new obj id */ function ilClone() { global $log, $lng; $lng->loadLanguageModule("style"); $new_obj = new ilObjStyleSheet(); $new_obj->setTitle($this->getTitle() . " (" . $lng->txt("sty_acopy") . ")"); $new_obj->setType($this->getType()); $new_obj->setDescription($this->getDescription()); $new_obj->create($this->getId()); $new_obj->writeStyleSetting("disable_auto_margins", $this->lookupStyleSetting("disable_auto_margins")); return $new_obj->getId(); }
/** * save style sheet */ function saveObject() { if (!trim($_POST["style_title"])) { $this->ctrl->redirect($this, "create"); } //echo "HH"; exit; $class_name = "ilObjStyleSheet"; require_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $newObj = new ilObjStyleSheet(); $newObj->setTitle("-"); $newObj->create(); $newObj->setTitle(ilUtil::stripSlashes($_POST["style_title"])); $newObj->setDescription(ilUtil::stripSlashes($_POST["style_description"])); $newObj->update(); // assign style to style sheet folder, // if parent is style sheet folder if ($_GET["ref_id"] > 0) { $fold =& ilObjectFactory::getInstanceByRefId($_GET["ref_id"]); if ($fold->getType() == "stys") { $fold->addStyle($newObj->getId()); $fold->update(); ilObjStyleSheet::_writeStandard($newObj->getId(), "1"); $this->ctrl->redirectByClass("ilobjstylesettingsgui", "editContentStyles"); } } return $newObj->getId(); }