ILIAS  release_8 Revision v8.24
ilLMPresentationStatus Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLMPresentationStatus:

Public Member Functions

 __construct (ilObjUser $user, ilObjLearningModule $lm, ilLMTree $lm_tree, string $requested_transl="", string $requested_focus_id="", string $requested_focus_return="", string $requested_search_string="", bool $offline=false, bool $export_all_languages=false, string $export_format="", bool $embed_mode=false)
 
 getLang ()
 
 getConcreteLang ()
 Only difference to getLang(): if current language is the master lang the language key will be returned, not "-". More...
 
 getFocusId ()
 
 getFocusReturn ()
 
 getSearchString ()
 
 offline ()
 
 getEmbedMode ()
 
 exportAllLanguages ()
 
 getExportFormat ()
 
 getLMPresentationTitle ()
 
 isTocNecessary ()
 Is TOC necessary, see #30027 Check if at least two entries will be shown. More...
 

Data Fields

bool $offline
 

Protected Member Functions

 init ()
 

Protected Attributes

string $export_format
 
bool $export_all_languages
 
ilObjUser $user
 
string $requested_search_string
 
ilLMTree $lm_tree
 
string $requested_focus_return
 
string $requested_focus_id
 
string $requested_transl
 
ilObjectTranslation $ot
 
ilObjLearningModule $lm
 
string $lang
 
int $focus_id = 0
 
 $concrete_lang = ""
 
 $embed_mode = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Contains info on offline mode, focus, translation, etc.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilLMPresentationStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMPresentationStatus::__construct ( ilObjUser  $user,
ilObjLearningModule  $lm,
ilLMTree  $lm_tree,
string  $requested_transl = "",
string  $requested_focus_id = "",
string  $requested_focus_return = "",
string  $requested_search_string = "",
bool  $offline = false,
bool  $export_all_languages = false,
string  $export_format = "",
bool  $embed_mode = false 
)

Definition at line 42 of file class.ilLMPresentationStatus.php.

54 {
55 $this->lm = $lm;
57 $this->requested_transl = $requested_transl;
58 $this->requested_focus_id = $requested_focus_id;
59 $this->requested_focus_return = $requested_focus_return;
60 $this->requested_search_string = $requested_search_string;
61 $this->user = $user;
62 $this->lm_tree = $lm_tree;
63 $this->offline = $offline;
64 $this->export_all_languages = $export_all_languages;
65 $this->export_format = $export_format;
66 $this->embed_mode = $embed_mode;
67 $this->init();
68 }
static getInstance(int $obj_id)

References $embed_mode, $export_all_languages, $export_format, $lm, $lm_tree, $offline, $requested_focus_id, $requested_focus_return, $requested_search_string, $requested_transl, $user, ilObject\getId(), ilObjectTranslation\getInstance(), init(), offline(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ exportAllLanguages()

ilLMPresentationStatus::exportAllLanguages ( )

Definition at line 133 of file class.ilLMPresentationStatus.php.

133 : bool
134 {
136 }

References $export_all_languages.

◆ getConcreteLang()

ilLMPresentationStatus::getConcreteLang ( )

Only difference to getLang(): if current language is the master lang the language key will be returned, not "-".

Definition at line 103 of file class.ilLMPresentationStatus.php.

103 : string
104 {
106 }

References $concrete_lang.

◆ getEmbedMode()

ilLMPresentationStatus::getEmbedMode ( )

Definition at line 128 of file class.ilLMPresentationStatus.php.

128 : bool
129 {
130 return $this->embed_mode;
131 }

References $embed_mode.

◆ getExportFormat()

ilLMPresentationStatus::getExportFormat ( )

Definition at line 138 of file class.ilLMPresentationStatus.php.

138 : string
139 {
141 }

References $export_format.

◆ getFocusId()

ilLMPresentationStatus::getFocusId ( )

Definition at line 108 of file class.ilLMPresentationStatus.php.

108 : int
109 {
110 return $this->focus_id;
111 }

References $focus_id.

◆ getFocusReturn()

ilLMPresentationStatus::getFocusReturn ( )

Definition at line 113 of file class.ilLMPresentationStatus.php.

113 : string
114 {
116 }

References $requested_focus_return.

◆ getLang()

ilLMPresentationStatus::getLang ( )

Definition at line 94 of file class.ilLMPresentationStatus.php.

94 : string
95 {
96 return $this->lang;
97 }

References $lang.

◆ getLMPresentationTitle()

ilLMPresentationStatus::getLMPresentationTitle ( )

Definition at line 143 of file class.ilLMPresentationStatus.php.

143 : string
144 {
145 if ($this->offline() && $this->lang != "" && $this->lang != "-") {
146 $ltitle = "";
147 $ot = $this->ot;
149 $ltitle = $data[$this->lang]->getTitle();
150 if ($ltitle !== "") {
151 return $ltitle;
152 }
153 $fb = $ot->getFallbackLanguage();
154 if (isset($data[$fb])) {
155 $ltitle = $data[$fb]->getTitle();
156 }
157 if ($ltitle !== "") {
158 return $ltitle;
159 }
160 }
161 return $this->lm->getTitle();
162 }

References $data, $lang, $ot, ilObjectTranslation\getFallbackLanguage(), ilObjectTranslation\getLanguages(), and offline().

+ Here is the call graph for this function:

◆ getSearchString()

ilLMPresentationStatus::getSearchString ( )

Definition at line 118 of file class.ilLMPresentationStatus.php.

118 : string
119 {
121 }

References $requested_search_string.

◆ init()

ilLMPresentationStatus::init ( )
protected

Definition at line 70 of file class.ilLMPresentationStatus.php.

70 : void
71 {
72 // determine language
73 $this->lang = "-";
74 $this->concrete_lang = "-";
75 if ($this->ot->getContentActivated()) {
76 $langs = $this->ot->getLanguages();
77 if (isset($langs[$this->requested_transl]) || $this->requested_transl == $this->ot->getMasterLanguage()) {
78 $this->lang = $this->requested_transl;
79 } else {
80 $this->lang = $this->user->getCurrentLanguage();
81 }
82 $this->concrete_lang = $this->lang;
83 if ($this->lang == $this->ot->getMasterLanguage()) {
84 $this->lang = "-";
85 }
86 }
87
88 // determin focus id
89 if ($this->requested_focus_id > 0 && $this->lm_tree->isInTree($this->requested_focus_id)) {
90 $this->focus_id = $this->requested_focus_id;
91 }
92 }

References $lang, $requested_focus_id, $requested_transl, and ILIAS\Repository\user().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTocNecessary()

ilLMPresentationStatus::isTocNecessary ( )

Is TOC necessary, see #30027 Check if at least two entries will be shown.

Definition at line 168 of file class.ilLMPresentationStatus.php.

168 : bool
169 {
170 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
171 if (count($childs) == 0) { // no chapter -> false
172 return false;
173 }
174 if (count($childs) > 1) { // more than one chapter -> true
175 return true;
176 }
177 if ($this->lm->getTOCMode() != "pages") { // one chapter TOC does not show pages -> false
178 return false;
179 }
180 $current_chapter = current($childs);
181 $childs = $this->lm_tree->getChilds($current_chapter["child"]);
182 if (count($childs) > 1) {
183 return true; // more than one page -> true
184 }
185 return false; // zero or one page -> false
186 }

◆ offline()

ilLMPresentationStatus::offline ( )

Definition at line 123 of file class.ilLMPresentationStatus.php.

123 : bool
124 {
125 return $this->offline;
126 }

References $offline.

Referenced by __construct(), and getLMPresentationTitle().

+ Here is the caller graph for this function:

Field Documentation

◆ $concrete_lang

ilLMPresentationStatus::$concrete_lang = ""
protected

Definition at line 39 of file class.ilLMPresentationStatus.php.

Referenced by getConcreteLang().

◆ $embed_mode

ilLMPresentationStatus::$embed_mode = false
protected

Definition at line 40 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and getEmbedMode().

◆ $export_all_languages

bool ilLMPresentationStatus::$export_all_languages
protected

Definition at line 27 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and exportAllLanguages().

◆ $export_format

string ilLMPresentationStatus::$export_format
protected

Definition at line 26 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and getExportFormat().

◆ $focus_id

int ilLMPresentationStatus::$focus_id = 0
protected

Definition at line 38 of file class.ilLMPresentationStatus.php.

Referenced by getFocusId().

◆ $lang

string ilLMPresentationStatus::$lang
protected

Definition at line 37 of file class.ilLMPresentationStatus.php.

Referenced by getLang(), getLMPresentationTitle(), and init().

◆ $lm

ilObjLearningModule ilLMPresentationStatus::$lm
protected

Definition at line 36 of file class.ilLMPresentationStatus.php.

Referenced by __construct().

◆ $lm_tree

ilLMTree ilLMPresentationStatus::$lm_tree
protected

Definition at line 31 of file class.ilLMPresentationStatus.php.

Referenced by __construct().

◆ $offline

bool ilLMPresentationStatus::$offline

Definition at line 28 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and offline().

◆ $ot

ilObjectTranslation ilLMPresentationStatus::$ot
protected

Definition at line 35 of file class.ilLMPresentationStatus.php.

Referenced by getLMPresentationTitle().

◆ $requested_focus_id

string ilLMPresentationStatus::$requested_focus_id
protected

Definition at line 33 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and init().

◆ $requested_focus_return

string ilLMPresentationStatus::$requested_focus_return
protected

Definition at line 32 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and getFocusReturn().

◆ $requested_search_string

string ilLMPresentationStatus::$requested_search_string
protected

Definition at line 30 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and getSearchString().

◆ $requested_transl

string ilLMPresentationStatus::$requested_transl
protected

Definition at line 34 of file class.ilLMPresentationStatus.php.

Referenced by __construct(), and init().

◆ $user

ilObjUser ilLMPresentationStatus::$user
protected

Definition at line 29 of file class.ilLMPresentationStatus.php.

Referenced by __construct().


The documentation for this class was generated from the following file: