ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjAICCLearningModuleGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 require_once "classes/class.ilObjectGUI.php";
25 require_once("classes/class.ilFileSystemGUI.php");
26 require_once("classes/class.ilTabsGUI.php");
27 require_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
28 require_once "./Modules/ScormAicc/classes/class.ilObjAICCCourseInterchangeFiles.php";
29 require_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
30 
44 {
50  function ilObjAICCLearningModuleGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output = true)
51  {
52  global $lng;
53 
54  $lng->loadLanguageModule("content");
55  $this->type = "sahs";
56  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
57  #$this->tabs_gui =& new ilTabsGUI();
58 
59  }
60 
61 
65  function assignObject()
66  {
67  if ($this->id != 0)
68  {
69  if ($this->call_by_reference)
70  {
71  $this->object =& new ilObjAICCLearningModule($this->id, true);
72  }
73  else
74  {
75  $this->object =& new ilObjAICCLearningModule($this->id, false);
76  }
77  }
78  }
79 
80 // /**
81 // * save new learning module to db
82 // */
83 // function saveObject()
84 // {
85 // global $rbacadmin;
86 //
87 // $this->uploadObject();
88 //
89 // ilUtil::sendInfo($this->lng->txt("alm_added"), true);
90 // ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
91 //
92 // }
93 
97  function showTrackingItems()
98  {
99  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
100  $privacy = ilPrivacySettings::_getInstance();
101  if(!$privacy->enabledSahsProtocolData())
102  {
103  $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
104  }
105 
106  include_once "./Services/Table/classes/class.ilTableGUI.php";
107 
108  // load template for table
109  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
110  // load template for table content data
111  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scorm_track_items.html", "Modules/ScormAicc");
112 
113  $num = 1;
114 
115  $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
116 
117  // create table
118  $tbl = new ilTableGUI();
119 
120  // title & header columns
121  $tbl->setTitle($this->lng->txt("cont_tracking_items"));
122 
123  $tbl->setHeaderNames(array($this->lng->txt("title")));
124 
125  $header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"],
126  "cmdClass" => get_class($this));
127  $cols = array("title");
128  $tbl->setHeaderVars($cols, $header_params);
129  $tbl->setColumnWidth(array("100%"));
130 
131  // control
132  $tbl->setOrderColumn($_GET["sort_by"]);
133  $tbl->setOrderDirection($_GET["sort_order"]);
134  $tbl->setLimit($_GET["limit"]);
135  $tbl->setOffset($_GET["offset"]);
136  $tbl->setMaxCount($this->maxcount);
137 
138  //$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
139  //$this->showActions(true);
140 
141  // footer
142  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
143  #$tbl->disable("footer");
144 
145  //$items = $this->object->getTrackingItems();
146  $items = $this->object->getTrackedItems();
147 
148  //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
149  $tbl->setMaxCount(count($items));
150  $items = array_slice($items, $_GET["offset"], $_GET["limit"]);
151 
152  $tbl->render();
153  if (count($items) > 0)
154  {
155  foreach ($items as $item)
156  {
157  $this->tpl->setCurrentBlock("tbl_content");
158  $this->tpl->setVariable("TXT_ITEM_TITLE", $item->getTitle());
159  $this->ctrl->setParameter($this, "obj_id", $item->getId());
160  $this->tpl->setVariable("LINK_ITEM",
161  $this->ctrl->getLinkTarget($this, "showTrackingItem"));
162 
163  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
164  $this->tpl->setVariable("CSS_ROW", $css_row);
165  $this->tpl->parseCurrentBlock();
166  }
167  } //if is_array
168  else
169  {
170  $this->tpl->setCurrentBlock("notfound");
171  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
172  $this->tpl->setVariable("NUM_COLS", $num);
173  $this->tpl->parseCurrentBlock();
174  }
175  }
176 
180  function showTrackingItem()
181  {
183  }
184 
185 
186 } // END class.ilObjAICCLearningModule
187 ?>