30 protected \ILIAS\Notes\Service
$notes;
31 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();
78 $cs =
$DIC->contentStyle();
79 $this->content_style_gui = $cs->gui();
81 $this->content_style_domain = $cs->domain()->styleForObjId($this->
object->getId());
83 $this->gui =
$DIC->portfolio()->internal()->gui();
84 $this->notes =
$DIC->notes();
93 strip_tags($this->
object->getTitle()),
94 $this->ctrl->getLinkTarget($this,
"view")
98 if ($this->page_id > 0) {
100 $title = $page->getTitle();
104 $this->
ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit")
112 if ($this->requested_ppage > 0) {
114 $this->
ctrl->redirect($this,
"view");
118 $this->page_mode =
"edit";
119 $this->
ctrl->setParameter($this,
"ppage", $this->page_id);
125 $this->page_mode =
"preview";
126 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
132 if (!$this->page_id) {
133 $this->
ctrl->redirect($this,
"view");
138 $this->tabs_gui->clearTargets();
139 $this->tabs_gui->setBackTarget(
140 $this->
lng->txt(
"back"),
141 $this->ctrl->getLinkTarget($this,
"view")
145 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
147 $ret = $this->
ctrl->forwardCommand($page_gui);
148 if ($ret !=
"" && $ret !==
true) {
150 if ($this->page_mode ===
"preview") {
154 $this->
preview(
false, $ret, ($a_cmd !==
"previewEmbedded"));
162 if (is_string($ret)) {
163 $this->tpl->setContent($ret);
174 $this->additional = $a_additional;
189 $this->perma_link = array(
"obj_id" => $a_obj_id,
"type" => $a_type);
200 $this->
lng->loadLanguageModule($this->getType());
203 $this->tabs_gui->addSubTab(
205 $this->
lng->txt($this->getType() .
"_properties"),
206 $this->ctrl->getLinkTarget($this,
'edit')
209 $this->tabs_gui->addSubTab(
211 $this->
lng->txt(
"obj_sty"),
212 $this->ctrl->getLinkTargetByClass(
"ilobjectcontentstylesettingsgui",
"")
215 $this->tabs_gui->activateSubTab($a_active);
220 $this->setSettingsSubTabs(
"properties");
230 $section->setTitle($this->
lng->txt(
'obj_features'));
248 $a_values[
"comments"] = $this->
object->hasPublicComments();
249 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
258 $this->
object->setPublicComments($form->
getInput(
"comments"));
259 $this->
object->setProfilePicture($form->
getInput(
"ppic"));
269 ?
int $a_page_id =
null,
270 ?
int $a_portfolio_id =
null
282 $ilToolbar = $this->toolbar;
286 if (!$this->checkPermissionBool(
"write")) {
287 $this->
ctrl->redirect($this,
"infoScreen");
290 $this->tabs_gui->activateTab(
"pages");
295 $this->
lng->txt(
"prtf_add_page"),
296 $this->ctrl->getLinkTarget($this,
"addPage")
302 if ($this->getType() ===
"prtf" && count($pages) > 0) {
303 $ilToolbar->addSeparator();
307 if ($this->
object->isCommentsExportPossible()) {
308 $this->
lng->loadLanguageModule(
"note");
309 $comment_export_helper = new \ILIAS\Notes\Export\ExportHelperGUI();
310 $comment_modal = $comment_export_helper->getCommentIncludeModalDialog(
311 $this->
lng->txt(
"export_html"),
312 $this->lng->txt(
"note_html_export_include_comments"),
313 $this->ctrl->getLinkTarget($this,
"export"),
314 $this->ctrl->getLinkTarget($this,
"exportWithComments")
316 $button = $ui->factory()->button()->standard($this->
lng->txt(
"export_html"),
'')
317 ->withOnClick($comment_modal->getShowSignal());
318 $ilToolbar->addComponent($button);
319 $modal_html = $ui->renderer()->render($comment_modal);
322 $this->
lng->txt(
"export_html"),
323 $this->ctrl->getLinkTarget($this,
"export")
327 $print_view = $this->getPrintView();
328 $modal_elements = $print_view->getModalElements($this->
ctrl->getLinkTarget(
332 $modal_html .= $ui->renderer()->render($modal_elements->modal);
333 $ilToolbar->addComponent($modal_elements->button);
339 $this->tpl->setContent($table->getHTML() . $modal_html);
342 public function getPrintView(): \
ILIAS\Export\PrintProcessGUI
344 $obj_ids = $this->port_request->getObjIds();
345 $signature = $this->port_request->getSignature();
346 $declaration = $this->port_request->getIncludeDeclaration();
347 if (count($obj_ids) === 0) {
351 $port = $this->object;
364 return new \ILIAS\Export\PrintProcessGUI(
377 $ilHelp = $this->help;
379 $this->tabs_gui->clearTargets();
380 $this->tabs_gui->setBackTarget(
381 $this->
lng->txt(
"back"),
382 $this->ctrl->getLinkTarget($this,
"view")
385 $ilHelp->setScreenIdComponent(
"prtf");
386 $ilHelp->setScreenId(
"add_page");
389 $form = $this->initPageForm(
"create");
390 $this->tpl->setContent($form->getHTML());
399 $form->setFormAction($this->
ctrl->getFormAction($this));
403 $ti->setMaxLength(200);
404 $ti->setRequired(
true);
408 if ($a_mode ===
"create") {
412 $use_template->setRequired(
true);
413 $form->addItem($use_template);
416 $use_template->addOption($opt);
418 foreach ($templates as $templ) {
419 $templ->readObject();
421 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
422 $use_template->addOption($opt);
426 $form->setTitle($this->
lng->txt(
"prtf_add_page") .
": " .
427 $this->object->getTitle());
428 $form->addCommandButton(
"savePage", $this->
lng->txt(
"save"));
429 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
440 $form = $this->initPageForm(
"create");
441 if ($form->checkInput() && $this->checkPermissionBool(
"write")) {
442 $page = $this->getPageInstance();
444 $page->setTitle($form->getInput(
"title"));
447 $layout_id = $form->getInput(
"tmpl");
450 $page->setXMLContent($layout_obj->copyXmlContent(
false));
455 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_page_created"),
true);
456 $this->
ctrl->redirect($this,
"view");
459 $this->tabs_gui->clearTargets();
460 $this->tabs_gui->setBackTarget(
461 $this->
lng->txt(
"back"),
462 $this->ctrl->getLinkTarget($this,
"view")
465 $form->setValuesByPost();
466 $this->tpl->setContent($form->getHTML());
474 if (!$this->checkPermissionBool(
"write")) {
478 $title_changes = array();
480 $order = $this->port_request->getOrder();
481 $titles = $this->port_request->getTitles();
482 if (count($order) > 0) {
483 foreach ($order as $k => $v) {
485 if ($titles[$k] ??
"") {
486 $new_title = $titles[$k] ??
"";
487 if ($page->getTitle() != $new_title) {
488 $title_changes[$page->getId()] = array(
"old" => $page->getTitle(),
"new" => $new_title);
489 $page->setTitle($new_title);
498 $this->
object->fixLinksOnTitleChange($title_changes);
500 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
501 $this->
ctrl->redirect($this,
"view");
506 $prtf_pages = $this->port_request->getPortfolioPageIds();
508 if (count($prtf_pages) === 0) {
509 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
510 $this->
ctrl->redirect($this,
"view");
512 $this->tabs_gui->activateTab(
"pages");
515 $cgui->setFormAction($this->
ctrl->getFormAction($this));
516 $cgui->setHeaderText($this->
lng->txt(
"prtf_sure_delete_portfolio_pages"));
517 $cgui->setCancel($this->
lng->txt(
"cancel"),
"view");
518 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deletePortfolioPages");
520 foreach ($prtf_pages as
$id) {
521 $page = $this->getPageInstance(
$id);
522 if ($page->getPortfolioId() !== $this->object->getId()) {
526 $title = $page->getTitle();
527 $cgui->addItem(
"prtf_pages[]",
$id, $title);
530 $this->tpl->setContent($cgui->getHTML());
536 if (!$this->checkPermissionBool(
"write")) {
540 $page_ids = $this->port_request->getPortfolioPageIds();
541 foreach ($page_ids as
$id) {
542 $page = $this->getPageInstance(
$id);
545 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_portfolio_page_deleted"),
true);
546 $this->
ctrl->redirect($this,
"view");
553 bool $a_return =
false,
555 bool $a_show_notes =
true
558 $ilUser = $this->user;
559 $portfolio_id = $this->
object->getId();
560 $user_id = $this->
object->getOwner();
564 $this->tabs_gui->clearTargets();
567 $current_page = $this->getCurrentPage();
571 $this->getType() ===
"prtf") {
572 $this->tpl->setLoginTargetPar(
"prtf_" . $this->
object->getId() .
"_" . $current_page);
576 if (count($pages) > 1) {
577 foreach ($pages as $p) {
578 $this->
ctrl->setParameter($this,
"user_page", $p[
"id"]);
579 $this->tabs_gui->addTab(
580 "user_page_" . $p[
"id"],
582 $this->
ctrl->getLinkTarget($this,
"preview")
586 $this->tabs_gui->activateTab(
"user_page_" . $current_page);
589 $this->
ctrl->setParameter($this,
"user_page", $current_page);
596 if ($a_show_notes && $this->
object->hasPublicComments() && $current_page) {
597 $comment_gui = $this->getCommentGUI();
598 $next_class = $this->
ctrl->getNextClass($this);
599 if ($next_class ===
"ilcommentgui") {
600 $notes = $this->
ctrl->forwardCommand($comment_gui);
602 $notes = $comment_gui->getListHTML();
610 $page_gui = $this->getPageGUIInstance($current_page);
611 $page_gui->setEmbedded(
true);
613 $content = $this->
ctrl->getHTML($page_gui);
616 $content = $a_content;
619 if ($a_return && $this->checkPermissionBool(
"write")) {
624 if (count($this->perma_link) === 0) {
625 if ($this->getType() ===
"prtf") {
626 $this->tpl->setPermanentLink($this->getType(), $this->
object->getId(),
"_" . $current_page);
628 $this->tpl->setPermanentLink($this->getType(), $this->
object->getRefId());
631 $this->tpl->setPermanentLink($this->perma_link[
"type"] ??
"", $this->perma_link[
"obj_id"] ?? 0);
635 if ($this->getType() ===
"prtt" && !$this->checkPermissionBool(
"write")) {
640 $obj = $this->object;
641 self::renderFullscreenHeader($obj, $this->tpl,
$user_id);
644 $this->
ctrl->setParameter($this,
"user_page",
"");
646 $this->
ctrl->setParameter($this,
"user_page", $this->page_id);
649 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
650 '<div class="ilc_page_Page">' .
654 $this->setContentStyleSheet($this->tpl);
656 $this->showEditButton($current_page);
659 $this->tpl->setContent($content .
660 '<div class="ilClearFloat">' . $notes .
'</div>');
667 $current_page = (
int) $this->requested_user_page;
670 if ($pages && $current_page) {
672 foreach ($pages as $page) {
673 if ((
int) $page[
"id"] === $current_page) {
679 $current_page =
null;
684 if (!$current_page && $pages) {
685 $current_page = $pages;
686 $current_page = array_shift($current_page);
687 $current_page = (
int) $current_page[
"id"];
689 return $current_page;
694 $gui = $this->notes->gui()->getCommentsGUI(
696 $this->getCurrentPage(),
700 $gui->enablePublicNotesDeletion(($this->user_id === $this->
object->getOwner()) &&
701 $this->settings->get(
"comments_del_tutor",
'1'));
708 $page_class = ($this->getType() ===
"prtt")
709 ?
"ilPortfolioTemplatePageGUI"
710 :
"ilportfoliopagegui";
712 if ($this->checkPermissionBool(
"write") &&
714 if ($this->getType() ===
"prtt") {
715 $button = $this->
ui->factory()->button()->standard(
716 $this->
lng->txt(
"prtt_edit"),
717 $this->ctrl->getLinkTargetByClass([
"ilobjportfoliotemplategui"],
"view")
720 $button = $this->
ui->factory()->button()->standard(
721 $this->
lng->txt(
"prtf_edit_portfolio"),
722 $this->ctrl->getLinkTargetByClass([
723 ilDashboardGUI::class,
724 ilPortfolioRepositoryGUI::class,
725 ilObjPortfolioGUI::class
729 $this->
toolbar->addComponent($button);
733 $this->
ctrl->setParameterByClass($page_class,
"ppage", $page_id);
734 $button = $this->
ui->factory()->button()->standard(
735 $this->
lng->txt(
"edit_page"),
736 $this->ctrl->getLinkTargetByClass($page_class,
"edit")
738 if ($this->checkPermissionBool(
"write")) {
739 $this->
toolbar->addComponent($button);
743 if ($button && $this->checkPermissionBool(
"write")) {
744 $this->tpl->setHeaderActionMenu($this->
ui->renderer()->render($button));
752 bool $a_export =
false
756 $ilUser =
$DIC->user();
761 ($a_portfolio->
getType() ===
"prtt")
763 : $a_portfolio->
getId(),
764 $a_portfolio->
getId(),
770 $name = $name[
"lastname"] .
", " . (($t = $name[
"title"]) ? $t .
" " :
"") . $name[
"firstname"];
779 $ppic = basename($ppic);
799 bool $a_with_comments =
false
801 $port_export = new \
ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
802 $port_export->includeComments($a_with_comments);
803 $port_export->exportHtml();
804 $port_export->deliver($this->
object->getTitle() .
".zip",
true);
818 $prtf_pages = $this->port_request->getPortfolioPageIds();
820 if (count($prtf_pages) === 0) {
821 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
822 $this->
ctrl->redirect($this,
"view");
824 $this->tabs_gui->activateTab(
"pages");
827 $a_form = $this->initCopyPageForm();
830 foreach ($prtf_pages as $page_id) {
832 $item->setValue($page_id);
833 $a_form->addItem($item);
836 $this->tpl->setContent($a_form->getHTML());
842 $form = $this->initCopyPageForm();
843 if ($form->checkInput()) {
845 if ($form->getInput(
"target") ===
"old") {
846 $portfolio_id = $form->getInput(
"prtf");
851 $portfolio->setTitle($form->getInput(
"title"));
852 $portfolio->create();
853 $portfolio_id = $portfolio->getId();
857 $page_ids = $this->port_request->getPortfolioPageIds();
858 foreach ($page_ids as $page_id) {
859 $source = $this->getPageInstance($page_id);
860 $target = $this->getPageInstance(
null, $portfolio_id);
861 $target->setXMLContent($source->copyXmlContent(
true));
862 $target->setType($source->getType());
863 $target->setTitle($source->getTitle());
867 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"prtf_pages_copied"),
true);
868 $this->
ctrl->redirect($this,
"view");
871 $form->setValuesByPost();
872 $this->copyPageForm($form);
880 $form->setFormAction($this->
ctrl->getFormAction($this));
881 $form->setTitle($this->
lng->txt(
"prtf_copy_page"));
883 $this->initCopyPageFormOptions($form);
885 $form->addCommandButton(
"copyPage", $this->
lng->txt(
"save"));
886 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
907 $this->content_style_gui->
addCss(
909 $this->
object->getRefId(),
910 $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, $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...
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.
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 _getPersonalPicturePath(int $usr_id, string $size='small', bool $force_pic=false)
static _lookupName(int $a_user_id)
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.