ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004PageNodeGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004NodeGUI.php");
5 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
6 
20 {
21 
26  function ilSCORM2004PageNodeGUI($a_slm_obj, $a_node_id = 0)
27  {
28  global $ilCtrl;
29 
30  $ilCtrl->saveParameter($this, "obj_id");
31 
32  parent::ilSCORM2004NodeGUI($a_slm_obj, $a_node_id);
33  }
34 
38  function getType()
39  {
40  return "page";
41  }
42 
46  function &executeCommand()
47  {
48  global $ilCtrl, $tpl;
49 
50  $next_class = $ilCtrl->getNextClass($this);
51  $cmd = $ilCtrl->getCmd();
52 
53  switch($next_class)
54  {
55 
56  case "ilscorm2004pagegui":
57  $tpl->getStandardTemplate();
58  $this->setContentStyle();
59  $this->setLocator();
60  // Determine whether the view of a learning resource should
61  // be shown in the frameset of ilias, or in a separate window.
62  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
63  $showViewInFrameset = true;
64 
65  $ilCtrl->setReturn($this, "edit");
66  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
67  $page_gui =& new ilSCORM2004PageGUI($this->slm_object->getType(),
68  $this->node_object->getId(), 0,
69  $this->getParentGUI()->object->getId(),
70  $this->slm_object->getAssignedGlossary());
71  $page_gui->setEditPreview(true);
72  $page_gui->setPresentationTitle($this->node_object->getTitle());
73  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
74  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
75  $this->slm_object->getStyleSheetId(), "sahs"));
76 
77  if ($this->node_object->tree->getParentId($this->node_object->getId()) > 0)
78  {
79  $sco = new ilSCORM2004Sco(
80  $this->node_object->getSLMObject(),
81  $this->node_object->tree->getParentId(
82  $this->node_object->getId()));
83  if (count($sco->getGlossaryTermIds()) > 1)
84  {
85  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php");
86  $page_gui->setGlossaryOverviewInfo(
88  }
89  }
90 
91  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui",
92  "active_node", $_GET["obj_id"]);
93  $page_gui->setExplorerUpdater("tree", "tree_div",
94  $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui",
95  "showTree", "", true));
96  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui",
97  "active_node", "");
98 
99  // set page view link
100  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
101  $page_gui->setLinkParams("ref_id=".$this->slm_object->getRefId());
102  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png"));
103 
104  $page_gui->activateMetaDataEditor($this->slm_object->getID(),
105  $this->node_object->getId(), $this->node_object->getType(),
106  $this->node_object,'MDUpdateListener');
107 
108 
109  $ret = $ilCtrl->forwardCommand($page_gui);
110  $this->setTabs();
111  $tpl->setContent($ret);
112  break;
113 
114  default:
115  $ret =& $this->$cmd();
116  break;
117  }
118 
119  return $ret;
120  }
121 
125  function edit()
126  {
127  global $ilCtrl;
128 
129  $ilCtrl->setCmdClass("ilscorm2004pagegui");
130  $ilCtrl->setCmd("edit");
131  $this->executeCommand();
132  }
133 
137  function setTabs()
138  {
139  global $ilTabs, $ilCtrl, $tpl, $lng;
140 
141  // metadata
142 /* $ilTabs->addTarget("meta_data",
143  $ilCtrl->getLinkTargetByClass("ilmdeditorgui",''),
144  "", "ilmdeditorgui");*/
145 
146  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.png"));
147  $tpl->setTitle(
148  $lng->txt("sahs_page").": ".$this->node_object->getTitle());
149  }
150 
151 }
152 ?>