ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLMPresentationStatus Class Reference

Contains info on offline mode, focus, translation, etc. More...

+ Collaboration diagram for ilLMPresentationStatus:

Public Member Functions

 __construct (ilObjUser $user, ilObjLearningModule $lm, ilLMTree $lm_tree, Translations $ot, 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
 
Translations $ot
 
ilObjLearningModule $lm
 
string $lang
 
int $focus_id = 0
 
 $concrete_lang = ""
 
 $embed_mode = false
 

Detailed Description

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 26 of file class.ilLMPresentationStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilLMPresentationStatus::__construct ( ilObjUser  $user,
ilObjLearningModule  $lm,
ilLMTree  $lm_tree,
Translations  $ot,
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 44 of file class.ilLMPresentationStatus.php.

57 {
58 $this->lm = $lm;
59 $this->ot = $ot;
60 $this->requested_transl = $requested_transl;
61 $this->requested_focus_id = $requested_focus_id;
62 $this->requested_focus_return = $requested_focus_return;
63 $this->requested_search_string = $requested_search_string;
64 $this->user = $user;
65 $this->lm_tree = $lm_tree;
66 $this->offline = $offline;
67 $this->export_all_languages = $export_all_languages;
68 $this->export_format = $export_format;
69 $this->embed_mode = $embed_mode;
70 $this->init();
71 }

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

+ Here is the call graph for this function:

Member Function Documentation

◆ exportAllLanguages()

ilLMPresentationStatus::exportAllLanguages ( )

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

136 : bool
137 {
139 }

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 106 of file class.ilLMPresentationStatus.php.

106 : string
107 {
109 }

References $concrete_lang.

◆ getEmbedMode()

ilLMPresentationStatus::getEmbedMode ( )

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

131 : bool
132 {
133 return $this->embed_mode;
134 }

References $embed_mode.

◆ getExportFormat()

ilLMPresentationStatus::getExportFormat ( )

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

141 : string
142 {
144 }

References $export_format.

◆ getFocusId()

ilLMPresentationStatus::getFocusId ( )

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

111 : int
112 {
113 return $this->focus_id;
114 }

References $focus_id.

◆ getFocusReturn()

ilLMPresentationStatus::getFocusReturn ( )

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

116 : string
117 {
119 }

References $requested_focus_return.

◆ getLang()

ilLMPresentationStatus::getLang ( )

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

97 : string
98 {
99 return $this->lang;
100 }

References $lang.

◆ getLMPresentationTitle()

ilLMPresentationStatus::getLMPresentationTitle ( )

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

146 : string
147 {
148 if ($this->lang != "" && $this->lang != "-") {
149 $ltitle = "";
150 $ot = $this->ot;
152 if (isset($data[$this->lang])) {
153 $ltitle = $data[$this->lang]->getTitle();
154 }
155 if ($ltitle !== "") {
156 return $ltitle;
157 }
158 $fb = $ot->getDefaultLanguage();
159 if (isset($data[$fb])) {
160 $ltitle = $data[$fb]->getTitle();
161 }
162 if ($ltitle !== "") {
163 return $ltitle;
164 }
165 }
166 return $this->lm->getTitle();
167 }

References $data, $lang, $ot, ILIAS\ILIASObject\Properties\Translations\Translations\getDefaultLanguage(), and ILIAS\ILIASObject\Properties\Translations\Translations\getLanguages().

+ Here is the call graph for this function:

◆ getSearchString()

ilLMPresentationStatus::getSearchString ( )

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

121 : string
122 {
124 }

References $requested_search_string.

◆ init()

ilLMPresentationStatus::init ( )
protected

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

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

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 173 of file class.ilLMPresentationStatus.php.

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

◆ offline()

ilLMPresentationStatus::offline ( )

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

126 : bool
127 {
128 return $this->offline;
129 }

References $offline.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $concrete_lang

ilLMPresentationStatus::$concrete_lang = ""
protected

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

Referenced by getConcreteLang().

◆ $embed_mode

ilLMPresentationStatus::$embed_mode = false
protected

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

Referenced by __construct(), and getEmbedMode().

◆ $export_all_languages

bool ilLMPresentationStatus::$export_all_languages
protected

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

Referenced by __construct(), and exportAllLanguages().

◆ $export_format

string ilLMPresentationStatus::$export_format
protected

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

Referenced by __construct(), and getExportFormat().

◆ $focus_id

int ilLMPresentationStatus::$focus_id = 0
protected

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

Referenced by getFocusId().

◆ $lang

string ilLMPresentationStatus::$lang
protected

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

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

◆ $lm

ilObjLearningModule ilLMPresentationStatus::$lm
protected

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

Referenced by __construct().

◆ $lm_tree

ilLMTree ilLMPresentationStatus::$lm_tree
protected

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

Referenced by __construct().

◆ $offline

bool ilLMPresentationStatus::$offline

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

Referenced by __construct(), and offline().

◆ $ot

Translations ilLMPresentationStatus::$ot
protected

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

Referenced by __construct(), and getLMPresentationTitle().

◆ $requested_focus_id

string ilLMPresentationStatus::$requested_focus_id
protected

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

Referenced by __construct(), and init().

◆ $requested_focus_return

string ilLMPresentationStatus::$requested_focus_return
protected

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

Referenced by __construct(), and getFocusReturn().

◆ $requested_search_string

string ilLMPresentationStatus::$requested_search_string
protected

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

Referenced by __construct(), and getSearchString().

◆ $requested_transl

string ilLMPresentationStatus::$requested_transl
protected

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

Referenced by __construct(), and init().

◆ $user

ilObjUser ilLMPresentationStatus::$user
protected

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

Referenced by __construct().


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