ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLMPageObjectGUI Class Reference

User Interface for Learning Module Page Objects Editing. More...

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

Public Member Functions

 __construct (ilObjLearningModule $a_content_obj)
 
 setLMPageObject (ilLMPageObject $a_pg_obj)
 Set content object dependent page object (co page) More...
 
 executeCommand ()
 
 edit ()
 display content of page (edit view) More...
 
 preview ()
 display content of page (edit view) More...
 
 cancel ()
 cancel More...
 
 getLinkXML (array $a_int_links)
 get link targets More...
 
 editLayout ()
 Edit layout of page. More...
 
 initEditLayoutForm ()
 
 saveLayout ()
 
 addPageTabs ()
 
 downloadFile ()
 download file of file lists More...
 
 create ()
 
 initNewPageForm ()
 
 save ()
 Save page. More...
 
- Public Member Functions inherited from ilLMObjectGUI
 __construct (ilObjLearningModule $a_content_obj)
 constructor More...
 
 setActions (?array $a_actions=null)
 
 getTargetFrame (string $a_cmd, string $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 getCreateForm ()
 
 putInTree (?int $target=0)
 put this object into content object tree More...
 
 delete (array $ids)
 Confirm deletion screen (delete page or structure objects) More...
 
 setTabs ()
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 showActions (array $a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto (string $a_target)
 redirect script More...
 
static getLayoutCssFix ()
 Get layout css fix (workaround for broken radio options) More...
 

Protected Attributes

ilPropertyFormGUI $form
 
ilTabsGUI $tabs
 
ilSetting $settings
 
ILIAS Style Content DomainService $content_style_domain
 
- Protected Attributes inherited from ilLMObjectGUI
int $requested_ref_id
 
ILIAS DI UIServices $ui
 
int $requested_obj_id
 
string $requested_totransl = ""
 
string $requested_transl = ""
 
string $requested_target
 
string $requested_new_type
 
array $target_frame
 
EditingGUIRequest $request
 

Additional Inherited Members

- Data Fields inherited from ilLMObjectGUI
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilLMObject $obj
 
ilCtrl $ctrl
 
ilObjLearningModule $content_object
 
array $actions
 

Detailed Description

User Interface for Learning Module Page Objects Editing.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilLMPageObjectGUI: ilLMPageGUI, ilAssGenFeedbackPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLMPageObjectGUI::__construct ( ilObjLearningModule  $a_content_obj)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), and ILIAS\Repository\tabs().

36  {
37  global $DIC;
38 
39  $this->tpl = $DIC["tpl"];
40  $this->ctrl = $DIC->ctrl();
41  $this->tabs = $DIC->tabs();
42  $this->settings = $DIC->settings();
43  $this->lng = $DIC->language();
44  parent::__construct($a_content_obj);
45  $cs = $DIC->contentStyle();
46  $this->content_style_domain = $cs->domain();
47  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto ( string  $a_target)
static

redirect script

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

References ilLMObjectGUI\$ctrl, $DIC, $ilErr, ilLMObjectGUI\$lng, $ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), ilLanguage\loadLanguageModule(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

337  : void
338  {
339  global $DIC;
340  $main_tpl = $DIC->ui()->mainTemplate();
341 
342  $ilErr = $DIC["ilErr"];
343  $lng = $DIC->language();
344  $ilAccess = $DIC->access();
345  $ctrl = $DIC->ctrl();
346  $ref_id = 0;
347  $anchor = "";
348 
349  $first = strpos($a_target, "_");
350  $second = strpos($a_target, "_", $first + 1);
351  if ($first > 0) {
352  $page_id = substr($a_target, 0, $first);
353  if ($second > 0) {
354  $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
355  $anchor = substr($a_target, $second + 1);
356  } else {
357  $ref_id = substr($a_target, $first + 1);
358  }
359  } else {
360  $page_id = $a_target;
361  }
362 
363  // determine learning object
364  $lm_id = ilLMObject::_lookupContObjID($page_id);
365 
366  // get all references
367  $ref_ids = ilObject::_getAllReferences($lm_id);
368 
369  // always try passed ref id first
370  if (in_array($ref_id, $ref_ids)) {
371  $ref_ids = array_merge(array($ref_id), $ref_ids);
372  }
373 
374  // check read permissions
375  foreach ($ref_ids as $ref_id) {
376  // check read permissions
377  if ($ilAccess->checkAccess("read", "", $ref_id)) {
378  $ctrl->setParameterByClass("ilLMPresentationGUI", "obj_id", $page_id);
379  $ctrl->setParameterByClass("ilLMPresentationGUI", "ref_id", $ref_id);
380  $ctrl->setParameterByClass("ilLMPresentationGUI", "anchor", $anchor);
381  $ctrl->redirectByClass("ilLMPresentationGUI", "");
382  }
383  }
384 
385  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
386  if ($lm_id > 0) {
387  $main_tpl->setOnScreenMessage('failure', sprintf(
388  $lng->txt("msg_no_perm_read_item"),
389  ilObject::_lookupTitle($lm_id)
390  ), true);
391  } else {
392  $lng->loadLanguageModule("content");
393  $main_tpl->setOnScreenMessage('failure', $lng->txt("page_does_not_exist"), true);
394  }
396  }
397 
398  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
399  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _getAllReferences(int $id)
get all reference ids for object ID
setParameterByClass(string $a_class, string $a_parameter, $a_value)
loadLanguageModule(string $a_module)
Load language module.
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
$ilErr
Definition: raiseError.php:33
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

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

References ilLMObjectGUI\$ctrl, and $tabs.

484  : void
485  {
486  $ilTabs = $this->tabs;
487  $ilCtrl = $this->ctrl;
488 
489  $ilTabs->addTarget(
490  "cont_layout",
491  $ilCtrl->getLinkTarget($this, 'editLayout'),
492  "editLayout"
493  );
494  }

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

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

References ILIAS\Repository\ctrl(), and ilUtil\redirect().

Referenced by save().

172  : void
173  {
174  if ($this->requested_obj_id != 0) {
175  ilUtil::redirect($this->ctrl->getLinkTargetByClass(
176  "ilStructureObjectGUI",
177  "view",
178  "",
179  true
180  ));
181  }
182  $up_gui = "ilobjlearningmodulegui";
183  $this->ctrl->redirectByClass($up_gui, "pages");
184  }
static redirect(string $a_script)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilLMPageObjectGUI::create ( )

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

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, $tabs, ilLMObjectGUI\$ui, ilCtrl\getLinkTarget(), initNewPageForm(), ilTabsGUI\setBackTarget(), ilCtrl\setParameter(), and ilLanguage\txt().

519  : void
520  {
521  $ui = $this->ui;
522  $lng = $this->lng;
523  $ctrl = $this->ctrl;
524 
525  $tabs = $this->tabs;
526  $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "cancel"));
527 
528  $ctrl->setParameter($this, "new_type", "pg");
529  $form = $this->initNewPageForm();
530 
531  $this->tpl->setContent($ui->renderer()->render($form) . self::getLayoutCssFix());
532  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
setBackTarget(string $a_title, string $a_target, string $a_frame="")
ILIAS DI UIServices $ui
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ downloadFile()

ilLMPageObjectGUI::downloadFile ( )

download file of file lists

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

References exit, and ILIAS\Repository\int().

499  : void
500  {
501  $pg_obj = $this->obj->getPageObject();
502  $pg_obj->buildDom();
503  $int_links = $pg_obj->getInternalLinks();
504  foreach ($int_links as $il) {
505  if ($il["Target"] == str_replace(
506  "_file_",
507  "_dfile_",
508  $this->request->getFileId()
509  )) {
510  $file = explode("_", $this->request->getFileId());
511  $file_id = (int) $file[count($file) - 1];
512  $fileObj = new ilObjFile($file_id, false);
513  $fileObj->sendFile();
514  exit;
515  }
516  }
517  }
Class ilObjFile.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ edit()

ilLMPageObjectGUI::edit ( )

display content of page (edit view)

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

References ILIAS\Repository\ctrl().

155  : void
156  {
157  $this->ctrl->redirectByClass(ilLMPageGUI::class, "edit");
158  }
+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

References ilLMObjectGUI\$ctrl, $lm_set, ilLMObjectGUI\$obj, $tabs, ilLMObjectGUI\$tpl, ILIAS\Repository\form(), ilUtil\getImagePath(), initEditLayoutForm(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilPageObjectGUI\setEditPreview(), ILIAS\UICore\GlobalTemplate\setTitle(), and ILIAS\UICore\GlobalTemplate\setTitleIcon().

404  : void
405  {
406  $tpl = $this->tpl;
407  $ilCtrl = $this->ctrl;
408  $ilTabs = $this->tabs;
409 
410  $page_gui = new ilLMPageGUI($this->obj->getId());
411  $page_gui->setEditPreview(true);
412  $page_gui->activateMetaDataEditor(
413  $this->content_object,
414  $this->obj->getType(),
415  $this->obj->getId(),
416  $this->obj,
417  "MDUpdateListener"
418  );
419  $page_gui->setActivationListener($this, "activatePage");
420  $page_gui->setTabHook($this, "addPageTabs");
421  $lm_set = new ilSetting("lm");
422  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
423  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
424  $ilCtrl->getHTML($page_gui);
425  $ilTabs->setTabActive("cont_layout");
426  $this->initEditLayoutForm();
427  $tpl->setContent($this->form->getHTML());
428  }
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
Extension of ilPageObjectGUI for learning modules.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
form( $class_path, string $cmd, string $submit_caption="")
$lm_set
+ Here is the call graph for this function:

◆ executeCommand()

ilLMPageObjectGUI::executeCommand ( )

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

References ilLMObjectGUI\$ctrl, $ilSetting, ilLMObjectGUI\$obj, ilLMObjectGUI\$requested_ref_id, ilLMObjectGUI\$requested_transl, $settings, ilLMObjectGUI\$tpl, ilPageObject\_exists(), ilLMPageObject\_getPresentationTitle(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), getLinkXML(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilPageObjectGUI\setEditPreview(), ILIAS\UICore\GlobalTemplate\setTitle(), and ILIAS\UICore\GlobalTemplate\setTitleIcon().

58  : void
59  {
60  $tpl = $this->tpl;
61  $ilCtrl = $this->ctrl;
63 
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66 
67  switch ($next_class) {
68  case "illmpagegui":
69 
70  $this->ctrl->setReturn($this, "edit");
71  if (!ilPageObject::_exists("lm", $this->obj->getId(), $this->requested_transl) &&
72  ilPageObject::_exists("lm", $this->obj->getId(), "-")) {
73  if ($this->requested_totransl == "") {
74  $this->requested_totransl = $this->requested_transl;
75  $ilCtrl->setParameterByClass("illmpagegui", "totransl", $this->requested_transl);
76  $ilCtrl->redirectByClass("illmpagegui", "switchToLanguage");
77  }
78  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
79  } else {
80  $page_gui = new ilLMPageGUI($this->obj->getId());
81  }
82  $page_gui->setEditPreview(true);
83  $page_gui->activateMetaDataEditor(
84  $this->content_object,
85  $this->obj->getType(),
86  $this->obj->getId(),
87  $this->obj,
88  "MDUpdateListener"
89  );
90  if ($ilSetting->get("block_activated_news")) {
91  $page_gui->setEnabledNews(
92  true,
93  $this->obj->content_object->getId(),
94  $this->obj->content_object->getType()
95  );
96  }
97 
98  $page_gui->setViewPageLink(
99  ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() .
101  );
102 
103  $page_gui->setStyleId($this->content_style_domain
104  ->styleForRefId($this->content_object->getRefId())
105  ->getEffectiveStyleId());
106  $page_gui->setTemplateTargetVar("ADM_CONTENT");
107  $page_gui->getPageObject()->buildDom();
108  $int_links = $page_gui->getPageObject()->getInternalLinks();
109  $link_xml = $this->getLinkXML($int_links);
110  $page_gui->setLinkXml($link_xml);
111 
112  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
113  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
114  $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
115  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
116  $page_gui->setPresentationTitle(
118  $this->obj->getId(),
119  $this->content_object->getPageHeader(),
120  $this->content_object->isActiveNumbering(),
121  false,
122  false,
123  0,
124  $page_gui->getLanguage()
125  )
126  );
127  //$page_gui->setLocator($contObjLocator);
128  $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
129  $page_gui->setActivationListener($this, "activatePage");
130 
131  $up_gui = "ilobjlearningmodulegui";
132  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
133 
134  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
135  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
136  if ($this->content_object->getLayoutPerPage()) {
137  $page_gui->setTabHook($this, "addPageTabs");
138  }
139  $ret = $this->ctrl->forwardCommand($page_gui);
140  if ($ret != "") { // in 6.0 this overwrites already set content with an empty string sometimes
141  $tpl->setContent($ret);
142  }
143  break;
144 
145  default:
146  $this->$cmd();
147  break;
148  }
149  }
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
Extension of ilPageObjectGUI for learning modules.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
global $ilSetting
Definition: privfeed.php:31
getLinkXML(array $a_int_links)
get link targets
+ Here is the call graph for this function:

◆ getLayoutCssFix()

static ilLMPageObjectGUI::getLayoutCssFix ( )
static

Get layout css fix (workaround for broken radio options)

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

Referenced by ILIAS\LearningModule\Editing\EditSubObjectsGUI\insertLayout().

593  : string
594  {
595  return "
596  <style>
597  .form-control.il-input-radiooption > label {
598  vertical-align: middle;
599  }
600  .form-control.il-input-radiooption > .help-block {
601  padding-left: 2rem;
602  }
603  </style>
604  ";
605  }
+ Here is the caller graph for this function:

◆ getLinkXML()

ilLMPageObjectGUI::getLinkXML ( array  $a_int_links)

get link targets

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

References ilLMObjectGUI\$content_object, ilFrameTargetInfo\_getFrame(), ilLMObject\_lookupContObjID(), ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ilWikiPage\getGotoForWikiPageTarget(), ilUserUtil\getNamePresentation(), ilUserUtil\hasPublicProfile(), and null.

Referenced by executeCommand().

189  : string
190  {
191  $link_info = "<IntLinkInfos>";
192  foreach ($a_int_links as $int_link) {
193  $target = $int_link["Target"];
194  $ltarget = "";
195  $href = "";
196  $lcontent = "";
197  if (substr($target, 0, 4) == "il__") {
198  $target_arr = explode("_", $target);
199  $target_id = $target_arr[count($target_arr) - 1];
200  $type = $int_link["Type"];
201  $targetframe = ($int_link["TargetFrame"] != "")
202  ? $int_link["TargetFrame"]
203  : "None";
204 
205  // anchor
206  $anc = $anc_add = "";
207  if (($int_link["Anchor"] ?? "") != "") {
208  $anc = $int_link["Anchor"];
209  $anc_add = "_" . rawurlencode($int_link["Anchor"]);
210  }
211 
212  switch ($type) {
213  case "PageObject":
214  case "StructureObject":
215  $lm_id = ilLMObject::_lookupContObjID($target_id);
216  $cont_obj = $this->content_object;
217  if ($lm_id == $cont_obj->getId()) {
218  $ltarget = "";
219  if ($type == "PageObject") {
220  $this->ctrl->setParameter($this, "obj_id", $target_id);
221  $href = $this->ctrl->getLinkTargetByClass(
222  get_class($this),
223  "edit",
224  "",
225  false,
226  true
227  );
228  } else {
229  $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $target_id);
230  $href = $this->ctrl->getLinkTargetByClass(
231  "ilstructureobjectgui",
232  "view",
233  "",
234  false,
235  true
236  );
237  }
238  $href = str_replace("&", "&amp;", $href);
239  $this->ctrl->setParameter($this, "obj_id", $this->requested_obj_id);
240  } else {
241  if ($type == "PageObject") {
242  $href = "goto.php?target=pg_" . $target_id . $anc_add;
243  } else {
244  $href = "goto.php?target=st_" . $target_id;
245  }
246  $ltarget = "ilContObj" . $lm_id;
247  }
248  if ($lm_id == "") {
249  $href = "";
250  }
251  break;
252 
253  case "GlossaryItem":
254  $ltarget = $nframe = "_blank";
255  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;" .
256  "obj_type=$type&amp;cmd=glossary&amp;ref_id=" . $this->requested_ref_id .
257  "&amp;obj_id=" . $target_id . "&amp;frame=$nframe";
258  break;
259 
260  case "MediaObject":
261  $ltarget = $nframe = "_blank";
262  $href = "ilias.php?cmdClass=illmpresentationgui&amp;baseClass=ilLMPresentationGUI&amp;obj_type=$type&amp;cmd=media&amp;ref_id=" . $this->requested_ref_id .
263  "&amp;mob_id=" . $target_id . "&amp;frame=$nframe";
264  break;
265 
266  case "RepositoryItem":
267  $obj_type = ilObject::_lookupType((int) $target_id, true);
268  $obj_id = ilObject::_lookupObjId((int) $target_id);
269  $href = "./goto.php?target=" . $obj_type . "_" . $target_id;
270  $t_frame = ilFrameTargetInfo::_getFrame("MainContent");
271  $ltarget = $t_frame;
272  break;
273 
274  case "File":
275  $this->ctrl->setParameter($this, "file_id", "il__file_" . $target_id);
276  $href = $this->ctrl->getLinkTarget(
277  $this,
278  "downloadFile",
279  "",
280  false,
281  true
282  );
283  $this->ctrl->setParameter($this, "file_id", null);
284  break;
285 
286  case "WikiPage":
287  $href = ilWikiPage::getGotoForWikiPageTarget($target_id);
288  break;
289 
290  case "User":
291  $obj_type = ilObject::_lookupType((int) $target_id);
292  if ($obj_type == "usr") {
293  $back = $this->ctrl->getLinkTarget(
294  $this,
295  "edit",
296  "",
297  false,
298  true
299  );
300  //var_dump($back); exit;
301  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $target_id);
302  $this->ctrl->setParameterByClass(
303  "ilpublicuserprofilegui",
304  "back_url",
305  rawurlencode($back)
306  );
307  $href = "";
308  if (ilUserUtil::hasPublicProfile($target_id)) {
309  $href = $this->ctrl->getLinkTargetByClass(
310  "ilpublicuserprofilegui",
311  "getHTML",
312  "",
313  false,
314  true
315  );
316  }
317  $this->ctrl->setParameterByClass("ilpublicuserprofilegui", "user_id", null);
318  $lcontent = ilUserUtil::getNamePresentation($target_id, false, false);
319  }
320  break;
321  }
322 
323  if ($href != "") {
324  $anc_par = 'Anchor="' . $anc . '"';
325  $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
326  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
327  }
328  }
329  }
330  $link_info .= "</IntLinkInfos>";
331  return $link_info;
332  }
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
ilObjLearningModule $content_object
static getGotoForWikiPageTarget(string $a_target, bool $a_offline=false)
static hasPublicProfile(int $a_user_id)
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _getFrame(string $a_class)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditLayoutForm()

ilLMPageObjectGUI::initEditLayoutForm ( )

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

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ILIAS\Repository\form(), ilObjContentObject\getAvailableLayouts(), ilUtil\getImagePath(), ilUtil\img(), and ilLanguage\txt().

Referenced by editLayout(), and saveLayout().

430  : void
431  {
432  $lng = $this->lng;
433  $ilCtrl = $this->ctrl;
434  $im_tag = "";
435 
436  $this->form = new ilPropertyFormGUI();
437 
438  // default layout
439  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
440 
441  if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
442  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
443  }
444  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
445  $lng->txt("cont_lm_default_layout") .
446  "</strong>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
447  "</td></tr></table>", ""));
448 
449  foreach (ilObjContentObject::getAvailableLayouts() as $l) {
450  $im_tag = "";
451  if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
452  $im_tag = ilUtil::img($im, $l);
453  }
454  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
455  $lng->txt("cont_layout_" . $l) . "</strong>: " . $lng->txt("cont_layout_" . $l . "_desc") .
456  "</td></tr></table>", $l));
457  }
458 
459  $layout->setValue($this->obj->getLayout());
460  $this->form->addItem($layout);
461 
462  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
463 
464  $this->form->setTitle($lng->txt("cont_page_layout"));
465  $this->form->setFormAction($ilCtrl->getFormAction($this));
466  }
This class represents an option in a radio group.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getAvailableLayouts()
get all available lm layouts
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
This class represents a property in a property form.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initNewPageForm()

ilLMPageObjectGUI::initNewPageForm ( )

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

References ilLMObjectGUI\$ctrl, Vendor\Package\$f, ilLMObjectGUI\$lng, ilLMObjectGUI\$ui, ilCtrl\getLinkTarget(), ilPageLayout\MODULE_LM, and ilLanguage\txt().

Referenced by create(), and save().

534  : Form\Standard
535  {
536  $ui = $this->ui;
537  $f = $ui->factory();
538  $ctrl = $this->ctrl;
539  $lng = $this->lng;
540 
541  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
542 
543  $fields["description"] = $f->input()->field()->textarea($lng->txt("description"));
544 
545  $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
546  if (!is_null($ts)) {
547  $fields["layout_id"] = $ts;
548  }
549 
550  // section
551  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
552 
553  $form_action = $ctrl->getLinkTarget($this, "save");
554  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
555  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ILIAS DI UIServices $ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview()

ilLMPageObjectGUI::preview ( )

display content of page (edit view)

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

References ILIAS\Repository\ctrl().

163  : void
164  {
165  $this->ctrl->redirectByClass(ilLMPageGUI::class, "preview");
166  }
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

Save page.

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

References $data, $DIC, ilLMObjectGUI\$lng, ilLMObjectGUI\$request, cancel(), initNewPageForm(), ILIAS\Repository\int(), ilUtil\stripSlashes(), and ilLanguage\txt().

560  : void
561  {
562  global $DIC;
563 
564  $request = $DIC->http()->request();
565  $lng = $this->lng;
566 
567  $form = $this->initNewPageForm();
568  if ($request->getMethod() == "POST") {
569  $form = $form->withRequest($request);
570  $data = $form->getData()["sec"];
571 
572  $layout_id = (int) ($data["layout_id"] ?? 0);
573 
574  $this->obj = new ilLMPageObject($this->content_object);
575  $this->obj->setType("pg");
576  $this->obj->setTitle(ilUtil::stripSlashes($data["title"]));
577  $this->obj->setDescription(ilUtil::stripSlashes($data["description"]));
578  $this->obj->setLMId($this->content_object->getId());
579  if ($layout_id > 0) {
580  $this->obj->create(false, false, $layout_id);
581  } else {
582  $this->obj->create();
583  }
584  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_created"), true);
585  }
586  $this->cancel();
587  }
EditingGUIRequest $request
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

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

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, ILIAS\Repository\form(), initEditLayoutForm(), ILIAS\UICore\GlobalTemplate\setContent(), ilLanguage\txt(), and ilLMObject\writeLayout().

468  : void
469  {
470  $tpl = $this->tpl;
471  $lng = $this->lng;
472  $ilCtrl = $this->ctrl;
473 
474  $this->initEditLayoutForm();
475  if ($this->form->checkInput()) {
476  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
477  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
478  $ilCtrl->redirect($this, "editLayout");
479  }
480  $this->form->setValuesByPost();
481  $tpl->setContent($this->form->getHTML());
482  }
ilGlobalTemplateInterface $tpl
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ setLMPageObject()

ilLMPageObjectGUI::setLMPageObject ( ilLMPageObject  $a_pg_obj)

Set content object dependent page object (co page)

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

References ilLMObject\setLMId().

52  : void
53  {
54  $this->obj = $a_pg_obj;
55  $this->obj->setLMId($this->content_object->getId());
56  }
setLMId(int $a_lm_id)
+ Here is the call graph for this function:

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilLMPageObjectGUI::$content_style_domain
protected

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

◆ $form

ilPropertyFormGUI ilLMPageObjectGUI::$form
protected

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

◆ $settings

ilSetting ilLMPageObjectGUI::$settings
protected

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

Referenced by executeCommand().

◆ $tabs

ilTabsGUI ilLMPageObjectGUI::$tabs
protected

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

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


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