ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLMPageObjectGUI Class Reference

Class ilLMPageObjectGUI. More...

+ Inheritance diagram for ilLMPageObjectGUI:
+ Collaboration diagram for ilLMPageObjectGUI:

Public Member Functions

 ilLMPageObjectGUI (&$a_content_obj)
 Constructor. More...
 
 setLMPageObject ($a_pg_obj)
 Set content object dependent page object (co page) More...
 
executeCommand ()
 execute command More...
 
 edit ()
 
 preview ()
 
 save ()
 save co page object More...
 
 cancel ()
 cancel More...
 
 getLinkXML ($a_int_links)
 get link targets More...
 
 updateHistory ()
 update history More...
 
 editLayout ()
 Edit layout of page. More...
 
 initEditLayoutForm ()
 Init edit layout form. More...
 
 saveLayout ()
 Save layout. More...
 
 addPageTabs ()
 Add page tabs. More...
 
 downloadFile ()
 download file of file lists More...
 
- Public Member Functions inherited from ilLMObjectGUI
 ilLMObjectGUI (&$a_content_obj)
 constructor More...
 
 setActions ($a_actions="")
 build action array More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 putInTree ()
 put this object into content object tree More...
 
 delete ()
 Confirm deletion screen (delete page or structure objects) More...
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 showActions ($a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto ($a_target)
 redirect script More...
 

Data Fields

 $obj
 
- Data Fields inherited from ilLMObjectGUI
 $ilias
 
 $tpl
 
 $lng
 
 $obj
 
 $ctrl
 
 $content_object
 
 $actions
 

Detailed Description

Class ilLMPageObjectGUI.

User Interface for Learning Module Page Objects Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilLMPageObjectGUI: ilLMPageGUI, ilAssGenFeedbackPageGUI

Definition at line 21 of file class.ilLMPageObjectGUI.php.

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

Definition at line 346 of file class.ilLMPageObjectGUI.php.

References $_GET, $ilErr, ilLMObjectGUI\$lng, $ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

347  {
348  global $rbacsystem, $ilErr, $lng, $ilAccess;
349 
350  $first = strpos($a_target, "_");
351  $second = strpos($a_target, "_", $first + 1);
352  $page_id = substr($a_target, 0, $first);
353  if ($first > 0)
354  {
355  $page_id = substr($a_target, 0, $first);
356  if ($second > 0)
357  {
358  $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
359  $anchor = substr($a_target, $second + 1);
360  }
361  else
362  {
363  $ref_id = substr($a_target, $first + 1);
364  }
365  }
366  else
367  {
368  $page_id = $a_target;
369  }
370 
371  // determine learning object
372  $lm_id = ilLMObject::_lookupContObjID($page_id);
373 
374  // get all references
375  $ref_ids = ilObject::_getAllReferences($lm_id);
376 
377  // always try passed ref id first
378  if (in_array($ref_id, $ref_ids))
379  {
380  $ref_ids = array_merge(array($ref_id), $ref_ids);
381  }
382 
383  // check read permissions
384  foreach ($ref_ids as $ref_id)
385  {
386  // check read permissions
387  if ($ilAccess->checkAccess("read", "", $ref_id))
388  {
389  // don't redirect anymore, just set parameters
390  // (goto.php includes "ilias.php")
391  $_GET["baseClass"] = "ilLMPresentationGUI";
392  $_GET["obj_id"] = $page_id;
393  $_GET["ref_id"] = $ref_id;
394  $_GET["anchor"] = $anchor;
395  include_once("ilias.php");
396  exit;
397  }
398  }
399 
400  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
401  {
402  if ($lm_id > 0)
403  {
404  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
405  ilObject::_lookupTitle($lm_id)), true);
406  }
407  else
408  {
409  $lng->loadLanguageModule("content");
410  ilUtil::sendFailure($lng->txt("page_does_not_exist"), true);
411  }
412  include_once("./Services/Object/classes/class.ilObjectGUI.php");
414  }
415 
416  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
417  }
exit
Definition: login.php:54
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
_lookupContObjID($a_id)
get learning module / digibook id for lm object
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ref_id
Definition: sahs_server.php:39
+ Here is the call graph for this function:

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

Add page tabs.

Definition at line 510 of file class.ilLMPageObjectGUI.php.

References $ilCtrl.

511  {
512  global $ilTabs, $ilCtrl;
513 
514  $ilTabs->addTarget("cont_layout",
515  $ilCtrl->getLinkTarget($this, 'editLayout'), "editLayout");
516  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

Definition at line 211 of file class.ilLMPageObjectGUI.php.

References $_GET, and ilUtil\redirect().

212  {
213  if ($_GET["obj_id"] != 0)
214  {
215  ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
216  "view", "", true));
217  }
218  $up_gui = ($this->content_object->getType() == "dbk")
219  ? "ilobjdlbookgui"
220  : "ilobjlearningmodulegui";
221  $this->ctrl->redirectByClass($up_gui, "pages");
222  }
$_GET["client_id"]
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPageObjectGUI::downloadFile ( )

download file of file lists

Definition at line 521 of file class.ilLMPageObjectGUI.php.

References $_GET, $file, and exit.

522  {
523  $pg_obj = $this->obj->getPageObject();
524  $pg_obj->buildDom();
525  $int_links = $pg_obj->getInternalLinks();
526  foreach ($int_links as $il)
527  {
528  if ($il["Target"] == str_replace("_file_", "_dfile_", $_GET["file_id"]))
529  {
530  $file = explode("_", $_GET["file_id"]);
531  $file_id = (int) $file[count($file) - 1];
532  require_once("./Modules/File/classes/class.ilObjFile.php");
533  $fileObj = new ilObjFile($file_id, false);
534  $fileObj->sendFile();
535  exit;
536  }
537  }
538  }
print $file
exit
Definition: login.php:54
$_GET["client_id"]
Class ilObjFile.

◆ edit()

ilLMPageObjectGUI::edit ( )

Definition at line 157 of file class.ilLMPageObjectGUI.php.

References executeCommand().

158  {
159 //echo "<br>umschuss";
160  $this->ctrl->setCmdClass("ilLMPageGUI");
161  $this->ctrl->setCmd("edit");
162  $this->executeCommand();
163  //$this->setTabs();
164  }
& executeCommand()
execute command
+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

Definition at line 422 of file class.ilLMPageObjectGUI.php.

References $ilCtrl, $lm_set, $obj, ilLMObjectGUI\$tpl, ilUtil\getImagePath(), initEditLayoutForm(), and ilPageObjectGUI\setEditPreview().

423  {
424  global $tpl, $ilCtrl, $ilTabs;
425 
426  $page_gui = new ilLMPageGUI($this->obj->getId());
427  $page_gui->setEditPreview(true);
428  $page_gui->activateMetaDataEditor($this->content_object->getID(),
429  $this->obj->getId(), $this->obj->getType(),
430  $this->obj, "MDUpdateListener");
431  $page_gui->setActivationListener($this, "activatePage");
432  $page_gui->setTabHook($this, "addPageTabs");
433  $lm_set = new ilSetting("lm");
434  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
435  $tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
436  $ilCtrl->getHTML($page_gui);
437  $ilTabs->setTabActive("cont_layout");
438  $this->initEditLayoutForm();
439  $tpl->setContent($this->form->getHTML());
440  }
ILIAS Setting Class.
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Extension of ilPageObjectGUI for learning modules.
$lm_set
initEditLayoutForm()
Init edit layout form.
+ Here is the call graph for this function:

◆ executeCommand()

& ilLMPageObjectGUI::executeCommand ( )

execute command

Definition at line 52 of file class.ilLMPageObjectGUI.php.

References $_GET, $cmd, $ilCtrl, $ilSetting, $lm_set, $obj, $ret, ilLMObjectGUI\$tpl, ilPageObject\_exists(), ilFrameTargetInfo\_getFrame(), ilLMPageObject\_getPresentationTitle(), ilObjStyleSheet\getEffectiveContentStyleId(), ilUtil\getImagePath(), getLinkXML(), and ilPageObjectGUI\setEditPreview().

Referenced by edit(), and preview().

53  {
54  global $tpl, $ilCtrl, $ilTabs, $ilSetting;
55 
56  $next_class = $this->ctrl->getNextClass($this);
57  $cmd = $this->ctrl->getCmd();
58 
59 //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
60 // ":nextClass:".$next_class.":"; flush();
61 
62  switch($next_class)
63  {
64  case "illmpagegui":
65 
66  // Determine whether the view of a learning resource should
67  // be shown in the frameset of ilias, or in a separate window.
68  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
69  $showViewInFrameset = true;
70  $lm_set = new ilSetting("lm");
71 
72  $this->ctrl->setReturn($this, "edit");
73  if (!ilPageObject::_exists("lm", $this->obj->getId(), $_GET["transl"]) &&
74  ilPageObject::_exists("lm", $this->obj->getId(), "-"))
75  {
76  if ($_GET["totransl"] == "")
77  {
78  $_GET["totransl"] = $_GET["transl"];
79  $ilCtrl->setCmd("switchToLanguage");
80  }
81  $ilCtrl->setCmdClass("illmpagegui");
82  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
83  }
84  else
85  {
86  $page_gui = new ilLMPageGUI($this->obj->getId());
87  }
88  $page_gui->setEditPreview(true);
89  $page_gui->activateMetaDataEditor($this->content_object->getID(),
90  $this->obj->getId(), $this->obj->getType(),
91  $this->obj, "MDUpdateListener");
92  if ($ilSetting->get("block_activated_news"))
93  {
94  $page_gui->setEnabledNews(true, $this->obj->content_object->getId(),
95  $this->obj->content_object->getType());
96  }
97 
98  // set page view link
99  if ($showViewInFrameset)
100  {
101  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
102  }
103  else
104  {
105  $view_frame = "ilContObj".$this->content_object->getID();
106  }
107  $page_gui->setViewPageLink(ILIAS_HTTP_PATH."/goto.php?target=pg_".$this->obj->getId().
108  "_".$_GET["ref_id"],
109  $view_frame);
110 
111  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
112  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
113  $this->content_object->getStyleSheetId(), "lm"));
114  $page_gui->setTemplateTargetVar("ADM_CONTENT");
115  $page_gui->getPageObject()->buildDom();
116  $int_links = $page_gui->getPageObject()->getInternalLinks();
117  $link_xml = $this->getLinkXML($int_links);
118  $page_gui->setLinkXML($link_xml);
119 
120  $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
121  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
122  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
123  $page_gui->setLinkParams("ref_id=".$this->content_object->getRefId());
124  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
125  $page_gui->setPresentationTitle(
126  ilLMPageObject::_getPresentationTitle($this->obj->getId(),
127  $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
128  $page_gui->setLocator($contObjLocator);
129  $page_gui->setHeader($this->lng->txt("page").": ".$this->obj->getTitle());
130  $page_gui->setActivationListener($this, "activatePage");
131 
132  $up_gui = ($this->content_object->getType() == "dbk")
133  ? "ilobjdlbookgui"
134  : "ilobjlearningmodulegui";
135  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
136 
137  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
138  $tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
139  if ($this->content_object->getLayoutPerPage())
140  {
141  $page_gui->setTabHook($this, "addPageTabs");
142  }
143  $ret = $this->ctrl->forwardCommand($page_gui);
144  $tpl->setContent($ret);
145  break;
146 
147  default:
148  $ret =& $this->$cmd();
149  break;
150  }
151  }
ILIAS Setting Class.
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Extension of ilPageObjectGUI for learning modules.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static _getFrame($a_class, $a_type='')
Get content frame name.
$lm_set
global $ilSetting
Definition: privfeed.php:40
getLinkXML($a_int_links)
get link targets
static _getPresentationTitle($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkXML()

ilLMPageObjectGUI::getLinkXML (   $a_int_links)

get link targets

Definition at line 227 of file class.ilLMPageObjectGUI.php.

References $_GET, ilLMObjectGUI\$content_object, $target_arr, $target_id, ilFrameTargetInfo\_getFrame(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), and ilObject\_lookupType().

Referenced by executeCommand().

228  {
229  if ($a_layoutframes == "")
230  {
231  $a_layoutframes = array();
232  }
233  $link_info = "<IntLinkInfos>";
234  foreach ($a_int_links as $int_link)
235  {
236  $target = $int_link["Target"];
237  if (substr($target, 0, 4) == "il__")
238  {
239  $target_arr = explode("_", $target);
240  $target_id = $target_arr[count($target_arr) - 1];
241  $type = $int_link["Type"];
242  $targetframe = ($int_link["TargetFrame"] != "")
243  ? $int_link["TargetFrame"]
244  : "None";
245 
246  // anchor
247  $anc = $anc_add = "";
248  if ($int_link["Anchor"] != "")
249  {
250  $anc = $int_link["Anchor"];
251  $anc_add = "_".rawurlencode($int_link["Anchor"]);
252  }
253 
254  switch($type)
255  {
256  case "PageObject":
257  case "StructureObject":
259  $cont_obj =& $this->content_object;
260  if ($lm_id == $cont_obj->getId())
261  {
262  $ltarget = "";
263  if ($type == "PageObject")
264  {
265  $this->ctrl->setParameter($this, "obj_id", $target_id);
266  $href = $this->ctrl->getLinkTargetByClass(get_class($this), "edit");
267  }
268  else
269  {
270  $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
271  $href = $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view");
272  }
273  $href = str_replace("&", "&amp;", $href);
274  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
275  }
276  else
277  {
278  if ($type == "PageObject")
279  {
280  $href = "goto.php?target=pg_".$target_id.$anc_add;
281  }
282  else
283  {
284  $href = "goto.php?target=st_".$target_id;
285  }
286  $ltarget = "ilContObj".$lm_id;
287  }
288  break;
289 
290  case "GlossaryItem":
291  $ltarget = $nframe = "_blank";
292  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;".
293  "obj_type=$type&amp;cmd=glossary&amp;ref_id=".$_GET["ref_id"].
294  "&amp;obj_id=".$target_id."&amp;frame=$nframe";
295  break;
296 
297  case "MediaObject":
298  $ltarget = $nframe = "_blank";
299  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type=$type&amp;cmd=media&amp;ref_id=".$_GET["ref_id"].
300  "&amp;mob_id=".$target_id."&amp;frame=$nframe";
301  break;
302 
303  case "RepositoryItem":
304  $obj_type = ilObject::_lookupType($target_id, true);
306  $href = "./goto.php?target=".$obj_type."_".$target_id;
307  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
308  $ltarget = $t_frame;
309  break;
310 
311  case "File":
312  $this->ctrl->setParameter($this, "file_id", "il__file_".$target_id);
313  $href = $this->ctrl->getLinkTarget($this, "downloadFile");
314  $this->ctrl->setParameter($this, "file_id", "");
315  break;
316 
317  }
318 
319  $anc_par = 'Anchor="'.$anc.'"';
320 
321  $link_info.="<IntLinkInfo Target=\"$target\" Type=\"$type\" ".
322  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" $anc_par/>";
323  }
324  }
325  $link_info.= "</IntLinkInfos>";
326 //echo ":".htmlentities($link_info).":";
327  return $link_info;
328  }
$target_arr
Definition: goto.php:86
$_GET["client_id"]
$target_id
Definition: goto.php:88
static _lookupObjId($a_id)
_lookupContObjID($a_id)
get learning module / digibook id for lm object
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getFrame($a_class, $a_type='')
Get content frame name.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilLMPageObjectGUI()

ilLMPageObjectGUI::ilLMPageObjectGUI ( $a_content_obj)

Constructor.

Parameters
object$a_content_objcontent object (lm | dbk) public

Definition at line 31 of file class.ilLMPageObjectGUI.php.

References ilLMObjectGUI\$ilias, ilLMObjectGUI\$lng, and ilLMObjectGUI\$tpl.

32  {
33  global $ilias, $tpl, $lng;
34 
35  parent::ilLMObjectGUI($a_content_obj);
36 
37  }

◆ initEditLayoutForm()

ilLMPageObjectGUI::initEditLayoutForm ( )

Init edit layout form.

Parameters
int$a_modeEdit Mode

Definition at line 447 of file class.ilLMPageObjectGUI.php.

References $ilCtrl, ilLMObjectGUI\$lng, ilObjContentObject\getAvailableLayouts(), ilUtil\getImagePath(), and ilUtil\img().

Referenced by editLayout(), and saveLayout().

448  {
449  global $lng, $ilCtrl;
450 
451  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
452  $this->form = new ilPropertyFormGUI();
453 
454  // default layout
455  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
456 
457  if (is_file($im = ilUtil::getImagePath("layout_".$this->content_object->getLayout().".png")))
458  {
459  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
460  }
461  $layout->addOption(new ilRadioOption("<table><tr><td>".$im_tag."</td><td><b>".
462  $lng->txt("cont_lm_default_layout").
463  "</b>: ".$lng->txt("cont_layout_".$this->content_object->getLayout()).
464  "</td></tr></table>", ""));
465 
467  {
468  $im_tag = "";
469  if (is_file($im = ilUtil::getImagePath("layout_".$l.".png")))
470  {
471  $im_tag = ilUtil::img($im, $l);
472  }
473  $layout->addOption(new ilRadioOption("<table><tr><td>".$im_tag."</td><td><b>".
474  $lng->txt("cont_layout_".$l)."</b>: ".$lng->txt("cont_layout_".$l."_desc").
475  "</td></tr></table>", $l));
476  }
477 
478  $layout->setValue($this->obj->getLayout());
479  $this->form->addItem($layout);
480 
481  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
482 
483  $this->form->setTitle($lng->txt("cont_page_layout"));
484  $this->form->setFormAction($ilCtrl->getFormAction($this));
485 
486  }
This class represents an option in a radio group.
This class represents a property form user interface.
getAvailableLayouts()
get all available lm layouts
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview()

ilLMPageObjectGUI::preview ( )

Definition at line 169 of file class.ilLMPageObjectGUI.php.

References executeCommand().

170  {
171  $this->ctrl->setCmdClass("ilLMPageGUI");
172  $this->ctrl->setCmd("preview");
173  $this->executeCommand();
174 // $this->setTabs();
175  }
& executeCommand()
execute command
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

save co page object

Definition at line 180 of file class.ilLMPageObjectGUI.php.

References $_GET, $_POST, ilLMObjectGUI\checkTree(), ilLMObjectGUI\putInTree(), ilUtil\redirect(), and ilUtil\stripSlashes().

181  {
182  $this->obj =& new ilLMPageObject($this->content_object);
183  $this->obj->setType("pg");
184  $this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
185  $this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
186  $this->obj->setLMId($this->content_object->getId());
187  $this->obj->create();
188 
189  // obj_id is empty, if page is created from "all pages" screen
190  // -> a free page is created (not in the tree)
191 //echo "<br>savePage:".$_GET["obj_id"].":";
192  if ($_GET["obj_id"] != 0)
193  {
194  $this->putInTree();
195 
196  // check the tree
197  $this->checkTree();
198 
199  ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
200  "edit", "", true));
201  }
202  $up_gui = ($this->content_object->getType() == "dbk")
203  ? "ilobjdlbookgui"
204  : "ilobjlearningmodulegui";
205  $this->ctrl->redirectByClass($up_gui, "pages");
206  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
checkTree()
check the content object tree
Class ilLMPageObject.
putInTree()
put this object into content object tree
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

Save layout.

Definition at line 492 of file class.ilLMPageObjectGUI.php.

References $ilCtrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, initEditLayoutForm(), ilUtil\sendSuccess(), and ilLMObject\writeLayout().

493  {
494  global $tpl, $lng, $ilCtrl;
495 
496  $this->initEditLayoutForm();
497  if ($this->form->checkInput())
498  {
499  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
500  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
501  $ilCtrl->redirect($this, "editLayout");
502  }
503  $this->form->setValuesByPost();
504  $tpl->setContent($this->form->getHtml());
505  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
global $ilCtrl
Definition: ilias.php:18
initEditLayoutForm()
Init edit layout form.
+ Here is the call graph for this function:

◆ setLMPageObject()

ilLMPageObjectGUI::setLMPageObject (   $a_pg_obj)

Set content object dependent page object (co page)

Definition at line 43 of file class.ilLMPageObjectGUI.php.

44  {
45  $this->obj = $a_pg_obj;
46  $this->obj->setLMId($this->content_object->getId());
47  }

◆ updateHistory()

ilLMPageObjectGUI::updateHistory ( )

update history

Definition at line 333 of file class.ilLMPageObjectGUI.php.

References ilHistory\_createEntry().

334  {
335  require_once("./Services/History/classes/class.ilHistory.php");
336  ilHistory::_createEntry($this->obj->getId(), "update",
337  "", $this->content_object->getType().":pg",
338  "", true);
339  }
_createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
+ Here is the call graph for this function:

Field Documentation

◆ $obj

ilLMPageObjectGUI::$obj

Definition at line 23 of file class.ilLMPageObjectGUI.php.

Referenced by editLayout(), and executeCommand().


The documentation for this class was generated from the following file: