43 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
47 $this->
user = $DIC->user();
48 $this->locator = $DIC[
"ilLocator"];
49 $this->toolbar = $DIC->toolbar();
51 $this->tree = $DIC->repositoryTree();
52 $this->
help = $DIC[
"ilHelp"];
53 $this->main_menu = $DIC[
"ilMainMenu"];
54 $this->tpl = $DIC[
"tpl"];
56 $this->
ui = $DIC->ui();
60 $this->user_id =
$ilUser->getId();
62 $this->lng->loadLanguageModule(
"prtf");
63 $this->lng->loadLanguageModule(
"user");
64 $this->lng->loadLanguageModule(
"obj");
66 $this->requested_ppage = (int) $_REQUEST[
"ppage"];
67 $this->requested_user_page = (int) $_REQUEST[
"user_page"];
70 $back = str_replace(
"&",
":::", $_REQUEST[
"back_url"]);
72 "/[^a-zA-Z0-9_\.\?=:\s]/",
76 $this->requested_back_url = str_replace(
":::",
"&", $back);
78 $this->ctrl->setParameterbyClass(
"ilobjportfoliogui",
"back_url", rawurlencode($this->requested_back_url));
87 strip_tags($this->object->getTitle()),
88 $this->ctrl->getLinkTarget($this,
"view")
94 $title = $page->getTitle();
101 $this->ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit")
109 if ($this->requested_ppage > 0) {
111 $this->ctrl->redirect($this,
"view");
115 $this->page_mode =
"edit";
116 $this->ctrl->setParameter($this,
"ppage", $this->page_id);
122 $this->page_mode =
"preview";
123 $this->ctrl->setParameter($this,
"user_page", $this->page_id);
130 $this->tabs_gui->clearTargets();
131 $this->tabs_gui->setBackTarget(
132 $this->lng->txt(
"back"),
133 $this->ctrl->getLinkTarget($this,
"view")
136 if (!$this->page_id) {
137 $this->ctrl->redirect($this,
"view");
144 $this->object->getStyleSheetId(),
148 $ret = $this->ctrl->forwardCommand($page_gui);
152 if ($this->page_mode ==
"preview") {
156 $this->
preview(
false,
$ret, ($a_cmd !=
"previewEmbedded"));
164 if (is_string(
$ret)) {
165 $this->tpl->setContent(
$ret);
178 $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->getLinkTarget($this,
'editStyleProperties')
225 $this->tabs_gui->activateSubTab($a_active);
238 if ($prfa_set->get(
"banner")) {
241 $dimensions =
" (" . $prfa_set->get(
"banner_width") .
"x" .
242 $prfa_set->get(
"banner_height") .
")";
248 $file = $this->
object->getImageFullPath(
true);
250 $img->setImage($file);
255 $section->setTitle($this->lng->txt(
'obj_features'));
259 $comments =
new ilCheckboxInputGUI($this->lng->txt(
"prtf_public_comments"),
"comments");
273 $a_values[
"comments"] = $this->
object->hasPublicComments();
274 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
283 $this->
object->setPublicComments($a_form->
getInput(
"comments"));
284 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
292 if ($_FILES[
"banner"][
"tmp_name"]) {
293 $this->
object->uploadImage($_FILES[
"banner"]);
294 } elseif ($prfa_set->get(
'banner') and $a_form->
getItemByPostVar(
"banner")->getDeletionFlag()) {
295 $this->
object->deleteImage();
304 abstract protected function getPageInstance($a_page_id = null, $a_portfolio_id = null);
320 $this->ctrl->redirect($this,
"infoScreen");
323 $this->tabs_gui->activateTab(
"pages");
327 $button->setCaption(
"prtf_add_page");
328 $button->setUrl($this->ctrl->getLinkTarget($this,
"addPage"));
329 $ilToolbar->addStickyItem($button);
333 $button->setCaption(
"prtf_add_blog");
334 $button->setUrl($this->ctrl->getLinkTarget($this,
"addBlog"));
335 $ilToolbar->addStickyItem($button);
340 if ($this->
getType() ==
"prtf") {
341 $ilToolbar->addSeparator();
344 $button->setCaption(
"export_html");
345 $button->setUrl($this->ctrl->getLinkTarget($this,
"export"));
346 $ilToolbar->addButtonInstance($button);
349 $button->setCaption(
"prtf_pdf");
350 $button->setUrl($this->ctrl->getLinkTarget($this,
"exportPDFSelection"));
351 $ilToolbar->addButtonInstance($button);
357 $this->tpl->setContent(
$message . $table->getHTML());
367 $this->tabs_gui->clearTargets();
368 $this->tabs_gui->setBackTarget(
369 $this->lng->txt(
"back"),
370 $this->ctrl->getLinkTarget($this,
"view")
373 $ilHelp->setScreenIdComponent(
"prtf");
374 $ilHelp->setScreenId(
"add_page");
378 $this->tpl->setContent($form->getHTML());
390 $form->setFormAction($this->ctrl->getFormAction($this));
394 $ti->setMaxLength(200);
395 $ti->setRequired(
true);
399 if ($a_mode ==
"create") {
404 $form->addItem($use_template);
407 $use_template->addOption($opt);
409 foreach ($templates as $templ) {
410 $templ->readObject();
412 $opt =
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
413 $use_template->addOption($opt);
417 $form->
setTitle($this->lng->txt(
"prtf_add_page") .
": " .
418 $this->
object->getTitle());
419 $form->addCommandButton(
"savePage", $this->lng->txt(
"save"));
420 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
441 $page->setTitle($form->getInput(
"title"));
444 $layout_id = $form->getInput(
"tmpl");
447 $page->setXMLContent($layout_obj->getXMLContent());
452 ilUtil::sendSuccess($this->lng->txt(
"prtf_page_created"),
true);
453 $this->ctrl->redirect($this,
"view");
456 $this->tabs_gui->clearTargets();
457 $this->tabs_gui->setBackTarget(
458 $this->lng->txt(
"back"),
459 $this->ctrl->getLinkTarget($this,
"view")
462 $form->setValuesByPost();
463 $this->tpl->setContent($form->getHtml());
473 $this->tabs_gui->clearTargets();
474 $this->tabs_gui->setBackTarget(
475 $this->lng->txt(
"back"),
476 $this->ctrl->getLinkTarget($this,
"view")
479 $ilHelp->setScreenIdComponent(
"prtf");
480 $ilHelp->setScreenId(
"add_blog");
483 $this->tpl->setContent($form->getHTML());
488 abstract protected function saveBlog();
499 $title_changes = array();
501 if (is_array(
$_POST[
"order"])) {
502 foreach (
$_POST[
"order"] as $k => $v) {
504 if (
$_POST[
"title"][$k]) {
506 if ($page->getTitle() != $new_title) {
507 $title_changes[$page->getId()] = array(
"old" => $page->getTitle(),
"new" => $new_title);
508 $page->setTitle($new_title);
517 $this->
object->fixLinksOnTitleChange($title_changes);
519 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
520 $this->ctrl->redirect($this,
"view");
528 $prtf_pages = $_REQUEST[
"prtf_pages"];
530 if (!is_array($prtf_pages) || count($prtf_pages) == 0) {
532 $this->ctrl->redirect($this,
"view");
534 $this->tabs_gui->activateTab(
"pages");
537 $cgui->setFormAction($this->ctrl->getFormAction($this));
538 $cgui->setHeaderText($this->lng->txt(
"prtf_sure_delete_portfolio_pages"));
539 $cgui->setCancel($this->lng->txt(
"cancel"),
"view");
540 $cgui->setConfirm($this->lng->txt(
"delete"),
"deletePortfolioPages");
542 foreach ($prtf_pages as $id) {
545 if ($page->getPortfolioId() != $this->
object->getId()) {
549 $title = $page->getTitle();
553 $cgui->addItem(
"prtf_pages[]", $id, $title);
556 $this->tpl->setContent($cgui->getHTML());
569 if (is_array(
$_POST[
"prtf_pages"])) {
570 foreach (
$_POST[
"prtf_pages"] as $id) {
576 ilUtil::sendSuccess($this->lng->txt(
"prtf_portfolio_page_deleted"),
true);
577 $this->ctrl->redirect($this,
"view");
588 $portfolio_id = $this->
object->getId();
589 $user_id = $this->
object->getOwner();
591 $this->tabs_gui->clearTargets();
597 if ($pages && $current_page) {
599 foreach ($pages as $page) {
600 if ($page[
"id"] == $current_page) {
606 $current_page = null;
611 if (!$current_page && $pages) {
612 $current_page = $pages;
613 $current_page = array_shift($current_page);
614 $current_page = $current_page[
"id"];
618 if ($this->user_id == ANONYMOUS_USER_ID &&
620 $this->tpl->setLoginTargetPar(
"prtf_" . $this->object->getId() .
"_" . $current_page);
626 if ($this->requested_back_url !=
"") {
628 } elseif (
$_GET[
"baseClass"] !=
"ilPublicUserProfileGUI" &&
629 $this->user_id && $this->user_id != ANONYMOUS_USER_ID) {
632 if ($this->
getType() ==
"prtf") {
633 $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id", $this->object->getOwner());
634 $back = $this->ctrl->getLinkTargetByClass(array(
"ildashboardgui",
"ilportfoliorepositorygui"),
"showOther");
635 $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id",
"");
647 $back = $this->ctrl->getLinkTarget($this,
"view");
648 if ($this->
getType() ==
"prtf") {
649 $back_caption = $this->lng->txt(
"prtf_back_to_portfolio_owner");
652 $this->lng->loadLanguageModule(
"prtt");
653 $back_caption = $this->lng->txt(
"prtt_edit");
662 $ilMainMenu->setTopBarBack($back, $back_caption);
666 $current_blog = null;
667 if (count($pages) > 1) {
668 foreach ($pages as $p) {
671 if ($p[
"id"] == $current_page) {
672 $current_blog = (int) $p[
"title"];
677 $this->ctrl->setParameter($this,
"user_page", $p[
"id"]);
678 $this->tabs_gui->addTab(
679 "user_page_" . $p[
"id"],
681 $this->ctrl->getLinkTarget($this,
"preview")
685 $this->tabs_gui->activateTab(
"user_page_" . $current_page);
688 $this->ctrl->setParameter($this,
"user_page", $current_page);
695 $page_gui->setEmbedded(
true);
697 $content = $this->ctrl->getHTML($page_gui);
709 if ($a_show_notes && $this->object->hasPublicComments() && !$current_blog && $current_page) {
710 $note_gui =
new ilNoteGUI($portfolio_id, $current_page,
"pfpg");
711 $note_gui->setRepositoryMode(
false);
712 $note_gui->enablePublicNotes(
true);
713 $note_gui->enablePrivateNotes(
false);
715 $note_gui->enablePublicNotesDeletion(($this->user_id ==
$user_id) &&
718 $next_class = $this->ctrl->getNextClass($this);
719 if ($next_class ==
"ilnotegui") {
720 $notes = $this->ctrl->forwardCommand($note_gui);
722 $notes = $note_gui->getNotesHTML();
726 if ($this->perma_link === null) {
727 if ($this->
getType() ==
"prtf") {
728 $this->tpl->setPermanentLink($this->
getType(), $this->object->getId(),
"_" . $current_page);
730 $this->tpl->setPermanentLink($this->
getType(), $this->object->getRefId());
733 $this->tpl->setPermanentLink($this->perma_link[
"type"], $this->perma_link[
"obj_id"]);
741 self::renderFullscreenHeader($this->
object, $this->tpl,
$user_id);
744 $this->ctrl->setParameter($this,
"user_page",
"");
746 $this->ctrl->setParameter($this,
"user_page", $this->page_id);
749 if (!$current_blog) {
750 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
751 '<div class="ilc_page_Page">' .
761 $this->tpl->setContent($content .
762 '<div class="ilClearFloat">' . $notes .
'</div>');
774 $page_class = ($this->
getType() ==
"prtt")
775 ?
"ilPortfolioTemplatePageGUI" 776 :
"ilportfoliopagegui";
779 $this->ctrl->setParameterByClass($page_class,
"ppage",
$page_id);
780 $button = $this->
ui->factory()->button()->standard(
781 $this->lng->txt(
"edit"),
782 $this->ctrl->getLinkTargetByClass($page_class,
"edit")
785 if ($this->
getType() !=
"prtt") {
786 $this->ctrl->setParameterByClass(
"ilobjbloggui",
"ppage",
$page_id);
787 $this->ctrl->setParameterByClass(
"ilobjbloggui",
"prt_id", (
int)
$_GET[
"prt_id"]);
788 $button = $this->
ui->factory()->button()->standard(
789 $this->lng->txt(
"edit"),
790 $this->ctrl->getLinkTargetByClass([$page_class,
"ilobjbloggui"],
"render")
793 $button = $this->
ui->factory()->button()->standard(
794 $this->lng->txt(
"edit"),
795 $this->ctrl->getLinkTargetByClass([
"ilobjportfoliotemplategui"],
"view")
800 $this->tpl->setHeaderActionMenu($this->
ui->renderer()->render($button));
819 $a_portfolio->getType(),
820 ($a_portfolio->getType() ==
"prtt")
821 ? $a_portfolio->getRefId()
822 : $a_portfolio->getId(),
823 $a_portfolio->getId(),
829 $name = $name[
"lastname"] .
", " . ($t = $name[
"title"] ? $t .
" " :
"") . $name[
"firstname"];
832 $banner = $banner_width = $banner_height =
false;
834 if ($prfa_set->get(
"banner")) {
836 $banner_width = $prfa_set->get(
"banner_width");
837 $banner_height = $prfa_set->get(
"banner_height");
839 $banner = basename($banner);
845 if ($a_portfolio->hasProfilePicture()) {
848 $ppic = basename($ppic);
852 $a_tpl->resetHeaderBlock(
false);
855 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
856 $a_tpl->setTitleIcon($ppic);
857 $a_tpl->setTitle($a_portfolio->getTitle());
859 $a_tpl->setDescription($name);
862 $a_tpl->setVariable(
"LOCATOR",
"");
870 $port_export = new \ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
871 $zip = $port_export->exportHtml();
882 $prtf_pages = $_REQUEST[
"prtf_pages"];
884 if (!is_array($prtf_pages) || count($prtf_pages) == 0) {
886 $this->ctrl->redirect($this,
"view");
888 $this->tabs_gui->activateTab(
"pages");
896 $item->setValue((
int) $page_id);
897 $a_form->addItem($item);
900 $this->tpl->setContent($a_form->getHTML());
907 if ($form->checkInput()) {
909 if ($form->getInput(
"target") ==
"old") {
910 $portfolio_id = $form->getInput(
"prtf");
915 $portfolio->setTitle($form->getInput(
"title"));
916 $portfolio->create();
917 $portfolio_id = $portfolio->getId();
922 $page_id = (int) $page_id;
925 $target->setXMLContent(
$source->copyXmlContent(
true));
926 $target->setType(
$source->getType());
927 $target->setTitle(
$source->getTitle());
931 ilUtil::sendSuccess($this->lng->txt(
"prtf_pages_copied"),
true);
932 $this->ctrl->redirect($this,
"view");
935 $form->setValuesByPost();
944 $form->setFormAction($this->ctrl->getFormAction($this));
945 $form->setTitle($this->lng->txt(
"prtf_copy_page"));
949 $form->addCommandButton(
"copyPage", $this->lng->txt(
"save"));
950 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
964 if ($a_tpl != null) {
970 $ctpl->setCurrentBlock(
"ContentStyle");
972 "LOCATION_CONTENT_STYLESHEET",
975 $ctpl->parseCurrentBlock();
982 $this->tabs_gui->activateTab(
"settings");
986 $this->tpl->setContent($form->getHTML());
993 $this->lng->loadLanguageModule(
"style");
997 $fixed_style =
$ilSetting->get(
"fixed_content_style_id");
998 $style_id = $this->
object->getStyleSheetId();
1000 if ($fixed_style > 0) {
1003 $this->lng->txt(
"global_fixed") .
")");
1004 $form->addItem($st);
1012 $st_styles[0] = $this->lng->txt(
"default");
1015 if ($style_id > 0) {
1020 $form->addItem($st);
1023 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
1024 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
1030 $this->lng->txt(
"style_current_style"),
1033 $style_sel->setOptions($st_styles);
1034 $style_sel->setValue($style_id);
1035 $form->addItem($style_sel);
1037 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
1038 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
1042 $form->setTitle($this->lng->txt($this->getType() .
"_style"));
1043 $form->setFormAction($this->ctrl->getFormAction($this));
1050 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
1055 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
1060 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
1067 if (
$ilSetting->get(
"fixed_content_style_id") <= 0 &&
1069 || $this->object->getStyleSheetId() == 0)) {
1071 $this->
object->update();
1073 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1075 $this->ctrl->redirect($this,
"editStyleProperties");
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _lookupName($a_user_id)
lookup user name
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
getEditFormCustomValues(array &$a_values)
confirmPortfolioPageDeletion()
Confirm portfolio deletion.
setValue($a_value)
Set Value.
static _lookupTitle($a_id)
setContentStyleSheet($a_tpl=null)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
view()
Show list of portfolio pages.
setPermaLink($a_obj_id, $a_type)
Set custom perma link (used in public profile?)
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
setSettingsSubTabs($a_active)
static fixOrdering($a_portfolio_id)
Fix ordering.
addPage()
Show portfolio page creation form.
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
savePage()
Create new portfolio page.
static lookupType($a_page_id)
Lookup type.
static _lookupStandard($a_id)
Lookup standard flag.
deletePortfolioPages()
Delete portfolio pages.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
savePortfolioPagesOrdering()
Save ordering of portfolio pages.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
setAdditional($a_additional)
Set Additonal Information (used in public profile?)
getType()
Functions that must be overwritten.
showEditButton($page_id)
Show edit button.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
getAdditional()
Get Additonal Information.
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
initPageForm($a_mode="create")
Init portfolio page form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static signFile($path_to_file)
addBlog()
Show portfolio blog page creation form.
getPageGUIInstance($a_page_id)
Portfolio view gui base class.
This class represents a non editable value in a property form.
static renderFullscreenHeader($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
__construct(Container $dic, ilPlugin $plugin)
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
initStylePropertiesForm()
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
initEditCustomForm(ilPropertyFormGUI $a_form)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
updateCustom(ilPropertyFormGUI $a_form)
copyPageForm($a_form=null)
Select target portfolio for page(s) copy.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Confirmation screen class.