ILIAS  release_7 Revision v7.30-3-g800a261c036
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, string $requested_transl="", string $requested_focus_id="", string $requested_focus_return="", string $requested_search_string="", string $offline, bool $export_all_languages, string $export_format, bool $embed_mode=false)
 Constructor. More...
 
 getLang ()
 Get language key. More...
 
 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 ()
 Get lm presentationtitle. More...
 
 isTocNecessary ()
 Is TOC necessary, see #30027 Check if at least two entries will be shown. More...
 

Protected Member Functions

 init ()
 Init. More...
 

Protected Attributes

 $lang
 
 $concrete_lang
 
 $focus_id = null
 

Detailed Description

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

Author
.de

Definition at line 11 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 = "",
string  $offline,
bool  $export_all_languages,
string  $export_format,
bool  $embed_mode = false 
)

Constructor.

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

References ilObject\getId(), ilObjectTranslation\getInstance(), init(), offline(), and user().

43  {
44  $this->lm = $lm;
45  $this->ot = ilObjectTranslation::getInstance($lm->getId());
46  $this->requested_transl = (string) $requested_transl;
47  $this->requested_focus_id = $requested_focus_id;
48  $this->requested_focus_return = $requested_focus_return;
49  $this->requested_search_string = $requested_search_string;
50  $this->user = $user;
51  $this->lm_tree = $lm_tree;
52  $this->offline = $offline;
53  $this->export_all_languages = $export_all_languages;
54  $this->export_format = $export_format;
55  $this->embed_mode = $embed_mode;
56  $this->init();
57  }
user()
Definition: user.php:4
getId()
get object id public
static getInstance($a_obj_id)
Get instance.
+ Here is the call graph for this function:

Member Function Documentation

◆ exportAllLanguages()

ilLMPresentationStatus::exportAllLanguages ( )
Returns
bool

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

145  : bool
146  {
147  return $this->export_all_languages;
148  }

◆ getConcreteLang()

ilLMPresentationStatus::getConcreteLang ( )

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

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

References $concrete_lang.

100  : string
101  {
102  return $this->concrete_lang;
103  }

◆ getEmbedMode()

ilLMPresentationStatus::getEmbedMode ( )

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

137  : bool
138  {
139  return $this->embed_mode;
140  }

◆ getExportFormat()

ilLMPresentationStatus::getExportFormat ( )
Returns
bool

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

153  : bool
154  {
155  return $this->export_format;
156  }

◆ getFocusId()

ilLMPresentationStatus::getFocusId ( )
Returns
int

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

References $focus_id.

◆ getFocusReturn()

ilLMPresentationStatus::getFocusReturn ( )
Returns
int

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

117  {
118  return $this->requested_focus_return;
119  }

◆ getLang()

ilLMPresentationStatus::getLang ( )

Get language key.

Returns
string

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

References $lang.

Referenced by ilLMPresentationService\__construct().

91  : string
92  {
93  return $this->lang;
94  }
+ Here is the caller graph for this function:

◆ getLMPresentationTitle()

ilLMPresentationStatus::getLMPresentationTitle ( )

Get lm presentationtitle.

Returns
string

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

References $data, $lang, and offline().

164  {
165  if ($this->offline() && $this->lang != "" && $this->lang != "-") {
166  $ot = $this->ot;
167  $data = $ot->getLanguages();
168  $ltitle = $data[$this->lang]["title"];
169  if ($ltitle != "") {
170  return $ltitle;
171  }
172  $ltitle = $data[$ot->getFallbackLanguage()]["title"];
173  if ($ltitle != "") {
174  return $ltitle;
175  }
176  }
177  return $this->lm->getTitle();
178  }
$data
Definition: storeScorm.php:23
+ Here is the call graph for this function:

◆ getSearchString()

ilLMPresentationStatus::getSearchString ( )
Returns
int

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

125  {
126  return $this->requested_search_string;
127  }

◆ init()

ilLMPresentationStatus::init ( )
protected

Init.

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

References $lang, and user().

Referenced by __construct().

63  {
64  // determine language
65  $this->lang = "-";
66  $this->concrete_lang = "-";
67  if ($this->ot->getContentActivated()) {
68  $langs = $this->ot->getLanguages();
69  if (isset($langs[$this->requested_transl]) || $this->requested_transl == $this->ot->getMasterLanguage()) {
70  $this->lang = $this->requested_transl;
71  } else {
72  $this->lang = $this->user->getCurrentLanguage();
73  }
74  $this->concrete_lang = $this->lang;
75  if ($this->lang == $this->ot->getMasterLanguage()) {
76  $this->lang = "-";
77  }
78  }
79 
80  // determin focus id
81  if ($this->requested_focus_id > 0 && $this->lm_tree->isInTree($this->requested_focus_id)) {
82  $this->focus_id = $this->requested_focus_id;
83  }
84  }
user()
Definition: user.php:4
+ 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.

Returns
bool

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

185  : bool
186  {
187  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
188  if (count($childs) == 0) { // no chapter -> false
189  return false;
190  }
191  if (count($childs) > 1) { // more than one chapter -> true
192  return true;
193  }
194  if ($this->lm->getTOCMode() != "pages") { // one chapter TOC does not show pages -> false
195  return false;
196  }
197  $current_chapter = current($childs);
198  $childs = $this->lm_tree->getChilds($current_chapter["child"]);
199  if (count($childs) > 1) {
200  return true; // more than one page -> true
201  }
202  return false; // zero or one page -> false
203  }

◆ offline()

ilLMPresentationStatus::offline ( )
Returns
bool

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

Referenced by __construct(), and getLMPresentationTitle().

132  : bool
133  {
134  return $this->offline;
135  }
+ Here is the caller graph for this function:

Field Documentation

◆ $concrete_lang

ilLMPresentationStatus::$concrete_lang
protected

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

Referenced by getConcreteLang().

◆ $focus_id

ilLMPresentationStatus::$focus_id = null
protected

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

Referenced by getFocusId().

◆ $lang

ilLMPresentationStatus::$lang
protected

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

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


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