30 string $requested_transl =
"",
31 string $requested_focus_id =
"",
32 string $requested_focus_return =
"",
33 string $requested_search_string =
"",
35 bool $export_all_languages,
40 $this->requested_transl = (string) $requested_transl;
41 $this->requested_focus_id = $requested_focus_id;
42 $this->requested_focus_return = $requested_focus_return;
43 $this->requested_search_string = $requested_search_string;
45 $this->lm_tree = $lm_tree;
47 $this->export_all_languages = $export_all_languages;
48 $this->export_format = $export_format;
59 if ($this->ot->getContentActivated()) {
60 $langs = $this->ot->getLanguages();
61 if (isset($langs[$this->requested_transl]) || $this->requested_transl == $this->ot->getMasterLanguage()) {
62 $this->lang = $this->requested_transl;
63 } elseif (isset($langs[$this->
user->getCurrentLanguage()])) {
64 $this->lang = $this->
user->getCurrentLanguage();
66 if ($this->lang == $this->ot->getMasterLanguage()) {
72 if ($this->requested_focus_id > 0 && $this->lm_tree->isInTree($this->requested_focus_id)) {
73 $this->focus_id = $this->requested_focus_id;
100 return $this->requested_focus_return;
108 return $this->requested_search_string;
116 return $this->offline;
124 return $this->export_all_languages;
132 return $this->export_format;
142 if ($this->
offline() && $this->lang !=
"" && $this->lang !=
"-") {
144 $data = $ot->getLanguages();
150 return $this->lm->getTitle();
160 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
161 if (count($childs) == 0) {
164 if (count($childs) > 1) {
167 if ($this->lm->getTOCMode() !=
"pages") {
170 $current_chapter = current($childs);
171 $childs = $this->lm_tree->getChilds($current_chapter[
"child"]);
172 if (count($childs) > 1) {
Class ilObjLearningModule.
__construct(ilObjUser $user, ilObjLearningModule $lm, ilLMTree $lm_tree, string $requested_transl="", string $requested_focus_id="", string $requested_focus_return="", string $requested_search_string="", string $offline, bool $export_all_languages, string $export_format)
Constructor.
getLMPresentationTitle()
Get lm presentationtitle.
Contains info on offline mode, focus, translation, etc.
getLang()
Get language key.
isTocNecessary()
Is TOC necessary, see #30027 Check if at least two entries will be shown.
getId()
get object id public
static getInstance($a_obj_id)
Get instance.