ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilCmiXapiVerficationTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14{
21 public function __construct($a_parent_obj, $a_parent_cmd = "")
22 {
23 global $ilCtrl;
24
25 parent::__construct($a_parent_obj, $a_parent_cmd);
26
27 $this->addColumn($this->lng->txt("title"), "title");
28 $this->addColumn($this->lng->txt("passed"), "passed");
29 $this->addColumn($this->lng->txt("action"), "");
30
31 $this->setTitle($this->lng->txt("cmxv_create"));
32 $this->setDescription($this->lng->txt("cmxv_create_info"));
33
34 $this->setRowTemplate("tpl.cmix_verification_row.html", "Modules/CmiXapi");
35 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
36
37 $this->getItems();
38 }
39
43 protected function getItems()
44 {
45 global $DIC; /* @var \ILIAS\DI\Container $DIC */
46
47 $userCertificateRepository = new ilUserCertificateRepository(
48 $DIC->database(),
49 $DIC->logger()->root()
50 );
51
52 $certificateArray = $userCertificateRepository->fetchActiveCertificatesByTypeForPresentation(
53 $DIC->user()->getId(),
54 'cmix'
55 );
56
57 $data = array();
58
59 foreach ($certificateArray as $certificate) {
60 $data[] = array(
61 'id' => $certificate->getUserCertificate()->getObjId(),
62 'title' => $certificate->getObjectTitle(),
63 'passed' => true
64 );
65 }
66
67 $this->setData($data);
68 }
69
75 protected function fillRow($a_set)
76 {
77 global $ilCtrl;
78
79 $this->tpl->setVariable("TITLE", $a_set["title"]);
80 $this->tpl->setVariable("PASSED", ($a_set["passed"]) ? $this->lng->txt("yes") :
81 $this->lng->txt("no"));
82
83 if ($a_set["passed"]) {
84 $ilCtrl->setParameter($this->parent_obj, "cmix_id", $a_set["id"]);
85 $action = $ilCtrl->getLinkTarget($this->parent_obj, "save");
86 $this->tpl->setVariable("URL_SELECT", $action);
87 $this->tpl->setVariable("TXT_SELECT", $this->lng->txt("select"));
88 }
89 }
90}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
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.
setDescription($a_val)
Set description.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46