ILIAS  Release_3_10_x_branch Revision 61812
 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 
43 {
49  function ilObjAICCLearningModuleGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output = true)
50  {
51  global $lng;
52 
53  $lng->loadLanguageModule("content");
54  $this->type = "sahs";
55  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
56  #$this->tabs_gui =& new ilTabsGUI();
57 
58  }
59 
60 
64  function assignObject()
65  {
66  if ($this->id != 0)
67  {
68  if ($this->call_by_reference)
69  {
70  $this->object =& new ilObjAICCLearningModule($this->id, true);
71  }
72  else
73  {
74  $this->object =& new ilObjAICCLearningModule($this->id, false);
75  }
76  }
77  }
78 
79 // /**
80 // * save new learning module to db
81 // */
82 // function saveObject()
83 // {
84 // global $rbacadmin;
85 //
86 // $this->uploadObject();
87 //
88 // ilUtil::sendInfo($this->lng->txt("alm_added"), true);
89 // ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
90 //
91 // }
92 
96  function showTrackingItems()
97  {
98 
99  include_once "./Services/Table/classes/class.ilTableGUI.php";
100 
101  // load template for table
102  $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
103  // load template for table content data
104  $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scorm_track_items.html", "Modules/ScormAicc");
105 
106  $num = 1;
107 
108  $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
109 
110  // create table
111  $tbl = new ilTableGUI();
112 
113  // title & header columns
114  $tbl->setTitle($this->lng->txt("cont_tracking_items"));
115 
116  $tbl->setHeaderNames(array($this->lng->txt("title")));
117 
118  $header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"],
119  "cmdClass" => get_class($this));
120  $cols = array("title");
121  $tbl->setHeaderVars($cols, $header_params);
122  $tbl->setColumnWidth(array("100%"));
123 
124  // control
125  $tbl->setOrderColumn($_GET["sort_by"]);
126  $tbl->setOrderDirection($_GET["sort_order"]);
127  $tbl->setLimit($_GET["limit"]);
128  $tbl->setOffset($_GET["offset"]);
129  $tbl->setMaxCount($this->maxcount);
130 
131  //$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
132  //$this->showActions(true);
133 
134  // footer
135  $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
136  #$tbl->disable("footer");
137 
138  //$items = $this->object->getTrackingItems();
139  $items = $this->object->getTrackedItems();
140 
141  //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
142  $tbl->setMaxCount(count($items));
143  $items = array_slice($items, $_GET["offset"], $_GET["limit"]);
144 
145  $tbl->render();
146  if (count($items) > 0)
147  {
148  foreach ($items as $item)
149  {
150  $this->tpl->setCurrentBlock("tbl_content");
151  $this->tpl->setVariable("TXT_ITEM_TITLE", $item->getTitle());
152  $this->ctrl->setParameter($this, "obj_id", $item->getId());
153  $this->tpl->setVariable("LINK_ITEM",
154  $this->ctrl->getLinkTarget($this, "showTrackingItem"));
155 
156  $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
157  $this->tpl->setVariable("CSS_ROW", $css_row);
158  $this->tpl->parseCurrentBlock();
159  }
160  } //if is_array
161  else
162  {
163  $this->tpl->setCurrentBlock("notfound");
164  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
165  $this->tpl->setVariable("NUM_COLS", $num);
166  $this->tpl->parseCurrentBlock();
167  }
168  }
169 
173  function showTrackingItem()
174  {
176  }
177 
178 
179 } // END class.ilObjAICCLearningModule
180 ?>