ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjPortfolioBaseGUI Class Reference

Portfolio view gui base class. More...

+ Inheritance diagram for ilObjPortfolioBaseGUI:
+ Collaboration diagram for ilObjPortfolioBaseGUI:

Public Member Functions

 __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?) More...
 
 getAdditional ()
 Get Additonal Information. More...
 
 setPermaLink ($a_obj_id, $a_type)
 Set custom perma link (used in public profile?) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getPageGUIClassName ()
 
 view ()
 Show list of portfolio pages. More...
 
 initPageForm ($a_mode="create")
 Init portfolio page form. More...
 
 savePage ()
 Create new portfolio page. More...
 
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages. More...
 
 confirmPortfolioPageDeletion ()
 Confirm portfolio deletion. More...
 
 deletePortfolioPages ()
 Delete portfolio pages. More...
 
 preview ($a_return=false, $a_content=false, $a_show_notes=true)
 Show user page. More...
 
 export ()
 
 copyPageForm ($a_form=null)
 Select target portfolio for page(s) copy. More...
 
 copyPage ()
 
 initCopyPageForm ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Static Public Member Functions

static renderFullscreenHeader ($a_portfolio, $a_tpl, $a_user_id, $a_export=false)
 Render banner, user name. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 addLocatorItems ()
 
 determinePageCall ()
 
 handlePageCall ($a_cmd)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 
 getPageGUIInstance ($a_page_id)
 
 addPage ()
 Show portfolio page creation form. More...
 
 addBlog ()
 Show portfolio blog page creation form. More...
 
 initBlogForm ()
 
 saveBlog ()
 
 showEditButton ($page_id)
 Show edit button. More...
 
 initCopyPageFormOptions (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $help
 
 $main_menu
 
 $user_id
 
 $additional = array()
 
 $perma_link
 
 $page_id
 
 $page_mode
 
 $requested_ppage
 
 $requested_user_page
 
 $requested_back_url = ""
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Portfolio view gui base class.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 10 of file class.ilObjPortfolioBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioBaseGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)

Definition at line 43 of file class.ilObjPortfolioBaseGUI.php.

References $DIC, $ilUser, ILIAS\GlobalScreen\Provider\__construct(), help(), settings(), ui(), and user().

44  {
45  global $DIC;
46 
47  $this->user = $DIC->user();
48  $this->locator = $DIC["ilLocator"];
49  $this->toolbar = $DIC->toolbar();
50  $this->settings = $DIC->settings();
51  $this->tree = $DIC->repositoryTree();
52  $this->help = $DIC["ilHelp"];
53  $this->main_menu = $DIC["ilMainMenu"];
54  $this->tpl = $DIC["tpl"];
55  $ilUser = $DIC->user();
56  $this->ui = $DIC->ui();
57 
58  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
59 
60  $this->user_id = $ilUser->getId();
61 
62  $this->lng->loadLanguageModule("prtf");
63  $this->lng->loadLanguageModule("user");
64  $this->lng->loadLanguageModule("obj");
65 
66  $this->requested_ppage = (int) $_REQUEST["ppage"];
67  $this->requested_user_page = (int) $_REQUEST["user_page"];
68 
69  // temp sanitization, should be done smarter in the future
70  $back = str_replace("&", ":::", $_REQUEST["back_url"]);
71  $back = preg_replace(
72  "/[^a-zA-Z0-9_\.\?=:\s]/",
73  "",
74  $back
75  );
76  $this->requested_back_url = str_replace(":::", "&", $back);
77 
78  $this->ctrl->setParameterbyClass("ilobjportfoliogui", "back_url", rawurlencode($this->requested_back_url));
79  }
settings()
Definition: settings.php:2
user()
Definition: user.php:4
help()
Definition: help.php:2
$ilUser
Definition: imgupload.php:18
ui()
Definition: ui.php:5
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ addBlog()

ilObjPortfolioBaseGUI::addBlog ( )
protected

Show portfolio blog page creation form.

Definition at line 469 of file class.ilObjPortfolioBaseGUI.php.

References $help, initBlogForm(), and saveBlog().

470  {
471  $ilHelp = $this->help;
472 
473  $this->tabs_gui->clearTargets();
474  $this->tabs_gui->setBackTarget(
475  $this->lng->txt("back"),
476  $this->ctrl->getLinkTarget($this, "view")
477  );
478 
479  $ilHelp->setScreenIdComponent("prtf");
480  $ilHelp->setScreenId("add_blog");
481 
482  $form = $this->initBlogForm();
483  $this->tpl->setContent($form->getHTML());
484  }
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjPortfolioBaseGUI::addLocatorItems ( )
protected

Definition at line 81 of file class.ilObjPortfolioBaseGUI.php.

References ilObjectGUI\$locator, ilObject\_lookupTitle(), getPageGUIClassName(), getPageInstance(), and ilPortfolioPage\TYPE_BLOG.

82  {
83  $ilLocator = $this->locator;
84 
85  if ($this->object) {
86  $ilLocator->addItem(
87  strip_tags($this->object->getTitle()),
88  $this->ctrl->getLinkTarget($this, "view")
89  );
90  }
91 
92  if ($this->page_id) {
93  $page = $this->getPageInstance($this->page_id);
94  $title = $page->getTitle();
95  if ($page->getType() == ilPortfolioPage::TYPE_BLOG) {
96  $title = ilObject::_lookupTitle($title);
97  }
98  $this->ctrl->setParameterByClass($this->getPageGUIClassName(), "ppage", $this->page_id);
99  $ilLocator->addItem(
100  $title,
101  $this->ctrl->getLinkTargetByClass($this->getPageGUIClassName(), "edit")
102  );
103  }
104  }
static _lookupTitle($a_id)
lookup object title
getPageInstance($a_page_id=null, $a_portfolio_id=null)
+ Here is the call graph for this function:

◆ addPage()

ilObjPortfolioBaseGUI::addPage ( )
protected

Show portfolio page creation form.

Definition at line 363 of file class.ilObjPortfolioBaseGUI.php.

References $help, and initPageForm().

364  {
365  $ilHelp = $this->help;
366 
367  $this->tabs_gui->clearTargets();
368  $this->tabs_gui->setBackTarget(
369  $this->lng->txt("back"),
370  $this->ctrl->getLinkTarget($this, "view")
371  );
372 
373  $ilHelp->setScreenIdComponent("prtf");
374  $ilHelp->setScreenId("add_page");
375 
376 
377  $form = $this->initPageForm("create");
378  $this->tpl->setContent($form->getHTML());
379  }
initPageForm($a_mode="create")
Init portfolio page form.
+ Here is the call graph for this function:

◆ confirmPortfolioPageDeletion()

ilObjPortfolioBaseGUI::confirmPortfolioPageDeletion ( )

Confirm portfolio deletion.

Definition at line 526 of file class.ilObjPortfolioBaseGUI.php.

References ilObject\_lookupTitle(), getPageInstance(), ilUtil\sendInfo(), and ilPortfolioPage\TYPE_BLOG.

527  {
528  $prtf_pages = $_REQUEST["prtf_pages"];
529 
530  if (!is_array($prtf_pages) || count($prtf_pages) == 0) {
531  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
532  $this->ctrl->redirect($this, "view");
533  } else {
534  $this->tabs_gui->activateTab("pages");
535 
536  $cgui = new ilConfirmationGUI();
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");
541 
542  foreach ($prtf_pages as $id) {
543  $id = (int) $id;
544  $page = $this->getPageInstance((int) $id);
545  if ($page->getPortfolioId() != $this->object->getId()) {
546  continue;
547  }
548 
549  $title = $page->getTitle();
550  if ($page->getType() == ilPortfolioPage::TYPE_BLOG) {
551  $title = $this->lng->txt("obj_blog") . ": " . ilObject::_lookupTitle((int) $title);
552  }
553  $cgui->addItem("prtf_pages[]", $id, $title);
554  }
555 
556  $this->tpl->setContent($cgui->getHTML());
557  }
558  }
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Confirmation screen class.
+ Here is the call graph for this function:

◆ copyPage()

ilObjPortfolioBaseGUI::copyPage ( )

Definition at line 904 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, $page_id, $source, copyPageForm(), getPageInstance(), initCopyPageForm(), and initCopyPageFormOptions().

905  {
906  $form = $this->initCopyPageForm();
907  if ($form->checkInput()) {
908  // existing
909  if ($form->getInput("target") == "old") {
910  $portfolio_id = $form->getInput("prtf");
911  }
912  // new
913  else {
914  $portfolio = new ilObjPortfolio();
915  $portfolio->setTitle($form->getInput("title"));
916  $portfolio->create();
917  $portfolio_id = $portfolio->getId();
918  }
919 
920  // copy page(s)
921  foreach ($_POST["prtf_pages"] as $page_id) {
922  $page_id = (int) $page_id;
923  $source = $this->getPageInstance($page_id);
924  $target = $this->getPageInstance(null, $portfolio_id);
925  $target->setXMLContent($source->copyXmlContent(true)); // copy mobs
926  $target->setType($source->getType());
927  $target->setTitle($source->getTitle());
928  $target->create();
929  }
930 
931  ilUtil::sendSuccess($this->lng->txt("prtf_pages_copied"), true);
932  $this->ctrl->redirect($this, "view");
933  }
934 
935  $form->setValuesByPost();
936  $this->copyPageForm($form);
937  }
getPageInstance($a_page_id=null, $a_portfolio_id=null)
$source
Definition: metadata.php:76
$_POST["username"]
copyPageForm($a_form=null)
Select target portfolio for page(s) copy.
+ Here is the call graph for this function:

◆ copyPageForm()

ilObjPortfolioBaseGUI::copyPageForm (   $a_form = null)

Select target portfolio for page(s) copy.

Definition at line 880 of file class.ilObjPortfolioBaseGUI.php.

References $page_id, initCopyPageForm(), and ilUtil\sendInfo().

Referenced by copyPage().

881  {
882  $prtf_pages = $_REQUEST["prtf_pages"];
883 
884  if (!is_array($prtf_pages) || count($prtf_pages) == 0) {
885  ilUtil::sendInfo($this->lng->txt("no_checkbox"), true);
886  $this->ctrl->redirect($this, "view");
887  } else {
888  $this->tabs_gui->activateTab("pages");
889 
890  if (!$a_form) {
891  $a_form = $this->initCopyPageForm();
892  }
893 
894  foreach ($prtf_pages as $page_id) {
895  $item = new ilHiddenInputGUI("prtf_pages[]");
896  $item->setValue((int) $page_id);
897  $a_form->addItem($item);
898  }
899 
900  $this->tpl->setContent($a_form->getHTML());
901  }
902  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a hidden form property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createStyle()

ilObjPortfolioBaseGUI::createStyle ( )

Definition at line 1048 of file class.ilObjPortfolioBaseGUI.php.

1049  {
1050  $this->ctrl->redirectByClass("ilobjstylesheetgui", "create");
1051  }

◆ deletePortfolioPages()

ilObjPortfolioBaseGUI::deletePortfolioPages ( )

Delete portfolio pages.

Definition at line 563 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, ilObject2GUI\checkPermissionBool(), and getPageInstance().

564  {
565  if (!$this->checkPermissionBool("write")) {
566  return;
567  }
568 
569  if (is_array($_POST["prtf_pages"])) {
570  foreach ($_POST["prtf_pages"] as $id) {
571  $id = (int) $id;
572  $page = $this->getPageInstance($id);
573  $page->delete();
574  }
575  }
576  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_page_deleted"), true);
577  $this->ctrl->redirect($this, "view");
578  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteStyle()

ilObjPortfolioBaseGUI::deleteStyle ( )

Definition at line 1058 of file class.ilObjPortfolioBaseGUI.php.

1059  {
1060  $this->ctrl->redirectByClass("ilobjstylesheetgui", "delete");
1061  }

◆ determinePageCall()

ilObjPortfolioBaseGUI::determinePageCall ( )
protected

Definition at line 106 of file class.ilObjPortfolioBaseGUI.php.

References $requested_ppage, $requested_user_page, and ilObject2GUI\checkPermissionBool().

Referenced by ilObjPortfolioTemplateGUI\executeCommand(), and ilObjPortfolioGUI\executeCommand().

107  {
108  // edit
109  if ($this->requested_ppage > 0) {
110  if (!$this->checkPermissionBool("write")) {
111  $this->ctrl->redirect($this, "view");
112  }
113 
114  $this->page_id = $this->requested_ppage;
115  $this->page_mode = "edit";
116  $this->ctrl->setParameter($this, "ppage", $this->page_id);
117  return true;
118  }
119  // preview
120  else {
121  $this->page_id = $this->requested_user_page;
122  $this->page_mode = "preview";
123  $this->ctrl->setParameter($this, "user_page", $this->page_id);
124  return false;
125  }
126  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editStyle()

ilObjPortfolioBaseGUI::editStyle ( )

Definition at line 1053 of file class.ilObjPortfolioBaseGUI.php.

1054  {
1055  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
1056  }

◆ editStyleProperties()

ilObjPortfolioBaseGUI::editStyleProperties ( )

Definition at line 978 of file class.ilObjPortfolioBaseGUI.php.

References ilObject2GUI\checkPermission(), initStylePropertiesForm(), and setSettingsSubTabs().

979  {
980  $this->checkPermission("write");
981 
982  $this->tabs_gui->activateTab("settings");
983  $this->setSettingsSubTabs("style");
984 
985  $form = $this->initStylePropertiesForm();
986  $this->tpl->setContent($form->getHTML());
987  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
+ Here is the call graph for this function:

◆ export()

ilObjPortfolioBaseGUI::export ( )

Definition at line 868 of file class.ilObjPortfolioBaseGUI.php.

References ilUtil\deliverFile().

869  {
870  $port_export = new \ILIAS\Portfolio\Export\PortfolioHtmlExport($this);
871  $zip = $port_export->exportHtml();
872 
873  ilUtil::deliverFile($zip, $this->object->getTitle() . ".zip", '', false, true);
874  }
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ getAdditional()

ilObjPortfolioBaseGUI::getAdditional ( )

Get Additonal Information.

Returns
array Additonal Information

Definition at line 186 of file class.ilObjPortfolioBaseGUI.php.

References $additional.

Referenced by ilObjPortfolioTemplateGUI\getPageGUIInstance(), and ilObjPortfolioGUI\getPageGUIInstance().

+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioBaseGUI::getEditFormCustomValues ( array &  $a_values)
protected

Definition at line 271 of file class.ilObjPortfolioBaseGUI.php.

272  {
273  $a_values["comments"] = $this->object->hasPublicComments();
274  $a_values["ppic"] = $this->object->hasProfilePicture();
275  /*
276  $a_values["bg_color"] = $this->object->getBackgroundColor();
277  $a_values["font_color"] = $this->object->getFontColor();
278  */
279  }

◆ getPageGUIClassName()

ilObjPortfolioBaseGUI::getPageGUIClassName ( )
abstract

Referenced by ilPortfolioPageTableGUI\__construct(), addLocatorItems(), and updateCustom().

+ Here is the caller graph for this function:

◆ getPageGUIInstance()

ilObjPortfolioBaseGUI::getPageGUIInstance (   $a_page_id)
abstractprotected

Referenced by handlePageCall(), preview(), and updateCustom().

+ Here is the caller graph for this function:

◆ getPageInstance()

ilObjPortfolioBaseGUI::getPageInstance (   $a_page_id = null,
  $a_portfolio_id = null 
)
abstractprotected

◆ handlePageCall()

ilObjPortfolioBaseGUI::handlePageCall (   $a_cmd)
protected

Definition at line 128 of file class.ilObjPortfolioBaseGUI.php.

References $ret, ilPortfolioPageGUI\EMBEDDED_NO_OUTPUT, ilObjStyleSheet\getEffectiveContentStyleId(), getPageGUIInstance(), ilObject2GUI\getType(), preview(), and setContentStyleSheet().

Referenced by ilObjPortfolioTemplateGUI\executeCommand(), and ilObjPortfolioGUI\executeCommand().

129  {
130  $this->tabs_gui->clearTargets();
131  $this->tabs_gui->setBackTarget(
132  $this->lng->txt("back"),
133  $this->ctrl->getLinkTarget($this, "view")
134  );
135 
136  if (!$this->page_id) {
137  $this->ctrl->redirect($this, "view");
138  }
139 
140  $page_gui = $this->getPageGUIInstance($this->page_id);
141 
142  // needed for editor
143  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
144  $this->object->getStyleSheetId(),
145  $this->getType()
146  ));
147 
148  $ret = $this->ctrl->forwardCommand($page_gui);
149 
150  if ($ret != "" && $ret !== true) {
151  // preview (fullscreen)
152  if ($this->page_mode == "preview") {
153  // embedded call which did not generate any output (e.g. calendar month navigation)
155  // suppress (portfolio) notes for blog postings
156  $this->preview(false, $ret, ($a_cmd != "previewEmbedded"));
157  } else {
158  $this->preview(false);
159  }
160  }
161  // edit
162  else {
163  $this->setContentStyleSheet();
164  if (is_string($ret)) {
165  $this->tpl->setContent($ret);
166  }
167  }
168  }
169  }
getType()
Functions that must be overwritten.
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
getPageGUIInstance($a_page_id)
$ret
Definition: parser.php:6
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioBaseGUI::initBlogForm ( )
abstractprotected

Referenced by addBlog().

+ Here is the caller graph for this function:

◆ initCopyPageForm()

ilObjPortfolioBaseGUI::initCopyPageForm ( )

Definition at line 941 of file class.ilObjPortfolioBaseGUI.php.

References initCopyPageFormOptions().

Referenced by copyPage(), and copyPageForm().

942  {
943  $form = new ilPropertyFormGUI();
944  $form->setFormAction($this->ctrl->getFormAction($this));
945  $form->setTitle($this->lng->txt("prtf_copy_page"));
946 
947  $this->initCopyPageFormOptions($form);
948 
949  $form->addCommandButton("copyPage", $this->lng->txt("save"));
950  $form->addCommandButton("view", $this->lng->txt("cancel"));
951 
952  return $form;
953  }
This class represents a property form user interface.
initCopyPageFormOptions(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioBaseGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
abstractprotected

Referenced by copyPage(), and initCopyPageForm().

+ Here is the caller graph for this function:

◆ initEditCustomForm()

ilObjPortfolioBaseGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Definition at line 228 of file class.ilObjPortfolioBaseGUI.php.

References $img, $section, ilPropertyFormGUI\addItem(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), and setSettingsSubTabs().

Referenced by ilObjPortfolioGUI\initEditForm().

229  {
230  $this->setSettingsSubTabs("properties");
231 
232 
233  // profile picture
234  $ppic = new ilCheckboxInputGUI($this->lng->txt("prtf_profile_picture"), "ppic");
235  $a_form->addItem($ppic);
236 
237  $prfa_set = new ilSetting("prfa");
238  if ($prfa_set->get("banner")) {
240 
241  $dimensions = " (" . $prfa_set->get("banner_width") . "x" .
242  $prfa_set->get("banner_height") . ")";
243 
244  $img = new ilImageFileInputGUI($this->lng->txt("prtf_banner") . $dimensions, "banner");
245  $a_form->addItem($img);
246 
247  // show existing file
248  $file = $this->object->getImageFullPath(true);
249  if ($file) {
250  $img->setImage($file);
251  }
252  }
253 
255  $section->setTitle($this->lng->txt('obj_features'));
256  $a_form->addItem($section);
257 
258  // comments
259  $comments = new ilCheckboxInputGUI($this->lng->txt("prtf_public_comments"), "comments");
260  $a_form->addItem($comments);
261 
262  /* #15000
263  $bg_color = new ilColorPickerInputGUI($this->lng->txt("prtf_background_color"), "bg_color");
264  $a_form->addItem($bg_color);
265 
266  $font_color = new ilColorPickerInputGUI($this->lng->txt("prtf_font_color"), "font_color");
267  $a_form->addItem($font_color);
268  */
269  }
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
$section
Definition: Utf8Test.php:83
static setPersonalWorkspaceQuotaCheck($a_value)
This class represents an image file property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPageForm()

ilObjPortfolioBaseGUI::initPageForm (   $a_mode = "create")

Init portfolio page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

Definition at line 387 of file class.ilObjPortfolioBaseGUI.php.

References ilPageLayout\activeLayouts(), ilPageLayout\MODULE_PORTFOLIO, ilFormPropertyGUI\setRequired(), and ilRadioOption\setTitle().

Referenced by addPage(), and savePage().

388  {
389  $form = new ilPropertyFormGUI();
390  $form->setFormAction($this->ctrl->getFormAction($this));
391 
392  // title
393  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
394  $ti->setMaxLength(200);
395  $ti->setRequired(true);
396  $form->addItem($ti);
397 
398  // save and cancel commands
399  if ($a_mode == "create") {
401  if ($templates) {
402  $use_template = new ilRadioGroupInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
403  $use_template->setRequired(true);
404  $form->addItem($use_template);
405 
406  $opt = new ilRadioOption($this->lng->txt("none"), 0);
407  $use_template->addOption($opt);
408 
409  foreach ($templates as $templ) {
410  $templ->readObject();
411 
412  $opt = new ilRadioOption($templ->getTitle() . $templ->getPreview(), $templ->getId());
413  $use_template->addOption($opt);
414  }
415  }
416 
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"));
421  } else {
422  /* edit is done directly in table gui
423  $form->setTitle($this->lng->txt("prtf_edit_page"));
424  $form->addCommandButton("updatePage", $this->lng->txt("save"));
425  $form->addCommandButton("view", $this->lng->txt("cancel"));
426  */
427  }
428 
429  return $form;
430  }
This class represents an option in a radio group.
setTitle($a_title)
Set Title.
This class represents a property form user interface.
This class represents a property in a property form.
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initStylePropertiesForm()

ilObjPortfolioBaseGUI::initStylePropertiesForm ( )

Definition at line 989 of file class.ilObjPortfolioBaseGUI.php.

References $_GET, $ilSetting, ilObjectGUI\$settings, ilObjStyleSheet\_getStandardStyles(), ilObjStyleSheet\_lookupStandard(), ilObject\_lookupTitle(), and ilNonEditableValueGUI\setValue().

Referenced by editStyleProperties().

990  {
992 
993  $this->lng->loadLanguageModule("style");
994 
995  $form = new ilPropertyFormGUI();
996 
997  $fixed_style = $ilSetting->get("fixed_content_style_id");
998  $style_id = $this->object->getStyleSheetId();
999 
1000  if ($fixed_style > 0) {
1001  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
1002  $st->setValue(ilObject::_lookupTitle($fixed_style) . " (" .
1003  $this->lng->txt("global_fixed") . ")");
1004  $form->addItem($st);
1005  } else {
1007  true,
1008  false,
1009  $_GET["ref_id"]
1010  );
1011 
1012  $st_styles[0] = $this->lng->txt("default");
1013  ksort($st_styles);
1014 
1015  if ($style_id > 0) {
1016  // individual style
1017  if (!ilObjStyleSheet::_lookupStandard($style_id)) {
1018  $st = new ilNonEditableValueGUI($this->lng->txt("style_current_style"));
1019  $st->setValue(ilObject::_lookupTitle($style_id));
1020  $form->addItem($st);
1021 
1022  // delete command
1023  $form->addCommandButton("editStyle", $this->lng->txt("style_edit_style"));
1024  $form->addCommandButton("deleteStyle", $this->lng->txt("style_delete_style"));
1025  }
1026  }
1027 
1028  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
1029  $style_sel = new ilSelectInputGUI(
1030  $this->lng->txt("style_current_style"),
1031  "style_id"
1032  );
1033  $style_sel->setOptions($st_styles);
1034  $style_sel->setValue($style_id);
1035  $form->addItem($style_sel);
1036 
1037  $form->addCommandButton("saveStyleSettings", $this->lng->txt("save"));
1038  $form->addCommandButton("createStyle", $this->lng->txt("sty_create_ind_style"));
1039  }
1040  }
1041 
1042  $form->setTitle($this->lng->txt($this->getType() . "_style"));
1043  $form->setFormAction($this->ctrl->getFormAction($this));
1044 
1045  return $form;
1046  }
This class represents a property form user interface.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
static _getStandardStyles( $a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static _lookupStandard($a_id)
Lookup standard flag.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview()

ilObjPortfolioBaseGUI::preview (   $a_return = false,
  $a_content = false,
  $a_show_notes = true 
)

Show user page.

Definition at line 583 of file class.ilObjPortfolioBaseGUI.php.

References $_GET, $a_content, $ilSetting, $ilUser, $main_menu, ilObject2GUI\$parent_id, $requested_back_url, $requested_user_page, ilObjectGUI\$settings, ilObject2GUI\$tree, ilObjectGUI\$user, $user_id, ilLink\_getStaticLink(), ilObject2\_lookupTitle(), ilObject2GUI\checkPermissionBool(), ilPortfolioPage\getAllPortfolioPages(), getPageGUIInstance(), ilObject2GUI\getType(), ilMainMenuGUI\MODE_TOPBAR_ONLY, setContentStyleSheet(), showEditButton(), and ilPortfolioPage\TYPE_BLOG.

Referenced by ilObjPortfolioGUI\executeCommand(), and handlePageCall().

584  {
587 
588  $portfolio_id = $this->object->getId();
589  $user_id = $this->object->getOwner();
590 
591  $this->tabs_gui->clearTargets();
592 
593  $pages = ilPortfolioPage::getAllPortfolioPages($portfolio_id);
594  $current_page = $this->requested_user_page;
595 
596  // validate current page
597  if ($pages && $current_page) {
598  $found = false;
599  foreach ($pages as $page) {
600  if ($page["id"] == $current_page) {
601  $found = true;
602  break;
603  }
604  }
605  if (!$found) {
606  $current_page = null;
607  }
608  }
609 
610  // display first page of portfolio if none given
611  if (!$current_page && $pages) {
612  $current_page = $pages;
613  $current_page = array_shift($current_page);
614  $current_page = $current_page["id"];
615  }
616 
617  // #13788 - keep page after login
618  if ($this->user_id == ANONYMOUS_USER_ID &&
619  $this->getType() == "prtf") {
620  $this->tpl->setLoginTargetPar("prtf_" . $this->object->getId() . "_" . $current_page);
621  }
622 
623  $back_caption = "";
624 
625  // public profile
626  if ($this->requested_back_url != "") {
628  } elseif ($_GET["baseClass"] != "ilPublicUserProfileGUI" &&
629  $this->user_id && $this->user_id != ANONYMOUS_USER_ID) {
630  if (!$this->checkPermissionBool("write")) {
631  // shared
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", "");
636  }
637  // listgui / parent container
638  else {
639  // #12819
640  $tree = $this->tree;
641  $parent_id = $tree->getParentId($this->node_id);
643  }
644  }
645  // owner
646  else {
647  $back = $this->ctrl->getLinkTarget($this, "view");
648  if ($this->getType() == "prtf") {
649  $back_caption = $this->lng->txt("prtf_back_to_portfolio_owner");
650  } else {
651  // #19316
652  $this->lng->loadLanguageModule("prtt");
653  $back_caption = $this->lng->txt("prtt_edit");
654  }
655  }
656  }
657 
658  $ilMainMenu = $this->main_menu;
659  $ilMainMenu->setMode(ilMainMenuGUI::MODE_TOPBAR_ONLY);
660  if ($back) {
661  // might already be set in ilPublicUserProfileGUI
662  $ilMainMenu->setTopBarBack($back, $back_caption);
663  }
664 
665  // render tabs
666  $current_blog = null;
667  if (count($pages) > 1) {
668  foreach ($pages as $p) {
669  if ($p["type"] == ilPortfolioPage::TYPE_BLOG) {
670  // needed for blog comments (see below)
671  if ($p["id"] == $current_page) {
672  $current_blog = (int) $p["title"];
673  }
674  $p["title"] = ilObjBlog::_lookupTitle($p["title"]);
675  }
676 
677  $this->ctrl->setParameter($this, "user_page", $p["id"]);
678  $this->tabs_gui->addTab(
679  "user_page_" . $p["id"],
680  $p["title"],
681  $this->ctrl->getLinkTarget($this, "preview")
682  );
683  }
684 
685  $this->tabs_gui->activateTab("user_page_" . $current_page);
686  }
687 
688  $this->ctrl->setParameter($this, "user_page", $current_page);
689 
690  if (!$a_content) {
691  // #18291
692  if ($current_page) {
693  // get current page content
694  $page_gui = $this->getPageGUIInstance($current_page);
695  $page_gui->setEmbedded(true);
696 
697  $content = $this->ctrl->getHTML($page_gui);
698  }
699  } else {
700  $content = $a_content;
701  }
702 
703  if ($a_return && $this->checkPermissionBool("write")) {
704  return $content;
705  }
706 
707  // blog posting comments are handled within the blog
708  $notes = "";
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);
714 
715  $note_gui->enablePublicNotesDeletion(($this->user_id == $user_id) &&
716  $ilSetting->get("comments_del_tutor", 1));
717 
718  $next_class = $this->ctrl->getNextClass($this);
719  if ($next_class == "ilnotegui") {
720  $notes = $this->ctrl->forwardCommand($note_gui);
721  } else {
722  $notes = $note_gui->getNotesHTML();
723  }
724  }
725 
726  if ($this->perma_link === null) {
727  if ($this->getType() == "prtf") {
728  $this->tpl->setPermanentLink($this->getType(), $this->object->getId(), "_" . $current_page);
729  } else {
730  $this->tpl->setPermanentLink($this->getType(), $this->object->getRefId());
731  }
732  } else {
733  $this->tpl->setPermanentLink($this->perma_link["type"], $this->perma_link["obj_id"]);
734  }
735 
736  // #18208 - see ilPortfolioTemplatePageGUI::getPageContentUserId()
737  if ($this->getType() == "prtt" && !$this->checkPermissionBool("write")) {
738  $user_id = $ilUser->getId();
739  }
740 
741  self::renderFullscreenHeader($this->object, $this->tpl, $user_id);
742 
743  // #13564
744  $this->ctrl->setParameter($this, "user_page", "");
745  //$this->tpl->setTitleUrl($this->ctrl->getLinkTarget($this, "preview"));
746  $this->ctrl->setParameter($this, "user_page", $this->page_id);
747 
748  // blog pages do their own (page) style handling
749  if (!$current_blog) {
750  $content = '<div id="ilCOPageContent" class="ilc_page_cont_PageContainer">' .
751  '<div class="ilc_page_Page">' .
752  $content .
753  '</div></div>';
754 
755  $this->setContentStyleSheet($this->tpl);
756  }
757 
758  $this->showEditButton($current_page);
759 
760  // #10717
761  $this->tpl->setContent($content .
762  '<div class="ilClearFloat">' . $notes . '</div>');
763  }
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static _lookupTitle($a_id)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$_GET["client_id"]
Notes GUI class.
$a_content
Definition: workflow.php:93
getType()
Functions that must be overwritten.
showEditButton($page_id)
Show edit button.
$ilUser
Definition: imgupload.php:18
getPageGUIInstance($a_page_id)
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderFullscreenHeader()

static ilObjPortfolioBaseGUI::renderFullscreenHeader (   $a_portfolio,
  $a_tpl,
  $a_user_id,
  $a_export = false 
)
static

Render banner, user name.

Parameters
object$a_tpl
int$a_user_id
bool$a_export_path

Definition at line 811 of file class.ilObjPortfolioBaseGUI.php.

References $DIC, $ilUser, $name, ilObjUser\_getPersonalPicturePath(), ilObjUser\_lookupName(), ilChangeEvent\_recordReadEvent(), and ilWACSignedPath\signFile().

812  {
813  global $DIC;
814 
815  $ilUser = $DIC->user();
816 
817  if (!$a_export) {
819  $a_portfolio->getType(),
820  ($a_portfolio->getType() == "prtt")
821  ? $a_portfolio->getRefId()
822  : $a_portfolio->getId(),
823  $a_portfolio->getId(),
824  $ilUser->getId()
825  );
826  }
827 
828  $name = ilObjUser::_lookupName($a_user_id);
829  $name = $name["lastname"] . ", " . ($t = $name["title"] ? $t . " " : "") . $name["firstname"];
830 
831  // show banner?
832  $banner = $banner_width = $banner_height = false;
833  $prfa_set = new ilSetting("prfa");
834  if ($prfa_set->get("banner")) {
835  $banner = ilWACSignedPath::signFile($a_portfolio->getImageFullPath());
836  $banner_width = $prfa_set->get("banner_width");
837  $banner_height = $prfa_set->get("banner_height");
838  if ($a_export) {
839  $banner = basename($banner);
840  }
841  }
842 
843  // profile picture
844  $ppic = null;
845  if ($a_portfolio->hasProfilePicture()) {
846  $ppic = ilObjUser::_getPersonalPicturePath($a_user_id, "xsmall", true, true);
847  if ($a_export) {
848  $ppic = basename($ppic);
849  }
850  }
851 
852  $a_tpl->resetHeaderBlock(false);
853  // $a_tpl->setBackgroundColor($a_portfolio->getBackgroundColor());
854  // @todo fix this
855  $a_tpl->setBanner($banner, $banner_width, $banner_height, $a_export);
856  $a_tpl->setTitleIcon($ppic);
857  $a_tpl->setTitle($a_portfolio->getTitle());
858  // $a_tpl->setTitleColor($a_portfolio->getFontColor());
859  $a_tpl->setDescription($name);
860 
861  // to get rid of locator in portfolio template preview
862  $a_tpl->setVariable("LOCATOR", "");
863 
864  // :TODO: obsolete?
865  // $a_tpl->setBodyClass("std ilExternal ilPortfolio");
866  }
static _lookupName($a_user_id)
lookup user name
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.
if($format !==null) $name
Definition: metadata.php:230
$ilUser
Definition: imgupload.php:18
static signFile($path_to_file)
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioBaseGUI::saveBlog ( )
abstractprotected

Referenced by addBlog().

+ Here is the caller graph for this function:

◆ savePage()

ilObjPortfolioBaseGUI::savePage ( )

Create new portfolio page.

Definition at line 435 of file class.ilObjPortfolioBaseGUI.php.

References ilObject2GUI\checkPermissionBool(), getPageInstance(), initPageForm(), and ilPortfolioPage\TYPE_PAGE.

436  {
437  $form = $this->initPageForm("create");
438  if ($form->checkInput() && $this->checkPermissionBool("write")) {
439  $page = $this->getPageInstance();
440  $page->setType(ilPortfolioPage::TYPE_PAGE);
441  $page->setTitle($form->getInput("title"));
442 
443  // use template as basis
444  $layout_id = $form->getInput("tmpl");
445  if ($layout_id) {
446  $layout_obj = new ilPageLayout($layout_id);
447  $page->setXMLContent($layout_obj->getXMLContent());
448  }
449 
450  $page->create();
451 
452  ilUtil::sendSuccess($this->lng->txt("prtf_page_created"), true);
453  $this->ctrl->redirect($this, "view");
454  }
455 
456  $this->tabs_gui->clearTargets();
457  $this->tabs_gui->setBackTarget(
458  $this->lng->txt("back"),
459  $this->ctrl->getLinkTarget($this, "view")
460  );
461 
462  $form->setValuesByPost();
463  $this->tpl->setContent($form->getHtml());
464  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
Class ilPageLayout.
initPageForm($a_mode="create")
Init portfolio page form.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
+ Here is the call graph for this function:

◆ savePortfolioPagesOrdering()

ilObjPortfolioBaseGUI::savePortfolioPagesOrdering ( )

Save ordering of portfolio pages.

Definition at line 493 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, ilObject2GUI\checkPermissionBool(), ilPortfolioPage\fixOrdering(), getPageInstance(), and ilUtil\stripSlashes().

494  {
495  if (!$this->checkPermissionBool("write")) {
496  return;
497  }
498 
499  $title_changes = array();
500 
501  if (is_array($_POST["order"])) {
502  foreach ($_POST["order"] as $k => $v) {
503  $page = $this->getPageInstance(ilUtil::stripSlashes($k));
504  if ($_POST["title"][$k]) {
505  $new_title = trim(ilUtil::stripSlashes($_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);
509  }
510  }
511  $page->setOrderNr(ilUtil::stripSlashes($v));
512  $page->update();
513  }
514  ilPortfolioPage::fixOrdering($this->object->getId());
515  }
516 
517  $this->object->fixLinksOnTitleChange($title_changes);
518 
519  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
520  $this->ctrl->redirect($this, "view");
521  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static fixOrdering($a_portfolio_id)
Fix ordering.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getPageInstance($a_page_id=null, $a_portfolio_id=null)
$_POST["username"]
+ Here is the call graph for this function:

◆ saveStyleSettings()

ilObjPortfolioBaseGUI::saveStyleSettings ( )

Definition at line 1063 of file class.ilObjPortfolioBaseGUI.php.

References $_POST, $ilSetting, ilObjectGUI\$settings, ilObjStyleSheet\_lookupStandard(), and ilUtil\stripSlashes().

1064  {
1066 
1067  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1068  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1069  || $this->object->getStyleSheetId() == 0)) {
1070  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1071  $this->object->update();
1072 
1073  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1074  }
1075  $this->ctrl->redirect($this, "editStyleProperties");
1076  }
static _lookupStandard($a_id)
Lookup standard flag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ setAdditional()

ilObjPortfolioBaseGUI::setAdditional (   $a_additional)

Set Additonal Information (used in public profile?)

Parameters
array$a_additionalAdditonal Information

Definition at line 176 of file class.ilObjPortfolioBaseGUI.php.

177  {
178  $this->additional = $a_additional;
179  }

◆ setContentStyleSheet()

ilObjPortfolioBaseGUI::setContentStyleSheet (   $a_tpl = null)

Definition at line 960 of file class.ilObjPortfolioBaseGUI.php.

References ilObjectGUI\$tpl, and ilObjStyleSheet\getContentStylePath().

Referenced by handlePageCall(), and preview().

961  {
962  $tpl = $this->tpl;
963 
964  if ($a_tpl != null) {
965  $ctpl = $a_tpl;
966  } else {
967  $ctpl = $tpl;
968  }
969 
970  $ctpl->setCurrentBlock("ContentStyle");
971  $ctpl->setVariable(
972  "LOCATION_CONTENT_STYLESHEET",
973  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId())
974  );
975  $ctpl->parseCurrentBlock();
976  }
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPermaLink()

ilObjPortfolioBaseGUI::setPermaLink (   $a_obj_id,
  $a_type 
)

Set custom perma link (used in public profile?)

Parameters
int$a_obj_id
string$a_type

Definition at line 197 of file class.ilObjPortfolioBaseGUI.php.

References $a_type.

198  {
199  $this->perma_link = array("obj_id" => $a_obj_id, "type" => $a_type);
200  }
$a_type
Definition: workflow.php:92

◆ setSettingsSubTabs()

ilObjPortfolioBaseGUI::setSettingsSubTabs (   $a_active)
protected

Definition at line 207 of file class.ilObjPortfolioBaseGUI.php.

References ilObject2GUI\getType().

Referenced by editStyleProperties(), and initEditCustomForm().

208  {
209  // #17455
210  $this->lng->loadLanguageModule($this->getType());
211 
212  // general properties
213  $this->tabs_gui->addSubTab(
214  "properties",
215  $this->lng->txt($this->getType() . "_properties"),
216  $this->ctrl->getLinkTarget($this, 'edit')
217  );
218 
219  $this->tabs_gui->addSubTab(
220  "style",
221  $this->lng->txt("obj_sty"),
222  $this->ctrl->getLinkTarget($this, 'editStyleProperties')
223  );
224 
225  $this->tabs_gui->activateSubTab($a_active);
226  }
getType()
Functions that must be overwritten.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showEditButton()

ilObjPortfolioBaseGUI::showEditButton (   $page_id)
protected

Show edit button.

Definition at line 769 of file class.ilObjPortfolioBaseGUI.php.

References $_GET, $page_id, ilObject2GUI\checkPermissionBool(), ilObject2GUI\getType(), ilPortfolioPage\lookupType(), ilPortfolioPage\TYPE_PAGE, and ui().

Referenced by preview().

770  {
771  if ($page_id == 0) {
772  return;
773  }
774  $page_class = ($this->getType() == "prtt")
775  ? "ilPortfolioTemplatePageGUI"
776  : "ilportfoliopagegui";
777  $button = null;
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")
783  );
784  } else {
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")
791  );
792  } else { // portfolio template, blog page cannot be edited -> link to overview
793  $button = $this->ui->factory()->button()->standard(
794  $this->lng->txt("edit"),
795  $this->ctrl->getLinkTargetByClass(["ilobjportfoliotemplategui"], "view")
796  );
797  }
798  }
799  if ($button && $this->checkPermissionBool("write")) {
800  $this->tpl->setHeaderActionMenu($this->ui->renderer()->render($button));
801  }
802  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$_GET["client_id"]
static lookupType($a_page_id)
Lookup type.
getType()
Functions that must be overwritten.
ui()
Definition: ui.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjPortfolioBaseGUI::updateCustom ( ilPropertyFormGUI  $a_form)

Definition at line 281 of file class.ilObjPortfolioBaseGUI.php.

References ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), getPageGUIClassName(), getPageGUIInstance(), and getPageInstance().

282  {
283  $this->object->setPublicComments($a_form->getInput("comments"));
284  $this->object->setProfilePicture($a_form->getInput("ppic"));
285  /*
286  $this->object->setBackgroundColor($a_form->getInput("bg_color"));
287  $this->object->setFontcolor($a_form->getInput("font_color"));
288  */
289 
290  $prfa_set = new ilSetting("prfa");
291 
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();
296  }
297  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ view()

ilObjPortfolioBaseGUI::view ( )

Show list of portfolio pages.

Definition at line 313 of file class.ilObjPortfolioBaseGUI.php.

References $ilSetting, $message, ilObjectGUI\$settings, ilObjectGUI\$toolbar, ilObject2GUI\$tree, ilObject2GUI\checkPermissionBool(), ilLinkButton\getInstance(), and ilObject2GUI\getType().

314  {
315  $ilToolbar = $this->toolbar;
317  $tree = $this->tree;
318 
319  if (!$this->checkPermissionBool("write")) {
320  $this->ctrl->redirect($this, "infoScreen");
321  }
322 
323  $this->tabs_gui->activateTab("pages");
324 
325 
326  $button = ilLinkButton::getInstance();
327  $button->setCaption("prtf_add_page");
328  $button->setUrl($this->ctrl->getLinkTarget($this, "addPage"));
329  $ilToolbar->addStickyItem($button);
330 
331  if (!$ilSetting->get('disable_wsp_blogs')) {
332  $button = ilLinkButton::getInstance();
333  $button->setCaption("prtf_add_blog");
334  $button->setUrl($this->ctrl->getLinkTarget($this, "addBlog"));
335  $ilToolbar->addStickyItem($button);
336  }
337 
338 
339  // #16571
340  if ($this->getType() == "prtf") {
341  $ilToolbar->addSeparator();
342 
343  $button = ilLinkButton::getInstance();
344  $button->setCaption("export_html");
345  $button->setUrl($this->ctrl->getLinkTarget($this, "export"));
346  $ilToolbar->addButtonInstance($button);
347 
348  $button = ilLinkButton::getInstance();
349  $button->setCaption("prtf_pdf");
350  $button->setUrl($this->ctrl->getLinkTarget($this, "exportPDFSelection"));
351  $ilToolbar->addButtonInstance($button);
352  }
353 
354  $table = new ilPortfolioPageTableGUI($this, "view");
355 
356 
357  $this->tpl->setContent($message . $table->getHTML());
358  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getType()
Functions that must be overwritten.
global $ilSetting
Definition: privfeed.php:17
$message
Definition: xapiexit.php:14
+ Here is the call graph for this function:

Field Documentation

◆ $additional

ilObjPortfolioBaseGUI::$additional = array()
protected

Definition at line 23 of file class.ilObjPortfolioBaseGUI.php.

Referenced by getAdditional().

◆ $help

ilObjPortfolioBaseGUI::$help
protected

Definition at line 15 of file class.ilObjPortfolioBaseGUI.php.

Referenced by addBlog(), and addPage().

◆ $main_menu

ilObjPortfolioBaseGUI::$main_menu
protected

Definition at line 20 of file class.ilObjPortfolioBaseGUI.php.

Referenced by preview().

◆ $page_id

ilObjPortfolioBaseGUI::$page_id
protected

Definition at line 25 of file class.ilObjPortfolioBaseGUI.php.

Referenced by copyPage(), copyPageForm(), and showEditButton().

◆ $page_mode

ilObjPortfolioBaseGUI::$page_mode
protected

Definition at line 26 of file class.ilObjPortfolioBaseGUI.php.

◆ $perma_link

ilObjPortfolioBaseGUI::$perma_link
protected

Definition at line 24 of file class.ilObjPortfolioBaseGUI.php.

◆ $requested_back_url

ilObjPortfolioBaseGUI::$requested_back_url = ""
protected

Definition at line 41 of file class.ilObjPortfolioBaseGUI.php.

Referenced by preview().

◆ $requested_ppage

ilObjPortfolioBaseGUI::$requested_ppage
protected

Definition at line 31 of file class.ilObjPortfolioBaseGUI.php.

Referenced by determinePageCall().

◆ $requested_user_page

ilObjPortfolioBaseGUI::$requested_user_page
protected

Definition at line 36 of file class.ilObjPortfolioBaseGUI.php.

Referenced by determinePageCall(), and preview().

◆ $user_id

ilObjPortfolioBaseGUI::$user_id
protected

Definition at line 22 of file class.ilObjPortfolioBaseGUI.php.

Referenced by preview().


The documentation for this class was generated from the following file: