ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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...
 
 updateHistory ()
 update history 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 ()
 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\MetaData\Repository\Validation\Data\__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: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto ( string  $a_target)
static

redirect script

Definition at line 360 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().

360  : void
361  {
362  global $DIC;
363  $main_tpl = $DIC->ui()->mainTemplate();
364 
365  $ilErr = $DIC["ilErr"];
366  $lng = $DIC->language();
367  $ilAccess = $DIC->access();
368  $ctrl = $DIC->ctrl();
369  $ref_id = 0;
370  $anchor = "";
371 
372  $first = strpos($a_target, "_");
373  $second = strpos($a_target, "_", $first + 1);
374  if ($first > 0) {
375  $page_id = substr($a_target, 0, $first);
376  if ($second > 0) {
377  $ref_id = substr($a_target, $first + 1, $second - ($first + 1));
378  $anchor = substr($a_target, $second + 1);
379  } else {
380  $ref_id = substr($a_target, $first + 1);
381  }
382  } else {
383  $page_id = $a_target;
384  }
385 
386  // determine learning object
387  $lm_id = ilLMObject::_lookupContObjID($page_id);
388 
389  // get all references
390  $ref_ids = ilObject::_getAllReferences($lm_id);
391 
392  // always try passed ref id first
393  if (in_array($ref_id, $ref_ids)) {
394  $ref_ids = array_merge(array($ref_id), $ref_ids);
395  }
396 
397  // check read permissions
398  foreach ($ref_ids as $ref_id) {
399  // check read permissions
400  if ($ilAccess->checkAccess("read", "", $ref_id)) {
401  $ctrl->setParameterByClass("ilLMPresentationGUI", "obj_id", $page_id);
402  $ctrl->setParameterByClass("ilLMPresentationGUI", "ref_id", $ref_id);
403  $ctrl->setParameterByClass("ilLMPresentationGUI", "anchor", $anchor);
404  $ctrl->redirectByClass("ilLMPresentationGUI", "");
405  }
406  }
407 
408  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
409  if ($lm_id > 0) {
410  $main_tpl->setOnScreenMessage('failure', sprintf(
411  $lng->txt("msg_no_perm_read_item"),
412  ilObject::_lookupTitle($lm_id)
413  ), true);
414  } else {
415  $lng->loadLanguageModule("content");
416  $main_tpl->setOnScreenMessage('failure', $lng->txt("page_does_not_exist"), true);
417  }
419  }
420 
421  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
422  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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.
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
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 507 of file class.ilLMPageObjectGUI.php.

References ilLMObjectGUI\$ctrl, and $tabs.

507  : void
508  {
509  $ilTabs = $this->tabs;
510  $ilCtrl = $this->ctrl;
511 
512  $ilTabs->addTarget(
513  "cont_layout",
514  $ilCtrl->getLinkTarget($this, 'editLayout'),
515  "editLayout"
516  );
517  }

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

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

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

Referenced by save().

180  : void
181  {
182  if ($this->requested_obj_id != 0) {
183  ilUtil::redirect($this->ctrl->getLinkTargetByClass(
184  "ilStructureObjectGUI",
185  "view",
186  "",
187  true
188  ));
189  }
190  $up_gui = "ilobjlearningmodulegui";
191  $this->ctrl->redirectByClass($up_gui, "pages");
192  }
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 542 of file class.ilLMPageObjectGUI.php.

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

542  : void
543  {
544  $ui = $this->ui;
545  $lng = $this->lng;
546  $ctrl = $this->ctrl;
547 
548  $tabs = $this->tabs;
549  $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "cancel"));
550 
551  $ctrl->setParameter($this, "new_type", "pg");
552  $form = $this->initNewPageForm();
553 
554  $this->tpl->setContent($ui->renderer()->render($form) . self::getLayoutCssFix());
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...
setBackTarget(string $a_title, string $a_target, string $a_frame="")
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
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 522 of file class.ilLMPageObjectGUI.php.

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

522  : void
523  {
524  $pg_obj = $this->obj->getPageObject();
525  $pg_obj->buildDom();
526  $int_links = $pg_obj->getInternalLinks();
527  foreach ($int_links as $il) {
528  if ($il["Target"] == str_replace(
529  "_file_",
530  "_dfile_",
531  $this->request->getFileId()
532  )) {
533  $file = explode("_", $this->request->getFileId());
534  $file_id = (int) $file[count($file) - 1];
535  $fileObj = new ilObjFile($file_id, false);
536  $fileObj->sendFile();
537  exit;
538  }
539  }
540  }
exit
Definition: login.php:29
Class ilObjFile.
+ Here is the call graph for this function:

◆ edit()

ilLMPageObjectGUI::edit ( )

display content of page (edit view)

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

References ILIAS\Repository\ctrl(), and executeCommand().

159  : void
160  {
161  $this->ctrl->setCmdClass("ilLMPageGUI");
162  $this->ctrl->setCmd("edit");
163  $this->executeCommand();
164  }
+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

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

427  : void
428  {
429  $tpl = $this->tpl;
430  $ilCtrl = $this->ctrl;
431  $ilTabs = $this->tabs;
432 
433  $page_gui = new ilLMPageGUI($this->obj->getId());
434  $page_gui->setEditPreview(true);
435  $page_gui->activateMetaDataEditor(
436  $this->content_object,
437  $this->obj->getType(),
438  $this->obj->getId(),
439  $this->obj,
440  "MDUpdateListener"
441  );
442  $page_gui->setActivationListener($this, "activatePage");
443  $page_gui->setTabHook($this, "addPageTabs");
444  $lm_set = new ilSetting("lm");
445  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
446  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
447  $ilCtrl->getHTML($page_gui);
448  $ilTabs->setTabActive("cont_layout");
449  $this->initEditLayoutForm();
450  $tpl->setContent($this->form->getHTML());
451  }
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
ilGlobalTemplateInterface $tpl
static getImagePath(string $img, 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
setContent(string $a_html)
Sets content for standard template.
Extension of ilPageObjectGUI for learning modules.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
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, $lm_set, 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(), ilGlobalTemplateInterface\setContent(), ilPageObjectGUI\setEditPreview(), ilGlobalTemplateInterface\setTitle(), and ilGlobalTemplateInterface\setTitleIcon().

Referenced by edit(), and preview().

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  $lm_set = new ilSetting("lm");
71 
72  $this->ctrl->setReturn($this, "edit");
73  if (!ilPageObject::_exists("lm", $this->obj->getId(), $this->requested_transl) &&
74  ilPageObject::_exists("lm", $this->obj->getId(), "-")) {
75  if ($this->requested_totransl == "") {
76  $this->requested_totransl = $this->requested_transl;
77  $ilCtrl->setParameterByClass("illmpagegui", "totransl", $this->requested_transl);
78  $ilCtrl->redirectByClass("illmpagegui", "switchToLanguage");
79  }
80  $ilCtrl->setCmdClass("illmpagegui");
81  $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
82  } else {
83  $page_gui = new ilLMPageGUI($this->obj->getId());
84  }
85  $page_gui->setEditPreview(true);
86  $page_gui->activateMetaDataEditor(
87  $this->content_object,
88  $this->obj->getType(),
89  $this->obj->getId(),
90  $this->obj,
91  "MDUpdateListener"
92  );
93  if ($ilSetting->get("block_activated_news")) {
94  $page_gui->setEnabledNews(
95  true,
96  $this->obj->content_object->getId(),
97  $this->obj->content_object->getType()
98  );
99  }
100 
101  $page_gui->setViewPageLink(
102  ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() .
104  );
105 
106  $page_gui->setStyleId($this->content_style_domain
107  ->styleForRefId($this->content_object->getRefId())
108  ->getEffectiveStyleId());
109  $page_gui->setTemplateTargetVar("ADM_CONTENT");
110  $page_gui->getPageObject()->buildDom();
111  $int_links = $page_gui->getPageObject()->getInternalLinks();
112  $link_xml = $this->getLinkXML($int_links);
113  $page_gui->setLinkXml($link_xml);
114 
115  $page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
116  $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
117  $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
118  $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
119  $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
120  $page_gui->setPresentationTitle(
122  $this->obj->getId(),
123  $this->content_object->getPageHeader(),
124  $this->content_object->isActiveNumbering(),
125  false,
126  false,
127  0,
128  $page_gui->getLanguage()
129  )
130  );
131  //$page_gui->setLocator($contObjLocator);
132  $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
133  $page_gui->setActivationListener($this, "activatePage");
134 
135  $up_gui = "ilobjlearningmodulegui";
136  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
137 
138  $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
139  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
140  if ($this->content_object->getLayoutPerPage()) {
141  $page_gui->setTabHook($this, "addPageTabs");
142  }
143  $ret = $this->ctrl->forwardCommand($page_gui);
144  if ($ret != "") { // in 6.0 this overwrites already set content with an empty string sometimes
145  $tpl->setContent($ret);
146  }
147  break;
148 
149  default:
150  $this->$cmd();
151  break;
152  }
153  }
setEditPreview(bool $a_editpreview)
Set Display first Edit tab, then Preview tab, instead of Page and Edit.
ilGlobalTemplateInterface $tpl
static getImagePath(string $img, 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
setContent(string $a_html)
Sets content for 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.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
$lm_set
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:18
getLinkXML(array $a_int_links)
get link targets
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLayoutCssFix()

static ilLMPageObjectGUI::getLayoutCssFix ( )
static

Get layout css fix (workaround for broken radio options)

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

Referenced by ilStructureObjectGUI\insertTemplate().

616  : string
617  {
618  return "
619  <style>
620  .form-control.il-input-radiooption > label {
621  vertical-align: middle;
622  }
623  .form-control.il-input-radiooption > .help-block {
624  padding-left: 2rem;
625  }
626  </style>
627  ";
628  }
+ Here is the caller graph for this function:

◆ getLinkXML()

ilLMPageObjectGUI::getLinkXML ( array  $a_int_links)

get link targets

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

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

Referenced by executeCommand().

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

453  : void
454  {
455  $lng = $this->lng;
456  $ilCtrl = $this->ctrl;
457  $im_tag = "";
458 
459  $this->form = new ilPropertyFormGUI();
460 
461  // default layout
462  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
463 
464  if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
465  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
466  }
467  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
468  $lng->txt("cont_lm_default_layout") .
469  "</strong>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
470  "</td></tr></table>", ""));
471 
472  foreach (ilObjContentObject::getAvailableLayouts() as $l) {
473  $im_tag = "";
474  if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
475  $im_tag = ilUtil::img($im, $l);
476  }
477  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
478  $lng->txt("cont_layout_" . $l) . "</strong>: " . $lng->txt("cont_layout_" . $l . "_desc") .
479  "</td></tr></table>", $l));
480  }
481 
482  $layout->setValue($this->obj->getLayout());
483  $this->form->addItem($layout);
484 
485  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
486 
487  $this->form->setTitle($lng->txt("cont_page_layout"));
488  $this->form->setFormAction($ilCtrl->getFormAction($this));
489  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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.
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 557 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().

557  : Form\Standard
558  {
559  $ui = $this->ui;
560  $f = $ui->factory();
561  $ctrl = $this->ctrl;
562  $lng = $this->lng;
563 
564  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
565 
566  $fields["description"] = $f->input()->field()->textarea($lng->txt("description"));
567 
568  $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
569  if (!is_null($ts)) {
570  $fields["layout_id"] = $ts;
571  }
572 
573  // section
574  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
575 
576  $form_action = $ctrl->getLinkTarget($this, "save");
577  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
578  }
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 169 of file class.ilLMPageObjectGUI.php.

References ILIAS\Repository\ctrl(), and executeCommand().

169  : void
170  {
171  $this->ctrl->setCmdClass("ilLMPageGUI");
172  $this->ctrl->setCmd("preview");
173  $this->executeCommand();
174  }
+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

Save page.

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

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

583  : void
584  {
585  global $DIC;
586 
587  $request = $DIC->http()->request();
588  $lng = $this->lng;
589 
590  $form = $this->initNewPageForm();
591  if ($request->getMethod() == "POST") {
592  $form = $form->withRequest($request);
593  $data = $form->getData()["sec"];
594 
595  $layout_id = (int) ($data["layout_id"] ?? 0);
596 
597  $this->obj = new ilLMPageObject($this->content_object);
598  $this->obj->setType("pg");
599  $this->obj->setTitle(ilUtil::stripSlashes($data["title"]));
600  $this->obj->setDescription(ilUtil::stripSlashes($data["description"]));
601  $this->obj->setLMId($this->content_object->getId());
602  if ($layout_id > 0) {
603  $this->obj->create(false, false, $layout_id);
604  } else {
605  $this->obj->create();
606  }
607  $this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_created"), true);
608  }
609  $this->cancel();
610  }
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="")
global $DIC
Definition: feed.php:28
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:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

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

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

491  : void
492  {
493  $tpl = $this->tpl;
494  $lng = $this->lng;
495  $ilCtrl = $this->ctrl;
496 
497  $this->initEditLayoutForm();
498  if ($this->form->checkInput()) {
499  ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
500  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
501  $ilCtrl->redirect($this, "editLayout");
502  }
503  $this->form->setValuesByPost();
504  $tpl->setContent($this->form->getHTML());
505  }
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:

◆ updateHistory()

ilLMPageObjectGUI::updateHistory ( )

update history

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

References ilHistory\_createEntry().

345  : void
346  {
348  $this->obj->getId(),
349  "update",
350  [],
351  $this->content_object->getType() . ":pg",
352  "",
353  true
354  );
355  }
static _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object.
+ 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: