4 include_once(
'./Services/Object/classes/class.ilObject2GUI.php');
5 include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolio.php');
6 include_once(
'./Modules/Portfolio/classes/class.ilPortfolioPage.php');
24 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
28 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
30 $this->user_id = $ilUser->getId();
32 $this->lng->loadLanguageModule(
"prtf");
33 $this->lng->loadLanguageModule(
"user");
42 $ilLocator->addItem(strip_tags($this->object->getTitle()),
43 $this->ctrl->getLinkTarget($this,
"view"));
49 $title = $page->getTitle();
55 $ilLocator->addItem($title,
56 $this->ctrl->getLinkTargetByClass($this->getPageGUIClassName(),
"edit"));
67 $this->ctrl->redirect($this,
"view");
71 $this->page_mode =
"edit";
72 $this->ctrl->setParameter($this,
"ppage", $this->page_id);
79 $this->page_mode =
"preview";
80 $this->ctrl->setParameter($this,
"user_page", $this->page_id);
87 $this->tabs_gui->clearTargets();
88 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
89 $this->ctrl->getLinkTarget($this,
"view"));
93 $this->ctrl->redirect($this,
"view");
100 $this->object->getStyleSheetId(), $this->
getType()));
102 $ret = $this->ctrl->forwardCommand($page_gui);
107 if($this->page_mode ==
"preview")
113 $this->
preview(
false,
$ret, ($a_cmd !=
"previewEmbedded"));
124 $this->tpl->setContent(
$ret);
136 $this->additional = $a_additional;
157 $this->perma_link = array(
"obj_id"=>$a_obj_id,
"type"=>$a_type);
168 $this->tabs_gui->addSubTab(
"properties",
169 $this->lng->txt($this->getType().
"_properties"),
170 $this->ctrl->getLinkTarget($this,
'edit'));
172 $this->tabs_gui->addSubTab(
"style",
173 $this->lng->txt(
"obj_sty"),
174 $this->ctrl->getLinkTarget($this,
'editStyleProperties'));
176 $this->tabs_gui->activateSubTab($a_active);
184 $comments =
new ilCheckboxInputGUI($this->lng->txt(
"prtf_public_comments"),
"comments");
192 if($prfa_set->get(
"banner"))
194 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
197 $dimensions =
" (".$prfa_set->get(
"banner_width").
"x".
198 $prfa_set->get(
"banner_height").
")";
204 $file = $this->
object->getImageFullPath(
true);
222 $a_values[
"comments"] = $this->
object->hasPublicComments();
223 $a_values[
"ppic"] = $this->
object->hasProfilePicture();
232 $this->
object->setPublicComments($a_form->
getInput(
"comments"));
233 $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
241 if($_FILES[
"banner"][
"tmp_name"])
243 $this->
object->uploadImage($_FILES[
"banner"]);
245 else if($prfa_set->get(
'banner') and $a_form->
getItemByPostVar(
"banner")->getDeletionFlag())
247 $this->
object->deleteImage();
256 abstract protected function getPageInstance($a_page_id = null, $a_portfolio_id = null);
271 $this->ctrl->redirect($this,
"infoScreen");
274 $this->tabs_gui->activateTab(
"pages");
276 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
279 $button->setCaption(
"prtf_add_page");
280 $button->setUrl($this->ctrl->getLinkTarget($this,
"addPage"));
281 $ilToolbar->addButtonInstance($button);
283 if(!$ilSetting->get(
'disable_wsp_blogs'))
286 $button->setCaption(
"prtf_add_blog");
287 $button->setUrl($this->ctrl->getLinkTarget($this,
"addBlog"));
288 $ilToolbar->addButtonInstance($button);
291 $ilToolbar->addSeparator();
294 $button->setCaption(
"export_html");
295 $button->setUrl($this->ctrl->getLinkTarget($this,
"export"));
296 $ilToolbar->addButtonInstance($button);
298 include_once
"Modules/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
302 include_once
"Modules/Exercise/classes/class.ilObjExercise.php";
307 foreach($exercises as $exercise)
313 if(!$tree->isSaved($ref_id))
321 $part = $this->getExerciseInfo($exercise[
"ass_id"], $table->dataExists());
334 $this->tpl->setContent($table->getHTML());
344 $this->tabs_gui->clearTargets();
345 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
346 $this->ctrl->getLinkTarget($this,
"view"));
348 $ilHelp->setScreenIdComponent(
"prtf");
349 $ilHelp->setScreenId(
"add_page");
353 $this->tpl->setContent($form->getHTML());
364 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
366 $form->setFormAction($this->ctrl->getFormAction($this));
371 $ti->setRequired(
true);
375 if ($a_mode ==
"create")
377 include_once
"Services/Style/classes/class.ilPageLayout.php";
383 $form->addItem($use_template);
386 $use_template->addOption($opt);
388 foreach ($templates as $templ)
390 $templ->readObject();
392 $opt =
new ilRadioOption($templ->getTitle().$templ->getPreview(), $templ->getId());
393 $use_template->addOption($opt);
397 $form->
setTitle($this->lng->txt(
"prtf_add_page").
": ".
398 $this->
object->getTitle());
399 $form->addCommandButton(
"savePage", $this->lng->txt(
"save"));
400 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
422 include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
425 $page->setTitle($form->getInput(
"title"));
428 $layout_id = $form->getInput(
"tmpl");
431 include_once(
"./Services/Style/classes/class.ilPageLayout.php");
433 $page->setXMLContent($layout_obj->getXMLContent());
439 $this->ctrl->redirect($this,
"view");
442 $this->tabs_gui->clearTargets();
443 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
444 $this->ctrl->getLinkTarget($this,
"view"));
446 $form->setValuesByPost();
447 $this->tpl->setContent($form->getHtml());
457 $this->tabs_gui->clearTargets();
458 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
459 $this->ctrl->getLinkTarget($this,
"view"));
461 $ilHelp->setScreenIdComponent(
"prtf");
462 $ilHelp->setScreenId(
"add_blog");
465 $this->tpl->setContent($form->getHTML());
470 abstract protected function saveBlog();
482 if (is_array(
$_POST[
"order"]))
484 foreach (
$_POST[
"order"] as $k => $v)
498 $this->ctrl->redirect($this,
"view");
506 if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0)
509 $this->ctrl->redirect($this,
"view");
513 $this->tabs_gui->activateTab(
"pages");
515 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
517 $cgui->setFormAction($this->ctrl->getFormAction($this));
518 $cgui->setHeaderText($this->lng->txt(
"prtf_sure_delete_portfolio_pages"));
519 $cgui->setCancel($this->lng->txt(
"cancel"),
"view");
520 $cgui->setConfirm($this->lng->txt(
"delete"),
"deletePortfolioPages");
522 foreach (
$_POST[
"prtf_pages"] as $id)
525 $title = $page->getTitle();
530 $cgui->addItem(
"prtf_pages[]", $id, $title);
533 $this->tpl->setContent($cgui->getHTML());
547 if (is_array(
$_POST[
"prtf_pages"]))
549 foreach (
$_POST[
"prtf_pages"] as $id)
556 $this->ctrl->redirect($this,
"view");
562 function preview($a_return =
false, $a_content =
false, $a_show_notes =
true)
566 $portfolio_id = $this->
object->getId();
567 $user_id = $this->
object->getOwner();
569 $this->tabs_gui->clearTargets();
572 $current_page = (int)
$_GET[
"user_page"];
575 if($pages && $current_page)
578 foreach($pages as $page)
580 if($page[
"id"] == $current_page)
588 $current_page = null;
593 if(!$current_page && $pages)
595 $current_page = $pages;
596 $current_page = array_shift($current_page);
597 $current_page = $current_page[
"id"];
601 if($this->user_id == ANONYMOUS_USER_ID &&
604 $this->tpl->setLoginTargetPar(
"prtf_".$this->object->getId().
"_".$current_page);
612 else if(
$_GET[
"baseClass"] !=
"ilPublicUserProfileGUI" &&
613 $this->user_id && $this->user_id != ANONYMOUS_USER_ID)
620 $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id", $this->object->getOwner());
621 $back = $this->ctrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui",
"ilportfoliorepositorygui"),
"showOther");
622 $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui",
"shr_id",
"");
629 $parent_id = $tree->getParentId($this->node_id);
630 include_once
"Services/Link/classes/class.ilLink.php";
637 $back = $this->ctrl->getLinkTarget($this,
"view");
646 $ilMainMenu->setTopBarBack($back);
650 $current_blog = null;
651 if(count($pages) > 1)
653 foreach ($pages as $p)
658 if($p[
"id"] == $current_page)
660 $current_blog = (int)$p[
"title"];
662 include_once
"Modules/Blog/classes/class.ilObjBlog.php";
666 $this->ctrl->setParameter($this,
"user_page", $p[
"id"]);
667 $this->tabs_gui->addTab(
"user_page_".$p[
"id"],
669 $this->ctrl->getLinkTarget($this,
"preview"));
672 $this->tabs_gui->activateTab(
"user_page_".$current_page);
675 $this->ctrl->setParameter($this,
"user_page", $current_page);
681 $page_gui->setEmbedded(
true);
683 $content = $this->ctrl->getHTML($page_gui);
687 $content = $a_content;
697 if($a_show_notes && $this->object->hasPublicComments() && !$current_blog)
699 include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
700 $note_gui =
new ilNoteGUI($portfolio_id, $current_page,
"pfpg");
701 $note_gui->setRepositoryMode(
false);
702 $note_gui->enablePublicNotes(
true);
703 $note_gui->enablePrivateNotes(
false);
705 $note_gui->enablePublicNotesDeletion(($this->user_id ==
$user_id) &&
706 $ilSetting->get(
"comments_del_tutor", 1));
708 $next_class = $this->ctrl->getNextClass($this);
709 if ($next_class ==
"ilnotegui")
711 $notes = $this->ctrl->forwardCommand($note_gui);
715 $notes = $note_gui->getNotesHTML();
719 if($this->perma_link === null)
723 $this->tpl->setPermanentLink($this->
getType(), $this->object->getId(),
"_".$current_page);
727 $this->tpl->setPermanentLink($this->
getType(), $this->object->getRefId());
732 $this->tpl->setPermanentLink($this->perma_link[
"type"], $this->perma_link[
"obj_id"]);
735 self::renderFullscreenHeader($this->
object, $this->tpl,
$user_id);
738 $this->ctrl->setParameter($this,
"user_page",
"");
739 $this->tpl->setTitleUrl($this->ctrl->getLinkTarget($this,
"preview"));
740 $this->ctrl->setParameter($this,
"user_page", $this->page_id);
745 $content =
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">'.
746 '<div class="ilc_page_Page">'.
754 $this->tpl->setContent($content.
755 '<div class="ilClearFloat">'.$notes.
'</div>');
768 $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ?
$t .
" " :
"").$name[
"firstname"];
771 $banner = $banner_width = $banner_height =
false;
773 if($prfa_set->get(
"banner"))
775 $banner = $a_portfolio->getImageFullPath();
776 $banner_width = $prfa_set->get(
"banner_width");
777 $banner_height = $prfa_set->get(
"banner_height");
780 $banner = basename($banner);
786 if($a_portfolio->hasProfilePicture())
791 $ppic = basename($ppic);
795 $a_tpl->resetHeaderBlock(
false);
797 $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
798 $a_tpl->setTitleIcon($ppic);
799 $a_tpl->setTitle($a_portfolio->getTitle());
801 $a_tpl->setDescription($name);
804 $a_tpl->setVariable(
"LOCATOR",
"");
812 include_once
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
814 $zip = $export->buildExportFile();
825 if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0)
828 $this->ctrl->redirect($this,
"view");
832 $this->tabs_gui->activateTab(
"pages");
842 $item->setValue($page_id);
843 $a_form->addItem($item);
846 $this->tpl->setContent($a_form->getHTML());
853 if($form->checkInput())
856 if($form->getInput(
"target") ==
"old")
858 $portfolio_id = $form->getInput(
"prtf");
864 $portfolio->setTitle($form->getInput(
"title"));
865 $portfolio->create();
866 $portfolio_id = $portfolio->getId();
874 $target->setXMLContent($source->copyXmlContent(
true));
875 $target->setType($source->getType());
876 $target->setTitle($source->getTitle());
881 $this->ctrl->redirect($this,
"view");
884 $form->setValuesByPost();
892 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
894 $form->setFormAction($this->ctrl->getFormAction($this));
895 $form->setTitle($this->lng->txt(
"prtf_copy_page"));
899 $form->addItem($tgt);
903 $form->addCommandButton(
"copyPage", $this->lng->txt(
"save"));
904 $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
927 $ctpl->setCurrentBlock(
"ContentStyle");
928 $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
930 $ctpl->parseCurrentBlock();
937 $this->tabs_gui->activateTab(
"settings");
941 $this->tpl->setContent($form->getHTML());
948 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
949 $this->lng->loadLanguageModule(
"style");
951 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
954 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
955 $style_id = $this->
object->getStyleSheetId();
957 if ($fixed_style > 0)
961 $this->lng->txt(
"global_fixed").
")");
969 $st_styles[0] = $this->lng->txt(
"default");
982 $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
983 $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
992 $style_sel->setValue($style_id);
993 $form->addItem($style_sel);
995 $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
996 $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
1000 $form->setTitle($this->lng->txt($this->getType().
"_style"));
1001 $form->setFormAction($this->ctrl->getFormAction($this));
1008 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"create");
1013 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
1018 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
1025 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1026 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
1028 || $this->object->getStyleSheetId() == 0))
1031 $this->
object->update();
1035 $this->ctrl->redirect($this,
"editStyleProperties");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
getEditFormCustomValues(array &$a_values)
confirmPortfolioPageDeletion()
Confirm portfolio deletion.
static findUserFiles($a_user_id, $a_filetitle)
Check if given file was assigned.
setValue($a_value)
Set Value.
static _lookupTitle($a_id)
setContentStyleSheet($a_tpl=null)
Portfolio HTML exporter class.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
view()
Show list of portfolio pages.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
setPermaLink($a_obj_id, $a_type)
Set custom perma link (used in public profile?)
setSettingsSubTabs($a_active)
initCopyPageFormOptions(ilFormPropertyGUI $a_tgt)
static fixOrdering($a_portfolio_id)
Fix ordering.
addPage()
Show portfolio page creation form.
static _lookupTitle($a_id)
lookup object title
savePage()
Create new portfolio page.
static _getAllReferences($a_id)
get all reference ids of object
deletePortfolioPages()
Delete portfolio pages.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
savePortfolioPagesOrdering()
Save ordering of portfolio pages.
checkPermission($a_perm, $a_cmd="")
__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.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
getAdditional()
Get Additonal Information.
This class represents a text property in a property form.
initPageForm($a_mode="create")
Init portfolio page form.
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
setMaxLength($a_maxlength)
Set Max Length.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
addBlog()
Show portfolio blog page creation form.
getPageGUIInstance($a_page_id)
Portfolio view gui base class.
static getAllPages($a_portfolio_id)
Get pages of portfolio.
_lookupStandard($a_id)
Lookup standard flag.
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.
getContentStylePath($a_style_id)
get content style path
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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
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.
Confirmation screen class.