ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSAHSPresentationGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 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 
41 {
42  var $ilias;
43  var $tpl;
44  var $lng;
45 
47  {
48  global $ilias, $tpl, $lng, $ilCtrl;
49 
50  $this->ilias =& $ilias;
51  $this->tpl =& $tpl;
52  $this->lng =& $lng;
53  $this->ctrl =& $ilCtrl;
54 
55  $this->ctrl->saveParameter($this, "ref_id");
56  }
57 
61  function &executeCommand()
62  {
63  global $lng,$ilAccess, $ilNavigationHistory, $ilCtrl, $ilLocator, $ilObjDataCache;
64 
65  include_once "./classes/class.ilObjectGUI.php";
66  include_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
67 
68  $lng->loadLanguageModule("content");
69 
70  // add entry to navigation history
71  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
72  {
73  $ilNavigationHistory->addItem($_GET["ref_id"],
74  "ilias.php?cmd=infoScreen&baseClass=ilSAHSPresentationGUI&ref_id=".$_GET["ref_id"], "lm");
75  }
76 
77  include_once 'payment/classes/class.ilPaymentObject.php';
78  if(ilPaymentObject::_isBuyable($_GET['ref_id']) &&
80  {
81  $ilLocator->addRepositoryItems();
82  $ilLocator->addItem($ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($_GET['ref_id'])),
83  'ilias.php?baseClass=ilSAHSPresentationGUI&amp;ref_id='.$_GET['ref_id'],
84  '',
85  $_GET['ref_id'],
86  'sahs');
87  $this->tpl->setLocator();
88  $this->tpl->getStandardTemplate();
89 
90  include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
91  $this->ctrl->setReturn($this, '');
92  $pp_gui = new ilShopPurchaseGUI($_GET['ref_id']);
93  $this->ctrl->forwardCommand($pp_gui);
94  $this->tpl->show();
95  exit();
96  }
97 
98  include_once './classes/class.ilSearch.php';
99 
100  $next_class = $this->ctrl->getNextClass($this);
101  $cmd = $this->ctrl->getCmd();
102 
103  $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
105 
106  if ($cmd == "downloadCertificate")
107  {
108  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
109  $scorm_gui = new ilSCORMPresentationGUI();
110  $ret =& $this->ctrl->forwardCommand($scorm_gui);
111  }
112 
113  switch($type)
114  {
115 
116  case "scorm2004":
117  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
118  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
119  break;
120 
121  case "scorm":
122  include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModuleGUI.php");
123  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
124  break;
125 
126  case "aicc":
127  include_once("./Modules/ScormAicc/classes/class.ilObjAICCLearningModuleGUI.php");
128  $this->slm_gui = new ilObjAICCLearningModuleGUI("", $_GET["ref_id"],true,false);
129  break;
130 
131  case "hacp":
132  include_once("./Modules/ScormAicc/classes/class.ilObjHACPLearningModuleGUI.php");
133  $this->slm_gui = new ilObjHACPLearningModuleGUI("", $_GET["ref_id"],true,false);
134  break;
135  }
136 
137  if ($next_class != "ilinfoscreengui" &&
138  $cmd != "infoScreen")
139  {
140  include_once("./Services/License/classes/class.ilLicense.php");
141  ilLicense::_noteAccess($obj_id);
142  switch($type)
143  {
144 
145  case "scorm2004":
146  $this->ctrl->setCmdClass("ilscorm13player");
147  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
148  break;
149 
150  case "scorm":
151  $this->ctrl->setCmdClass("ilscormpresentationgui");
152  $this->slm_gui = new ilObjSCORMLearningModuleGUI("", $_GET["ref_id"],true,false);
153  break;
154 
155  case "aicc":
156  $this->ctrl->setCmdClass("ilaiccpresentationgui");
157  break;
158 
159  case "hacp":
160  $this->ctrl->setCmdClass("ilhacppresentationgui");
161  break;
162  }
163  $next_class = $this->ctrl->getNextClass($this);
164  }
165 
166  switch($next_class)
167  {
168  case "ilinfoscreengui":
169  $ret =& $this->outputInfoScreen();
170  break;
171 
172  case "ilscorm13player":
173  require_once "./Modules/Scorm2004/classes/ilSCORM13Player.php";
174 
175  $scorm_gui = new ilSCORM13Player();
176  $ret =& $this->ctrl->forwardCommand($scorm_gui);
177  break;
178 
179  case "ilscormpresentationgui":
180  require_once "./Modules/ScormAicc/classes/SCORM/class.ilSCORMPresentationGUI.php";
181  $scorm_gui = new ilSCORMPresentationGUI();
182  $ret =& $this->ctrl->forwardCommand($scorm_gui);
183  break;
184 
185  case "ilaiccpresentationgui":
186  require_once "./Modules/ScormAicc/classes/AICC/class.ilAICCPresentationGUI.php";
187  $aicc_gui = new ilAICCPresentationGUI();
188  $ret =& $this->ctrl->forwardCommand($aicc_gui);
189  break;
190 
191  case "ilhacppresentationgui":
192  require_once "./Modules/ScormAicc/classes/HACP/class.ilHACPPresentationGUI.php";
193  $hacp_gui = new ilHACPPresentationGUI();
194  $ret =& $this->ctrl->forwardCommand($hacp_gui);
195  break;
196 
197  default:
198  $this->$cmd();
199  }
200  }
201 
202 
203  function attrib2arr(&$a_attributes)
204  {
205  $attr = array();
206 
207  if(!is_array($a_attributes))
208  {
209  return $attr;
210  }
211  foreach ($a_attributes as $attribute)
212  {
213  $attr[$attribute->name()] = $attribute->value();
214  }
215 
216 
217  return $attr;
218  }
219 
220 
224  function frameset()
225  {
226  $this->tpl = new ilTemplate("tpl.sahs_pres_frameset.html", false, false, "Modules/ScormAicc");
227  $this->tpl->setVariable("REF_ID",$this->slm->getRefId());
228  $this->tpl->show("DEFAULT", false);
229  exit;
230  }
231 
232 
236  function explorer($a_target = "sahs_content")
237  {
238  global $ilBench;
239 
240  $ilBench->start("SAHSExplorer", "initExplorer");
241 
242  $this->tpl = new ilTemplate("tpl.sahs_exp_main.html", true, true, "Modules/ScormAicc");
243 
244  require_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMExplorer.php");
245  $exp = new ilSCORMExplorer("ilias.php?baseClass=ilSAHSPresentationGUI&cmd=view&ref_id=".$this->slm->getRefId(), $this->slm);
246  $exp->setTargetGet("obj_id");
247  $exp->setFrameTarget($a_target);
248 
249  //$exp->setFiltered(true);
250 
251  if ($_GET["scexpand"] == "")
252  {
253  $mtree = new ilSCORMTree($this->slm->getId());
254  $expanded = $mtree->readRootId();
255  }
256  else
257  {
258  $expanded = $_GET["scexpand"];
259  }
260  $exp->setExpand($expanded);
261 
262  $exp->forceExpandAll(true, false);
263 
264  // build html-output
265  //666$exp->setOutput(0);
266  $ilBench->stop("SAHSExplorer", "initExplorer");
267 
268  // set output
269  $ilBench->start("SAHSExplorer", "setOutput");
270  $exp->setOutput(0);
271  $ilBench->stop("SAHSExplorer", "setOutput");
272 
273  $ilBench->start("SAHSExplorer", "getOutput");
274  $output = $exp->getOutput();
275  $ilBench->stop("SAHSExplorer", "getOutput");
276 
277  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
278  $this->tpl->addBlockFile("CONTENT", "content", "tpl.sahs_explorer.html", "Modules/ScormAicc");
279  //$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_content"));
280  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
281  $this->tpl->setVariable("EXPLORER",$output);
282  $this->tpl->setVariable("ACTION", "ilias.php?baseClass=ilSAHSPresentationGUI&cmd=".$_GET["cmd"]."&frame=".$_GET["frame"].
283  "&ref_id=".$this->slm->getRefId()."&scexpand=".$_GET["scexpand"]);
284  $this->tpl->parseCurrentBlock();
285  $this->tpl->show();
286  }
287 
288 
289  function view()
290  {
291  $sc_gui_object =& ilSCORMObjectGUI::getInstance($_GET["obj_id"]);
292 
293  if(is_object($sc_gui_object))
294  {
295  $sc_gui_object->view();
296  }
297 
298  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
299  $this->tpl->show();
300  }
301 
302  function api()
303  {
304  global $ilias;
305 
306  $slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
307 
308  $this->tpl = new ilTemplate("tpl.sahs_api.html", true, true, "Modules/ScormAicc");
309  $this->tpl->setVariable("USER_ID",$ilias->account->getId());
310  $this->tpl->setVariable("USER_FIRSTNAME",$ilias->account->getFirstname());
311  $this->tpl->setVariable("USER_LASTNAME",$ilias->account->getLastname());
312  $this->tpl->setVariable("REF_ID",$_GET["ref_id"]);
313  $this->tpl->setVariable("SESSION_ID",session_id());
314 
315  $this->tpl->setVariable("CODE_BASE", "http://".$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, strpos ($_SERVER['PHP_SELF'], "/ilias.php")));
316  $this->tpl->parseCurrentBlock();
317 
318  $this->tpl->show(false);
319  exit;
320  }
321 
322  function launchSahs()
323  {
324 
325  global $ilUser, $ilDB;
326 
327  $sco_id = ($_GET["sahs_id"] == "")
328  ? $_POST["sahs_id"]
329  : $_GET["sahs_id"];
330  $ref_id = ($_GET["ref_id"] == "")
331  ? $_POST["ref_id"]
332  : $_GET["ref_id"];
333 
334  $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
335 
336  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
337  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
338  $item =& new ilSCORMItem($sco_id);
339 
340  $id_ref = $item->getIdentifierRef();
341  $resource =& new ilSCORMResource();
342  $resource->readByIdRef($id_ref, $item->getSLMId());
343  //$slm_obj =& new ilObjSCORMLearningModule($_GET["ref_id"]);
344  $href = $resource->getHref();
345  $this->tpl = new ilTemplate("tpl.sahs_launch_cbt.html", true, true, "Modules/ScormAicc");
346  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
347 
348  // set item data
349  $this->tpl->setVariable("LAUNCH_DATA", $item->getDataFromLms());
350  $this->tpl->setVariable("MAST_SCORE", $item->getMasteryScore());
351  $this->tpl->setVariable("MAX_TIME", $item->getMaxTimeAllowed());
352  $this->tpl->setVariable("LIMIT_ACT", $item->getTimeLimitAction());
353 
354  // set alternative API name
355  if ($this->slm->getAPIAdapterName() != "API")
356  {
357  $this->tpl->setCurrentBlock("alt_api_ref");
358  $this->tpl->setVariable("API_NAME", $this->slm->getAPIAdapterName());
359  $this->tpl->parseCurrentBlock();
360  }
361 
362 
363  $val_set = $ilDB->queryF('
364  SELECT * FROM scorm_tracking
365  WHERE user_id = %s
366  AND sco_id = %s
367  AND obj_id = %s',
368  array('integer','integer','integer'),
369  array($ilUser->getId(),$sco_id,$this->slm->getId()));
370 
371  $re_value = array();
372 
373  while($val_rec = $ilDB->fetchAssoc($val_set))
374  {
375  $val_rec["rvalue"] = str_replace("\r\n", "\n", $val_rec["rvalue"]);
376  $val_rec["rvalue"] = str_replace("\r", "\n", $val_rec["rvalue"]);
377  $val_rec["rvalue"] = str_replace("\n", "\\n", $val_rec["rvalue"]);
378  $re_value[$val_rec["lvalue"]] = $val_rec["rvalue"];
379  }
380 
381  foreach($re_value as $var => $value)
382  {
383  switch ($var)
384  {
385  case "cmi.core.lesson_location":
386  case "cmi.core.lesson_status":
387  case "cmi.core.entry":
388  case "cmi.core.score.raw":
389  case "cmi.core.score.max":
390  case "cmi.core.score.min":
391  case "cmi.core.total_time":
392  case "cmi.core.exit":
393  case "cmi.suspend_data":
394  case "cmi.comments":
395  case "cmi.student_preference.audio":
396  case "cmi.student_preference.language":
397  case "cmi.student_preference.speed":
398  case "cmi.student_preference.text":
399  $this->setSingleVariable($var, $value);
400  break;
401 
402  case "cmi.objectives._count":
403  $this->setSingleVariable($var, $value);
404  $this->setArray("cmi.objectives", $value, "id", $re_value);
405  $this->setArray("cmi.objectives", $value, "score.raw", $re_value);
406  $this->setArray("cmi.objectives", $value, "score.max", $re_value);
407  $this->setArray("cmi.objectives", $value, "score.min", $re_value);
408  $this->setArray("cmi.objectives", $value, "status", $re_value);
409  break;
410 
411  case "cmi.interactions._count":
412  $this->setSingleVariable($var, $value);
413  $this->setArray("cmi.interactions", $value, "id", $re_value);
414  for($i=0; $i<$value; $i++)
415  {
416  $var2 = "cmi.interactions.".$i.".objectives._count";
417  if (isset($v_array[$var2]))
418  {
419  $cnt = $v_array[$var2];
420  $this->setArray("cmi.interactions.".$i.".objectives",
421  $cnt, "id", $re_value);
422  /*
423  $this->setArray("cmi.interactions.".$i.".objectives",
424  $cnt, "score.raw", $re_value);
425  $this->setArray("cmi.interactions.".$i.".objectives",
426  $cnt, "score.max", $re_value);
427  $this->setArray("cmi.interactions.".$i.".objectives",
428  $cnt, "score.min", $re_value);
429  $this->setArray("cmi.interactions.".$i.".objectives",
430  $cnt, "status", $re_value);*/
431  }
432  }
433  $this->setArray("cmi.interactions", $value, "time", $re_value);
434  $this->setArray("cmi.interactions", $value, "type", $re_value);
435  for($i=0; $i<$value; $i++)
436  {
437  $var2 = "cmi.interactions.".$i.".correct_responses._count";
438  if (isset($v_array[$var2]))
439  {
440  $cnt = $v_array[$var2];
441  $this->setArray("cmi.interactions.".$i.".correct_responses",
442  $cnt, "pattern", $re_value);
443  $this->setArray("cmi.interactions.".$i.".correct_responses",
444  $cnt, "weighting", $re_value);
445  }
446  }
447  $this->setArray("cmi.interactions", $value, "student_response", $re_value);
448  $this->setArray("cmi.interactions", $value, "result", $re_value);
449  $this->setArray("cmi.interactions", $value, "latency", $re_value);
450  break;
451  }
452  }
453 
454  global $lng;
455  $this->tpl->setCurrentBlock("switch_icon");
456  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
457  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath("scorm/running.gif"));
458  $this->tpl->setVariable("SCO_ALT",
459  $lng->txt("cont_status").": "
460  .$lng->txt("cont_sc_stat_running")
461  );
462  $this->tpl->parseCurrentBlock();
463 
464  // lesson mode
465  $lesson_mode = $this->slm->getDefaultLessonMode();
466  if ($this->slm->getAutoReview())
467  {
468  if ($re_value["cmi.core.lesson_status"] == "completed" ||
469  $re_value["cmi.core.lesson_status"] == "passed" ||
470  $re_value["cmi.core.lesson_status"] == "failed")
471  {
472  $lesson_mode = "review";
473  }
474  }
475  $this->tpl->setVariable("LESSON_MODE", $lesson_mode);
476 
477  // credit mode
478  if ($lesson_mode == "normal")
479  {
480  $this->tpl->setVariable("CREDIT_MODE",
481  str_replace("_", "-", $this->slm->getCreditMode()));
482  }
483  else
484  {
485  $this->tpl->setVariable("CREDIT_MODE", "no-credit");
486  }
487 
488  // init cmi.core.total_time, cmi.core.lesson_status and cmi.core.entry
489  $sahs_obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
490  if (!isset($re_value["cmi.core.total_time"]))
491  {
492  $item->insertTrackData("cmi.core.total_time", "0000:00:00", $sahs_obj_id);
493  }
494  if (!isset($re_value["cmi.core.lesson_status"]))
495  {
496  $item->insertTrackData("cmi.core.lesson_status", "not attempted", $sahs_obj_id);
497  }
498  if (!isset($re_value["cmi.core.entry"]))
499  {
500  $item->insertTrackData("cmi.core.entry", "", $sahs_obj_id);
501  }
502 
503  $this->tpl->show();
504  }
505 
506  function finishSahs ()
507  {
508  global $lng;
509  $this->tpl = new ilTemplate("tpl.sahs_finish_cbt.html", true, true, "Modules/ScormAicc");
510  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
511 
512  $this->tpl->setCurrentBlock("switch_icon");
513  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
514  $this->tpl->setVariable("SCO_ICO", ilUtil::getImagePath(
515  "scorm/".str_replace(" ", "_", $_GET["status"]).'.gif')
516  );
517  $this->tpl->setVariable("SCO_ALT",
518  $lng->txt("cont_status").": "
519  .$lng->txt("cont_sc_stat_".str_replace(" ", "_", $_GET["status"])).", "
520  .$lng->txt("cont_total_time"). ": "
521  .$_GET["totime"]
522  );
523  $this->tpl->setVariable("SCO_LAUNCH_ID", $_GET["launch"]);
524  $this->tpl->parseCurrentBlock();
525  $this->tpl->show();
526  }
527 
528  function unloadSahs ()
529  {
530  $this->tpl = new ilTemplate("tpl.sahs_unload_cbt.html", true, true, "Modules/ScormAicc");
531  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
532  $this->tpl->setVariable("SCO_ID", $_GET["sahs_id"]);
533  $this->tpl->show();
534  }
535 
536 
537  function launchAsset()
538  {
539  global $ilUser, $ilDB;
540 
541  $sco_id = ($_GET["asset_id"] == "")
542  ? $_POST["asset_id"]
543  : $_GET["asset_id"];
544  $ref_id = ($_GET["ref_id"] == "")
545  ? $_POST["ref_id"]
546  : $_GET["ref_id"];
547 
548  $this->slm =& new ilObjSCORMLearningModule($ref_id, true);
549 
550  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php");
551  include_once("./Modules/ScormAicc/classes/SCORM/class.ilSCORMResource.php");
552  $item =& new ilSCORMItem($sco_id);
553 
554  $id_ref = $item->getIdentifierRef();
555  $resource =& new ilSCORMResource();
556  $resource->readByIdRef($id_ref, $item->getSLMId());
557  $href = $resource->getHref();
558  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
559  $this->tpl = new ilTemplate("tpl.scorm_launch_asset.html", true, true, "Modules/ScormAicc");
560  $this->tpl->setVariable("HREF", $this->slm->getDataDirectory("output")."/".$href);
561  $this->tpl->show();
562  }
563 
564 
568  function setSingleVariable($a_var, $a_value)
569  {
570  $this->tpl->setCurrentBlock("set_value");
571  $this->tpl->setVariable("VAR", $a_var);
572  $this->tpl->setVariable("VALUE", $a_value);
573  $this->tpl->parseCurrentBlock();
574  }
575 
579  function setArray($a_left, $a_value, $a_name, &$v_array)
580  {
581  for($i=0; $i<$a_value; $i++)
582  {
583  $var = $a_left.".".$i.".".$a_name;
584  if (isset($v_array[$var]))
585  {
586  $this->tpl->setCurrentBlock("set_value");
587  $this->tpl->setVariable("VAR", $var);
588  $this->tpl->setVariable("VALUE", $v_array[$var]);
589  $this->tpl->parseCurrentBlock();
590  }
591  }
592  }
593 
599  function infoScreen()
600  {
601  $this->ctrl->setCmd("showSummary");
602  $this->ctrl->setCmdClass("ilinfoscreengui");
603  $this->outputInfoScreen();
604  }
605 
609  function outputInfoScreen($a_standard_locator = false)
610  {
611  global $ilBench, $ilLocator, $ilAccess, $tpl;
612 
613  //$this->tpl->setHeaderPageTitle("PAGETITLE", " - ".$this->lm->getTitle());
614 
615  // set style sheets
616  /*
617  if (!$this->offlineMode())
618  {
619  $this->tpl->setStyleSheetLocation(ilUtil::getStyleSheetLocation());
620  }
621  else
622  {
623  $style_name = $this->ilias->account->prefs["style"].".css";;
624  $this->tpl->setStyleSheetLocation("./".$style_name);
625  }*/
626 
627  $this->tpl->getStandardTemplate();
628  $this->tpl->setTitle($this->slm_gui->object->getTitle());
629  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_slm_b.gif"));
630 
631  $ilLocator->addRepositoryItems();
632  $ilLocator->addItem($this->slm_gui->object->getTitle(),
633  $this->ctrl->getLinkTarget($this, "infoScreen"), "", $_GET["ref_id"]);
634 
635  $this->tpl->setLocator();
636 
637  $this->lng->loadLanguageModule("meta");
638 
639  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
640 
641  $info = new ilInfoScreenGUI($this->slm_gui);
642  $info->enablePrivateNotes();
643  //$info->enableLearningProgress();
644 
645  $info->enableNews();
646  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
647  {
648  $info->enableNewsEditing();
649  $news_set = new ilSetting("news");
650  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
651  if ($enable_internal_rss)
652  {
653  $info->setBlockProperty("news", "settings", true);
654  }
655  }
656 
657  // add read / back button
658  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
659  {
660  $info->addButton($this->lng->txt("view"),
661  $this->ctrl->getLinkTarget($this, ""),
662  ' target="ilContObj'.$this->slm_gui->object->getId().'" ');
663  }
664 
665  // show standard meta data section
666  $info->addMetaDataSections($this->slm_gui->object->getId(),0,
667  $this->slm_gui->object->getType());
668 
669  /*
670  if ($this->offlineMode())
671  {
672  $this->tpl->setContent($info->getHTML());
673  return $this->tpl->get();
674  }
675  else
676  {*/
677  // forward the command
678  $this->ctrl->forwardCommand($info);
679  //$this->tpl->setContent("aa");
680  $this->tpl->show();
681  //}
682  }
683 
684 }
685 ?>