ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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...
 
 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...
 
 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: feed.php:28
__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 361 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().

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

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

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

References ilLMObjectGUI\$ctrl, and $tabs.

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

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

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

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

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

523  : void
524  {
525  $pg_obj = $this->obj->getPageObject();
526  $pg_obj->buildDom();
527  $int_links = $pg_obj->getInternalLinks();
528  foreach ($int_links as $il) {
529  if ($il["Target"] == str_replace(
530  "_file_",
531  "_dfile_",
532  $this->request->getFileId()
533  )) {
534  $file = explode("_", $this->request->getFileId());
535  $file_id = (int) $file[count($file) - 1];
536  $fileObj = new ilObjFile($file_id, false);
537  $fileObj->sendFile();
538  exit;
539  }
540  }
541  }
exit
Definition: login.php:28
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 428 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().

428  : void
429  {
430  $tpl = $this->tpl;
431  $ilCtrl = $this->ctrl;
432  $ilTabs = $this->tabs;
433 
434  $page_gui = new ilLMPageGUI($this->obj->getId());
435  $page_gui->setEditPreview(true);
436  $page_gui->activateMetaDataEditor(
437  $this->content_object,
438  $this->obj->getType(),
439  $this->obj->getId(),
440  $this->obj,
441  "MDUpdateListener"
442  );
443  $page_gui->setActivationListener($this, "activatePage");
444  $page_gui->setTabHook($this, "addPageTabs");
445  $lm_set = new ilSetting("lm");
446  $tpl->setTitleIcon(ilUtil::getImagePath("icon_pg.svg"));
447  $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
448  $ilCtrl->getHTML($page_gui);
449  $ilTabs->setTabActive("cont_layout");
450  $this->initEditLayoutForm();
451  $tpl->setContent($this->form->getHTML());
452  }
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)
$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("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:17
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 617 of file class.ilLMPageObjectGUI.php.

Referenced by ilStructureObjectGUI\insertTemplate().

617  : string
618  {
619  return "
620  <style>
621  .form-control.il-input-radiooption > label {
622  vertical-align: middle;
623  }
624  .form-control.il-input-radiooption > .help-block {
625  padding-left: 2rem;
626  }
627  </style>
628  ";
629  }
+ 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, $target_arr, $target_id, $type, 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":
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":
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 = "";
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 
332  if ($href != "") {
333  $anc_par = 'Anchor="' . $anc . '"';
334  $link_info .= "<IntLinkInfo Target=\"$target\" Type=\"$type\" " .
335  "TargetFrame=\"$targetframe\" LinkHref=\"$href\" LinkTarget=\"$ltarget\" LinkContent=\"$lcontent\" $anc_par/>";
336  }
337  }
338  }
339  $link_info .= "</IntLinkInfos>";
340  return $link_info;
341  }
$target_arr
Definition: goto.php:50
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:
$type
$target_id
Definition: goto.php:52
static _lookupObjId(int $ref_id)
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 454 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().

454  : void
455  {
456  $lng = $this->lng;
457  $ilCtrl = $this->ctrl;
458  $im_tag = "";
459 
460  $this->form = new ilPropertyFormGUI();
461 
462  // default layout
463  $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
464 
465  if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
466  $im_tag = ilUtil::img($im, $this->content_object->getLayout());
467  }
468  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
469  $lng->txt("cont_lm_default_layout") .
470  "</b>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
471  "</td></tr></table>", ""));
472 
473  foreach (ilObjContentObject::getAvailableLayouts() as $l) {
474  $im_tag = "";
475  if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
476  $im_tag = ilUtil::img($im, $l);
477  }
478  $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><b>" .
479  $lng->txt("cont_layout_" . $l) . "</b>: " . $lng->txt("cont_layout_" . $l . "_desc") .
480  "</td></tr></table>", $l));
481  }
482 
483  $layout->setValue($this->obj->getLayout());
484  $this->form->addItem($layout);
485 
486  $this->form->addCommandButton("saveLayout", $lng->txt("save"));
487 
488  $this->form->setTitle($lng->txt("cont_page_layout"));
489  $this->form->setFormAction($ilCtrl->getFormAction($this));
490  }
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initNewPageForm()

ilLMPageObjectGUI::initNewPageForm ( )

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

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

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

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

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

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

References ilHistory\_createEntry().

346  : void
347  {
349  $this->obj->getId(),
350  "update",
351  [],
352  $this->content_object->getType() . ":pg",
353  "",
354  true
355  );
356  }
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: