ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
 $tpl
 
 $lng
 
 $obj
 
 $ctrl
 
 $content_object
 
 $actions
 

Protected Attributes

 $tabs
 
 $settings
 

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 41 of file class.ilLMPageObjectGUI.php.

References $DIC, and settings().

42  {
43  global $DIC;
44 
45  $this->tpl = $DIC["tpl"];
46  $this->ctrl = $DIC->ctrl();
47  $this->tabs = $DIC->tabs();
48  $this->settings = $DIC->settings();
49  $this->lng = $DIC->language();
50  parent::__construct($a_content_obj);
51  }
settings()
Definition: settings.php:2
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto (   $a_target)
static

redirect script

Parameters
string$a_target

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

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

385  {
386  global $DIC;
387 
388  $rbacsystem = $DIC->rbac()->system();
389  $ilErr = $DIC["ilErr"];
390  $lng = $DIC->language();
391  $ilAccess = $DIC->access();
392 
393  $first = strpos($a_target, "_");
394  $second = strpos($a_target, "_", $first + 1);
395  $page_id = substr($a_target, 0, $first);
396  if ($first > 0) {
397  $page_id = substr($a_target, 0, $first);
398  if ($second > 0) {
399  $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
400  $anchor = substr($a_target, $second + 1);
401  } else {
402  $ref_id = substr($a_target, $first + 1);
403  }
404  } else {
405  $page_id = $a_target;
406  }
407 
408  // determine learning object
409  $lm_id = ilLMObject::_lookupContObjID($page_id);
410 
411  // get all references
412  $ref_ids = ilObject::_getAllReferences($lm_id);
413 
414  // always try passed ref id first
415  if (in_array($ref_id, $ref_ids)) {
416  $ref_ids = array_merge(array($ref_id), $ref_ids);
417  }
418 
419  // check read permissions
420  foreach ($ref_ids as $ref_id) {
421  // check read permissions
422  if ($ilAccess->checkAccess("read", "", $ref_id)) {
423  // don't redirect anymore, just set parameters
424  // (goto.php includes "ilias.php")
425  $_GET["baseClass"] = "ilLMPresentationGUI";
426  $_GET["obj_id"] = $page_id;
427  $_GET["ref_id"] = $ref_id;
428  $_GET["anchor"] = $anchor;
429  include_once("ilias.php");
430  exit;
431  }
432  }
433 
434  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
435  if ($lm_id > 0) {
436  ilUtil::sendFailure(sprintf(
437  $lng->txt("msg_no_perm_read_item"),
438  ilObject::_lookupTitle($lm_id)
439  ), true);
440  } else {
441  $lng->loadLanguageModule("content");
442  ilUtil::sendFailure($lng->txt("page_does_not_exist"), true);
443  }
444  include_once("./Services/Object/classes/class.ilObjectGUI.php");
446  }
447 
448  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
449  }
global $DIC
Definition: saml.php:7
$_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
$ilErr
Definition: raiseError.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

Add page tabs.

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

References ilLMObjectGUI\$ctrl, $ilCtrl, and $tabs.

547  {
548  $ilTabs = $this->tabs;
550 
551  $ilTabs->addTarget(
552  "cont_layout",
553  $ilCtrl->getLinkTarget($this, 'editLayout'),
554  "editLayout"
555  );
556  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

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

References $_GET, and ilUtil\redirect().

232  {
233  if ($_GET["obj_id"] != 0) {
234  ilUtil::redirect($this->ctrl->getLinkTargetByClass(
235  "ilStructureObjectGUI",
236  "view",
237  "",
238  true
239  ));
240  }
241  $up_gui = "ilobjlearningmodulegui";
242  $this->ctrl->redirectByClass($up_gui, "pages");
243  }
$_GET["client_id"]
static redirect($a_script)
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPageObjectGUI::downloadFile ( )

download file of file lists

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

References $_GET, and exit.

562  {
563  $pg_obj = $this->obj->getPageObject();
564  $pg_obj->buildDom();
565  $int_links = $pg_obj->getInternalLinks();
566  foreach ($int_links as $il) {
567  if ($il["Target"] == str_replace("_file_", "_dfile_", $_GET["file_id"])) {
568  $file = explode("_", $_GET["file_id"]);
569  $file_id = (int) $file[count($file) - 1];
570  require_once("./Modules/File/classes/class.ilObjFile.php");
571  $fileObj = new ilObjFile($file_id, false);
572  $fileObj->sendFile();
573  exit;
574  }
575  }
576  }
$_GET["client_id"]
exit
Definition: backend.php:16

◆ edit()

ilLMPageObjectGUI::edit ( )

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

References executeCommand().

177  {
178  //echo "<br>umschuss";
179  $this->ctrl->setCmdClass("ilLMPageGUI");
180  $this->ctrl->setCmd("edit");
181  $this->executeCommand();
182  //$this->setTabs();
183  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

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

455  {
456  $tpl = $this->tpl;
458  $ilTabs = $this->tabs;
459 
460  $page_gui = new ilLMPageGUI($this->obj->getId());
461  $page_gui->setEditPreview(true);
462  $page_gui->activateMetaDataEditor(
463  $this->content_object,
464  $this->obj->getType(),
465  $this->obj->getId(),
466  $this->obj,
467  "MDUpdateListener"
468  );
469  $page_gui->setActivationListener($this, "activatePage");
470  $page_gui->setTabHook($this, "addPageTabs");
471  $lm_set = new ilSetting("lm");
472  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
473  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
474  $ilCtrl->getHTML($page_gui);
475  $ilTabs->setTabActive("cont_layout");
476  $this->initEditLayoutForm();
477  $tpl->setContent($this->form->getHTML());
478  }
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 66 of file class.ilLMPageObjectGUI.php.

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

Referenced by edit(), and preview().

67  {
68  $tpl = $this->tpl;
70  $ilTabs = $this->tabs;
72 
73  $next_class = $this->ctrl->getNextClass($this);
74  $cmd = $this->ctrl->getCmd();
75 
76  //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":".
77  // ":nextClass:".$next_class.":"; flush();
78 
79  switch ($next_class) {
80  case "illmpagegui":
81 
82  // Determine whether the view of a learning resource should
83  // be shown in the frameset of ilias, or in a separate window.
84  $showViewInFrameset = true;
85  $lm_set = new ilSetting("lm");
86 
87  $this->ctrl->setReturn($this, "edit");
88  if (!ilPageObject::_exists("lm", $this->obj->getId(), $_GET["transl"]) &&
89  ilPageObject::_exists("lm", $this->obj->getId(), "-")) {
90  if ($_GET["totransl"] == "") {
91  $_GET["totransl"] = $_GET["transl"];
92  $ilCtrl->setCmd("switchToLanguage");
93  }
94  $ilCtrl->setCmdClass("illmpagegui");
95  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
96  } else {
97  $page_gui = new ilLMPageGUI($this->obj->getId());
98  }
99  $page_gui->setEditPreview(true);
100  $page_gui->activateMetaDataEditor(
101  $this->content_object,
102  $this->obj->getType(),
103  $this->obj->getId(),
104  $this->obj,
105  "MDUpdateListener"
106  );
107  if ($ilSetting->get("block_activated_news")) {
108  $page_gui->setEnabledNews(
109  true,
110  $this->obj->content_object->getId(),
111  $this->obj->content_object->getType()
112  );
113  }
114 
115  // set page view link
116  if ($showViewInFrameset) {
117  $view_frame = ilFrameTargetInfo::_getFrame("MainContent");
118  } else {
119  $view_frame = "ilContObj" . $this->content_object->getID();
120  }
121  $page_gui->setViewPageLink(
122  ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() .
123  "_" . $_GET["ref_id"],
124  $view_frame
125  );
126 
127  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
128  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
129  $this->content_object->getStyleSheetId(),
130  "lm"
131  ));
132  $page_gui->setTemplateTargetVar("ADM_CONTENT");
133  $page_gui->getPageObject()->buildDom();
134  $int_links = $page_gui->getPageObject()->getInternalLinks();
135  $link_xml = $this->getLinkXML($int_links);
136  $page_gui->setLinkXML($link_xml);
137 
138  $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
139  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
140  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
141  $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
142  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $_GET["ref_id"] . "&baseClass=ilLMPresentationGUI");
143  $page_gui->setPresentationTitle(
145  $this->obj->getId(),
146  $this->content_object->getPageHeader(),
147  $this->content_object->isActiveNumbering()
148  )
149  );
150  $page_gui->setLocator($contObjLocator);
151  $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
152  $page_gui->setActivationListener($this, "activatePage");
153 
154  $up_gui = "ilobjlearningmodulegui";
155  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
156 
157  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
158  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
159  if ($this->content_object->getLayoutPerPage()) {
160  $page_gui->setTabHook($this, "addPageTabs");
161  }
162  $ret = $this->ctrl->forwardCommand($page_gui);
163  $tpl->setContent($ret);
164  break;
165 
166  default:
167  $ret = $this->$cmd();
168  break;
169  }
170  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
setEditPreview($a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
$_GET["client_id"]
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 _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="-", $a_include_short=false)
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
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
+ 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 248 of file class.ilLMPageObjectGUI.php.

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

Referenced by executeCommand().

249  {
250  if ($a_layoutframes == "") {
251  $a_layoutframes = array();
252  }
253  $link_info = "<IntLinkInfos>";
254  foreach ($a_int_links as $int_link) {
255  $target = $int_link["Target"];
256  if (substr($target, 0, 4) == "il__") {
257  $target_arr = explode("_", $target);
258  $target_id = $target_arr[count($target_arr) - 1];
259  $type = $int_link["Type"];
260  $targetframe = ($int_link["TargetFrame"] != "")
261  ? $int_link["TargetFrame"]
262  : "None";
263 
264  // anchor
265  $anc = $anc_add = "";
266  if ($int_link["Anchor"] != "") {
267  $anc = $int_link["Anchor"];
268  $anc_add = "_" . rawurlencode($int_link["Anchor"]);
269  }
270 
271  switch ($type) {
272  case "PageObject":
273  case "StructureObject":
275  $cont_obj = $this->content_object;
276  if ($lm_id == $cont_obj->getId()) {
277  $ltarget = "";
278  if ($type == "PageObject") {
279  $this->ctrl->setParameter($this, "obj_id", $target_id);
280  $href = $this->ctrl->getLinkTargetByClass(get_class($this), "edit");
281  } else {
282  $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
283  $href = $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view");
284  }
285  $href = str_replace("&", "&amp;", $href);
286  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
287  } else {
288  if ($type == "PageObject") {
289  $href = "goto.php?target=pg_" . $target_id . $anc_add;
290  } else {
291  $href = "goto.php?target=st_" . $target_id;
292  }
293  $ltarget = "ilContObj" . $lm_id;
294  }
295  if ($lm_id == "") {
296  $href = "";
297  }
298  break;
299 
300  case "GlossaryItem":
301  $ltarget = $nframe = "_blank";
302  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;" .
303  "obj_type=$type&amp;cmd=glossary&amp;ref_id=" . $_GET["ref_id"] .
304  "&amp;obj_id=" . $target_id . "&amp;frame=$nframe";
305  break;
306 
307  case "MediaObject":
308  $ltarget = $nframe = "_blank";
309  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type=$type&amp;cmd=media&amp;ref_id=" . $_GET["ref_id"] .
310  "&amp;mob_id=" . $target_id . "&amp;frame=$nframe";
311  break;
312 
313  case "RepositoryItem":
314  $obj_type = ilObject::_lookupType($target_id, true);
316  $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
317  $t_frame = ilFrameTargetInfo::_getFrame("MainContent", $obj_type);
318  $ltarget = $t_frame;
319  break;
320 
321  case "File":
322  $this->ctrl->setParameter($this, "file_id", "il__file_" . $target_id);
323  $href = $this->ctrl->getLinkTarget($this, "downloadFile");
324  $this->ctrl->setParameter($this, "file_id", "");
325  break;
326 
327  case "User":
328  $obj_type = ilObject::_lookupType($target_id);
329  if ($obj_type == "usr") {
330  include_once("./Services/User/classes/class.ilUserUtil.php");
331  $back = $this->ctrl->getLinkTarget($this, "edit");
332  //var_dump($back); exit;
333  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $target_id);
334  $this->ctrl->setParameterByClass(
335  "ilpublicuserprofilegui",
336  "back_url",
337  rawurlencode($back)
338  );
339  $href = "";
340  include_once("./Services/User/classes/class.ilUserUtil.php");
342  $href = $this->ctrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML");
343  }
344  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", "");
345  $lcontent = ilUserUtil::getNamePresentation($target_id, false, false);
346  }
347  break;
348 
349  }
350 
351  if ($href != "") {
352  $anc_par = 'Anchor="' . $anc . '"';
353  $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
354  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
355  }
356  }
357  }
358  $link_info .= "</IntLinkInfos>";
359  //echo ":".htmlentities($link_info).":";
360  return $link_info;
361  }
$target_arr
Definition: goto.php:47
$type
$_GET["client_id"]
$target_id
Definition: goto.php:49
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static hasPublicProfile($a_user_id)
Has public profile.
static _lookupObjId($a_id)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getFrame($a_class, $a_type='')
Get content frame name.
$target
Definition: test.php:19
+ 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 485 of file class.ilLMPageObjectGUI.php.

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

Referenced by editLayout(), and saveLayout().

486  {
487  $lng = $this->lng;
489 
490  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
491  $this->form = new ilPropertyFormGUI();
492 
493  // default layout
494  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
495 
496  if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
497  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
498  }
499  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
500  $lng->txt("cont_lm_default_layout") .
501  "</b>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
502  "</td></tr></table>", ""));
503 
505  $im_tag = "";
506  if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
507  $im_tag = ilUtil::img($im, $l);
508  }
509  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
510  $lng->txt("cont_layout_" . $l) . "</b>: " . $lng->txt("cont_layout_" . $l . "_desc") .
511  "</td></tr></table>", $l));
512  }
513 
514  $layout->setValue($this->obj->getLayout());
515  $this->form->addItem($layout);
516 
517  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
518 
519  $this->form->setTitle($lng->txt("cont_page_layout"));
520  $this->form->setFormAction($ilCtrl->getFormAction($this));
521  }
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=null, $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 188 of file class.ilLMPageObjectGUI.php.

References executeCommand().

189  {
190  $this->ctrl->setCmdClass("ilLMPageGUI");
191  $this->ctrl->setCmd("preview");
192  $this->executeCommand();
193  // $this->setTabs();
194  }
executeCommand()
execute command
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

save co page object

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

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

200  {
201  $this->obj = new ilLMPageObject($this->content_object);
202  $this->obj->setType("pg");
203  $this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
204  $this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
205  $this->obj->setLMId($this->content_object->getId());
206  $this->obj->create();
207 
208  // obj_id is empty, if page is created from "all pages" screen
209  // -> a free page is created (not in the tree)
210  //echo "<br>savePage:".$_GET["obj_id"].":";
211  if ($_GET["obj_id"] != 0) {
212  $this->putInTree();
213 
214  // check the tree
215  $this->checkTree();
216 
217  ilUtil::redirect($this->ctrl->getLinkTargetByClass(
218  "ilStructureObjectGUI",
219  "edit",
220  "",
221  true
222  ));
223  }
224  $up_gui = "ilobjlearningmodulegui";
225  $this->ctrl->redirectByClass($up_gui, "pages");
226  }
$_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)
$_POST["username"]
+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

Save layout.

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

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

528  {
529  $tpl = $this->tpl;
530  $lng = $this->lng;
532 
533  $this->initEditLayoutForm();
534  if ($this->form->checkInput()) {
535  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
536  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
537  $ilCtrl->redirect($this, "editLayout");
538  }
539  $this->form->setValuesByPost();
540  $tpl->setContent($this->form->getHtml());
541  }
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 57 of file class.ilLMPageObjectGUI.php.

58  {
59  $this->obj = $a_pg_obj;
60  $this->obj->setLMId($this->content_object->getId());
61  }

◆ updateHistory()

ilLMPageObjectGUI::updateHistory ( )

update history

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

References ilHistory\_createEntry().

367  {
368  require_once("./Services/History/classes/class.ilHistory.php");
370  $this->obj->getId(),
371  "update",
372  "",
373  $this->content_object->getType() . ":pg",
374  "",
375  true
376  );
377  }
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 33 of file class.ilLMPageObjectGUI.php.

Referenced by editLayout(), and executeCommand().

◆ $settings

ilLMPageObjectGUI::$settings
protected

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

Referenced by executeCommand().

◆ $tabs

ilLMPageObjectGUI::$tabs
protected

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

Referenced by addPageTabs(), editLayout(), and executeCommand().


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