ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilGlossaryAutoLinkTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11{
15 protected $glossary;
16
20 protected $ctrl;
21
25 protected $lng;
26
27
31 public function __construct(ilObjGlossary $a_glossary, $a_parent_obj, $a_parent_cmd)
32 {
33 global $DIC;
34
35 $this->glossary = $a_glossary;
36 $this->id = "glo_glo";
37 $this->lng = $DIC->language();
38 $this->ctrl = $DIC->ctrl();
39
40 parent::__construct($a_parent_obj, $a_parent_cmd);
41 $data = array();
42 foreach ($a_glossary->getAutoGlossaries() as $glo_id) {
43 $data[] = array("glo_id" => $glo_id, "title" => ilObject::_lookupTitle($glo_id));
44 }
45 $this->setData($data);
46 $this->setTitle($this->lng->txt("cont_auto_glossaries"));
47
48 $this->addColumn($this->lng->txt("title"), "title");
49 $this->addColumn($this->lng->txt("actions"));
50
51 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
52 $this->setRowTemplate("tpl.glo_glossary_auto_link_row.html", "Modules/Glossary");
53
54 // $this->addMultiCommand("", $lng->txt(""));
55// $this->addCommandButton("", $lng->txt(""));
56 }
57
61 protected function fillRow($a_set)
62 {
63 $this->ctrl->setParameter($this->parent_obj, "glo_id", $a_set["glo_id"]);
64 $this->tpl->setCurrentBlock("cmd");
65 $this->tpl->setVariable("CMD_HREF", $this->ctrl->getLinkTarget($this->parent_obj, "removeGlossary"));
66 $this->tpl->setVariable("CMD_TXT", $this->lng->txt("remove"));
67 $this->tpl->parseCurrentBlock();
68 $this->tpl->setVariable("TITLE", ilObject::_lookupTitle($a_set["glo_id"]));
69 }
70}
An exception for terminatinating execution or to throw for unit testing.
TableGUI class for auto link glossaries.
__construct(ilObjGlossary $a_glossary, $a_parent_obj, $a_parent_cmd)
Constructor.
Class ilObjGlossary.
getAutoGlossaries()
Get auto glossaries.
static _lookupTitle($a_id)
lookup object title
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46