43 $this->help_map =
$DIC->help()->internal()->domain()->map();
44 $this->lom_services =
$DIC->learningObjectMetadata();
47 public function delete(
bool $a_delete_meta_data =
true):
void
50 $this->help_map->removeScreenIdsOfChapter($this->
getId());
52 $node_data = $this->tree->getNodeData($this->
getId());
53 $this->
delete_rec($this->tree, $a_delete_meta_data);
54 $this->tree->deleteTree($node_data);
62 bool $a_delete_meta_data =
true
64 $childs = $a_tree->getChilds($this->
getId());
65 foreach ($childs as $child) {
67 if (is_object($obj)) {
68 if ($obj->getType() ==
"st") {
69 $obj->delete_rec($a_tree, $a_delete_meta_data);
71 if ($obj->getType() ==
"pg") {
72 $obj->delete($a_delete_meta_data);
77 parent::delete($a_delete_meta_data);
88 if ($this->getLMId() != $a_target_lm->
getId()) {
89 $chap->setImportId(
"il__st_" . $this->
getId());
91 $chap->setLMId($a_target_lm->
getId());
92 $chap->setType($this->getType());
93 $chap->setDescription($this->getDescription());
95 $a_copied_nodes[$this->
getId()] = $chap->getId();
98 $this->lom_services->derive()
99 ->fromObject($this->getLMId(), $this->
getId(), $this->getType())
100 ->forObject($a_target_lm->
getId(), $chap->getId(), $this->getType());
114 $expLog->write(date(
"[y-m-d H:i:s] ") .
"Structure Object " . $this->
getId());
116 $a_xml_writer->
xmlStartTag(
"StructureObject", $attrs);
119 $this->exportXMLMetaData($a_xml_writer);
122 $this->exportXMLPageObjects($a_xml_writer, $a_inst);
125 $this->exportXMLStructureObjects($a_xml_writer, $a_inst, $expLog);
127 $a_xml_writer->
xmlEndTag(
"StructureObject");
146 public function modifyExportIdentifier(
151 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
160 string $a_mode = self::CHAPTER_TITLE,
161 bool $a_include_numbers =
false,
162 bool $a_time_scheduled_activation =
false,
163 bool $a_force_content =
false,
165 string $a_lang =
"-",
166 bool $a_include_short =
false
182 if ($a_include_short) {
189 $ot = (
new TranslationsRepository(
$ilDB))->getFor($a_lm_id);
191 if ($a_lang !=
"-" && $ot->getContentTranslationActivated()) {
194 if ($a_include_short) {
195 $trans_title = trim($lmobjtrans->getShortTitle());
197 if ($trans_title ==
"") {
198 $trans_title = $lmobjtrans->getTitle();
200 if ($trans_title ==
"") {
202 $trans_title = $lmobjtrans->getTitle();
204 if ($trans_title !=
"") {
205 $title = $trans_title;
212 if ($a_include_numbers) {
218 $query =
"SELECT * FROM lm_tree WHERE child = " .
219 $ilDB->quote($a_st_id,
"integer") .
" AND lm_id = " .
220 $ilDB->quote($a_lm_id,
"integer");
221 $tree_set =
$ilDB->query($query);
223 $depth = $tree_node[
"depth"];
226 for ($i = $depth - 1; $i > 1; $i--) {
228 $query =
"SELECT * FROM lm_tree WHERE child = " .
229 $ilDB->quote($tree_node[
"parent"],
"integer") .
" AND lm_id = " .
230 $ilDB->quote($a_lm_id,
"integer");
231 $tree_set =
$ilDB->query($query);
235 $nr = $seq .
"." . $nr;
247 $childs = $this->tree->getChilds($this->
getId());
248 foreach ($childs as $child) {
249 if ($child[
"type"] !=
"pg") {
263 $childs = $this->tree->getChilds($this->
getId());
264 foreach ($childs as $child) {
265 if ($child[
"type"] !=
"st") {
271 $this->getContentObject(),
274 $structure_obj->exportXML($a_xml_writer, $a_inst, $expLog);
275 unset($structure_obj);
288 foreach ($childs as $child) {
289 if ($child[
"type"] ==
"st") {
290 $chapters[] = $child;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static copy(string $a_source_id, string $a_target_id)
Copy all translations of an object.
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
static _lookupShortTitle(int $a_obj_id)
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _lookupTitle(int $a_obj_id)
setTitle(string $a_title)
static _exportXMLAlias(ilXmlWriter $a_xml_writer, int $a_id, int $a_inst=0)
export page alias to xml
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_tree_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
exportXMLStructureObjects(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
exportXML(ilXmlWriter $a_xml_writer, int $a_inst, ilLog $expLog)
__construct(ilObjLearningModule $a_content_obj, int $a_id=0)
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
ILIAS Help Map MapManager $help_map
copy(ilObjLearningModule $a_target_lm)
copy chapter
LOMServices $lom_services
exportXMLMetaData(ilXmlWriter $a_xml_writer)
delete_rec(ilLMTree $a_tree, bool $a_delete_meta_data=true)
Delete sub tree.
static getChapterList(int $a_lm_id)
exportXMLPageObjects(ilXmlWriter $a_xml_writer, int $a_inst=0)
getChildSequenceNumber(array $a_node, string $type="")
get sequence number of node in sibling sequence
isInTree(?int $a_node_id)
get all information of a node.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))