ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLMPageObjectGUI Class Reference

Class ilLMPageObjectGUI. More...

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

Public Member Functions

 __construct (&$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
 __construct (&$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.

Constructor & Destructor Documentation

◆ __construct()

ilLMPageObjectGUI::__construct ( $a_content_obj)

Constructor.

Parameters
object$a_content_objcontent object (lm | dbk) public

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

32  {
33  parent::__construct($a_content_obj);
34 
35  }

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

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

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

References $ilCtrl.

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

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

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

References $_GET, and ilUtil\redirect().

206  {
207  if ($_GET["obj_id"] != 0)
208  {
209  ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
210  "view", "", true));
211  }
212  $up_gui = "ilobjlearningmodulegui";
213  $this->ctrl->redirectByClass($up_gui, "pages");
214  }
$_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 519 of file class.ilLMPageObjectGUI.php.

References $_GET, $file, and exit.

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

◆ edit()

ilLMPageObjectGUI::edit ( )

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

References executeCommand().

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

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

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

421  {
422  global $tpl, $ilCtrl, $ilTabs;
423 
424  $page_gui = new ilLMPageGUI($this->obj->getId());
425  $page_gui->setEditPreview(true);
426  $page_gui->activateMetaDataEditor($this->content_object,
427  $this->obj->getType(), $this->obj->getId(),
428  $this->obj, "MDUpdateListener");
429  $page_gui->setActivationListener($this, "activatePage");
430  $page_gui->setTabHook($this, "addPageTabs");
431  $lm_set = new ilSetting("lm");
432  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
433  $tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
434  $ilCtrl->getHTML($page_gui);
435  $ilTabs->setTabActive("cont_layout");
436  $this->initEditLayoutForm();
437  $tpl->setContent($this->form->getHTML());
438  }
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 50 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().

51  {
52  global $tpl, $ilCtrl, $ilTabs, $ilSetting;
53 
54  $next_class = $this->ctrl->getNextClass($this);
55  $cmd = $this->ctrl->getCmd();
56 
57 //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
58 // ":nextClass:".$next_class.":"; flush();
59 
60  switch($next_class)
61  {
62  case "illmpagegui":
63 
64  // Determine whether the view of a learning resource should
65  // be shown in the frameset of ilias, or in a separate window.
66  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
67  $showViewInFrameset = true;
68  $lm_set = new ilSetting("lm");
69 
70  $this->ctrl->setReturn($this, "edit");
71  if (!ilPageObject::_exists("lm", $this->obj->getId(), $_GET["transl"]) &&
72  ilPageObject::_exists("lm", $this->obj->getId(), "-"))
73  {
74  if ($_GET["totransl"] == "")
75  {
76  $_GET["totransl"] = $_GET["transl"];
77  $ilCtrl->setCmd("switchToLanguage");
78  }
79  $ilCtrl->setCmdClass("illmpagegui");
80  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
81  }
82  else
83  {
84  $page_gui = new ilLMPageGUI($this->obj->getId());
85  }
86  $page_gui->setEditPreview(true);
87  $page_gui->activateMetaDataEditor($this->content_object,
88  $this->obj->getType(), $this->obj->getId(),
89  $this->obj, "MDUpdateListener");
90  if ($ilSetting->get("block_activated_news"))
91  {
92  $page_gui->setEnabledNews(true, $this->obj->content_object->getId(),
93  $this->obj->content_object->getType());
94  }
95 
96  // set page view link
97  if ($showViewInFrameset)
98  {
99  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
100  }
101  else
102  {
103  $view_frame = "ilContObj".$this->content_object->getID();
104  }
105  $page_gui->setViewPageLink(ILIAS_HTTP_PATH."/goto.php?target=pg_".$this->obj->getId().
106  "_".$_GET["ref_id"],
107  $view_frame);
108 
109  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
110  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
111  $this->content_object->getStyleSheetId(), "lm"));
112  $page_gui->setTemplateTargetVar("ADM_CONTENT");
113  $page_gui->getPageObject()->buildDom();
114  $int_links = $page_gui->getPageObject()->getInternalLinks();
115  $link_xml = $this->getLinkXML($int_links);
116  $page_gui->setLinkXML($link_xml);
117 
118  $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
119  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
120  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
121  $page_gui->setLinkParams("ref_id=".$this->content_object->getRefId());
122  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=".$_GET["ref_id"]."&baseClass=ilLMPresentationGUI");
123  $page_gui->setPresentationTitle(
124  ilLMPageObject::_getPresentationTitle($this->obj->getId(),
125  $this->content_object->getPageHeader(), $this->content_object->isActiveNumbering()));
126  $page_gui->setLocator($contObjLocator);
127  $page_gui->setHeader($this->lng->txt("page").": ".$this->obj->getTitle());
128  $page_gui->setActivationListener($this, "activatePage");
129 
130  $up_gui = "ilobjlearningmodulegui";
131  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
132 
133  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
134  $tpl->setTitle($this->lng->txt("page").": ".$this->obj->getTitle());
135  if ($this->content_object->getLayoutPerPage())
136  {
137  $page_gui->setTabHook($this, "addPageTabs");
138  }
139  $ret = $this->ctrl->forwardCommand($page_gui);
140  $tpl->setContent($ret);
141  break;
142 
143  default:
144  $ret = $this->$cmd();
145  break;
146  }
147  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
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 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:17
getLinkXML($a_int_links)
get link targets
$ret
Definition: parser.php:6
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 219 of file class.ilLMPageObjectGUI.php.

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

Referenced by executeCommand().

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

◆ initEditLayoutForm()

ilLMPageObjectGUI::initEditLayoutForm ( )

Init edit layout form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by editLayout(), and saveLayout().

446  {
447  global $lng, $ilCtrl;
448 
449  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
450  $this->form = new ilPropertyFormGUI();
451 
452  // default layout
453  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
454 
455  if (is_file($im = ilUtil::getImagePath("layout_".$this->content_object->getLayout().".png")))
456  {
457  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
458  }
459  $layout->addOption(new ilRadioOption("<table><tr><td>".$im_tag."</td><td><b>".
460  $lng->txt("cont_lm_default_layout").
461  "</b>: ".$lng->txt("cont_layout_".$this->content_object->getLayout()).
462  "</td></tr></table>", ""));
463 
465  {
466  $im_tag = "";
467  if (is_file($im = ilUtil::getImagePath("layout_".$l.".png")))
468  {
469  $im_tag = ilUtil::img($im, $l);
470  }
471  $layout->addOption(new ilRadioOption("<table><tr><td>".$im_tag."</td><td><b>".
472  $lng->txt("cont_layout_".$l)."</b>: ".$lng->txt("cont_layout_".$l."_desc").
473  "</td></tr></table>", $l));
474  }
475 
476  $layout->setValue($this->obj->getLayout());
477  $this->form->addItem($layout);
478 
479  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
480 
481  $this->form->setTitle($lng->txt("cont_page_layout"));
482  $this->form->setFormAction($ilCtrl->getFormAction($this));
483 
484  }
This class represents an option in a radio group.
This class represents a property form user interface.
static 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.
global $l
Definition: afr.php:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview()

ilLMPageObjectGUI::preview ( )

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

References executeCommand().

166  {
167  $this->ctrl->setCmdClass("ilLMPageGUI");
168  $this->ctrl->setCmd("preview");
169  $this->executeCommand();
170 // $this->setTabs();
171  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

save co page object

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

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

177  {
178  $this->obj = new ilLMPageObject($this->content_object);
179  $this->obj->setType("pg");
180  $this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
181  $this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
182  $this->obj->setLMId($this->content_object->getId());
183  $this->obj->create();
184 
185  // obj_id is empty, if page is created from "all pages" screen
186  // -> a free page is created (not in the tree)
187 //echo "<br>savePage:".$_GET["obj_id"].":";
188  if ($_GET["obj_id"] != 0)
189  {
190  $this->putInTree();
191 
192  // check the tree
193  $this->checkTree();
194 
195  ilUtil::redirect($this->ctrl->getLinkTargetByClass("ilStructureObjectGUI",
196  "edit", "", true));
197  }
198  $up_gui = "ilobjlearningmodulegui";
199  $this->ctrl->redirectByClass($up_gui, "pages");
200  }
$_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
$_POST["username"]
+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

Save layout.

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

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

491  {
492  global $tpl, $lng, $ilCtrl;
493 
494  $this->initEditLayoutForm();
495  if ($this->form->checkInput())
496  {
497  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
498  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
499  $ilCtrl->redirect($this, "editLayout");
500  }
501  $this->form->setValuesByPost();
502  $tpl->setContent($this->form->getHtml());
503  }
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 41 of file class.ilLMPageObjectGUI.php.

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

◆ updateHistory()

ilLMPageObjectGUI::updateHistory ( )

update history

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

References ilHistory\_createEntry().

332  {
333  require_once("./Services/History/classes/class.ilHistory.php");
334  ilHistory::_createEntry($this->obj->getId(), "update",
335  "", $this->content_object->getType().":pg",
336  "", true);
337  }
static _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: