ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
class.ilSCORMTrackingItemsPerUserFilterGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
5 
13 {
14 
18  public function __construct($a_parent_obj,$a_parent_cmd)
19  {
20  $this->parent_obj = $a_parent_obj;
21  $this->parent_cmd = $a_parent_cmd;
22  parent::__construct($a_parent_obj, $a_parent_cmd);
23  }
24 
25  public function parse($userSelected,$report,$reports)
26  {
27  global $ilCtrl, $lng;
28  $lng->loadLanguageModule("scormtrac");
29  $this->form = new ilPropertyFormGUI();
30  $this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj));
31 
32  $options = array("all" => $lng->txt("all"));
33 
34  include_once "Services/Tracking/classes/class.ilTrQuery.php";
35  $users=ilTrQuery::getParticipantsForObject($this->parent_obj->object->ref_id);
36 
37  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
39  $allowExportPrivacy = $privacy->enabledExportSCORM();
40 
41  //$users = $this->parent_obj->object->getTrackedUsers("");
42  foreach($users as $user)
43  {
44  if(ilObject::_exists($user) && ilObject::_lookUpType($user) == 'usr')
45  {
46  if ($allowExportPrivacy == true)
47  {
48  $e_user = new ilObjUser($user);
49  $options[$user] = $e_user->getLastname().", ".$e_user->getFirstname();
50  } else {
51  $options[$user] = 'User Id: '.$user;
52  }
53  }
54  }
55  $si = new ilSelectInputGUI($lng->txt("user"), "userSelected");
56  $si->setOptions($options);
57  $si->setValue($userSelected);
58  $this->form->addItem($si);
59 
60  $options = array("choose" => $lng->txt("please_choose"));
61  for ($i=0;$i<count($reports);$i++) {
62  $options[$reports[$i]] = $lng->txt(strtolower($reports[$i]));
63  }
64  $si = new ilSelectInputGUI($lng->txt("report"), "report");
65  $si->setOptions($options);
66  $si->setValue($report);
67  $this->form->addItem($si);
68  $this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter"));
69  }
70 
71 
72 }
73 ?>
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
ilPropertyFormGUI()
Constructor.
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
static getParticipantsForObject($a_ref_id)
Get participant ids for given object.
global $lng
Definition: privfeed.php:40
static _getInstance()
Get instance of ilPrivacySettings.