30 protected \ILIAS\Notes\Service
$notes;
31 protected \ILIAS\Portfolio\InternalGUIService
$gui;
42 protected \ILIAS\DI\UIServices
$ui;
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()
70 $this->user_id = $ilUser->getId();
72 $this->
lng->loadLanguageModule(
"prtf");
73 $this->
lng->loadLanguageModule(
"user");
74 $this->
lng->loadLanguageModule(
"obj");
76 $this->requested_ppage = $this->port_request->getPortfolioPageId();
77 $this->requested_user_page = $this->port_request->getUserPage();
80 $back = str_replace(
"&",
":::", $this->port_request->getBackUrl());
82 "/[^a-zA-Z0-9_\.\?=:\s]/",
86 $this->requested_back_url = str_replace(
":::",
"&", $back);
88 $this->
ctrl->setParameterByClass(
"ilobjportfoliogui",
"back_url", rawurlencode($this->requested_back_url));
89 $cs =
$DIC->contentStyle();
90 $this->content_style_gui = $cs->gui();
92 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
94 $this->gui =
$DIC->portfolio()->internal()->gui();
95 $this->notes =
$DIC->notes();
104 strip_tags($this->
object->getTitle()),
105 $this->ctrl->getLinkTarget($this,
"view")
109 if ($this->page_id > 0) {
111 $title = $page->getTitle();
115 $this->
ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit")
123 if ($this->requested_ppage > 0) {
125 $this->
ctrl->redirect($this,
"view");
129 $this->page_mode =
"edit";
130 $this->
ctrl->setParameter($this,
"ppage", $this->page_id);
136 $this->page_mode =
"preview";
137 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
143 if (!$this->page_id) {
144 $this->
ctrl->redirect($this,
"view");
149 $this->tabs_gui->clearTargets();
150 $this->tabs_gui->setBackTarget(
151 $this->
lng->txt(
"back"),
152 $this->ctrl->getLinkTarget($this,
"view")
156 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
158 $ret = $this->
ctrl->forwardCommand($page_gui);
159 if ($ret !=
"" && $ret !==
true) {
161 if ($this->page_mode ===
"preview") {
165 $this->
preview(
false, $ret, ($a_cmd !==
"previewEmbedded"));
173 if (is_string($ret)) {
174 $this->tpl->setContent($ret);
185 $this->additional = $a_additional;
200 $this->perma_link = array(
"obj_id" => $a_obj_id,
"type" => $a_type);
211 $this->
lng->loadLanguageModule($this->getType());
214 $this->tabs_gui->addSubTab(
216 $this->
lng->txt($this->getType() .
"_properties"),
217 $this->ctrl->getLinkTarget($this,
'edit')
220 $this->tabs_gui->addSubTab(
222 $this->
lng->txt(
"obj_sty"),
223 $this->ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
226 $this->tabs_gui->activateSubTab($a_active);
231 $this->setSettingsSubTabs(
"properties");
241 $section->setTitle($this->
lng->txt(
'obj_features'));
259 $a_values[
"comments"] = $this->
object->hasPublicComments();
260 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
269 $this->
object->setPublicComments($form->
getInput(
"comments"));
270 $this->
object->setProfilePicture($form->
getInput(
"ppic"));
280 ?
int $a_page_id =
null,
281 ?
int $a_portfolio_id =
null
293 $ilToolbar = $this->toolbar;
297 if (!$this->checkPermissionBool(
"write")) {
298 $this->
ctrl->redirect($this,
"infoScreen");
301 $this->tabs_gui->activateTab(
"pages");
306 $this->
lng->txt(
"prtf_add_page"),
307 $this->ctrl->getLinkTarget($this,
"addPage")
313 if ($this->getType() ===
"prtf" && count($pages) > 0) {
314 $ilToolbar->addSeparator();
318 if ($this->
object->isCommentsExportPossible()) {
319 $this->
lng->loadLanguageModule(
"note");
320 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
321 $comment_modal = $comment_export_helper->getCommentIncludeModalDialog(
322 $this->
lng->txt(
"export_html"),
323 $this->lng->txt(
"note_html_export_include_comments"),
324 $this->ctrl->getLinkTarget($this,
"export"),
325 $this->ctrl->getLinkTarget($this,
"exportWithComments")
327 $button = $ui->factory()->button()->standard($this->
lng->txt(
"export_html"),
'')
328 ->withOnClick($comment_modal->getShowSignal());
329 $ilToolbar->addComponent($button);
330 $modal_html = $ui->renderer()->render($comment_modal);
333 $this->
lng->txt(
"export_html"),
334 $this->ctrl->getLinkTarget($this,
"export")
338 $print_view = $this->getPrintView();
339 $modal_elements = $print_view->getModalElements($this->
ctrl->getLinkTarget(
343 $modal_html .= $ui->renderer()->render($modal_elements->modal);
344 $ilToolbar->addComponent($modal_elements->button);
350 $this->tpl->setContent($table->getHTML() . $modal_html);
353 public function getPrintView(): \
ILIAS\Export\PrintProcessGUI
355 $obj_ids = $this->port_request->getObjIds();
356 $signature = $this->port_request->getSignature();
357 $declaration = $this->port_request->getIncludeDeclaration();
358 if (count($obj_ids) === 0) {
362 $port = $this->object;
375 return new \ILIAS\Export\PrintProcessGUI(
388 $ilHelp = $this->help;
390 $this->tabs_gui->clearTargets();
391 $this->tabs_gui->setBackTarget(
392 $this->
lng->txt(
"back"),
393 $this->ctrl->getLinkTarget($this,
"view")
396 $ilHelp->setScreenIdComponent(
"prtf");
397 $ilHelp->setScreenId(
"add_page");
400 $form = $this->initPageForm(
"create");
401 $this->tpl->setContent($form->getHTML());
410 $form->setFormAction($this->
ctrl->getFormAction($this));
414 $ti->setMaxLength(200);
415 $ti->setRequired(
true);
419 if ($a_mode ===
"create") {
423 $use_template->setRequired(
true);
424 $form->addItem($use_template);
427 $use_template->addOption($opt);
429 foreach ($templates as $templ) {
430 $templ->readObject();
432 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
433 $use_template->addOption($opt);
437 $form->setTitle($this->
lng->txt(
"prtf_add_page") .
": " .
438 $this->object->getTitle());
439 $form->addCommandButton(
"savePage", $this->
lng->txt(
"save"));
440 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
451 $form = $this->initPageForm(
"create");
452 if ($form->checkInput() && $this->checkPermissionBool(
"write")) {
453 $page = $this->getPageInstance();
455 $page->setTitle($form->getInput(
"title"));
458 $layout_id = $form->getInput(
"tmpl");
461 $page->setXMLContent($layout_obj->copyXmlContent(
false));
466 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_page_created"),
true);
467 $this->
ctrl->redirect($this,
"view");
470 $this->tabs_gui->clearTargets();
471 $this->tabs_gui->setBackTarget(
472 $this->
lng->txt(
"back"),
473 $this->ctrl->getLinkTarget($this,
"view")
476 $form->setValuesByPost();
477 $this->tpl->setContent($form->getHTML());
485 if (!$this->checkPermissionBool(
"write")) {
489 $title_changes = array();
491 $order = $this->port_request->getOrder();
492 $titles = $this->port_request->getTitles();
493 if (count($order) > 0) {
494 foreach ($order as $k => $v) {
496 if ($titles[$k] ??
"") {
497 $new_title = $titles[$k] ??
"";
498 if ($page->getTitle() != $new_title) {
499 $title_changes[$page->getId()] = array(
"old" => $page->getTitle(),
"new" => $new_title);
500 $page->setTitle($new_title);
509 $this->
object->fixLinksOnTitleChange($title_changes);
511 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
512 $this->
ctrl->redirect($this,
"view");
517 $prtf_pages = $this->port_request->getPortfolioPageIds();
519 if (count($prtf_pages) === 0) {
520 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
521 $this->
ctrl->redirect($this,
"view");
523 $this->tabs_gui->activateTab(
"pages");
526 $cgui->setFormAction($this->
ctrl->getFormAction($this));
527 $cgui->setHeaderText($this->
lng->txt(
"prtf_sure_delete_portfolio_pages"));
528 $cgui->setCancel($this->
lng->txt(
"cancel"),
"view");
529 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deletePortfolioPages");
531 foreach ($prtf_pages as
$id) {
532 $page = $this->getPageInstance(
$id);
533 if ($page->getPortfolioId() !== $this->object->getId()) {
537 $title = $page->getTitle();
538 $cgui->addItem(
"prtf_pages[]",
$id, $title);
541 $this->tpl->setContent($cgui->getHTML());
547 if (!$this->checkPermissionBool(
"write")) {
551 $page_ids = $this->port_request->getPortfolioPageIds();
552 foreach ($page_ids as
$id) {
553 $page = $this->getPageInstance(
$id);
556 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_portfolio_page_deleted"),
true);
557 $this->
ctrl->redirect($this,
"view");
564 bool $a_return =
false,
566 bool $a_show_notes =
true
569 $ilUser = $this->user;
570 $portfolio_id = $this->
object->getId();
571 $user_id = $this->
object->getOwner();
575 $this->tabs_gui->clearTargets();
578 $current_page = $this->getCurrentPage();
582 $this->getType() ===
"prtf") {
583 $this->tpl->setLoginTargetPar(
"prtf_" . $this->
object->getId() .
"_" . $current_page);
589 if ($this->requested_back_url !=
"") {
590 $back = $this->requested_back_url;
591 } elseif (strtolower($this->port_request->getBaseClass()) !== strtolower(PublicProfileGUI::class) &&
593 if (!$this->checkPermissionBool(
"write")) {
595 if ($this->getType() ===
"prtf") {
596 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id", $this->
object->getOwner());
597 $back = $this->
ctrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilportfoliorepositorygui"),
"showOther");
598 $this->
ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id",
"");
604 $parent_id = $tree->getParentId($this->node_id);
610 $back = $this->
ctrl->getLinkTarget($this,
"view");
611 if ($this->getType() ===
"prtf") {
612 $back_caption = $this->
lng->txt(
"prtf_back_to_portfolio_owner");
615 $this->
lng->loadLanguageModule(
"prtt");
616 $back_caption = $this->
lng->txt(
"prtt_edit");
622 if (count($pages) > 1) {
623 foreach ($pages as $p) {
624 $this->
ctrl->setParameter($this,
"user_page", $p[
"id"]);
625 $this->tabs_gui->addTab(
626 "user_page_" . $p[
"id"],
628 $this->
ctrl->getLinkTarget($this,
"preview")
632 $this->tabs_gui->activateTab(
"user_page_" . $current_page);
635 $this->
ctrl->setParameter($this,
"user_page", $current_page);
642 if ($a_show_notes && $this->
object->hasPublicComments() && $current_page) {
643 $comment_gui = $this->getCommentGUI();
644 $next_class = $this->
ctrl->getNextClass($this);
645 if ($next_class ===
"ilcommentgui") {
646 $notes = $this->
ctrl->forwardCommand($comment_gui);
648 $notes = $comment_gui->getListHTML();
656 $page_gui = $this->getPageGUIInstance($current_page);
657 $page_gui->setEmbedded(
true);
659 $content = $this->
ctrl->getHTML($page_gui);
662 $content = $a_content;
665 if ($a_return && $this->checkPermissionBool(
"write")) {
670 if (count($this->perma_link) === 0) {
671 if ($this->getType() ===
"prtf") {
672 $this->tpl->setPermanentLink($this->getType(), $this->
object->getId(),
"_" . $current_page);
674 $this->tpl->setPermanentLink($this->getType(), $this->
object->getRefId());
677 $this->tpl->setPermanentLink($this->perma_link[
"type"] ??
"", $this->perma_link[
"obj_id"] ?? 0);
681 if ($this->getType() ===
"prtt" && !$this->checkPermissionBool(
"write")) {
686 $obj = $this->object;
687 self::renderFullscreenHeader($obj, $this->tpl,
$user_id);
690 $this->
ctrl->setParameter($this,
"user_page",
"");
692 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
695 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
696 '<div class="ilc_page_Page">' .
700 $this->setContentStyleSheet($this->tpl);
702 $this->showEditButton($current_page);
705 $this->tpl->setContent($content .
706 '<div class="ilClearFloat">' . $notes .
'</div>');
713 $current_page = (
int) $this->requested_user_page;
716 if ($pages && $current_page) {
718 foreach ($pages as $page) {
719 if ((
int) $page[
"id"] === $current_page) {
725 $current_page =
null;
730 if (!$current_page && $pages) {
731 $current_page = $pages;
732 $current_page = array_shift($current_page);
733 $current_page = (
int) $current_page[
"id"];
735 return $current_page;
740 $gui = $this->notes->gui()->getCommentsGUI(
742 $this->getCurrentPage(),
746 $gui->enablePublicNotesDeletion(($this->user_id === $this->
object->getOwner()) &&
747 $this->settings->get(
"comments_del_tutor",
'1'));
754 $page_class = ($this->getType() ===
"prtt")
755 ?
"ilPortfolioTemplatePageGUI"
756 :
"ilportfoliopagegui";
758 if ($this->checkPermissionBool(
"write") &&
760 if ($this->getType() ===
"prtt") {
761 $button = $this->
ui->factory()->button()->standard(
762 $this->
lng->txt(
"prtt_edit"),
763 $this->ctrl->getLinkTargetByClass([
"ilobjportfoliotemplategui"],
"view")
766 $button = $this->
ui->factory()->button()->standard(
767 $this->
lng->txt(
"prtf_edit_portfolio"),
768 $this->ctrl->getLinkTargetByClass([
769 ilDashboardGUI::class,
770 ilPortfolioRepositoryGUI::class,
771 ilObjPortfolioGUI::class
775 $this->
toolbar->addComponent($button);
779 $this->
ctrl->setParameterByClass($page_class,
"ppage", $page_id);
780 $button = $this->
ui->factory()->button()->standard(
781 $this->
lng->txt(
"edit_page"),
782 $this->ctrl->getLinkTargetByClass($page_class,
"edit")
784 if ($this->checkPermissionBool(
"write")) {
785 $this->
toolbar->addComponent($button);
789 if ($button && $this->checkPermissionBool(
"write")) {
790 $this->tpl->setHeaderActionMenu($this->
ui->renderer()->render($button));
798 bool $a_export =
false
802 $ilUser =
$DIC->user();
807 ($a_portfolio->
getType() ===
"prtt")
809 : $a_portfolio->
getId(),
810 $a_portfolio->
getId(),
816 $name = $name[
"lastname"] .
", " . (($t = $name[
"title"]) ? $t .
" " :
"") . $name[
"firstname"];
825 $ppic = basename($ppic);
845 bool $a_with_comments =
false
847 $port_export = new \
ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
848 $port_export->includeComments($a_with_comments);
849 $port_export->exportHtml();
850 $port_export->deliver($this->
object->getTitle() .
".zip",
true);
864 $prtf_pages = $this->port_request->getPortfolioPageIds();
866 if (count($prtf_pages) === 0) {
867 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
868 $this->
ctrl->redirect($this,
"view");
870 $this->tabs_gui->activateTab(
"pages");
873 $a_form = $this->initCopyPageForm();
876 foreach ($prtf_pages as $page_id) {
878 $item->setValue($page_id);
879 $a_form->addItem($item);
882 $this->tpl->setContent($a_form->getHTML());
888 $form = $this->initCopyPageForm();
889 if ($form->checkInput()) {
891 if ($form->getInput(
"target") ===
"old") {
892 $portfolio_id = $form->getInput(
"prtf");
897 $portfolio->setTitle($form->getInput(
"title"));
898 $portfolio->create();
899 $portfolio_id = $portfolio->getId();
903 $page_ids = $this->port_request->getPortfolioPageIds();
904 foreach ($page_ids as $page_id) {
905 $source = $this->getPageInstance($page_id);
906 $target = $this->getPageInstance(
null, $portfolio_id);
907 $target->setXMLContent($source->copyXmlContent(
true));
908 $target->setType($source->getType());
909 $target->setTitle($source->getTitle());
913 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_pages_copied"),
true);
914 $this->
ctrl->redirect($this,
"view");
917 $form->setValuesByPost();
918 $this->copyPageForm($form);
926 $form->setFormAction($this->
ctrl->getFormAction($this));
927 $form->setTitle($this->
lng->txt(
"prtf_copy_page"));
929 $this->initCopyPageFormOptions($form);
931 $form->addCommandButton(
"copyPage", $this->
lng->txt(
"save"));
932 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
953 $this->content_style_gui->
addCss(
955 $this->
object->getRefId(),
956 $this->object->getId()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
GUI class for public user profile presentation.
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
setRepositoryMode(bool $a_value)
Portfolio view gui base class.
ILIAS Style Content GUIService $content_style_gui
ILIAS Style Content Object ObjectFacade $content_style_domain
setSettingsSubTabs(string $a_active)
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
addPage()
Show portfolio page creation form.
setPermaLink(int $a_obj_id, string $a_type)
Set custom perma link (used in public profile?)
view()
Show list of portfolio pages.
savePage()
Create new portfolio page.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
string $requested_back_url
showEditButton(int $page_id)
confirmPortfolioPageDeletion()
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
getPageInstance(?int $a_page_id=null, ?int $a_portfolio_id=null)
setAdditional(array $a_additional)
Set Additonal Information (used in public profile?)
ILIAS Portfolio InternalGUIService $gui
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
handlePageCall(string $a_cmd)
getPageGUIInstance(int $a_page_id)
ILIAS Notes Service $notes
static renderFullscreenHeader(ilObjPortfolioBase $a_portfolio, ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
StandardGUIRequest $port_request
savePortfolioPagesOrdering()
Save ordering of portfolio pages.
initPageForm(string $a_mode="create")
Init portfolio page form.
export(bool $a_with_comments=false)
copyPageForm(?ilPropertyFormGUI $a_form=null)
Select target portfolio for page(s) copy.
addLocatorItems()
Functions to be overwritten.
setContentStyleSheet(?ilGlobalTemplateInterface $a_tpl=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupName(int $a_user_id)
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
New implementation of ilObjectGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static activeLayouts(int $a_module=0)
Get active layouts.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Portfolio page gui class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupType($a_page_id)
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
static fixOrdering(int $a_portfolio_id)
This class represents an option in a radio group.
This class represents a text property in a property form.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
setDescription(string $a_descr)
Sets description below title in standard template.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
resetHeaderBlock(bool $a_reset_header_action=true)
Reset all header properties: title, icon, description, alerts, action menu.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.