29 protected \ILIAS\Notes\Service
$notes;
30 protected \ILIAS\Portfolio\InternalGUIService
$gui;
41 protected \ILIAS\DI\UIServices
$ui;
47 int $a_id_type = self::REPOSITORY_NODE_ID,
48 int $a_parent_node_id = 0
52 $this->
user = $DIC->user();
53 $this->
locator = $DIC[
"ilLocator"];
54 $this->
toolbar = $DIC->toolbar();
56 $this->tree = $DIC->repositoryTree();
57 $this->
help = $DIC[
"ilHelp"];
58 $this->tpl = $DIC[
"tpl"];
59 $ilUser = $DIC->user();
60 $this->
ui = $DIC->ui();
62 $this->port_request = $DIC->portfolio()
69 $this->user_id = $ilUser->getId();
71 $this->
lng->loadLanguageModule(
"prtf");
72 $this->
lng->loadLanguageModule(
"user");
73 $this->
lng->loadLanguageModule(
"obj");
75 $this->requested_ppage = $this->port_request->getPortfolioPageId();
76 $this->requested_user_page = $this->port_request->getUserPage();
79 $back = str_replace(
"&",
":::", $this->port_request->getBackUrl());
81 "/[^a-zA-Z0-9_\.\?=:\s]/",
85 $this->requested_back_url = str_replace(
":::",
"&", $back);
87 $this->
ctrl->setParameterByClass(
"ilobjportfoliogui",
"back_url", rawurlencode($this->requested_back_url));
88 $cs = $DIC->contentStyle();
89 $this->content_style_gui = $cs->gui();
91 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
93 $this->gui = $DIC->portfolio()->internal()->gui();
94 $this->notes = $DIC->notes();
103 strip_tags($this->
object->getTitle()),
104 $this->
ctrl->getLinkTarget($this,
"view")
108 if ($this->page_id > 0) {
110 $title = $page->getTitle();
114 $this->
ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit")
122 if ($this->requested_ppage > 0) {
124 $this->
ctrl->redirect($this,
"view");
128 $this->page_mode =
"edit";
129 $this->
ctrl->setParameter($this,
"ppage", $this->page_id);
135 $this->page_mode =
"preview";
136 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
142 if (!$this->page_id) {
143 $this->
ctrl->redirect($this,
"view");
148 $this->tabs_gui->clearTargets();
149 $this->tabs_gui->setBackTarget(
150 $this->
lng->txt(
"back"),
151 $this->
ctrl->getLinkTarget($this,
"view")
155 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
157 $ret = $this->
ctrl->forwardCommand($page_gui);
158 if ($ret !=
"" && $ret !==
true) {
160 if ($this->page_mode ===
"preview") {
164 $this->
preview(
false, $ret, ($a_cmd !==
"previewEmbedded"));
172 if (is_string($ret)) {
173 $this->tpl->setContent($ret);
184 $this->additional = $a_additional;
199 $this->perma_link = array(
"obj_id" => $a_obj_id,
"type" => $a_type);
210 $this->
lng->loadLanguageModule($this->
getType());
213 $this->tabs_gui->addSubTab(
215 $this->
lng->txt($this->getType() .
"_properties"),
216 $this->
ctrl->getLinkTarget($this,
'edit')
219 $this->tabs_gui->addSubTab(
221 $this->
lng->txt(
"obj_sty"),
222 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
225 $this->tabs_gui->activateSubTab($a_active);
240 $section->setTitle($this->
lng->txt(
'obj_features'));
258 $a_values[
"comments"] = $this->
object->hasPublicComments();
259 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
268 $this->
object->setPublicComments($form->
getInput(
"comments"));
269 $this->
object->setProfilePicture($form->
getInput(
"ppic"));
279 ?
int $a_page_id =
null,
280 ?
int $a_portfolio_id =
null 297 $this->
ctrl->redirect($this,
"infoScreen");
300 $this->tabs_gui->activateTab(
"pages");
305 $this->
lng->txt(
"prtf_add_page"),
306 $this->
ctrl->getLinkTarget($this,
"addPage")
312 if ($this->
getType() ===
"prtf" && count($pages) > 0) {
313 $ilToolbar->addSeparator();
317 if ($this->
object->isCommentsExportPossible()) {
318 $this->
lng->loadLanguageModule(
"note");
319 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
320 $comment_modal = $comment_export_helper->getCommentIncludeModalDialog(
321 $this->
lng->txt(
"export_html"),
322 $this->
lng->txt(
"note_html_export_include_comments"),
323 $this->
ctrl->getLinkTarget($this,
"export"),
324 $this->
ctrl->getLinkTarget($this,
"exportWithComments")
326 $button = $ui->factory()->button()->standard($this->
lng->txt(
"export_html"),
'')
327 ->withOnClick($comment_modal->getShowSignal());
328 $ilToolbar->addComponent($button);
329 $modal_html = $ui->renderer()->render($comment_modal);
332 $this->
lng->txt(
"export_html"),
333 $this->
ctrl->getLinkTarget($this,
"export")
337 $print_view = $this->getPrintView();
338 $modal_elements = $print_view->getModalElements($this->
ctrl->getLinkTarget(
342 $modal_html .= $ui->renderer()->render($modal_elements->modal);
343 $ilToolbar->addComponent($modal_elements->button);
349 $this->tpl->setContent($table->getHTML() . $modal_html);
352 public function getPrintView(): \ILIAS\Export\PrintProcessGUI
354 $obj_ids = $this->port_request->getObjIds();
355 $signature = $this->port_request->getSignature();
356 $declaration = $this->port_request->getIncludeDeclaration();
357 if (count($obj_ids) === 0) {
374 return new \ILIAS\Export\PrintProcessGUI(
389 $this->tabs_gui->clearTargets();
390 $this->tabs_gui->setBackTarget(
391 $this->
lng->txt(
"back"),
392 $this->
ctrl->getLinkTarget($this,
"view")
396 $ilHelp->setScreenId(
"add_page");
400 $this->tpl->setContent($form->getHTML());
409 $form->setFormAction($this->
ctrl->getFormAction($this));
413 $ti->setMaxLength(200);
414 $ti->setRequired(
true);
418 if ($a_mode ===
"create") {
423 $form->addItem($use_template);
426 $use_template->addOption($opt);
428 foreach ($templates as $templ) {
429 $templ->readObject();
431 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
432 $use_template->addOption($opt);
436 $form->
setTitle($this->
lng->txt(
"prtf_add_page") .
": " .
437 $this->
object->getTitle());
438 $form->addCommandButton(
"savePage", $this->
lng->txt(
"save"));
439 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
454 $page->setTitle($form->getInput(
"title"));
457 $layout_id = $form->getInput(
"tmpl");
460 $page->setXMLContent($layout_obj->copyXmlContent(
false));
465 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_page_created"),
true);
466 $this->
ctrl->redirect($this,
"view");
469 $this->tabs_gui->clearTargets();
470 $this->tabs_gui->setBackTarget(
471 $this->
lng->txt(
"back"),
472 $this->
ctrl->getLinkTarget($this,
"view")
475 $form->setValuesByPost();
476 $this->tpl->setContent($form->getHTML());
488 $title_changes = array();
490 $order = $this->port_request->getOrder();
491 $titles = $this->port_request->getTitles();
492 if (count($order) > 0) {
493 foreach ($order as $k => $v) {
495 if ($titles[$k] ??
"") {
496 $new_title = $titles[$k] ??
"";
497 if ($page->getTitle() != $new_title) {
498 $title_changes[$page->getId()] = array(
"old" => $page->getTitle(),
"new" => $new_title);
499 $page->setTitle($new_title);
508 $this->
object->fixLinksOnTitleChange($title_changes);
510 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
511 $this->
ctrl->redirect($this,
"view");
516 $prtf_pages = $this->port_request->getPortfolioPageIds();
518 if (count($prtf_pages) === 0) {
519 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
520 $this->
ctrl->redirect($this,
"view");
522 $this->tabs_gui->activateTab(
"pages");
525 $cgui->setFormAction($this->
ctrl->getFormAction($this));
526 $cgui->setHeaderText($this->
lng->txt(
"prtf_sure_delete_portfolio_pages"));
527 $cgui->setCancel($this->
lng->txt(
"cancel"),
"view");
528 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deletePortfolioPages");
530 foreach ($prtf_pages as
$id) {
532 if ($page->getPortfolioId() !== $this->
object->getId()) {
536 $title = $page->getTitle();
537 $cgui->addItem(
"prtf_pages[]", $id, $title);
540 $this->tpl->setContent($cgui->getHTML());
550 $page_ids = $this->port_request->getPortfolioPageIds();
551 foreach ($page_ids as
$id) {
555 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_portfolio_page_deleted"),
true);
556 $this->
ctrl->redirect($this,
"view");
563 bool $a_return =
false,
565 bool $a_show_notes =
true 569 $portfolio_id = $this->
object->
getId();
570 $user_id = $this->
object->getOwner();
574 $this->tabs_gui->clearTargets();
582 $this->tpl->setLoginTargetPar(
"prtf_" . $this->
object->getId() .
"_" . $current_page);
588 if ($this->requested_back_url !=
"") {
590 } elseif (strtolower($this->port_request->getBaseClass()) !==
"ilpublicuserprofilegui" &&
594 if ($this->
getType() ===
"prtf") {
595 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id", $this->
object->getOwner());
596 $back = $this->
ctrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilportfoliorepositorygui"),
"showOther");
597 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id",
"");
609 $back = $this->
ctrl->getLinkTarget($this,
"view");
610 if ($this->
getType() ===
"prtf") {
611 $back_caption = $this->
lng->txt(
"prtf_back_to_portfolio_owner");
614 $this->
lng->loadLanguageModule(
"prtt");
615 $back_caption = $this->
lng->txt(
"prtt_edit");
621 if (count($pages) > 1) {
622 foreach ($pages as $p) {
623 $this->
ctrl->setParameter($this,
"user_page", $p[
"id"]);
624 $this->tabs_gui->addTab(
625 "user_page_" . $p[
"id"],
627 $this->
ctrl->getLinkTarget($this,
"preview")
631 $this->tabs_gui->activateTab(
"user_page_" . $current_page);
634 $this->
ctrl->setParameter($this,
"user_page", $current_page);
641 if ($a_show_notes && $this->
object->hasPublicComments() && $current_page) {
643 $next_class = $this->
ctrl->getNextClass($this);
644 if ($next_class ===
"ilcommentgui") {
645 $notes = $this->
ctrl->forwardCommand($comment_gui);
647 $notes = $comment_gui->getListHTML();
656 $page_gui->setEmbedded(
true);
658 $content = $this->
ctrl->getHTML($page_gui);
661 $content = $a_content;
669 if (count($this->perma_link) === 0) {
670 if ($this->
getType() ===
"prtf") {
671 $this->tpl->setPermanentLink($this->
getType(), $this->
object->getId(),
"_" . $current_page);
673 $this->tpl->setPermanentLink($this->
getType(), $this->
object->getRefId());
676 $this->tpl->setPermanentLink($this->perma_link[
"type"] ??
"", $this->perma_link[
"obj_id"] ?? 0);
681 $user_id = $ilUser->getId();
686 self::renderFullscreenHeader($obj, $this->tpl, $user_id);
689 $this->
ctrl->setParameter($this,
"user_page",
"");
691 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
694 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
695 '<div class="ilc_page_Page">' .
704 $this->tpl->setContent($content .
705 '<div class="ilClearFloat">' . $notes .
'</div>');
712 $current_page = (
int) $this->requested_user_page;
715 if ($pages && $current_page) {
717 foreach ($pages as $page) {
718 if ((
int) $page[
"id"] === $current_page) {
724 $current_page =
null;
729 if (!$current_page && $pages) {
730 $current_page = $pages;
731 $current_page = array_shift($current_page);
732 $current_page = (
int) $current_page[
"id"];
734 return $current_page;
739 $gui = $this->notes->gui()->getCommentsGUI(
745 $gui->enablePublicNotesDeletion(($this->user_id === $this->
object->getOwner()) &&
746 $this->
settings->get(
"comments_del_tutor",
'1'));
753 $page_class = ($this->
getType() ===
"prtt")
754 ?
"ilPortfolioTemplatePageGUI" 755 :
"ilportfoliopagegui";
759 if ($this->
getType() ===
"prtt") {
760 $button = $this->
ui->factory()->button()->standard(
761 $this->
lng->txt(
"prtt_edit"),
762 $this->
ctrl->getLinkTargetByClass([
"ilobjportfoliotemplategui"],
"view")
765 $button = $this->
ui->factory()->button()->standard(
766 $this->
lng->txt(
"prtf_edit_portfolio"),
767 $this->
ctrl->getLinkTargetByClass([
"ilobjportfoliogui"],
"view")
770 $this->
toolbar->addComponent($button);
774 $this->
ctrl->setParameterByClass($page_class,
"ppage", $page_id);
775 $button = $this->
ui->factory()->button()->standard(
776 $this->
lng->txt(
"edit_page"),
777 $this->
ctrl->getLinkTargetByClass($page_class,
"edit")
780 $this->
toolbar->addComponent($button);
785 $this->tpl->setHeaderActionMenu($this->
ui->renderer()->render($button));
793 bool $a_export =
false 797 $ilUser = $DIC->user();
802 ($a_portfolio->
getType() ===
"prtt")
804 : $a_portfolio->
getId(),
805 $a_portfolio->
getId(),
811 $name = $name[
"lastname"] .
", " . (($t = $name[
"title"]) ? $t .
" " :
"") . $name[
"firstname"];
820 $ppic = basename($ppic);
840 bool $a_with_comments =
false 842 $port_export = new \ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
843 $port_export->includeComments($a_with_comments);
844 $port_export->exportHtml();
845 $port_export->deliver($this->
object->getTitle() .
".zip",
true);
859 $prtf_pages = $this->port_request->getPortfolioPageIds();
861 if (count($prtf_pages) === 0) {
862 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
863 $this->
ctrl->redirect($this,
"view");
865 $this->tabs_gui->activateTab(
"pages");
871 foreach ($prtf_pages as $page_id) {
873 $item->setValue($page_id);
874 $a_form->addItem($item);
877 $this->tpl->setContent($a_form->getHTML());
884 if ($form->checkInput()) {
886 if ($form->getInput(
"target") ===
"old") {
887 $portfolio_id = $form->getInput(
"prtf");
892 $portfolio->setTitle($form->getInput(
"title"));
893 $portfolio->create();
894 $portfolio_id = $portfolio->getId();
898 $page_ids = $this->port_request->getPortfolioPageIds();
899 foreach ($page_ids as $page_id) {
902 $target->setXMLContent($source->copyXmlContent(
true));
903 $target->setType($source->getType());
904 $target->setTitle($source->getTitle());
908 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_pages_copied"),
true);
909 $this->
ctrl->redirect($this,
"view");
912 $form->setValuesByPost();
921 $form->setFormAction($this->
ctrl->getFormAction($this));
922 $form->setTitle($this->
lng->txt(
"prtf_copy_page"));
926 $form->addCommandButton(
"copyPage", $this->
lng->txt(
"save"));
927 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
948 $this->content_style_gui->
addCss(
950 $this->
object->getRefId(),
951 $this->
object->getId()
updateCustom(ilPropertyFormGUI $form)
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
This class represents an option in a radio group.
getPageInstance(?int $a_page_id=null, ?int $a_portfolio_id=null)
getEditFormCustomValues(array &$a_values)
confirmPortfolioPageDeletion()
ILIAS Portfolio InternalGUIService $gui
New implementation of ilObjectGUI.
view()
Show list of portfolio pages.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
showEditButton(int $page_id)
setPermaLink(int $a_obj_id, string $a_type)
Set custom perma link (used in public profile?)
static _lookupName(int $a_user_id)
lookup user name
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static renderFullscreenHeader(ilObjPortfolioBase $a_portfolio, ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
addPage()
Show portfolio page creation form.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
savePage()
Create new portfolio page.
static lookupType($a_page_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
export(bool $a_with_comments=false)
handlePageCall(string $a_cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
string $requested_back_url
getPageGUIInstance(int $a_page_id)
preview()
description: > Example for rendering a Preview Glyph.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static activeLayouts(int $a_module=0)
Get active layouts.
savePortfolioPagesOrdering()
Save ordering of portfolio pages.
static http()
Fetches the global http state from ILIAS.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
ILIAS Notes Service $notes
getType()
Functions that must be overwritten.
setRepositoryMode(bool $a_value)
setScreenIdComponent(string $a_comp)
ILIAS Style Content GUIService $content_style_gui
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
getParentId(int $a_node_id)
get parent id of given node
setAdditional(array $a_additional)
Set Additonal Information (used in public profile?)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContentStyleSheet(?ilGlobalTemplateInterface $a_tpl=null)
Portfolio view gui base class.
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
setDescription(string $a_descr)
Sets description below title in standard template.
setSettingsSubTabs(string $a_active)
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
StandardGUIRequest $port_request
__construct(Container $dic, ilPlugin $plugin)
copyPageForm(?ilPropertyFormGUI $a_form=null)
Select target portfolio for page(s) copy.
ILIAS Style Content Object ObjectFacade $content_style_domain
static fixOrdering(int $a_portfolio_id)
initEditCustomForm(ilPropertyFormGUI $a_form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initPageForm(string $a_mode="create")
Init portfolio page form.
setTitle(string $a_title)