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

Public Member Functions

 __construct (string $a_parent_type, int $a_parent_id, bool $a_single_page_mode=false)
 Constructur. More...
 
 executeCommand ()
 Execute command. More...
 
 getMultiLangInfo (string $a_page_lang="-")
 

Protected Attributes

ilObjectTranslation $ot
 
ilCtrl $ctrl
 
ilLanguage $lng
 
bool $single_page_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 Page multilinguality GUI class. This could be generalized as an object service in the future.

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

Definition at line 25 of file class.ilPageMultiLangGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPageMultiLangGUI::__construct ( string  $a_parent_type,
int  $a_parent_id,
bool  $a_single_page_mode = false 
)

Constructur.

Parameters
string$a_parent_typeparent object type
int$a_parent_idparent object id
bool$a_single_page_modesingle page mode (page includes ml managing)

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

References $DIC, ILIAS\Repository\ctrl(), ilObjectTranslation\getInstance(), and ILIAS\Repository\lng().

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->lng = $DIC->language();
48  //$this->ml = new ilPageMultiLang($a_parent_type, $a_parent_id);
49 
50  // object translation
51  $this->ot = ilObjectTranslation::getInstance($a_parent_id);
52  }
static getInstance(int $obj_id)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPageMultiLangGUI::executeCommand ( )

Execute command.

Definition at line 57 of file class.ilPageMultiLangGUI.php.

References $ctrl, and ilCtrl\getNextClass().

57  : void
58  {
59  $ilCtrl = $this->ctrl;
60 
61  $next_class = $ilCtrl->getNextClass();
62 
63  switch ($next_class) {
64  default:
65  $cmd = $ilCtrl->getCmd("settings");
66  if (in_array($cmd, array("settings", "activateMultilinguality", "cancel",
67  "saveMultilingualitySettings", "confirmDeactivateMultiLanguage", "addLanguage",
68  "saveLanguages", "deactivateMultiLang", "confirmRemoveLanguages",
69  "removeLanguages"))) {
70  $this->$cmd();
71  }
72  break;
73  }
74  }
getNextClass($a_gui_class=null)
+ Here is the call graph for this function:

◆ getMultiLangInfo()

ilPageMultiLangGUI::getMultiLangInfo ( string  $a_page_lang = "-")

Definition at line 76 of file class.ilPageMultiLangGUI.php.

References $lng, ilLanguage\loadLanguageModule(), and ilLanguage\txt().

78  : string {
79  $lng = $this->lng;
80 
81  if ($a_page_lang == "") {
82  $a_page_lang = "-";
83  }
84 
85  $lng->loadLanguageModule("meta");
86 
87  $tpl = new ilTemplate("tpl.page_multi_lang_info.html", true, true, "components/ILIAS/COPage");
88  $tpl->setVariable("TXT_MASTER_LANG", $lng->txt("obj_master_lang"));
89  $tpl->setVariable("VAL_ML", $lng->txt("meta_l_" . $this->ot->getMasterLanguage()));
90  $cl = ($a_page_lang == "-")
91  ? $this->ot->getMasterLanguage()
92  : $a_page_lang;
93  $tpl->setVariable("TXT_CURRENT_LANG", $lng->txt("cont_current_lang"));
94  $tpl->setVariable("VAL_CL", $lng->txt("meta_l_" . $cl));
95  return $tpl->get();
96  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilPageMultiLangGUI::$ctrl
protected

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

Referenced by executeCommand().

◆ $lng

ilLanguage ilPageMultiLangGUI::$lng
protected

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

Referenced by getMultiLangInfo().

◆ $ot

ilObjectTranslation ilPageMultiLangGUI::$ot
protected

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

◆ $single_page_mode

bool ilPageMultiLangGUI::$single_page_mode = false
protected

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


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