29 protected \ILIAS\Notes\Service
$notes;
30 protected \ILIAS\Portfolio\InternalGUIService
$gui;
41 protected \ILIAS\DI\UIServices
$ui;
42 protected \ILIAS\HTTP\Services
$http;
48 int $a_id_type = self::REPOSITORY_NODE_ID,
49 int $a_parent_node_id = 0
53 $this->
user = $DIC->user();
54 $this->
locator = $DIC[
"ilLocator"];
55 $this->
toolbar = $DIC->toolbar();
57 $this->tree = $DIC->repositoryTree();
58 $this->
help = $DIC[
"ilHelp"];
59 $this->tpl = $DIC[
"tpl"];
60 $ilUser = $DIC->user();
61 $this->
ui = $DIC->ui();
63 $this->port_request = $DIC->portfolio()
68 $this->
http = $DIC->http();
72 $this->user_id = $ilUser->getId();
74 $this->
lng->loadLanguageModule(
"prtf");
75 $this->
lng->loadLanguageModule(
"user");
76 $this->
lng->loadLanguageModule(
"obj");
78 $this->requested_ppage = $this->port_request->getPortfolioPageId();
79 $this->requested_user_page = $this->port_request->getUserPage();
82 $back = str_replace(
"&",
":::", $this->port_request->getBackUrl());
84 "/[^a-zA-Z0-9_\.\?=:\s]/",
88 $this->requested_back_url = str_replace(
":::",
"&", $back);
90 $this->
ctrl->setParameterByClass(
"ilobjportfoliogui",
"back_url", rawurlencode($this->requested_back_url));
91 $cs = $DIC->contentStyle();
92 $this->content_style_gui = $cs->gui();
94 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
96 $this->gui = $DIC->portfolio()->internal()->gui();
97 $this->notes = $DIC->notes();
106 strip_tags($this->
object->getTitle()),
107 $this->
ctrl->getLinkTarget($this,
"view")
111 if ($this->page_id > 0) {
113 $title = $page->getTitle();
117 $this->
ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit")
125 if ($this->requested_ppage > 0) {
127 $this->
ctrl->redirect($this,
"view");
131 $this->page_mode =
"edit";
132 $this->
ctrl->setParameter($this,
"ppage", $this->page_id);
138 $this->page_mode =
"preview";
139 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
145 if (!$this->page_id) {
146 $this->
ctrl->redirect($this,
"view");
151 $this->tabs_gui->clearTargets();
152 $this->tabs_gui->setBackTarget(
153 $this->
lng->txt(
"back"),
154 $this->
ctrl->getLinkTarget($this,
"view")
158 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
160 $ret = $this->
ctrl->forwardCommand($page_gui);
161 if ($ret !=
"" && $ret !==
true) {
163 if ($this->page_mode ===
"preview") {
167 $this->
preview(
false, $ret, ($a_cmd !==
"previewEmbedded"));
175 if (is_string($ret)) {
176 $this->tpl->setContent($ret);
187 $this->additional = $a_additional;
202 $this->perma_link = array(
"obj_id" => $a_obj_id,
"type" => $a_type);
213 $this->
lng->loadLanguageModule($this->
getType());
216 $this->tabs_gui->addSubTab(
218 $this->
lng->txt($this->getType() .
"_properties"),
219 $this->
ctrl->getLinkTarget($this,
'edit')
222 $this->tabs_gui->addSubTab(
224 $this->
lng->txt(
"obj_sty"),
225 $this->
ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
228 $this->tabs_gui->activateSubTab($a_active);
243 $section->setTitle($this->
lng->txt(
'obj_features'));
261 $a_values[
"comments"] = $this->
object->hasPublicComments();
262 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
271 $this->
object->setPublicComments($form->
getInput(
"comments"));
272 $this->
object->setProfilePicture($form->
getInput(
"ppic"));
282 ?
int $a_page_id = null,
283 ?
int $a_portfolio_id = null
300 $this->
ctrl->redirect($this,
"infoScreen");
303 $this->tabs_gui->activateTab(
"pages");
308 $this->
lng->txt(
"prtf_add_page"),
309 $this->
ctrl->getLinkTarget($this,
"addPage")
315 if ($this->
getType() ===
"prtf" && count($pages) > 0) {
316 $ilToolbar->addSeparator();
320 if ($this->
object->isCommentsExportPossible()) {
321 $this->
lng->loadLanguageModule(
"note");
322 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
323 $comment_modal = $comment_export_helper->getCommentIncludeModalDialog(
324 $this->
lng->txt(
"export_html"),
325 $this->
lng->txt(
"note_html_export_include_comments"),
326 $this->
ctrl->getLinkTarget($this,
"export"),
327 $this->
ctrl->getLinkTarget($this,
"exportWithComments")
329 $button = $ui->factory()->button()->standard($this->
lng->txt(
"export_html"),
'')
330 ->withOnClick($comment_modal->getShowSignal());
331 $ilToolbar->addComponent($button);
332 $modal_html = $ui->renderer()->render($comment_modal);
335 $this->
lng->txt(
"export_html"),
336 $this->
ctrl->getLinkTarget($this,
"export")
340 $print_view = $this->getPrintView();
341 $modal_elements = $print_view->getModalElements($this->
ctrl->getLinkTarget(
345 $modal_html .= $ui->renderer()->render($modal_elements->modal);
346 $ilToolbar->addComponent($modal_elements->button);
352 $this->tpl->setContent($table->getHTML() . $modal_html);
357 $obj_ids = $this->port_request->getObjIds();
358 $signature = $this->port_request->getSignature();
359 $declaration = $this->port_request->getIncludeDeclaration();
360 if (count($obj_ids) === 0) {
377 return new \ILIAS\Export\PrintProcessGUI(
392 $this->tabs_gui->clearTargets();
393 $this->tabs_gui->setBackTarget(
394 $this->
lng->txt(
"back"),
395 $this->
ctrl->getLinkTarget($this,
"view")
399 $ilHelp->setScreenId(
"add_page");
403 $this->tpl->setContent($form->getHTML());
412 $form->setFormAction($this->
ctrl->getFormAction($this));
416 $ti->setMaxLength(200);
417 $ti->setRequired(
true);
421 if ($a_mode ===
"create") {
426 $form->addItem($use_template);
429 $use_template->addOption($opt);
431 foreach ($templates as $templ) {
432 $templ->readObject();
434 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
435 $use_template->addOption($opt);
439 $form->
setTitle($this->
lng->txt(
"prtf_add_page") .
": " .
440 $this->
object->getTitle());
441 $form->addCommandButton(
"savePage", $this->
lng->txt(
"save"));
442 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
457 $page->setTitle($form->getInput(
"title"));
460 $layout_id = $form->getInput(
"tmpl");
463 $page->setXMLContent($layout_obj->copyXmlContent(
false));
468 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_page_created"),
true);
469 $this->
ctrl->redirect($this,
"view");
472 $this->tabs_gui->clearTargets();
473 $this->tabs_gui->setBackTarget(
474 $this->
lng->txt(
"back"),
475 $this->
ctrl->getLinkTarget($this,
"view")
478 $form->setValuesByPost();
479 $this->tpl->setContent($form->getHTML());
491 $title_changes = array();
493 $order = $this->port_request->getOrder();
494 $titles = $this->port_request->getTitles();
495 if (count($order) > 0) {
496 foreach ($order as $k => $v) {
498 if ($titles[$k] ??
"") {
499 $new_title = $titles[$k] ??
"";
500 if ($page->getTitle() != $new_title) {
501 $title_changes[$page->getId()] = array(
"old" => $page->getTitle(),
"new" => $new_title);
502 $page->setTitle($new_title);
511 $this->
object->fixLinksOnTitleChange($title_changes);
513 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
514 $this->
ctrl->redirect($this,
"view");
519 $prtf_pages = $this->port_request->getPortfolioPageIds();
521 if (count($prtf_pages) === 0) {
522 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
523 $this->
ctrl->redirect($this,
"view");
525 $this->tabs_gui->activateTab(
"pages");
528 $cgui->setFormAction($this->
ctrl->getFormAction($this));
529 $cgui->setHeaderText($this->
lng->txt(
"prtf_sure_delete_portfolio_pages"));
530 $cgui->setCancel($this->
lng->txt(
"cancel"),
"view");
531 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deletePortfolioPages");
533 foreach ($prtf_pages as
$id) {
535 if ($page->getPortfolioId() !== $this->
object->getId()) {
539 $title = $page->getTitle();
540 $cgui->addItem(
"prtf_pages[]", $id, $title);
543 $this->tpl->setContent($cgui->getHTML());
553 $page_ids = $this->port_request->getPortfolioPageIds();
554 foreach ($page_ids as
$id) {
558 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_portfolio_page_deleted"),
true);
559 $this->
ctrl->redirect($this,
"view");
566 bool $a_return =
false,
568 bool $a_show_notes =
true 572 $portfolio_id = $this->
object->
getId();
573 $user_id = $this->
object->getOwner();
577 $this->tabs_gui->clearTargets();
585 $this->tpl->setLoginTargetPar(
"prtf_" . $this->
object->getId() .
"_" . $current_page);
591 if ($this->requested_back_url !=
"") {
593 } elseif (strtolower($this->port_request->getBaseClass()) !==
"ilpublicuserprofilegui" &&
597 if ($this->
getType() ===
"prtf") {
598 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id", $this->
object->getOwner());
599 $back = $this->
ctrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilportfoliorepositorygui"),
"showOther");
600 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id",
"");
612 $back = $this->
ctrl->getLinkTarget($this,
"view");
613 if ($this->
getType() ===
"prtf") {
614 $back_caption = $this->
lng->txt(
"prtf_back_to_portfolio_owner");
617 $this->
lng->loadLanguageModule(
"prtt");
618 $back_caption = $this->
lng->txt(
"prtt_edit");
624 if (count($pages) > 1) {
625 foreach ($pages as $p) {
626 $this->
ctrl->setParameter($this,
"user_page", $p[
"id"]);
627 $this->tabs_gui->addTab(
628 "user_page_" . $p[
"id"],
630 $this->
ctrl->getLinkTarget($this,
"preview")
634 $this->tabs_gui->activateTab(
"user_page_" . $current_page);
637 $this->
ctrl->setParameter($this,
"user_page", $current_page);
644 if ($a_show_notes && $this->
object->hasPublicComments() && $current_page) {
646 $next_class = $this->
ctrl->getNextClass($this);
647 if ($next_class ===
"ilcommentgui") {
648 $notes = $this->
ctrl->forwardCommand($comment_gui);
650 $notes = $comment_gui->getListHTML();
659 $page_gui->setEmbedded(
true);
661 $content = $this->
ctrl->getHTML($page_gui);
664 $content = $a_content;
672 if (count($this->perma_link) === 0) {
673 if ($this->
getType() ===
"prtf") {
674 $this->tpl->setPermanentLink($this->
getType(), $this->
object->getId(),
"_" . $current_page);
676 $this->tpl->setPermanentLink($this->
getType(), $this->
object->getRefId());
679 $this->tpl->setPermanentLink($this->perma_link[
"type"] ??
"", $this->perma_link[
"obj_id"] ?? 0);
684 $user_id = $ilUser->getId();
689 self::renderFullscreenHeader($obj, $this->tpl, $user_id);
692 $this->
ctrl->setParameter($this,
"user_page",
"");
694 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
697 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
698 '<div class="ilc_page_Page">' .
707 $this->tpl->setContent($content .
708 '<div class="ilClearFloat">' . $notes .
'</div>');
715 $current_page = (
int) $this->requested_user_page;
718 if ($pages && $current_page) {
720 foreach ($pages as $page) {
721 if ((
int) $page[
"id"] === $current_page) {
727 $current_page = null;
732 if (!$current_page && $pages) {
733 $current_page = $pages;
734 $current_page = array_shift($current_page);
735 $current_page = (
int) $current_page[
"id"];
737 return $current_page;
742 $gui = $this->notes->gui()->getCommentsGUI(
748 $gui->enablePublicNotesDeletion(($this->user_id === $this->
object->getOwner()) &&
749 $this->
settings->get(
"comments_del_tutor",
'1'));
756 $page_class = ($this->
getType() ===
"prtt")
757 ?
"ilPortfolioTemplatePageGUI" 758 :
"ilportfoliopagegui";
762 if ($this->
getType() ===
"prtt") {
763 $button = $this->
ui->factory()->button()->standard(
764 $this->
lng->txt(
"prtt_edit"),
765 $this->
ctrl->getLinkTargetByClass([
"ilobjportfoliotemplategui"],
"view")
768 $button = $this->
ui->factory()->button()->standard(
769 $this->
lng->txt(
"prtf_edit_portfolio"),
770 $this->
ctrl->getLinkTargetByClass([
"ilobjportfoliogui"],
"view")
773 $this->
toolbar->addComponent($button);
777 $this->
ctrl->setParameterByClass($page_class,
"ppage", $page_id);
778 $button = $this->
ui->factory()->button()->standard(
779 $this->
lng->txt(
"edit_page"),
780 $this->
ctrl->getLinkTargetByClass($page_class,
"edit")
783 $this->
toolbar->addComponent($button);
788 $this->tpl->setHeaderActionMenu($this->
ui->renderer()->render($button));
796 bool $a_export =
false 800 $ilUser = $DIC->user();
805 ($a_portfolio->
getType() ===
"prtt")
807 : $a_portfolio->
getId(),
808 $a_portfolio->
getId(),
814 $name = $name[
"lastname"] .
", " . (($t = $name[
"title"]) ? $t .
" " :
"") . $name[
"firstname"];
823 $ppic = basename($ppic);
843 bool $a_with_comments =
false 845 $port_export = new \ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
846 $port_export->includeComments($a_with_comments);
847 $port_export->exportHtml();
848 $port_export->deliver($this->
object->getTitle() .
".zip",
true);
862 $prtf_pages = $this->port_request->getPortfolioPageIds();
864 if (count($prtf_pages) === 0) {
865 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
866 $this->
ctrl->redirect($this,
"view");
868 $this->tabs_gui->activateTab(
"pages");
874 foreach ($prtf_pages as $page_id) {
876 $item->setValue($page_id);
877 $a_form->addItem($item);
880 $this->tpl->setContent($a_form->getHTML());
887 if ($form->checkInput()) {
889 if ($form->getInput(
"target") ===
"old") {
890 $portfolio_id = $form->getInput(
"prtf");
895 $portfolio->setTitle($form->getInput(
"title"));
896 $portfolio->create();
897 $portfolio_id = $portfolio->getId();
901 $page_ids = $this->port_request->getPortfolioPageIds();
902 foreach ($page_ids as $page_id) {
905 $target->setXMLContent($source->copyXmlContent(
true));
906 $target->setType($source->getType());
907 $target->setTitle($source->getTitle());
911 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_pages_copied"),
true);
912 $this->
ctrl->redirect($this,
"view");
915 $form->setValuesByPost();
924 $form->setFormAction($this->
ctrl->getFormAction($this));
925 $form->setTitle($this->
lng->txt(
"prtf_copy_page"));
929 $form->addCommandButton(
"copyPage", $this->
lng->txt(
"save"));
930 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
951 $this->content_style_gui->
addCss(
953 $this->
object->getRefId(),
954 $this->
object->getId()
updateCustom(ilPropertyFormGUI $form)
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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?)
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
savePage()
Create new portfolio page.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
static lookupType($a_page_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
export(bool $a_with_comments=false)
handlePageCall(string $a_cmd)
copyPageForm(ilPropertyFormGUI $a_form=null)
Select target portfolio for page(s) copy.
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.
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...
getParentId(int $a_node_id)
get parent id of given node
setAdditional(array $a_additional)
Set Additonal Information (used in public profile?)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ILIAS HTTP Services $http
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)
setSettingsSubTabs(string $a_active)
StandardGUIRequest $port_request
__construct(Container $dic, ilPlugin $plugin)
setDescription(string $a_descr)
Sets description below title in standard template.
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...
setContentStyleSheet(ilGlobalTemplateInterface $a_tpl=null)
initPageForm(string $a_mode="create")
Init portfolio page form.
setTitle(string $a_title)
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.