ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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)
 Constructor. More...
 
 getLang ()
 Get language key. More...
 
 getFocusId ()
 
 getFocusReturn ()
 
 getSearchString ()
 
 offline ()
 
 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
 
 $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 
)

Constructor.

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

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

37  {
38  $this->lm = $lm;
39  $this->ot = ilObjectTranslation::getInstance($lm->getId());
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;
44  $this->user = $user;
45  $this->lm_tree = $lm_tree;
46  $this->offline = $offline;
47  $this->export_all_languages = $export_all_languages;
48  $this->export_format = $export_format;
49  $this->init();
50  }
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 122 of file class.ilLMPresentationStatus.php.

122  : bool
123  {
124  return $this->export_all_languages;
125  }

◆ getExportFormat()

ilLMPresentationStatus::getExportFormat ( )
Returns
bool

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

130  : bool
131  {
132  return $this->export_format;
133  }

◆ getFocusId()

ilLMPresentationStatus::getFocusId ( )
Returns
int

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

References $focus_id.

◆ getFocusReturn()

ilLMPresentationStatus::getFocusReturn ( )
Returns
int

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

99  {
100  return $this->requested_focus_return;
101  }

◆ getLang()

ilLMPresentationStatus::getLang ( )

Get language key.

Returns
string

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

References $lang.

Referenced by ilLMPresentationService\__construct().

82  : string
83  {
84  return $this->lang;
85  }
+ Here is the caller graph for this function:

◆ getLMPresentationTitle()

ilLMPresentationStatus::getLMPresentationTitle ( )

Get lm presentationtitle.

Returns
string

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

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

141  {
142  if ($this->offline() && $this->lang != "" && $this->lang != "-") {
143  $ot = $this->ot;
144  $data = $ot->getLanguages();
145  $ltitle = $data[$this->lang]["title"];
146  if ($ltitle != "") {
147  return $ltitle;
148  }
149  }
150  return $this->lm->getTitle();
151  }
$data
Definition: storeScorm.php:23
+ Here is the call graph for this function:

◆ getSearchString()

ilLMPresentationStatus::getSearchString ( )
Returns
int

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

107  {
108  return $this->requested_search_string;
109  }

◆ init()

ilLMPresentationStatus::init ( )
protected

Init.

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

References user().

Referenced by __construct().

56  {
57  // determine language
58  $this->lang = "-";
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();
65  }
66  if ($this->lang == $this->ot->getMasterLanguage()) {
67  $this->lang = "-";
68  }
69  }
70 
71  // determin focus id
72  if ($this->requested_focus_id > 0 && $this->lm_tree->isInTree($this->requested_focus_id)) {
73  $this->focus_id = $this->requested_focus_id;
74  }
75  }
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 158 of file class.ilLMPresentationStatus.php.

158  : bool
159  {
160  $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
161  if (count($childs) == 0) { // no chapter -> false
162  return false;
163  }
164  if (count($childs) > 1) { // more than one chapter -> true
165  return true;
166  }
167  if ($this->lm->getTOCMode() != "pages") { // one chapter TOC does not show pages -> false
168  return false;
169  }
170  $current_chapter = current($childs);
171  $childs = $this->lm_tree->getChilds($current_chapter["child"]);
172  if (count($childs) > 1) {
173  return true; // more than one page -> true
174  }
175  return false; // zero or one page -> false
176  }

◆ offline()

ilLMPresentationStatus::offline ( )
Returns
bool

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

Referenced by __construct(), and getLMPresentationTitle().

114  : bool
115  {
116  return $this->offline;
117  }
+ Here is the caller graph for this function:

Field Documentation

◆ $focus_id

ilLMPresentationStatus::$focus_id = null
protected

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

Referenced by getFocusId().

◆ $lang

ilLMPresentationStatus::$lang
protected

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

Referenced by getLang(), and getLMPresentationTitle().


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