ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilLMEditShortTitlesTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
15 {
19  protected $ctrl;
20 
24  protected $lm;
25 
29  protected $tpl;
30 
34  protected $lng;
35 
39  public function __construct($a_parent_obj, $a_parent_cmd, $a_lm, $a_lang)
40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->lm = $a_lm;
45  $this->tpl = $DIC["tpl"];
46  $this->lng = $DIC->language();
47  $this->lang = $a_lang;
48 
49  $this->setId("lm_short_title");
50 
51  parent::__construct($a_parent_obj, $a_parent_cmd);
52  include_once("./Modules/LearningModule/classes/class.ilLMObject.php");
53  $this->setData(ilLMObject::getShortTitles($this->lm->getId(), $this->lang));
54  $this->setTitle($this->lng->txt("cont_short_titles"));
55 
56  $this->addColumn($this->lng->txt("title"));
57  $this->addColumn($this->lng->txt("cont_short_title"));
58 
59  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
60  $this->setRowTemplate("tpl.short_title_row.html", "Modules/LearningModule");
61 
62  $this->addCommandButton("save", $this->lng->txt("save"));
63  //$this->setMaxCount(9999);
64  }
65 
69  protected function fillRow($a_set)
70  {
71  $this->tpl->setVariable("TITLE", $a_set["title"]);
72  $this->tpl->setVariable("DEFAULT_TITLE", $a_set["default_title"]);
73  $this->tpl->setVariable("DEFAULT_SHORT_TITLE", $a_set["default_short_title"]);
74  $this->tpl->setVariable("ID", $a_set["obj_id"]);
75  $this->tpl->setVariable("SHORT_TITLE", ilUtil::prepareFormOutput($a_set["short_title"]));
76  }
77 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static getShortTitles($a_lm_id, $a_lang="-")
Get short titles.
global $DIC
Definition: saml.php:7
setId($a_val)
Set id.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct($a_parent_obj, $a_parent_cmd, $a_lm, $a_lang)
Constructor.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
TableGUI class for lm short titles.