/** * view list of styles */ function editContentStylesObject() { global $rbacsystem, $ilias, $tpl, $ilToolbar, $ilCtrl, $lng; if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE); } // this may not be cool, if styles are organised as (independent) Service include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php"; include_once "./Services/Style/classes/class.ilObjStyleSheet.php"; $from_styles = $to_styles = $data = array(); $styles = $this->object->getStyles(); foreach ($styles as $style) { $style["active"] = ilObjStyleSheet::_lookupActive($style["id"]); $style["lm_nr"] = ilObjContentObject::_getNrOfAssignedLMs($style["id"]); $data[$style["title"] . ":" . $style["id"]] = $style; if ($style["lm_nr"] > 0) { $from_styles[$style["id"]] = $style["title"]; } if ($style["active"] > 0) { $to_styles[$style["id"]] = $style["title"]; } } // number of individual styles if ($fixed_style <= 0) { $data[-1] = array("title" => $this->lng->txt("sty_individual_styles"), "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsIndividualStyles()); $from_styles[-1] = $this->lng->txt("sty_individual_styles"); } // number of default style (fallback default style) if ($default_style <= 0 && $fixed_style <= 0) { $data[0] = array("title" => $this->lng->txt("sty_default_style"), "id" => 0, "lm_nr" => ilObjContentObject::_getNrLMsNoStyle()); $from_styles[0] = $this->lng->txt("sty_default_style"); $to_styles[0] = $this->lng->txt("sty_default_style"); } if ($rbacsystem->checkAccess("write", $this->object->getRefId())) { $ilToolbar->addButton($lng->txt("sty_add_content_style"), $ilCtrl->getLinkTarget($this, "createStyle")); $ilToolbar->addSeparator(); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; // from styles selector $si = new ilSelectInputGUI($lng->txt("sty_move_lm_styles") . ": " . $lng->txt("sty_from"), "from_style"); $si->setOptions($from_styles); $ilToolbar->addInputItem($si, true); // from styles selector $si = new ilSelectInputGUI($lng->txt("sty_to"), "to_style"); $si->setOptions($to_styles); $ilToolbar->addInputItem($si, true); $ilToolbar->addFormButton($lng->txt("sty_move_style"), "moveLMStyles"); $ilToolbar->setFormAction($ilCtrl->getFormAction($this)); } include_once "./Services/Style/classes/class.ilContentStylesTableGUI.php"; $table = new ilContentStylesTableGUI($this, "editContentStyles", $data, $this->object); $tpl->setContent($table->getHTML()); }