ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilTestVerificationTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Table/classes/class.ilTable2GUI.php';
5 
13 {
20  public function __construct($a_parent_obj, $a_parent_cmd = "")
21  {
22  global $ilCtrl;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->addColumn($this->lng->txt("title"), "title");
27  $this->addColumn($this->lng->txt("passed"), "passed");
28  $this->addColumn($this->lng->txt("action"), "");
29 
30  $this->setTitle($this->lng->txt("tstv_create"));
31  $this->setDescription($this->lng->txt("tstv_create_info"));
32 
33  $this->setRowTemplate("tpl.il_test_verification_row.html", "Modules/Test");
34  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
35 
36  $this->getItems();
37  }
38 
42  protected function getItems()
43  {
44  global $ilUser;
45 
46  include_once "Modules/Test/classes/class.ilObjTest.php";
47 
48  $data = array();
49  foreach(ilObjTest::_lookupFinishedUserTests($ilUser->getId()) as $test_id => $passed)
50  {
51  // #11210 - only available certificates!
52  $test = new ilObjTest($test_id, false);
53  $active_id = $test->getActiveIdOfUser($ilUser->getId());
54  if($test->canShowCertificate($ilUser->getId(), $active_id))
55  {
56  $data[] = array("id" => $test_id,
57  "title" => ilObject::_lookupTitle($test_id),
58  "passed" => $passed);
59  }
60  }
61 
62  $this->setData($data);
63  }
64 
70  protected function fillRow($a_set)
71  {
72  global $ilCtrl;
73 
74  $this->tpl->setVariable("TITLE", $a_set["title"]);
75  $this->tpl->setVariable("PASSED", ($a_set["passed"]) ? $this->lng->txt("yes") :
76  $this->lng->txt("no"));
77  $this->tpl->setVariable("TXT_SELECT", $this->lng->txt("select"));
78 
79  $ilCtrl->setParameter($this->parent_obj, "tst_id", $a_set["id"]);
80  $action = $ilCtrl->getLinkTarget($this->parent_obj, "save");
81  $this->tpl->setVariable("URL_SELECT", $action);
82  }
83 }
84 
85 ?>