ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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().

54  {
55  $this->lm = $lm;
56  $this->ot = ilObjectTranslation::getInstance($lm->getId());
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)
+ Here is the call graph for this function:

Member Function Documentation

◆ exportAllLanguages()

ilLMPresentationStatus::exportAllLanguages ( )

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

References $export_all_languages.

133  : bool
134  {
136  }

◆ 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.

References $concrete_lang.

103  : string
104  {
105  return $this->concrete_lang;
106  }

◆ getEmbedMode()

ilLMPresentationStatus::getEmbedMode ( )

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

References $embed_mode.

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

◆ getExportFormat()

ilLMPresentationStatus::getExportFormat ( )

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

References $export_format.

138  : string
139  {
140  return $this->export_format;
141  }

◆ getFocusId()

ilLMPresentationStatus::getFocusId ( )

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

References $focus_id.

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

◆ getFocusReturn()

ilLMPresentationStatus::getFocusReturn ( )

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

References $requested_focus_return.

113  : string
114  {
116  }

◆ getLang()

ilLMPresentationStatus::getLang ( )

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

References $lang.

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

◆ getLMPresentationTitle()

ilLMPresentationStatus::getLMPresentationTitle ( )

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

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

143  : string
144  {
145  if ($this->lang != "" && $this->lang != "-") {
146  $ltitle = "";
147  $ot = $this->ot;
148  $data = $ot->getLanguages();
149  if (isset($data[$this->lang])) {
150  $ltitle = $data[$this->lang]->getTitle();
151  }
152  if ($ltitle !== "") {
153  return $ltitle;
154  }
155  $fb = $ot->getFallbackLanguage();
156  if (isset($data[$fb])) {
157  $ltitle = $data[$fb]->getTitle();
158  }
159  if ($ltitle !== "") {
160  return $ltitle;
161  }
162  }
163  return $this->lm->getTitle();
164  }
+ Here is the call graph for this function:

◆ getSearchString()

ilLMPresentationStatus::getSearchString ( )

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

References $requested_search_string.

118  : string
119  {
121  }

◆ init()

ilLMPresentationStatus::init ( )
protected

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

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

Referenced by __construct().

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  }
+ 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 170 of file class.ilLMPresentationStatus.php.

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

◆ offline()

ilLMPresentationStatus::offline ( )

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

References $offline.

Referenced by __construct().

123  : bool
124  {
125  return $this->offline;
126  }
+ 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: