ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSkillAssignedObjectsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
15  protected $ctrl;
16 
20  protected $lng;
21 
25  protected $access;
26 
30  protected $tree;
31 
35  public function __construct($a_parent_obj, $a_parent_cmd, $a_ass_objects)
36  {
37  global $DIC;
38 
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  $this->access = $DIC->access();
42  $this->tree = $DIC->repositoryTree();
43 
44  parent::__construct($a_parent_obj, $a_parent_cmd);
45 
46  $data = array();
47  foreach ($a_ass_objects as $obj) {
49  $data[] = array("obj_id" => $obj);
50  }
51  }
52 
53  $this->setData($data);
54  $this->setTitle($this->lng->txt("skmg_assigned_objects"));
55 
56  $this->addColumn($this->lng->txt("title"), "title");
57  $this->addColumn($this->lng->txt("path"), "path");
58 
59  $this->setRowTemplate("tpl.skill_assigned_objects_row.html", "Services/Skill");
60  }
61 
65  protected function fillRow($a_set)
66  {
67  $obj_type = ilObject::_lookupType($a_set["obj_id"]);
68  $this->tpl->setVariable(
69  "OBJECT_IMG",
71  $a_set["obj_id"]),
72  $this->lng->txt("icon") . " " . $this->lng->txt($obj_type)
73  )
74  );
75  $this->tpl->setVariable("OBJECT_TITLE", ilObject::_lookupTitle($a_set["obj_id"]));
76 
77  $obj_ref_id = ilObject::_getAllReferences($a_set["obj_id"]);
78  $obj_ref_id = end($obj_ref_id);
79  $obj_ref_id_parent = $this->tree->getParentId($obj_ref_id);
80 
81  $path = new ilPathGUI();
82 
83  $this->tpl->setVariable(
84  "PATH",
85  $path->getPath($this->tree->getParentId($obj_ref_id_parent), $obj_ref_id)
86  );
87  }
88 }
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
Creates a path for a start and endnode.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
__construct($a_parent_obj, $a_parent_cmd, $a_ass_objects)
Constructor.
static _lookupTitle($a_id)
lookup object title
TableGUI class for assigned objects of skills.
static _getAllReferences($a_id)
get all reference ids of object
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
global $DIC
Definition: goto.php:24
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct(Container $dic, ilPlugin $plugin)
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.