ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
24require_once "./Services/Object/classes/class.ilObjectGUI.php";
25require_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
26require_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
27require_once "./Modules/ScormAicc/classes/class.ilObjAICCCourseInterchangeFiles.php";
28require_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
29
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 }
57
58
62 function assignObject()
63 {
64 if ($this->id != 0)
65 {
66 if ($this->call_by_reference)
67 {
68 $this->object =& new ilObjAICCLearningModule($this->id, true);
69 }
70 else
71 {
72 $this->object =& new ilObjAICCLearningModule($this->id, false);
73 }
74 }
75 }
76
77// /**
78// * save new learning module to db
79// */
80// function saveObject()
81// {
82// global $rbacadmin;
83//
84// $this->uploadObject();
85//
86// ilUtil::sendInfo($this->lng->txt("alm_added"), true);
87// ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
88//
89// }
90
95 {
96 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
98 if(!$privacy->enabledSahsProtocolData())
99 {
100 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
101 }
102
103 include_once "./Services/Table/classes/class.ilTableGUI.php";
104
105 // load template for table
106 $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");
107 // load template for table content data
108 $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.scorm_track_items.html", "Modules/ScormAicc");
109
110 $num = 1;
111
112 $this->tpl->setVariable("FORMACTION", "adm_object.php?ref_id=".$this->ref_id."$obj_str&cmd=gateway");
113
114 // create table
115 $tbl = new ilTableGUI();
116
117 // title & header columns
118 $tbl->setTitle($this->lng->txt("cont_tracking_items"));
119
120 $tbl->setHeaderNames(array($this->lng->txt("title")));
121
122 $header_params = array("ref_id" => $this->ref_id, "cmd" => $_GET["cmd"],
123 "cmdClass" => get_class($this));
124 $cols = array("title");
125 $tbl->setHeaderVars($cols, $header_params);
126 $tbl->setColumnWidth(array("100%"));
127
128 // control
129 $tbl->setOrderColumn($_GET["sort_by"]);
130 $tbl->setOrderDirection($_GET["sort_order"]);
131 $tbl->setLimit($_GET["limit"]);
132 $tbl->setOffset($_GET["offset"]);
133 $tbl->setMaxCount($this->maxcount);
134
135 //$this->tpl->setVariable("COLUMN_COUNTS",count($this->data["cols"]));
136 //$this->showActions(true);
137
138 // footer
139 $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
140 #$tbl->disable("footer");
141
142 //$items = $this->object->getTrackingItems();
143 $items = $this->object->getTrackedItems();
144
145 //$objs = ilUtil::sortArray($objs, $_GET["sort_by"], $_GET["sort_order"]);
146 $tbl->setMaxCount(count($items));
147 $items = array_slice($items, $_GET["offset"], $_GET["limit"]);
148
149 $tbl->render();
150 if (count($items) > 0)
151 {
152 foreach ($items as $item)
153 {
154 $this->tpl->setCurrentBlock("tbl_content");
155 $this->tpl->setVariable("TXT_ITEM_TITLE", $item->getTitle());
156 $this->ctrl->setParameter($this, "obj_id", $item->getId());
157 $this->tpl->setVariable("LINK_ITEM",
158 $this->ctrl->getLinkTarget($this, "showTrackingItem"));
159
160 $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
161 $this->tpl->setVariable("CSS_ROW", $css_row);
162 $this->tpl->parseCurrentBlock();
163 }
164 } //if is_array
165 else
166 {
167 $this->tpl->setCurrentBlock("notfound");
168 $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
169 $this->tpl->setVariable("NUM_COLS", $num);
170 $this->tpl->parseCurrentBlock();
171 }
172 }
173
178 {
179 parent::showTrackingItem();
180 }
181
182
183} // END class.ilObjAICCLearningModule
184?>
$_GET["client_id"]
Class ilObjAICCLearningModuleGUI.
ilObjAICCLearningModuleGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
assignObject()
assign aicc object to aicc gui object
Class ilObjAICCLearningModule.
Class ilObjSCORMLearningModuleGUI.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
static _getInstance()
Get instance of ilPrivacySettings.
Class ilTableGUI.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows)
$tbl
Definition: example_048.php:81
redirection script todo: (a better solution should control the processing via a xml file)