4include_once(
'./Services/Object/classes/class.ilObject2GUI.php');
 
    5include_once(
'./Modules/Portfolio/classes/class.ilObjPortfolio.php');
 
    6include_once(
'./Modules/Portfolio/classes/class.ilPortfolioPage.php');
 
   34    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   38        $this->
user = $DIC->user();
 
   39        $this->locator = 
$DIC[
"ilLocator"];
 
   40        $this->toolbar = 
$DIC->toolbar();
 
   42        $this->tree = 
$DIC->repositoryTree();
 
   43        $this->help = 
$DIC[
"ilHelp"];
 
   44        $this->main_menu = 
$DIC[
"ilMainMenu"];
 
   45        $this->tpl = 
$DIC[
"tpl"];
 
   48        parent::__construct($a_id, $a_id_type, $a_parent_node_id);
 
   50        $this->user_id = 
$ilUser->getId();
 
   52        $this->lng->loadLanguageModule(
"prtf");
 
   53        $this->lng->loadLanguageModule(
"user");
 
   62                strip_tags($this->object->getTitle()),
 
   63                $this->ctrl->getLinkTarget($this, 
"view")
 
   69            $title = $page->getTitle();
 
   76                $this->ctrl->getLinkTargetByClass($this->getPageGUIClassName(), 
"edit")
 
   84        if (isset($_REQUEST[
"ppage"])) {
 
   86                $this->ctrl->redirect($this, 
"view");
 
   89            $this->page_id = $_REQUEST[
"ppage"];
 
   90            $this->page_mode = 
"edit";
 
   91            $this->ctrl->setParameter($this, 
"ppage", $this->page_id);
 
   96            $this->page_id = $_REQUEST[
"user_page"];
 
   97            $this->page_mode = 
"preview";
 
   98            $this->ctrl->setParameter($this, 
"user_page", $this->page_id);
 
  105        $this->tabs_gui->clearTargets();
 
  106        $this->tabs_gui->setBackTarget(
 
  107            $this->lng->txt(
"back"),
 
  108            $this->ctrl->getLinkTarget($this, 
"view")
 
  111        if (!$this->page_id) {
 
  112            $this->ctrl->redirect($this, 
"view");
 
  119            $this->object->getStyleSheetId(),
 
  123        $ret = $this->ctrl->forwardCommand($page_gui);
 
  127            if ($this->page_mode == 
"preview") {
 
  131                    $this->
preview(
false, 
$ret, ($a_cmd != 
"previewEmbedded"));
 
  139                $this->tpl->setContent(
$ret);
 
  151        $this->additional = $a_additional;
 
  172        $this->perma_link = array(
"obj_id"=>$a_obj_id, 
"type"=>
$a_type);
 
  183        $this->lng->loadLanguageModule($this->
getType());
 
  186        $this->tabs_gui->addSubTab(
 
  188            $this->lng->txt($this->getType() . 
"_properties"),
 
  189            $this->ctrl->getLinkTarget($this, 
'edit')
 
  192        $this->tabs_gui->addSubTab(
 
  194            $this->lng->txt(
"obj_sty"),
 
  195            $this->ctrl->getLinkTarget($this, 
'editStyleProperties')
 
  198        $this->tabs_gui->activateSubTab($a_active);
 
  206        $comments = 
new ilCheckboxInputGUI($this->lng->txt(
"prtf_public_comments"), 
"comments");
 
  214        if ($prfa_set->get(
"banner")) {
 
  215            include_once 
"Services/Form/classes/class.ilFileInputGUI.php";
 
  218            $dimensions = 
" (" . $prfa_set->get(
"banner_width") . 
"x" .
 
  219                $prfa_set->get(
"banner_height") . 
")";
 
  225            $file = $this->
object->getImageFullPath(
true);
 
  242        $a_values[
"comments"] = $this->
object->hasPublicComments();
 
  243        $a_values[
"ppic"] = $this->
object->hasProfilePicture();
 
  252        $this->
object->setPublicComments($a_form->
getInput(
"comments"));
 
  253        $this->
object->setProfilePicture($a_form->
getInput(
"ppic"));
 
  261        if ($_FILES[
"banner"][
"tmp_name"]) {
 
  262            $this->
object->uploadImage($_FILES[
"banner"]);
 
  263        } elseif ($prfa_set->get(
'banner') and $a_form->
getItemByPostVar(
"banner")->getDeletionFlag()) {
 
  264            $this->
object->deleteImage();
 
  273    abstract protected function getPageInstance($a_page_id = 
null, $a_portfolio_id = 
null);
 
  289            $this->ctrl->redirect($this, 
"infoScreen");
 
  292        $this->tabs_gui->activateTab(
"pages");
 
  294        include_once 
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
 
  297        $button->setCaption(
"prtf_add_page");
 
  298        $button->setUrl($this->ctrl->getLinkTarget($this, 
"addPage"));
 
  299        $ilToolbar->addStickyItem($button);
 
  303            $button->setCaption(
"prtf_add_blog");
 
  304            $button->setUrl($this->ctrl->getLinkTarget($this, 
"addBlog"));
 
  305            $ilToolbar->addStickyItem($button);
 
  310        if ($this->
getType() == 
"prtf") {
 
  311            $ilToolbar->addSeparator();
 
  314            $button->setCaption(
"export_html");
 
  315            $button->setUrl($this->ctrl->getLinkTarget($this, 
"export"));
 
  316            $ilToolbar->addButtonInstance($button);
 
  319            $button->setCaption(
"prtf_pdf");
 
  320            $button->setUrl($this->ctrl->getLinkTarget($this, 
"exportPDFSelection"));
 
  321            $ilToolbar->addButtonInstance($button);
 
  324        include_once 
"Modules/Portfolio/classes/class.ilPortfolioPageTableGUI.php";
 
  328        include_once 
"Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
 
  334        $this->tpl->setContent(
$table->getHTML());
 
  344        $this->tabs_gui->clearTargets();
 
  345        $this->tabs_gui->setBackTarget(
 
  346            $this->lng->txt(
"back"),
 
  347            $this->ctrl->getLinkTarget($this, 
"view")
 
  350        $ilHelp->setScreenIdComponent(
"prtf");
 
  351        $ilHelp->setScreenId(
"add_page");
 
  355        $this->tpl->setContent(
$form->getHTML());
 
  366        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  368        $form->setFormAction($this->ctrl->getFormAction($this));
 
  372        $ti->setMaxLength(200);
 
  373        $ti->setRequired(
true);
 
  377        if ($a_mode == 
"create") {
 
  378            include_once 
"Services/COPage/Layout/classes/class.ilPageLayout.php";
 
  382                $use_template->setRequired(
true);
 
  383                $form->addItem($use_template);
 
  386                $use_template->addOption($opt);
 
  388                foreach ($templates as $templ) {
 
  389                    $templ->readObject();
 
  391                    $opt = 
new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
 
  392                    $use_template->addOption($opt);
 
  396            $form->setTitle($this->lng->txt(
"prtf_add_page") . 
": " .
 
  397                $this->object->getTitle());
 
  398            $form->addCommandButton(
"savePage", $this->lng->txt(
"save"));
 
  399            $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  417        if (
$form->checkInput() && $this->checkPermissionBool(
"write")) {
 
  418            include_once(
"Modules/Portfolio/classes/class.ilPortfolioPage.php");
 
  421            $page->setTitle(
$form->getInput(
"title"));
 
  424            $layout_id = 
$form->getInput(
"tmpl");
 
  426                include_once(
"./Services/COPage/Layout/classes/class.ilPageLayout.php");
 
  428                $page->setXMLContent($layout_obj->getXMLContent());
 
  434            $this->ctrl->redirect($this, 
"view");
 
  437        $this->tabs_gui->clearTargets();
 
  438        $this->tabs_gui->setBackTarget(
 
  439            $this->lng->txt(
"back"),
 
  440            $this->ctrl->getLinkTarget($this, 
"view")
 
  443        $form->setValuesByPost();
 
  444        $this->tpl->setContent(
$form->getHtml());
 
  454        $this->tabs_gui->clearTargets();
 
  455        $this->tabs_gui->setBackTarget(
 
  456            $this->lng->txt(
"back"),
 
  457            $this->ctrl->getLinkTarget($this, 
"view")
 
  460        $ilHelp->setScreenIdComponent(
"prtf");
 
  461        $ilHelp->setScreenId(
"add_blog");
 
  464        $this->tpl->setContent(
$form->getHTML());
 
  480        $title_changes = array();
 
  482        if (is_array(
$_POST[
"order"])) {
 
  483            foreach (
$_POST[
"order"] as $k => $v) {
 
  485                if (
$_POST[
"title"][$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);
 
  501        $this->ctrl->redirect($this, 
"view");
 
  509        if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0) {
 
  511            $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");
 
  524                $title = $page->getTitle();
 
  528                $cgui->addItem(
"prtf_pages[]", 
$id, 
$title);
 
  531            $this->tpl->setContent($cgui->getHTML());
 
  544        if (is_array(
$_POST[
"prtf_pages"])) {
 
  551        $this->ctrl->redirect($this, 
"view");
 
  562        $portfolio_id = $this->
object->getId();
 
  563        $user_id = $this->
object->getOwner();
 
  565        $this->tabs_gui->clearTargets();
 
  568        $current_page = (int) 
$_GET[
"user_page"];
 
  571        if ($pages && $current_page) {
 
  573            foreach ($pages as $page) {
 
  574                if ($page[
"id"] == $current_page) {
 
  580                $current_page = 
null;
 
  585        if (!$current_page && $pages) {
 
  586            $current_page = $pages;
 
  587            $current_page = array_shift($current_page);
 
  588            $current_page = $current_page[
"id"];
 
  592        if ($this->user_id == ANONYMOUS_USER_ID &&
 
  594            $this->tpl->setLoginTargetPar(
"prtf_" . $this->object->getId() . 
"_" . $current_page);
 
  600        if ($_REQUEST[
"back_url"]) {
 
  601            $back = $_REQUEST[
"back_url"];
 
  602        } elseif (
$_GET[
"baseClass"] != 
"ilPublicUserProfileGUI" &&
 
  603            $this->user_id && $this->user_id != ANONYMOUS_USER_ID) {
 
  606                if ($this->
getType() == 
"prtf") {
 
  607                    $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui", 
"shr_id", $this->object->getOwner());
 
  608                    $back = $this->ctrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui", 
"ilportfoliorepositorygui"), 
"showOther");
 
  609                    $this->ctrl->setParameterByClass(
"ilportfoliorepositorygui", 
"shr_id", 
"");
 
  616                    include_once 
"Services/Link/classes/class.ilLink.php";
 
  622                $back = $this->ctrl->getLinkTarget($this, 
"view");
 
  623                if ($this->
getType() == 
"prtf") {
 
  624                    $back_caption = $this->lng->txt(
"prtf_back_to_portfolio_owner");
 
  627                    $this->lng->loadLanguageModule(
"prtt");
 
  628                    $back_caption = $this->lng->txt(
"prtt_edit");
 
  637            $ilMainMenu->setTopBarBack($back, $back_caption);
 
  641        $current_blog = 
null;
 
  642        if (count($pages) > 1) {
 
  643            foreach ($pages as $p) {
 
  646                    if ($p[
"id"] == $current_page) {
 
  647                        $current_blog = (int) $p[
"title"];
 
  649                    include_once 
"Modules/Blog/classes/class.ilObjBlog.php";
 
  653                $this->ctrl->setParameter($this, 
"user_page", $p[
"id"]);
 
  654                $this->tabs_gui->addTab(
 
  655                    "user_page_" . $p[
"id"],
 
  657                    $this->ctrl->getLinkTarget($this, 
"preview")
 
  661            $this->tabs_gui->activateTab(
"user_page_" . $current_page);
 
  664        $this->ctrl->setParameter($this, 
"user_page", $current_page);
 
  671                $page_gui->setEmbedded(
true);
 
  673                $content = $this->ctrl->getHTML($page_gui);
 
  685        if ($a_show_notes && $this->object->hasPublicComments() && !$current_blog && $current_page) {
 
  686            include_once(
"./Services/Notes/classes/class.ilNoteGUI.php");
 
  687            $note_gui = 
new ilNoteGUI($portfolio_id, $current_page, 
"pfpg");
 
  688            $note_gui->setRepositoryMode(
false);
 
  689            $note_gui->enablePublicNotes(
true);
 
  690            $note_gui->enablePrivateNotes(
false);
 
  692            $note_gui->enablePublicNotesDeletion(($this->user_id == 
$user_id) &&
 
  695            $next_class = $this->ctrl->getNextClass($this);
 
  696            if ($next_class == 
"ilnotegui") {
 
  697                $notes = $this->ctrl->forwardCommand($note_gui);
 
  699                $notes = $note_gui->getNotesHTML();
 
  703        if ($this->perma_link === 
null) {
 
  704            if ($this->
getType() == 
"prtf") {
 
  705                $this->tpl->setPermanentLink($this->
getType(), $this->object->getId(), 
"_" . $current_page);
 
  707                $this->tpl->setPermanentLink($this->
getType(), $this->object->getRefId());
 
  710            $this->tpl->setPermanentLink($this->perma_link[
"type"], $this->perma_link[
"obj_id"]);
 
  721        $this->ctrl->setParameter($this, 
"user_page", 
"");
 
  722        $this->tpl->setTitleUrl($this->ctrl->getLinkTarget($this, 
"preview"));
 
  723        $this->ctrl->setParameter($this, 
"user_page", $this->page_id);
 
  726        if (!$current_blog) {
 
  727            $content = 
'<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
 
  728                '<div class="ilc_page_Page">' .
 
  736        $this->tpl->setContent($content .
 
  737            '<div class="ilClearFloat">' . $notes . 
'</div>');
 
  754            require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
  756                $a_portfolio->getType(),
 
  757                ($a_portfolio->getType() == 
"prtt")
 
  758                    ? $a_portfolio->getRefId()
 
  759                    : $a_portfolio->getId(),
 
  760                $a_portfolio->getId(),
 
  769        $banner = $banner_width = $banner_height = 
false;
 
  771        if ($prfa_set->get(
"banner")) {
 
  772            require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
 
  774            $banner_width = $prfa_set->get(
"banner_width");
 
  775            $banner_height = $prfa_set->get(
"banner_height");
 
  777                $banner = basename($banner);
 
  783        if ($a_portfolio->hasProfilePicture()) {
 
  784            $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, 
"xsmall", 
true, 
true);
 
  786                $ppic = basename($ppic);
 
  790        $a_tpl->resetHeaderBlock(
false);
 
  792        $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
 
  793        $a_tpl->setTitleIcon($ppic);
 
  794        $a_tpl->setTitle($a_portfolio->getTitle());
 
  796        $a_tpl->setDescription(
$name);
 
  799        $a_tpl->setVariable(
"LOCATOR", 
"");
 
  807        include_once 
"Modules/Portfolio/classes/class.ilPortfolioHTMLExport.php";
 
  809        $zip = $export->buildExportFile();
 
  820        if (!is_array(
$_POST[
"prtf_pages"]) || count(
$_POST[
"prtf_pages"]) == 0) {
 
  822            $this->ctrl->redirect($this, 
"view");
 
  824            $this->tabs_gui->activateTab(
"pages");
 
  833                $a_form->addItem($item);
 
  836            $this->tpl->setContent($a_form->getHTML());
 
  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();
 
  867            $this->ctrl->redirect($this, 
"view");
 
  870        $form->setValuesByPost();
 
  878        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  880        $form->setFormAction($this->ctrl->getFormAction($this));
 
  881        $form->setTitle($this->lng->txt(
"prtf_copy_page"));
 
  885        $form->addCommandButton(
"copyPage", $this->lng->txt(
"save"));
 
  886        $form->addCommandButton(
"view", $this->lng->txt(
"cancel"));
 
  900        if ($a_tpl != 
null) {
 
  906        $ctpl->setCurrentBlock(
"ContentStyle");
 
  908            "LOCATION_CONTENT_STYLESHEET",
 
  911        $ctpl->parseCurrentBlock();
 
  918        $this->tabs_gui->activateTab(
"settings");
 
  922        $this->tpl->setContent(
$form->getHTML());
 
  929        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
  930        $this->lng->loadLanguageModule(
"style");
 
  932        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  935        $fixed_style = 
$ilSetting->get(
"fixed_content_style_id");
 
  936        $style_id = $this->
object->getStyleSheetId();
 
  938        if ($fixed_style > 0) {
 
  941                $this->lng->txt(
"global_fixed") . 
")");
 
  950            $st_styles[0] = $this->lng->txt(
"default");
 
  961                    $form->addCommandButton(
"editStyle", $this->lng->txt(
"style_edit_style"));
 
  962                    $form->addCommandButton(
"deleteStyle", $this->lng->txt(
"style_delete_style"));
 
  968                    $this->lng->txt(
"style_current_style"),
 
  971                $style_sel->setOptions($st_styles);
 
  972                $style_sel->setValue($style_id);
 
  973                $form->addItem($style_sel);
 
  975                $form->addCommandButton(
"saveStyleSettings", $this->lng->txt(
"save"));
 
  976                $form->addCommandButton(
"createStyle", $this->lng->txt(
"sty_create_ind_style"));
 
  980        $form->setTitle($this->lng->txt($this->getType() . 
"_style"));
 
  981        $form->setFormAction($this->ctrl->getFormAction($this));
 
  988        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"create");
 
  993        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  998        $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"delete");
 
 1005        include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
 
 1006        if (
$ilSetting->get(
"fixed_content_style_id") <= 0 &&
 
 1008            || $this->object->getStyleSheetId() == 0)) {
 
 1010            $this->
object->update();
 
 1014        $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 _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id, $add_random=true)
get content style path
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 deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
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 signFile($path_to_file)
if(!array_key_exists('StateId', $_REQUEST)) $id
if(empty($password)) $table
if(isset($_POST['submit'])) $form
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file