ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 constructor More...
 
 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 ()
 structure / page object creation form More...
 
 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 @ilCtrl_Calls ilLMPageObjectGUI: ilLMPageGUI, ilAssGenFeedbackPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLMPageObjectGUI::__construct ( ilObjLearningModule  $a_content_obj)

constructor

Reimplemented from ilLMObjectGUI.

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

37 {
38 global $DIC;
39
40 $this->tpl = $DIC["tpl"];
41 $this->ctrl = $DIC->ctrl();
42 $this->tabs = $DIC->tabs();
43 $this->settings = $DIC->settings();
44 $this->lng = $DIC->language();
45 parent::__construct($a_content_obj);
46 $cs = $DIC->contentStyle();
47 $this->content_style_domain = $cs->domain();
48 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilLMPageObjectGUI::_goto ( string  $a_target)
static

redirect script

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

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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addPageTabs()

ilLMPageObjectGUI::addPageTabs ( )

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

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

References ilLMObjectGUI\$ctrl, and $tabs.

◆ cancel()

ilLMPageObjectGUI::cancel ( )

cancel

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

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

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

Referenced by save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilLMPageObjectGUI::create ( )

structure / page object creation form

Reimplemented from ilLMObjectGUI.

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

520 : void
521 {
522 $ui = $this->ui;
525
527 $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "cancel"));
528
529 $ctrl->setParameter($this, "new_type", "pg");
530 $form = $this->initNewPageForm();
531
532 $this->tpl->setContent($ui->renderer()->render($form) . self::getLayoutCssFix());
533 }
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
ILIAS DI UIServices $ui
setBackTarget(string $a_title, string $a_target, string $a_frame="")

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

+ Here is the call graph for this function:

◆ downloadFile()

ilLMPageObjectGUI::downloadFile ( )

download file of file lists

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

500 : void
501 {
502 $pg_obj = $this->obj->getPageObject();
503 $pg_obj->buildDom();
504 $int_links = $pg_obj->getInternalLinks();
505 foreach ($int_links as $il) {
506 if ($il["Target"] == str_replace(
507 "_file_",
508 "_dfile_",
509 $this->request->getFileId()
510 )) {
511 $file = explode("_", $this->request->getFileId());
512 $file_id = (int) $file[count($file) - 1];
513 $fileObj = new ilObjFile($file_id, false);
514 $fileObj->sendFile();
515 exit;
516 }
517 }
518 }
Class ilObjFile.
exit

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

+ Here is the call graph for this function:

◆ edit()

ilLMPageObjectGUI::edit ( )

display content of page (edit view)

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

156 : void
157 {
158 $this->ctrl->redirectByClass(ilLMPageGUI::class, "edit");
159 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editLayout()

ilLMPageObjectGUI::editLayout ( )

Edit layout of page.

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

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilLMPageObjectGUI::executeCommand ( )

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

59 : void
60 {
62 $ilCtrl = $this->ctrl;
64
65 $next_class = $this->ctrl->getNextClass($this);
66 $cmd = $this->ctrl->getCmd();
67
68 switch ($next_class) {
69 case "illmpagegui":
70
71 $this->ctrl->setReturn($this, "edit");
72 if (!ilPageObject::_exists("lm", $this->obj->getId(), $this->requested_transl) &&
73 ilPageObject::_exists("lm", $this->obj->getId(), "-")) {
74 if ($this->requested_totransl == "") {
75 $this->requested_totransl = $this->requested_transl;
76 $ilCtrl->setParameterByClass("illmpagegui", "totransl", $this->requested_transl);
77 $ilCtrl->redirectByClass("illmpagegui", "switchToLanguage");
78 }
79 $page_gui = new ilLMPageGUI($this->obj->getId(), 0, false, "-");
80 } else {
81 $page_gui = new ilLMPageGUI($this->obj->getId());
82 }
83 $page_gui->setEditPreview(true);
84 $page_gui->activateMetaDataEditor(
85 $this->content_object,
86 $this->obj->getType(),
87 $this->obj->getId(),
88 $this->obj,
89 "MDUpdateListener"
90 );
91 if ($ilSetting->get("block_activated_news")) {
92 $page_gui->setEnabledNews(
93 true,
94 $this->obj->content_object->getId(),
95 $this->obj->content_object->getType()
96 );
97 }
98
99 $page_gui->setViewPageLink(
100 ILIAS_HTTP_PATH . "/goto.php?target=pg_" . $this->obj->getId() .
101 "_" . $this->requested_ref_id
102 );
103
104 $page_gui->setStyleId($this->content_style_domain
105 ->styleForRefId($this->content_object->getRefId())
106 ->getEffectiveStyleId());
107 $page_gui->setTemplateTargetVar("ADM_CONTENT");
108 $page_gui->getPageObject()->buildDom();
109 $int_links = $page_gui->getPageObject()->getInternalLinks();
110 $link_xml = $this->getLinkXML($int_links);
111 $page_gui->setLinkXml($link_xml);
112
113 $page_gui->setFileDownloadLink("ilias.php?cmd=downloadFile&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
114 $page_gui->setFullscreenLink("ilias.php?cmd=fullscreen&ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
115 $page_gui->setLinkParams("ref_id=" . $this->content_object->getRefId());
116 $page_gui->setSourcecodeDownloadScript("ilias.php?ref_id=" . $this->requested_ref_id . "&baseClass=ilLMPresentationGUI");
117 $page_gui->setPresentationTitle(
119 $this->obj->getId(),
120 $this->content_object->getPageHeader(),
121 $this->content_object->isActiveNumbering(),
122 false,
123 false,
124 0,
125 $page_gui->getLanguage()
126 )
127 );
128 //$page_gui->setLocator($contObjLocator);
129 $page_gui->setHeader($this->lng->txt("page") . ": " . $this->obj->getTitle());
130 $page_gui->setActivationListener($this, "activatePage");
131
132 $up_gui = "ilobjlearningmodulegui";
133 $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
134
135 $tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
136 $tpl->setTitle($this->lng->txt("page") . ": " . $this->obj->getTitle());
137 if ($this->content_object->getLayoutPerPage()) {
138 $page_gui->setTabHook($this, "addPageTabs");
139 }
140 $ret = $this->ctrl->forwardCommand($page_gui);
141 if ($ret != "") { // in 6.0 this overwrites already set content with an empty string sometimes
142 $tpl->setContent($ret);
143 }
144 break;
145
146 default:
147 $this->$cmd();
148 break;
149 }
150 }
getLinkXML(array $a_int_links)
get link targets
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...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
global $ilSetting
Definition: privfeed.php:31

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

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

594 : string
595 {
596 return "
597 <style>
598 .form-control.il-input-radiooption > label {
599 vertical-align: middle;
600 }
601 .form-control.il-input-radiooption > .help-block {
602 padding-left: 2rem;
603 }
604 </style>
605 ";
606 }

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

+ Here is the caller graph for this function:

◆ getLinkXML()

ilLMPageObjectGUI::getLinkXML ( array  $a_int_links)

get link targets

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

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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditLayoutForm()

ilLMPageObjectGUI::initEditLayoutForm ( )

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

431 : void
432 {
434 $ilCtrl = $this->ctrl;
435 $im_tag = "";
436
437 $this->form = new ilPropertyFormGUI();
438
439 // default layout
440 $layout = new ilRadioGroupInputGUI($lng->txt("cont_layout"), "layout");
441
442 if (is_file($im = ilUtil::getImagePath("layout_" . $this->content_object->getLayout() . ".png"))) {
443 $im_tag = ilUtil::img($im, $this->content_object->getLayout());
444 }
445 $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
446 $lng->txt("cont_lm_default_layout") .
447 "</strong>: " . $lng->txt("cont_layout_" . $this->content_object->getLayout()) .
448 "</td></tr></table>", ""));
449
451 $im_tag = "";
452 if (is_file($im = ilUtil::getImagePath("layout_" . $l . ".png"))) {
453 $im_tag = ilUtil::img($im, $l);
454 }
455 $layout->addOption(new ilRadioOption("<table><tr><td>" . $im_tag . "</td><td><strong>" .
456 $lng->txt("cont_layout_" . $l) . "</strong>: " . $lng->txt("cont_layout_" . $l . "_desc") .
457 "</td></tr></table>", $l));
458 }
459
460 $layout->setValue($this->obj->getLayout());
461 $this->form->addItem($layout);
462
463 $this->form->addCommandButton("saveLayout", $lng->txt("save"));
464
465 $this->form->setTitle($lng->txt("cont_page_layout"));
466 $this->form->setFormAction($ilCtrl->getFormAction($this));
467 }
static getAvailableLayouts()
get all available lm layouts
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.

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

Referenced by editLayout(), and saveLayout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initNewPageForm()

ilLMPageObjectGUI::initNewPageForm ( )

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

535 : Form\Standard
536 {
537 $ui = $this->ui;
538 $f = $ui->factory();
541
542 $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
543
544 $fields["description"] = $f->input()->field()->textarea($lng->txt("description"));
545
546 $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
547 if (!is_null($ts)) {
548 $fields["layout_id"] = $ts;
549 }
550
551 // section
552 $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
553
554 $form_action = $ctrl->getLinkTarget($this, "save");
555 return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
556 }

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

Referenced by create(), and save().

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

164 : void
165 {
166 $this->ctrl->redirectByClass(ilLMPageGUI::class, "preview");
167 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ save()

ilLMPageObjectGUI::save ( )

Save page.

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

561 : void
562 {
563 global $DIC;
564
565 $request = $DIC->http()->request();
567
568 $form = $this->initNewPageForm();
569 if ($request->getMethod() == "POST") {
570 $form = $form->withRequest($request);
571 $data = $form->getData()["sec"];
572
573 $layout_id = (int) ($data["layout_id"] ?? 0);
574
575 $this->obj = new ilLMPageObject($this->content_object);
576 $this->obj->setType("pg");
577 $this->obj->setTitle(ilUtil::stripSlashes($data["title"]));
578 $this->obj->setDescription(ilUtil::stripSlashes($data["description"]));
579 $this->obj->setLMId($this->content_object->getId());
580 if ($layout_id > 0) {
581 $this->obj->create(false, false, $layout_id);
582 } else {
583 $this->obj->create();
584 }
585 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_created"), true);
586 }
587 $this->cancel();
588 }
EditingGUIRequest $request
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

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

+ Here is the call graph for this function:

◆ saveLayout()

ilLMPageObjectGUI::saveLayout ( )

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

469 : void
470 {
473 $ilCtrl = $this->ctrl;
474
475 $this->initEditLayoutForm();
476 if ($this->form->checkInput()) {
477 ilLMObject::writeLayout($this->obj->getId(), $this->form->getInput("layout"));
478 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
479 $ilCtrl->redirect($this, "editLayout");
480 }
481 $this->form->setValuesByPost();
482 $tpl->setContent($this->form->getHTML());
483 }
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.

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

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

53 : void
54 {
55 $this->obj = $a_pg_obj;
56 $this->obj->setLMId($this->content_object->getId());
57 }
setLMId(int $a_lm_id)

References ilLMObject\setLMId().

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

◆ $form

ilPropertyFormGUI ilLMPageObjectGUI::$form
protected

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

Referenced by create(), and save().

◆ $settings

ilSetting ilLMPageObjectGUI::$settings
protected

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

Referenced by executeCommand().

◆ $tabs

ilTabsGUI ilLMPageObjectGUI::$tabs
protected

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

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


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