4include_once(
'./Services/Object/classes/class.ilObject2GUI.php');
 
    5include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolio.php');
 
    6include_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"));               
 
   63                if(isset($_REQUEST[
"ppage"]))
 
   67                                $this->ctrl->redirect($this, 
"view");
 
   70                        $this->page_id = $_REQUEST[
"ppage"];
 
   71                        $this->page_mode = 
"edit";
 
   72                        $this->ctrl->setParameter($this, 
"ppage", $this->page_id);      
 
   78                        $this->page_id = $_REQUEST[
"user_page"];
 
   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->lng->loadLanguageModule($this->
getType());
 
  171                $this->tabs_gui->addSubTab(
"properties",
 
  172                        $this->lng->txt($this->getType().
"_properties"),
 
  173                                $this->ctrl->getLinkTarget($this, 
'edit'));
 
  175                $this->tabs_gui->addSubTab(
"style",
 
  176                        $this->lng->txt(
"obj_sty"),
 
  177                        $this->ctrl->getLinkTarget($this, 
'editStyleProperties'));
 
  179                $this->tabs_gui->activateSubTab($a_active);
 
  187                $comments = 
new ilCheckboxInputGUI($this->lng->txt(
"prtf_public_comments"), 
"comments");
 
  195                if($prfa_set->get(
"banner"))
 
  197                        include_once 
"Services/Form/classes/class.ilFileInputGUI.php";
 
  200                        $dimensions = 
" (".$prfa_set->get(
"banner_width").
"x".
 
  201                                $prfa_set->get(
"banner_height").
")";
 
  207                        $file = $this->
object->getImageFullPath(
true);
 
  225                $a_values[
"comments"] = $this->
object->hasPublicComments();
 
  226                $a_values[
"ppic"] = $this->
object->hasProfilePicture();         
 
  235                $this->
object->setPublicComments($a_form->
getInput(
"comments"));
 
  236                $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
 
  244                if($_FILES[
"banner"][
"tmp_name"])
 
  246                        $this->
object->uploadImage($_FILES[
"banner"]);
 
  248                else if($prfa_set->get(
'banner') and $a_form->
getItemByPostVar(
"banner")->getDeletionFlag())
 
  250                        $this->
object->deleteImage();
 
  259        abstract protected function getPageInstance($a_page_id = 
null, $a_portfolio_id = 
null);
 
  274                        $this->ctrl->redirect($this, 
"infoScreen");
 
  277                $this->tabs_gui->activateTab(
"pages");
 
  279                include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
  282                $button->setCaption(
"prtf_add_page");
 
  283                $button->setUrl($this->ctrl->getLinkTarget($this, 
"addPage"));
 
  284                $ilToolbar->addStickyItem($button);
 
  289                        $button->setCaption(
"prtf_add_blog");
 
  290                        $button->setUrl($this->ctrl->getLinkTarget($this, 
"addBlog"));
 
  291                        $ilToolbar->addStickyItem($button);
 
  294                $ilToolbar->addSeparator();
 
  300                        $button->setCaption(
"export_html");
 
  301                        $button->setUrl($this->ctrl->getLinkTarget($this, 
"export"));
 
  302                        $ilToolbar->addButtonInstance($button);
 
  305                include_once 
"Modules/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
 
  309                include_once 
"Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";                      
 
  316                $this->tpl->setContent($table->getHTML());
 
  326                $this->tabs_gui->clearTargets();
 
  327                $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
 
  328                        $this->ctrl->getLinkTarget($this, 
"view"));
 
  330                $ilHelp->setScreenIdComponent(
"prtf");
 
  331                $ilHelp->setScreenId(
"add_page");
 
  335                $this->tpl->setContent($form->getHTML());
 
  346                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  348                $form->setFormAction($this->ctrl->getFormAction($this));
 
  352                $ti->setMaxLength(200);
 
  353                $ti->setRequired(
true);
 
  357                if ($a_mode == 
"create")
 
  359                        include_once 
"Services/COPage/Layout/classes/class.ilPageLayout.php";
 
  364                                $use_template->setRequired(
true);
 
  365                                $form->addItem($use_template);
 
  368                                $use_template->addOption($opt);
 
  370                                foreach ($templates as $templ)
 
  372                                        $templ->readObject();
 
  374                                        $opt = 
new ilRadioOption($templ->getTitle().$templ->getPreview(), $templ->getId());
 
  375                                        $use_template->addOption($opt);                 
 
  379                        $form->setTitle($this->lng->txt(
"prtf_add_page").
": ".
 
  380                                $this->object->getTitle());
 
  381                        $form->addCommandButton(
"savePage", $this->lng->txt(
"save"));
 
  382                        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));                     
 
  402                if ($form->checkInput() && $this->checkPermissionBool(
"write"))
 
  404                        include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
 
  407                        $page->setTitle($form->getInput(
"title"));              
 
  410                        $layout_id = $form->getInput(
"tmpl");
 
  413                                include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
 
  415                                $page->setXMLContent($layout_obj->getXMLContent());
 
  421                        $this->ctrl->redirect($this, 
"view");
 
  424                $this->tabs_gui->clearTargets();
 
  425                $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
 
  426                        $this->ctrl->getLinkTarget($this, 
"view"));
 
  428                $form->setValuesByPost();
 
  429                $this->tpl->setContent($form->getHtml());
 
  439                $this->tabs_gui->clearTargets();
 
  440                $this->tabs_gui->setBackTarget($this->lng->txt(
"back"),
 
  441                        $this->ctrl->getLinkTarget($this, 
"view"));
 
  443                $ilHelp->setScreenIdComponent(
"prtf");
 
  444                $ilHelp->setScreenId(
"add_blog");
 
  447                $this->tpl->setContent($form->getHTML());
 
  464                if (is_array(
$_POST[
"order"]))
 
  466                        foreach (
$_POST[
"order"] as $k => $v)
 
  480                $this->ctrl->redirect($this, 
"view");
 
  488                if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0)
 
  491                        $this->ctrl->redirect($this, 
"view");
 
  495                        $this->tabs_gui->activateTab(
"pages");
 
  497                        include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  499                        $cgui->setFormAction($this->ctrl->getFormAction($this));
 
  500                        $cgui->setHeaderText($this->lng->txt(
"prtf_sure_delete_portfolio_pages"));
 
  501                        $cgui->setCancel($this->lng->txt(
"cancel"), 
"view");
 
  502                        $cgui->setConfirm($this->lng->txt(
"delete"), 
"deletePortfolioPages");
 
  504                        foreach (
$_POST[
"prtf_pages"] as $id)
 
  507                                $title = $page->getTitle();
 
  512                                $cgui->addItem(
"prtf_pages[]", $id, 
$title);
 
  515                        $this->tpl->setContent($cgui->getHTML());
 
  529                if (is_array(
$_POST[
"prtf_pages"]))
 
  531                        foreach (
$_POST[
"prtf_pages"] as $id)
 
  538                $this->ctrl->redirect($this, 
"view");
 
  548                $portfolio_id = $this->
object->getId();
 
  549                $user_id = $this->
object->getOwner();
 
  551                $this->tabs_gui->clearTargets();
 
  554                $current_page = (int)
$_GET[
"user_page"];
 
  557                if($pages && $current_page)
 
  560                        foreach($pages as $page)
 
  562                                if($page[
"id"] == $current_page)
 
  570                                $current_page = 
null;
 
  575                if(!$current_page && $pages)
 
  577                        $current_page = $pages;
 
  578                        $current_page = array_shift($current_page);
 
  579                        $current_page = $current_page[
"id"];
 
  583                if($this->user_id == ANONYMOUS_USER_ID &&
 
  586                        $this->tpl->setLoginTargetPar(
"prtf_".$this->object->getId().
"_".$current_page);
 
  592                if($_REQUEST[
"back_url"])
 
  594                        $back = $_REQUEST[
"back_url"];                                          
 
  596                else if(
$_GET[
"baseClass"] != 
"ilPublicUserProfileGUI" && 
 
  597                        $this->user_id && $this->user_id != ANONYMOUS_USER_ID)
 
  604                                        $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui", 
"shr_id", $this->object->getOwner());
 
  605                                        $back = $this->ctrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui", 
"ilportfoliorepositorygui"), 
"showOther");
 
  606                                        $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui", 
"shr_id", 
"");
 
  614                                        include_once 
"Services/Link/classes/class.ilLink.php";
 
  621                                $back = $this->ctrl->getLinkTarget($this, 
"view");
 
  624                                        $back_caption = $this->lng->txt(
"prtf_back_to_portfolio_owner");
 
  629                                        $this->lng->loadLanguageModule(
"prtt");
 
  630                                        $back_caption = $this->lng->txt(
"prtt_edit");
 
  640                        $ilMainMenu->setTopBarBack($back, $back_caption);
 
  644                $current_blog = 
null;
 
  645                if(count($pages) > 1)
 
  647                        foreach ($pages as $p)
 
  652                                        if($p[
"id"] == $current_page)
 
  654                                                $current_blog = (int)$p[
"title"];
 
  656                                        include_once 
"Modules/Blog/classes/class.ilObjBlog.php";
 
  660                                $this->ctrl->setParameter($this, 
"user_page", $p[
"id"]);
 
  661                                $this->tabs_gui->addTab(
"user_page_".$p[
"id"],
 
  663                                        $this->ctrl->getLinkTarget($this, 
"preview"));                          
 
  666                        $this->tabs_gui->activateTab(
"user_page_".$current_page);                       
 
  669                $this->ctrl->setParameter($this, 
"user_page", $current_page);
 
  678                                $page_gui->setEmbedded(
true);
 
  680                                $content = $this->ctrl->getHTML($page_gui);                     
 
  695                if($a_show_notes && $this->object->hasPublicComments() && !$current_blog && $current_page)
 
  697                        include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");                   
 
  698                        $note_gui = 
new ilNoteGUI($portfolio_id, $current_page, 
"pfpg");
 
  699                        $note_gui->setRepositoryMode(
false);                    
 
  700                        $note_gui->enablePublicNotes(
true);
 
  701                        $note_gui->enablePrivateNotes(
false);
 
  703                        $note_gui->enablePublicNotesDeletion(($this->user_id == 
$user_id) &&
 
  706                        $next_class = $this->ctrl->getNextClass($this);
 
  707                        if ($next_class == 
"ilnotegui")
 
  709                                $notes = $this->ctrl->forwardCommand($note_gui);
 
  713                                $notes = $note_gui->getNotesHTML();
 
  717                if($this->perma_link === 
null)
 
  721                                $this->tpl->setPermanentLink($this->
getType(), $this->object->getId(), 
"_".$current_page);                              
 
  725                                $this->tpl->setPermanentLink($this->
getType(), $this->object->getRefId());                              
 
  730                        $this->tpl->setPermanentLink($this->perma_link[
"type"], $this->perma_link[
"obj_id"]);
 
  742                $this->ctrl->setParameter($this, 
"user_page", 
"");
 
  743                $this->tpl->setTitleUrl($this->ctrl->getLinkTarget($this, 
"preview")); 
 
  744                $this->ctrl->setParameter($this, 
"user_page", $this->page_id);
 
  749                        $content = 
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">'.
 
  750                                '<div class="ilc_page_Page">'.
 
  758                $this->tpl->setContent($content.
 
  759                        '<div class="ilClearFloat">'.$notes.
'</div>');                                  
 
  775                        require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
  777                                $a_portfolio->getType(), 
 
  778                                ($a_portfolio->getType() == 
"prtt")
 
  779                                        ? $a_portfolio->getRefId()
 
  780                                        : $a_portfolio->getId(), 
 
  781                                $a_portfolio->getId(),
 
  787                $name = $name[
"lastname"].
", ".(
$t = $name[
"title"] ? 
$t . 
" " : 
"").$name[
"firstname"];
 
  790                $banner = $banner_width = $banner_height = 
false;
 
  792                if($prfa_set->get(
"banner"))
 
  794                        require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
  796                        $banner_width = $prfa_set->get(
"banner_width");
 
  797                        $banner_height = $prfa_set->get(
"banner_height");
 
  800                                $banner = basename($banner);
 
  806                if($a_portfolio->hasProfilePicture())
 
  811                                $ppic = basename($ppic);
 
  815                $a_tpl->resetHeaderBlock(
false);
 
  817                $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
 
  818                $a_tpl->setTitleIcon($ppic);
 
  819                $a_tpl->setTitle($a_portfolio->getTitle());
 
  821                $a_tpl->setDescription($name);          
 
  824                $a_tpl->setVariable(
"LOCATOR", 
"");
 
  832                include_once 
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
 
  834                $zip = $export->buildExportFile();
 
  845                if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0)
 
  848                        $this->ctrl->redirect($this, 
"view");
 
  852                        $this->tabs_gui->activateTab(
"pages");
 
  863                                $a_form->addItem($item);
 
  866                        $this->tpl->setContent($a_form->getHTML());
 
  873                if($form->checkInput())
 
  876                        if($form->getInput(
"target") == 
"old")
 
  878                                $portfolio_id = $form->getInput(
"prtf");                                                
 
  884                                $portfolio->setTitle($form->getInput(
"title"));
 
  885                                $portfolio->create();           
 
  886                                $portfolio_id = $portfolio->getId();
 
  894                                $target->setXMLContent($source->copyXmlContent(
true)); 
 
  895                                $target->setType($source->getType());
 
  896                                $target->setTitle($source->getTitle());
 
  901                        $this->ctrl->redirect($this, 
"view");
 
  904                $form->setValuesByPost();
 
  912                include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  914                $form->setFormAction($this->ctrl->getFormAction($this));                
 
  915                $form->setTitle($this->lng->txt(
"prtf_copy_page"));                     
 
  919                $form->addCommandButton(
"copyPage", $this->lng->txt(
"save"));
 
  920                $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  943                $ctpl->setCurrentBlock(
"ContentStyle");
 
  944                $ctpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  946                $ctpl->parseCurrentBlock();
 
  953                $this->tabs_gui->activateTab(
"settings");
 
  957                $this->tpl->setContent($form->getHTML());                               
 
  964                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  965                $this->lng->loadLanguageModule(
"style");
 
  967                include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  970                $fixed_style = 
$ilSetting->get(
"fixed_content_style_id");
 
  971                $style_id = $this->
object->getStyleSheetId();
 
  973                if ($fixed_style > 0)
 
  977                                $this->lng->txt(
"global_fixed").
")");
 
  985                        $st_styles[0] = $this->lng->txt(
"default");
 
  998                                        $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
 
  999                                        $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
 
 1007                                $style_sel->setOptions($st_styles);
 
 1008                                $style_sel->setValue($style_id);
 
 1009                                $form->addItem($style_sel);
 
 1011                                $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
 
 1012                                $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
 
 1016                $form->setTitle($this->lng->txt($this->getType().
"_style"));
 
 1017                $form->setFormAction($this->ctrl->getFormAction($this));
 
 1024                $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"create");
 
 1029                $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
 1034                $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"delete");
 
 1041                include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1042                if (
$ilSetting->get(
"fixed_content_style_id") <= 0 &&
 
 1044                        || $this->object->getStyleSheetId() == 0))
 
 1047                        $this->
object->update();
 
 1051                $this->ctrl->redirect($this, 
"editStyleProperties");
 
An exception for terminatinating execution or to throw for unit testing.
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.
Confirmation screen class.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
This class represents a non editable value in a property form.
Portfolio view gui base class.
initPageForm($a_mode="create")
Init portfolio page form.
setPermaLink($a_obj_id, $a_type)
Set custom perma link (used in public profile?)
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
addBlog()
Show portfolio blog page creation form.
addPage()
Show portfolio page creation form.
view()
Show list of portfolio pages.
savePage()
Create new portfolio page.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
getAdditional()
Get Additonal Information.
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
confirmPortfolioPageDeletion()
Confirm portfolio deletion.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
initStylePropertiesForm()
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
copyPageForm($a_form=null)
Select target portfolio for page(s) copy.
deletePortfolioPages()
Delete portfolio pages.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
savePortfolioPagesOrdering()
Save ordering of portfolio pages.
addLocatorItems()
Functions to be overwritten.
static renderFullscreenHeader($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
Render banner, user name.
setAdditional($a_additional)
Set Additonal Information (used in public profile?)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
setSettingsSubTabs($a_active)
getPageGUIInstance($a_page_id)
setContentStyleSheet($a_tpl=null)
static _lookupStandard($a_id)
Lookup standard flag.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id)
get content style path
static _getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static _lookupName($a_user_id)
lookup user name
New implementation of ilObjectGUI.
getType()
Functions that must be overwritten.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_id)
lookup object title
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
static checkExercise($a_user_id, $a_obj_id, $a_add_submit=false)
Portfolio HTML exporter class.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static fixOrdering($a_portfolio_id)
Fix ordering.
This class represents an option in a radio group.
This class represents a text property in a property form.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static signFile($path_to_file)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file