ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSCORM2004PageNodeGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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("./Modules/Scorm2004/classes/class.ilSCORM2004NodeGUI.php");
25 require_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageNode.php");
26 
40 {
41 
46  function ilSCORM2004PageNodeGUI($a_slm_obj, $a_node_id = 0)
47  {
48  global $ilCtrl;
49 
50  $ilCtrl->saveParameter($this, "obj_id");
51 
52  parent::ilSCORM2004NodeGUI($a_slm_obj, $a_node_id);
53  }
54 
58  function getType()
59  {
60  return "page";
61  }
62 
66  function &executeCommand()
67  {
68  global $ilCtrl, $tpl;
69 
70  $next_class = $ilCtrl->getNextClass($this);
71  $cmd = $ilCtrl->getCmd();
72 
73  switch($next_class)
74  {
75 
76  case "ilscorm2004pagegui":
77  $tpl->getStandardTemplate();
78  $this->setLocator();
79  // Determine whether the view of a learning resource should
80  // be shown in the frameset of ilias, or in a separate window.
81  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
82  $showViewInFrameset = true;
83 
84  $ilCtrl->setReturn($this, "edit");
85  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004PageGUI.php");
86  $page_gui =& new ilSCORM2004PageGUI($this->slm_object->getType(),
87  $this->node_object->getId(), 0,
88  $this->getParentGUI()->object->getId(),
89  $this->slm_object->getAssignedGlossary());
90  $page_gui->setEditPreview(true);
91  $page_gui->setPresentationTitle($this->node_object->getTitle());
92  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
93  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
94  $this->slm_object->getStyleSheetId(), "sahs"));
95  $sco = new ilSCORM2004Sco(
96  $this->node_object->getSLMObject(),
97  $this->node_object->tree->getParentId(
98  $this->node_object->getId()));
99  if (count($sco->getGlossaryTermIds()) > 1)
100  {
101  include_once("./Modules/Scorm2004/classes/class.ilSCORM2004ScoGUI.php");
102  $page_gui->setGlossaryOverviewInfo(
104  }
105 
106  //$page_gui->activateMetaDataEditor($this->content_object->getID(),
107  // $this->obj->getId(), $this->obj->getType(),
108  // $this->obj, "MDUpdateListener");
109 
110  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui",
111  "active_node", $_GET["obj_id"]);
112  $page_gui->setExplorerUpdater("tree", "tree_div",
113  $ilCtrl->getLinkTargetByClass("ilobjscorm2004learningmodulegui",
114  "showTree", "", true));
115  $ilCtrl->setParameterByClass("ilobjscorm2004learningmodulegui",
116  "active_node", "");
117 
118  // set page view link
119  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
120  //$page_gui->setViewPageLink(ILIAS_HTTP_PATH."/goto.php?target=pg_".$this->obj->getId().
121  // "_".$_GET["ref_id"],
122  // $view_frame);
123 
124  //$page_gui->setTemplateTargetVar("ADM_CONTENT");
125  //$page_gui->setLinkXML($link_xml);
126  //$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
127  //$page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
128  //$page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
129  $page_gui->setLinkParams("ref_id=".$this->slm_object->getRefId());
130  //$page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
131  /*$page_gui->setPresentationTitle(
132  ilLMPageObject::_getPresentationTitle($this->obj->getId(),
133  $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));*/
134  //$page_gui->setLocator($contObjLocator);
135  //$page_gui->setHeader($this->lng->txt("page").": ".$this->obj->getTitle());
136 
137  //$page_gui->setEnabledActivation(true);
138  //$page_gui->setActivationListener($this, "activatePage");
139  //$page_gui->setActivated($this->obj->getActive());
140 
141  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.gif"));
142  //$tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
143 
144  $page_gui->activateMetaDataEditor($this->slm_object->getID(),
145  $this->node_object->getId(), $this->node_object->getType(),
146  $this->node_object,'MDUpdateListener');
147 
148 
149  $ret = $ilCtrl->forwardCommand($page_gui);
150  $this->setTabs();
151  $tpl->setContent($ret);
152  break;
153 
154  default:
155  $ret =& $this->$cmd();
156  break;
157  }
158 
159  return $ret;
160  }
161 
165  function edit()
166  {
167  global $ilCtrl;
168 
169  $ilCtrl->setCmdClass("ilscorm2004pagegui");
170  $ilCtrl->setCmd("edit");
171  $this->executeCommand();
172  }
173 
177  function setTabs()
178  {
179  global $ilTabs, $ilCtrl, $tpl, $lng;
180 
181  // metadata
182 /* $ilTabs->addTarget("meta_data",
183  $ilCtrl->getLinkTargetByClass("ilmdeditorgui",''),
184  "", "ilmdeditorgui");*/
185 
186  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg_b.gif"));
187  $tpl->setTitle(
188  $lng->txt("sahs_page").": ".$this->node_object->getTitle());
189  }
190 
191 }
192 ?>