ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilLMEditShortTitlesGUI.php
Go to the documentation of this file.
1 <?php
2 
20 
22 {
23  protected string $lang;
24  protected ilCtrl $ctrl;
28  protected ilLanguage $lng;
30 
31  public function __construct(
32  ilObjLearningModuleGUI $a_lm_gui,
33  string $requested_transl
34  ) {
35  global $DIC;
36 
37  $this->request = $DIC
38  ->learningModule()
39  ->internal()
40  ->gui()
41  ->editing()
42  ->request();
43 
44  $this->ctrl = $DIC->ctrl();
46  $lm = $a_lm_gui->getObject();
47  $this->lm = $lm;
48  $this->lm_gui = $a_lm_gui;
49  $this->tpl = $DIC["tpl"];
50  $this->lng = $DIC->language();
51 
52  $this->lang = ($requested_transl == "")
53  ? "-"
54  : $requested_transl;
55  }
56 
57  public function executeCommand(): void
58  {
59  $next_class = $this->ctrl->getNextClass($this);
60  $cmd = $this->ctrl->getCmd("listShortTitles");
61 
62  switch ($next_class) {
63  default:
64  if (in_array($cmd, array("listShortTitles", "save"))) {
65  $this->$cmd();
66  }
67  }
68  }
69 
70  public function listShortTitles(): void
71  {
72  $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_short_title_info"));
73  $ml_head = ilObjContentObjectGUI::getMultiLangHeader($this->lm->getId(), $this->lm_gui, "short_titles");
74  $tab = new ilLMEditShortTitlesTableGUI($this, "listShortTitles", $this->lm, $this->lang);
75  $this->tpl->setContent($ml_head . $tab->getHTML());
76  }
77 
78  public function save(): void
79  {
80  $short_titles = $this->request->getShortTitles();
81 
82  foreach ($short_titles as $id => $title) {
83  if (ilLMObject::_lookupContObjID($id) == $this->lm->getId()) {
85  }
86  }
87  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
88  $this->ctrl->redirect($this, "listShortTitles");
89  }
90 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static writeShortTitle(int $a_id, string $a_short_title, string $a_lang="-")
global $DIC
Definition: shib_login.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getMultiLangHeader(int $a_lm_id, object $a_gui_class, string $a_mode="")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
__construct(Container $dic, ilPlugin $plugin)
static _lookupContObjID(int $a_id)
get learning module id for lm object
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...