ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilPageMultiLangGUI Class Reference

Page multilinguality GUI class. 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

Translations $ot
 
ilCtrl $ctrl
 
ilLanguage $lng
 
bool $single_page_mode = false
 

Detailed Description

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 28 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 42 of file class.ilPageMultiLangGUI.php.

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

46  {
47  global $DIC;
48 
49  $this->ctrl = $DIC->ctrl();
50  $this->lng = $DIC->language();
51  //$this->ml = new ilPageMultiLang($a_parent_type, $a_parent_id);
52 
53  // object translation
54  $this->ot = (new TranslationsRepository($DIC->database()))->getFor($a_parent_id);
55  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPageMultiLangGUI::executeCommand ( )

Execute command.

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

References $ctrl, and ilCtrl\getNextClass().

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

◆ getMultiLangInfo()

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

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

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

81  : string {
82  $lng = $this->lng;
83 
84  if ($a_page_lang == "") {
85  $a_page_lang = "-";
86  }
87 
88  $lng->loadLanguageModule("meta");
89 
90  $tpl = new ilTemplate("tpl.page_multi_lang_info.html", true, true, "components/ILIAS/COPage");
91  $tpl->setVariable("TXT_MASTER_LANG", $lng->txt("obj_base_lang"));
92  $tpl->setVariable("VAL_ML", $lng->txt("meta_l_" . $this->ot->getBaseLanguage()));
93  $cl = ($a_page_lang == "-")
94  ? $this->ot->getBaseLanguage()
95  : $a_page_lang;
96  $tpl->setVariable("TXT_CURRENT_LANG", $lng->txt("cont_current_lang"));
97  $tpl->setVariable("VAL_CL", $lng->txt("meta_l_" . $cl));
98  return $tpl->get();
99  }
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 31 of file class.ilPageMultiLangGUI.php.

Referenced by executeCommand().

◆ $lng

ilLanguage ilPageMultiLangGUI::$lng
protected

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

Referenced by getMultiLangInfo().

◆ $ot

Translations ilPageMultiLangGUI::$ot
protected

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

◆ $single_page_mode

bool ilPageMultiLangGUI::$single_page_mode = false
protected

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


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