ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjPortfolioGUI Class Reference

Portfolio view gui class. More...

+ Inheritance diagram for ilObjPortfolioGUI:
+ Collaboration diagram for ilObjPortfolioGUI:

Public Member Functions

 __construct ($a_id=0)
 
 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 execute command More...
 
 save ()
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 getPageGUIClassName ()
 
 initBlogForm ()
 Init blog page form. More...
 
 saveBlog ()
 Create new portfolio blog page. More...
 
- Public Member Functions inherited from ilObjPortfolioBaseGUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 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)
 Insert custom update form values into object. More...
 
 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)
 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...
 
 isVisible ()
 
 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...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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 ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObjPortfolioBaseGUI
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

 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 addLocator ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 toRepository ()
 
 initEditForm ()
 Init object edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 Get portfolio template page instance. More...
 
 getPageGUIInstance ($a_page_id)
 Get portfolio template page gui instance. More...
 
 initCopyPageFormOptions (ilFormPropertyGUI $a_tgt)
 
 createPortfolioFromTemplate (ilPropertyFormGUI $a_form=null)
 
 initCreatePortfolioFromTemplateForm ($a_prtt_id, $a_title)
 
 createPortfolioFromTemplateProcess ($a_process_form=true)
 
- Protected Member Functions inherited from ilObjPortfolioBaseGUI
 addLocatorItems ()
 Functions to be overwritten. More...
 
 determinePageCall ()
 
 handlePageCall ($a_cmd)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 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 ()
 
 initCopyPageFormOptions (ilFormPropertyGUI $a_tgt)
 
- 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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ()
 
 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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)
 Activate rating automatically if parent container setting. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 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...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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

 $ws_access
 
- Protected Attributes inherited from ilObjPortfolioBaseGUI
 $user_id
 
 $additional = array()
 
 $perma_link
 
 $page_id
 
 $page_mode
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

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
 
 $ilias
 
 $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

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioGUI::__construct (   $a_id = 0)

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

23 {
24 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
25 }

Member Function Documentation

◆ _goto()

static ilObjPortfolioGUI::_goto (   $a_target)
static

Definition at line 934 of file class.ilObjPortfolioGUI.php.

935 {
936 $id = explode("_", $a_target);
937
938 $_GET["baseClass"] = "ilsharedresourceGUI";
939 $_GET["prt_id"] = $id[0];
940 if(sizeof($id) == 2)
941 {
942 $_GET["gtp"] = $id[1];
943 }
944
945 include("ilias.php");
946 exit;
947 }
$_GET["client_id"]
exit
Definition: login.php:54

References $_GET, and exit.

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

Definition at line 175 of file class.ilObjPortfolioGUI.php.

176 {
177 if(!$this->creation_mode)
178 {
179 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
180 }
181
182 parent::addLocatorItems();
183
184 $this->tpl->setLocator();
185 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterSave()

ilObjPortfolioGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

Definition at line 379 of file class.ilObjPortfolioGUI.php.

380 {
381 // create 1st page / blog
382 include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
383 $page = $this->getPageInstance(null, $a_new_object->getId());
384 if($_POST["ptype"] == "page")
385 {
386 $page->setType(ilPortfolioPage::TYPE_PAGE);
387 $page->setTitle($_POST["fpage"]);
388
389 // use template as basis
390 $layout_id = $_POST["tmpl"];
391 if($layout_id)
392 {
393 include_once("./Services/Style/classes/class.ilPageLayout.php");
394 $layout_obj = new ilPageLayout($layout_id);
395 $page->setXMLContent($layout_obj->getXMLContent());
396 }
397 }
398 else
399 {
400 $page->setType(ilPortfolioPage::TYPE_BLOG);
401 $page->setTitle($_POST["blog"]);
402 }
403 $page->create();
404
405 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
406 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
407 $this->ctrl->redirect($this, "view");
408 }
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
getId()
get object id @access public
Class ilPageLayout.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, ilObject\getId(), getPageInstance(), ilUtil\sendSuccess(), ilPortfolioPage\TYPE_BLOG, and ilPortfolioPage\TYPE_PAGE.

+ Here is the call graph for this function:

◆ checkPermissionBool()

ilObjPortfolioGUI::checkPermissionBool (   $a_perm,
  $a_cmd = "",
  $a_type = "",
  $a_node_id = null 
)
protected

Check permission.

Parameters
string$a_perm
string$a_cmd
string$a_type
int$a_node_id
Returns
bool

Reimplemented from ilObject2GUI.

Definition at line 32 of file class.ilObjPortfolioGUI.php.

33 {
34 if($a_perm == "create")
35 {
36 return true;
37 }
38 if(!$a_node_id)
39 {
40 $a_node_id = $this->obj_id;
41 }
42 return $this->access_handler->checkAccess($a_perm, "", $a_node_id);
43 }

References ilObjectGUI\$obj_id.

Referenced by executeCommand(), and setTabs().

+ Here is the caller graph for this function:

◆ createPortfolioFromTemplate()

ilObjPortfolioGUI::createPortfolioFromTemplate ( ilPropertyFormGUI  $a_form = null)
protected

Definition at line 643 of file class.ilObjPortfolioGUI.php.

644 {
645 $title = trim($_REQUEST["pt"]);
646 $prtt_id = (int)$_REQUEST["prtt"];
647
648 // valid template?
649 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
651 if(!sizeof($templates) || !in_array($prtt_id, $templates))
652 {
653 $this->toRepository();
654 }
655 unset($templates);
656
657 $this->ctrl->setParameter($this, "prtt", $prtt_id);
658
659 if(!$a_form)
660 {
661 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
662 }
663 if($a_form)
664 {
665 $this->tpl->setContent($a_form->getHTML());
666 }
667 else
668 {
670 }
671 }
createPortfolioFromTemplateProcess($a_process_form=true)
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
static getAvailablePortfolioTemplates($a_permission="read")
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_REQUEST, createPortfolioFromTemplateProcess(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initCreatePortfolioFromTemplateForm(), and toRepository().

Referenced by createPortfolioFromTemplateProcess(), and save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioFromTemplateProcess()

ilObjPortfolioGUI::createPortfolioFromTemplateProcess (   $a_process_form = true)
protected

Definition at line 833 of file class.ilObjPortfolioGUI.php.

834 {
835 global $ilSetting, $ilUser, $ilAccess;
836
837 $title = trim($_REQUEST["pt"]);
838 $prtt_id = (int)$_REQUEST["prtt"];
839
840 // valid template?
841 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
843 if(!sizeof($templates) || !in_array($prtt_id, $templates))
844 {
845 $this->toRepository();
846 }
847 unset($templates);
848
849 // build page recipe (aka import form values)
850 $recipe = null;
851 if($a_process_form)
852 {
853 $this->ctrl->setParameter($this, "prtt", $prtt_id);
854
855 $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
856 if($form->checkInput())
857 {
858 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
859 foreach(ilPortfolioTemplatePage::getAllPages($prtt_id) as $page)
860 {
861 switch($page["type"])
862 {
864 if(!$ilSetting->get('disable_wsp_blogs'))
865 {
866 $field_id = "blog_".$page["id"];
867 switch($form->getInput($field_id))
868 {
869 case "blog_create":
870 $recipe[$page["id"]] = array("blog", "create",
871 trim($form->getInput($field_id."_create_title")));
872 break;
873
874 case "blog_resuse":
875 $recipe[$page["id"]] = array("blog", "reuse",
876 (int)$form->getInput($field_id."_reuse_blog"));
877 break;
878
879 case "blog_ignore":
880 $recipe[$page["id"]] = array("blog", "ignore");
881 break;
882 }
883 }
884 break;
885 }
886 }
887
888 $recipe["skills"] = (array)$form->getInput("skill_ids");
889 }
890 else
891 {
892 $form->setValuesByPost();
893 return $this->createPortfolioFromTemplate($form);
894 }
895 }
896
897 $source = new ilObjPortfolioTemplate($prtt_id, false);
898
899 // create portfolio
900 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
901 $target = new ilObjPortfolio();
902 $target->setTitle($title);
903 $target->create();
904 $target_id = $target->getId();
905
906 $source->clonePagesAndSettings($source, $target, $recipe);
907
908 // link portfolio to exercise assignment
909 $exc_ref_id = (int)$_REQUEST["exc_id"];
910 $ass_id = (int)$_REQUEST["ass_id"];
911 if($exc_ref_id &&
912 $ass_id &&
913 $ilAccess->checkAccess("read", "", $exc_ref_id))
914 {
915 include_once "Modules/Exercise/classes/class.ilObjExercise.php";
916 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
917 $exc = new ilObjExercise($exc_ref_id);
918 $ass = new ilExAssignment($ass_id);
919 if($ass->getExerciseId() == $exc->getId() &&
920 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO)
921 {
922 // #16205
923 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
924 $sub = new ilExSubmission($ass, $ilUser->getId());
925 $sub->addResourceObject($target_id);
926 }
927 }
928
929 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
930 $this->ctrl->setParameter($this, "prt_id", $target_id);
931 $this->ctrl->redirect($this, "view");
932 }
Exercise assignment.
Exercise submission.
Class ilObjExercise.
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
static getAllPages($a_portfolio_id)
Get pages of portfolio.
$target_id
Definition: goto.php:88
global $ilSetting
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

References $_REQUEST, $ilSetting, $ilUser, $target_id, createPortfolioFromTemplate(), ilPortfolioPage\getAllPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initCreatePortfolioFromTemplateForm(), ilUtil\sendSuccess(), toRepository(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilExAssignment\TYPE_PORTFOLIO.

Referenced by createPortfolioFromTemplate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

Definition at line 45 of file class.ilObjPortfolioGUI.php.

46 {
47 $this->checkPermission("read");
48
49 // goto link to portfolio page
50 if($_GET["gtp"])
51 {
52 $_GET["user_page"] = $_GET["gtp"];
53 }
54
56
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd("view");
59
60 /*
61 if($_REQUEST["ecal"])
62 {
63 $cmd = "preview";
64 $next_class = "";
65 }
66 */
67
68 switch($next_class)
69 {
70 case "ilworkspaceaccessgui";
71 if($this->checkPermissionBool("write"))
72 {
73 $this->setTabs();
74 $this->tabs_gui->activateTab("share");
75
76 $this->tpl->setPermanentLink("prtf", $this->object->getId());
77
78 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
79 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true, $plink);
80 $this->ctrl->forwardCommand($wspacc);
81 }
82 break;
83
84 case 'ilportfoliopagegui':
85 if($this->determinePageCall())
86 {
87 // only in edit mode
88 $this->addLocator();
89
90 include_once "Services/Form/classes/class.ilFileInputGUI.php";
92 }
93 $this->handlePageCall($cmd);
94 break;
95
96 case "ilnotegui";
97 $this->preview();
98 break;
99
100 case "ilobjstylesheetgui":
101 include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
102 $this->ctrl->setReturn($this, "editStyleProperties");
103 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
104 $style_gui->omitLocator();
105 if ($cmd == "create" || $_GET["new_type"]=="sty")
106 {
107 $style_gui->setCreationMode(true);
108 }
109
110 if ($cmd == "confirmedDelete")
111 {
112 $this->object->setStyleSheetId(0);
113 $this->object->update();
114 }
115
116 $ret = $this->ctrl->forwardCommand($style_gui);
117
118 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
119 {
120 $style_id = $ret;
121 $this->object->setStyleSheetId($style_id);
122 $this->object->update();
123 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
124 }
125 break;
126
127 case "ilportfolioexercisegui":
128 $this->ctrl->setReturn($this, "view");
129 include_once "Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
130 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
131 $this->ctrl->forwardCommand($gui);
132 break;
133
134 default:
135
136 if($cmd != "preview")
137 {
138 $this->addLocator();
139 $this->setTabs();
140 }
141 $this->$cmd();
142 break;
143 }
144
145 return true;
146 }
setPersonalWorkspaceQuotaCheck($a_value)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
setTitleAndDescription()
called by prepare output
setTabs()
create tabs (repository/workspace switch)
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
Class ilObjStyleSheetGUI.
checkPermission($a_perm, $a_cmd="")
Class ilPortfolioExerciseGUI.
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ret, addLocator(), ilObject2GUI\checkPermission(), checkPermissionBool(), ilObjPortfolioBaseGUI\determinePageCall(), ilObjPortfolioBaseGUI\handlePageCall(), ilObjPortfolioBaseGUI\preview(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), setTabs(), and setTitleAndDescription().

+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 462 of file class.ilObjPortfolioGUI.php.

463 {
464 $a_values["online"] = $this->object->isOnline();
465
466 parent::getEditFormCustomValues($a_values);
467 }

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

Reimplemented from ilObjPortfolioBaseGUI.

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

527 {
528 return "ilportfoliopagegui";
529 }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance (   $a_page_id)
protected

Get portfolio template page gui instance.

Parameters
int$a_page_id
Returns
ilPortfolioPageGUI

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 513 of file class.ilObjPortfolioGUI.php.

514 {
515 include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
516 $page_gui = new ilPortfolioPageGUI(
517 $this->object->getId(),
518 $a_page_id,
519 0,
520 $this->object->hasPublicComments()
521 );
522 $page_gui->setAdditional($this->getAdditional());
523 return $page_gui;
524 }
getAdditional()
Get Additonal Information.
Portfolio page gui class.

References ilObjPortfolioBaseGUI\getAdditional().

+ Here is the call graph for this function:

◆ getPageInstance()

ilObjPortfolioGUI::getPageInstance (   $a_page_id = null,
  $a_portfolio_id = null 
)
protected

Get portfolio template page instance.

Parameters
int$a_page_id
int$a_portfolio_id
Returns
ilPortfolioPage

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 494 of file class.ilObjPortfolioGUI.php.

495 {
496 // #11531
497 if(!$a_portfolio_id && $this->object)
498 {
499 $a_portfolio_id = $this->object->getId();
500 }
501 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
502 $page = new ilPortfolioPage($a_page_id);
503 $page->setPortfolioId($a_portfolio_id);
504 return $page;
505 }
Page for user portfolio.

Referenced by afterSave(), and saveBlog().

+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 27 of file class.ilObjPortfolioGUI.php.

28 {
29 return "prtf";
30 }

Referenced by initCreateForm().

+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )

Init blog page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 568 of file class.ilObjPortfolioGUI.php.

569 {
570 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
571 $form = new ilPropertyFormGUI();
572 $form->setFormAction($this->ctrl->getFormAction($this));
573
574 $options = array();
575 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
576 $tree = new ilWorkspaceTree($this->user_id);
577 $root = $tree->readRootId();
578 if($root)
579 {
580 $root = $tree->getNodeData($root);
581 foreach ($tree->getSubTree($root, true, "blog") as $node)
582 {
583 $options[$node["obj_id"]] = $node["title"];
584 }
585 asort($options);
586 }
587
588 // no blogs to add?
589 if(!sizeof($options))
590 {
591 // #17218
592 $this->lng->loadLanguageModule('pd');
593 $url = $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumpToWorkspace");
594 $url = '<a href="'.$url.'">'.$this->lng->txt("pd_personal_workspace").'</a>';
595
596 ilUtil::sendInfo(sprintf($this->lng->txt("prtf_no_blogs_info"), $url), true);
597 $this->ctrl->redirect($this, "view");
598 }
599
600 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
601 $obj->setRequired(true);
602 $obj->setOptions($options);
603 $form->addItem($obj);
604
605 $form->setTitle($this->lng->txt("prtf_add_blog").": ".
606 $this->object->getTitle());
607 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
608 $form->addCommandButton("view", $this->lng->txt("cancel"));
609
610 return $form;
611 }
This class represents a property form user interface.
This class represents a selection list property in a property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Tree handler for personal workspace.
$url
Definition: shib_logout.php:72
if(!is_array($argv)) $options

References $options, ilObject2GUI\$tree, $url, and ilUtil\sendInfo().

Referenced by saveBlog().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilFormPropertyGUI  $a_tgt)
protected

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 531 of file class.ilObjPortfolioGUI.php.

532 {
533 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
534 $a_tgt->addOption($old);
535
536 $options = array();
537 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
538 foreach($all as $item)
539 {
540 $options[$item["id"]] = $item["title"];
541 }
542 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
543 $prtf->setRequired(true);
544 $prtf->setOptions($options);
545 $old->addSubItem($prtf);
546
547 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
548 $a_tgt->addOption($new);
549
550 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
551 $tf->setMaxLength(128);
552 $tf->setSize(40);
553 $tf->setRequired(true);
554 $new->addSubItem($tf);
555 }
static getPortfoliosOfUser($a_user_id)
Get views of user.
This class represents an option in a radio group.
This class represents a text property in a property form.

References $options, and ilObjPortfolio\getPortfoliosOfUser().

+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 221 of file class.ilObjPortfolioGUI.php.

222 {
223 global $ilSetting;
224
225 $this->ctrl->setParameter($this, "new_type", $this->getType());
226
227 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
228 $form = new ilPropertyFormGUI();
229 $form->setFormAction($this->ctrl->getFormAction($this));
230
231 // title
232 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
233 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
234 $ti->setMaxLength(ilObject::TITLE_LENGTH);
235 $ti->setRequired(true);
236 $form->addItem($ti);
237
238 /* description
239 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
240 $ta->setCols(40);
241 $ta->setRows(2);
242 $form->addItem($ta);
243 */
244
245 $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
246 $main->setValue("mode_scratch");
247 $form->addItem($main);
248
249 $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
250 $main->addOption($opt_scratch);
251
252
253 // 1st page
254
255 $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
256 $type->setRequired(true);
257 $opt_scratch->addSubItem($type);
258
259 $type_page = new ilRadioOption($this->lng->txt("page"), "page");
260 $type->addOption($type_page);
261
262 // page type: page
263 $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
264 $tf->setMaxLength(128);
265 $tf->setSize(40);
266 $tf->setRequired(true);
267 $type_page->addSubItem($tf);
268
269 // page templates
270 include_once "Services/Style/classes/class.ilPageLayout.php";
272 if($templates)
273 {
274 $options = array(0 => $this->lng->txt("none"));
275 foreach ($templates as $templ)
276 {
277 $templ->readObject();
278 $options[$templ->getId()] = $templ->getTitle();
279 }
280
281 $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
282 $use_template->setRequired(true);
283 $use_template->setOptions($options);
284 $type_page->addSubItem($use_template);
285 }
286
287 // page type: blog
288 if(!$ilSetting->get('disable_wsp_blogs'))
289 {
290 $options = array();
291 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
292 $tree = new ilWorkspaceTree($this->user_id);
293 $root = $tree->readRootId();
294 if($root)
295 {
296 $root = $tree->getNodeData($root);
297 foreach ($tree->getSubTree($root) as $node)
298 {
299 if ($node["type"] == "blog")
300 {
301 $options[$node["obj_id"]] = $node["title"];
302 }
303 }
304 asort($options);
305 }
306 if(sizeof($options))
307 {
308 $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
309 $type->addOption($type_blog);
310
311 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
312 $obj->setRequired(true);
313 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$options);
314 $type_blog->addSubItem($obj);
315 }
316 else
317 {
318 // #18147
319 $this->lng->loadLanguageModule('pd');
320 $url = $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumpToWorkspace");
321 $url = '<a href="'.$url.'">'.$this->lng->txt("pd_personal_workspace").'</a>';
322
323 ilUtil::sendInfo(sprintf($this->lng->txt("prtf_no_blogs_info"), $url), true);
324 $type->setValue("page");
325 }
326 }
327
328
329 // portfolio templates
330
331 $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
332 $main->addOption($opt_tmpl);
333
334 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
336 if(!sizeof($templates))
337 {
338 $opt_tmpl->setDisabled(true);
339 }
340 else
341 {
342 $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
343 $tmpl->setRequired(true);
344 $tmpl->setOptions(array(""=>$this->lng->txt("please_select"))+$templates);
345 $opt_tmpl->addSubItem($tmpl);
346
347 // incoming from repository
348 if((int)$_REQUEST["prtt_pre"])
349 {
350 $tmpl->setValue((int)$_REQUEST["prtt_pre"]);
351 $main->setValue("mode_tmpl");
352 }
353 }
354
355
356 $form->setTitle($this->lng->txt("prtf_create_portfolio"));
357 $form->addCommandButton("save", $this->lng->txt("create"));
358 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
359
360 return $form;
361 }
getType()
Functions that must be overwritten.
const TITLE_LENGTH
max length of object title
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
This class represents a property in a property form.

References $_REQUEST, $ilSetting, $options, ilObject2GUI\$tree, $url, ilPageLayout\activeLayouts(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getType(), ilPageLayout\MODULE_PORTFOLIO, ilUtil\sendInfo(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and save().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreatePortfolioFromTemplateForm()

ilObjPortfolioGUI::initCreatePortfolioFromTemplateForm (   $a_prtt_id,
  $a_title 
)
protected

Definition at line 673 of file class.ilObjPortfolioGUI.php.

674 {
675 global $ilSetting, $ilUser;
676
677 if((int)$_REQUEST["exc_id"])
678 {
679 $this->ctrl->setParameter($this, "exc_id", (int)$_REQUEST["exc_id"]);
680 $this->ctrl->setParameter($this, "ass_id", (int)$_REQUEST["ass_id"]);
681 }
682
683 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
684 $form = new ilPropertyFormGUI();
685 $form->setFormAction($this->ctrl->getFormAction($this));
686
687 $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
688 $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
689 $form->addItem($tmpl);
690
691 $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
692 $title->setValue($a_title);
693 $form->addItem($title);
694
695 // gather user blogs
696 if(!$ilSetting->get('disable_wsp_blogs'))
697 {
698 $blog_options = array();
699 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
700 $tree = new ilWorkspaceTree($this->user_id);
701 $root = $tree->readRootId();
702 if($root)
703 {
704 $root = $tree->getNodeData($root);
705 foreach ($tree->getSubTree($root, true, "blog") as $node)
706 {
707 $blog_options[$node["obj_id"]] = $node["title"];
708 }
709 asort($blog_options);
710 }
711 }
712
713 $has_form_content = false;
714
715 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
717 $quota_sum = 0;
718
719 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
720 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
721 $skill_ids = array();
722
723 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
724 foreach(ilPortfolioTemplatePage::getAllPages($a_prtt_id) as $page)
725 {
726 switch($page["type"])
727 {
729 // skills
730 $source_page = new ilPortfolioTemplatePage($page["id"]);
731 $source_page->buildDom(true);
732 $dom = $source_page->getDom();
733 if($dom instanceof php4DOMDocument)
734 {
735 $dom = $dom->myDOMDocument;
736 }
737 $xpath = new DOMXPath($dom);
738 $nodes = $xpath->query("//PageContent/Skills");
739 foreach($nodes as $node)
740 {
741 $skill_id = $node->getAttribute("Id");
742 if(!in_array($skill_id, $pskills))
743 {
744 $skill_ids[] = $skill_id;
745 }
746 }
747 unset($nodes);
748 unset($xpath);
749 unset($dom);
750 if($check_quota)
751 {
752 $quota_sum += $source_page->getPageDiskSize();
753 }
754 if(sizeof($skill_ids))
755 {
756 $has_form_content = true;
757 }
758 break;
759
761 if(!$ilSetting->get('disable_wsp_blogs'))
762 {
763 $has_form_content = true;
764
765 $field_id = "blog_".$page["id"];
766
767 $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog").": ".
768 $page["title"], $field_id);
769 $blog->setRequired(true);
770 $blog->setValue("blog_create");
771 $form->addItem($blog);
772
773 $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
774 $blog->addOption($new_blog);
775
776 $title = new ilTextInputGUI($this->lng->txt("title"), $field_id."_create_title");
777 $title->setRequired(true);
778 $new_blog->addSubItem($title);
779
780 if(sizeof($blog_options))
781 {
782 $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
783 $blog->addOption($reuse_blog);
784
785 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id."_reuse_blog");
786 $obj->setRequired(true);
787 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
788 $reuse_blog->addSubItem($obj);
789 }
790
791 $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
792 }
793 break;
794 }
795 }
796
797 if($skill_ids)
798 {
799 include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
800 $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
801 $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
802 $skills->setValue($skill_ids);
803 foreach($skill_ids as $skill_id)
804 {
805 $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
806 }
807 $form->addItem($skills);
808 }
809
810 if($quota_sum)
811 {
812 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
814 {
815 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
816 $this->ctrl->redirect($this, "create");
817 }
818 }
819
820 // no dialog needed, go ahead
821 if(!$has_form_content)
822 {
823 return;
824 }
825
826 $form->setTitle($this->lng->txt("prtf_creation_mode").": ".$this->lng->txt("prtf_creation_mode_template"));
827 $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
828 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
829
830 return $form;
831 }
This class represents a property in a property form.
This class represents an option in a checkbox group.
static isUploadPossible($a_additional_size=null)
This class represents a non editable value in a property form.
static _lookupTitle($a_id)
lookup object title
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
Page for portfolio template.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_REQUEST, $ilSetting, $ilUser, ilObject2GUI\$tree, ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObject\_lookupTitle(), ilSkillTreeNode\_lookupTitle(), ilPortfolioPage\getAllPages(), ilPersonalSkill\getSelectedUserSkills(), ilDiskQuotaHandler\isUploadPossible(), ilUtil\sendFailure(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilPortfolioPage\TYPE_PAGE.

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjPortfolioGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

Definition at line 216 of file class.ilObjPortfolioGUI.php.

217 {
218 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
219 }
initCreateForm($a_new_type)
Init object creation form.

References initCreateForm().

+ Here is the call graph for this function:

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

Init object edit form.

Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

Definition at line 426 of file class.ilObjPortfolioGUI.php.

427 {
428 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
429 $form = new ilPropertyFormGUI();
430 $form->setFormAction($this->ctrl->getFormAction($this));
431
432 // title
433 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
434 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
435 $ti->setMaxLength(ilObject::TITLE_LENGTH);
436 $ti->setRequired(true);
437 $ti->setValue($this->object->getTitle());
438 $form->addItem($ti);
439
440 /* description
441 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
442 $ta->setCols(40);
443 $ta->setRows(2);
444 $ta->setValue($this->object->getDescription());
445 $form->addItem($ta);
446 */
447
448 // :TODO: online
449 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
450 $online->setChecked($this->object->isOnline());
451 $form->addItem($online);
452
453 $this->initEditCustomForm($form);
454
455 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
456 $form->addCommandButton("update", $this->lng->txt("save"));
457 $form->addCommandButton("view", $this->lng->txt("cancel"));
458
459 return $form;
460 }
This class represents a checkbox property in a property form.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.

References ilObjPortfolioBaseGUI\initEditCustomForm(), and ilObject\TITLE_LENGTH.

+ Here is the call graph for this function:

◆ save()

ilObjPortfolioGUI::save ( )

Reimplemented from ilObject2GUI.

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

364 {
365 $form = $this->initCreateForm("prtf");
366 if($form->checkInput())
367 {
368 // trigger portfolio template "import" process
369 if($form->getInput("mode") == "mode_tmpl")
370 {
371 $_REQUEST["pt"] = $form->getInput("title");
372 return $this->createPortfolioFromTemplate();
373 }
374 }
375
376 return parent::save();
377 }

References $_REQUEST, createPortfolioFromTemplate(), and initCreateForm().

+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )

Create new portfolio blog page.

Reimplemented from ilObjPortfolioBaseGUI.

Definition at line 616 of file class.ilObjPortfolioGUI.php.

617 {
618 $form = $this->initBlogForm();
619 if ($form->checkInput() && $this->checkPermissionBool("write"))
620 {
621 $page = $this->getPageInstance();
622 $page->setType(ilPortfolioPage::TYPE_BLOG);
623 $page->setTitle($form->getInput("blog"));
624 $page->create();
625
626 ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
627 $this->ctrl->redirect($this, "view");
628 }
629
630 $this->tabs_gui->clearTargets();
631 $this->tabs_gui->setBackTarget($this->lng->txt("back"),
632 $this->ctrl->getLinkTarget($this, "view"));
633
634 $form->setValuesByPost();
635 $this->tpl->setContent($form->getHtml());
636 }
initBlogForm()
Init blog page form.

References getPageInstance(), initBlogForm(), ilUtil\sendSuccess(), and ilPortfolioPage\TYPE_BLOG.

+ Here is the call graph for this function:

◆ setTabs()

ilObjPortfolioGUI::setTabs ( )
protected

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 148 of file class.ilObjPortfolioGUI.php.

149 {
150 global $ilHelp;
151
152 $ilHelp->setScreenIdComponent("prtf");
153
154 if($this->checkPermissionBool("write"))
155 {
156 $this->tabs_gui->addTab("pages",
157 $this->lng->txt("content"),
158 $this->ctrl->getLinkTarget($this, "view"));
159
160 $this->tabs_gui->addTab("settings",
161 $this->lng->txt("settings"),
162 $this->ctrl->getLinkTarget($this, "edit"));
163
164 $this->tabs_gui->addNonTabbedLink("preview",
165 $this->lng->txt("user_profile_preview"),
166 $this->ctrl->getLinkTarget($this, "preview"));
167
168 $this->lng->loadLanguageModule("wsp");
169 $this->tabs_gui->addTab("share",
170 $this->lng->txt("wsp_permissions"),
171 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share"));
172 }
173 }

References checkPermissionBool().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTitleAndDescription()

ilObjPortfolioGUI::setTitleAndDescription ( )
protected

called by prepare output

Reimplemented from ilObject2GUI.

Definition at line 187 of file class.ilObjPortfolioGUI.php.

188 {
189 // parent::setTitleAndDescription();
190
191 $title = $this->lng->txt("portfolio");
192 if($this->object)
193 {
194 $title .= ": ".$this->object->getTitle();
195 }
196 $this->tpl->setTitle($title);
197 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_prtf.svg"),
198 $this->lng->txt("portfolio"));
199
200 if($this->object &&
201 !$this->object->isOnline())
202 {
203 $this->tpl->setAlertProperties(array(
204 array("alert" => true,
205 "property" => $this->lng->txt("status"),
206 "value" => $this->lng->txt("offline"))
207 ));
208 }
209 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

Definition at line 410 of file class.ilObjPortfolioGUI.php.

411 {
412 global $ilAccess;
413
414 // return to exercise (portfolio assignment)
415 $exc_ref_id = (int)$_REQUEST["exc_id"];
416 if($exc_ref_id &&
417 $ilAccess->checkAccess("read", "", $exc_ref_id))
418 {
419 include_once "Services/Link/classes/class.ilLink.php";
420 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
421 }
422
423 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
424 }
static redirect($a_script)
http redirect to other script

References $_REQUEST, ilLink\_getLink(), and ilUtil\redirect().

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $a_form)

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjPortfolioBaseGUI.

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

470 {
471 $this->object->setOnline($a_form->getInput("online"));
472
473 // if portfolio is not online, it cannot be default
474 if(!$a_form->getInput("online"))
475 {
476 ilObjPortfolio::setUserDefault($this->user_id, 0);
477 }
478
479 parent::updateCustom($a_form);
480 }
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput(), and ilObjPortfolio\setUserDefault().

+ Here is the call graph for this function:

Field Documentation

◆ $ws_access

ilObjPortfolioGUI::$ws_access
protected

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


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