ILIAS  Release_4_0_x_branch Revision 61816
 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 
100  include_once "./Services/Table/classes/class.ilTableGUI.php";
101 
102  // load template for table
103  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
104  // load template for table content data
105  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scorm_track_items.html", "Modules/ScormAicc");
106 
107  $num = 1;
108 
109  $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
110 
111  // create table
112  $tbl = new ilTableGUI();
113 
114  // title & header columns
115  $tbl->setTitle($this->lng->txt("cont_tracking_items"));
116 
117  $tbl->setHeaderNames(array($this->lng->txt("title")));
118 
119  $header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"],
120  "cmdClass" => get_class($this));
121  $cols = array("title");
122  $tbl->setHeaderVars($cols, $header_params);
123  $tbl->setColumnWidth(array("100%"));
124 
125  // control
126  $tbl->setOrderColumn($_GET["sort_by"]);
127  $tbl->setOrderDirection($_GET["sort_order"]);
128  $tbl->setLimit($_GET["limit"]);
129  $tbl->setOffset($_GET["offset"]);
130  $tbl->setMaxCount($this->maxcount);
131 
132  //$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
133  //$this->showActions(true);
134 
135  // footer
136  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
137  #$tbl->disable("footer");
138 
139  //$items = $this->object->getTrackingItems();
140  $items = $this->object->getTrackedItems();
141 
142  //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
143  $tbl->setMaxCount(count($items));
144  $items = array_slice($items, $_GET["offset"], $_GET["limit"]);
145 
146  $tbl->render();
147  if (count($items) > 0)
148  {
149  foreach ($items as $item)
150  {
151  $this->tpl->setCurrentBlock("tbl_content");
152  $this->tpl->setVariable("TXT_ITEM_TITLE", $item->getTitle());
153  $this->ctrl->setParameter($this, "obj_id", $item->getId());
154  $this->tpl->setVariable("LINK_ITEM",
155  $this->ctrl->getLinkTarget($this, "showTrackingItem"));
156 
157  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
158  $this->tpl->setVariable("CSS_ROW", $css_row);
159  $this->tpl->parseCurrentBlock();
160  }
161  } //if is_array
162  else
163  {
164  $this->tpl->setCurrentBlock("notfound");
165  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
166  $this->tpl->setVariable("NUM_COLS", $num);
167  $this->tpl->parseCurrentBlock();
168  }
169  }
170 
174  function showTrackingItem()
175  {
177  }
178 
179 
180 } // END class.ilObjAICCLearningModule
181 ?>