ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
- 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 @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 (ilPropertyFormGUI $a_form)
 
 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 (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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) 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 (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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 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...
 
 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 ()
 
 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...
 
 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

 $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
 
 $tabs_gui = null
 
 $ctrl
 

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 947 of file class.ilObjPortfolioGUI.php.

948 {
949 $id = explode("_", $a_target);
950
951 $_GET["baseClass"] = "ilsharedresourceGUI";
952 $_GET["prt_id"] = $id[0];
953 if(sizeof($id) == 2)
954 {
955 $_GET["gtp"] = $id[1];
956 }
957
958 include("ilias.php");
959 exit;
960 }
$_GET["client_id"]

References $_GET, and exit.

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

184 {
185 if(!$this->creation_mode)
186 {
187 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
188 }
189
190 parent::addLocatorItems();
191
192 $this->tpl->setLocator();
193 }

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 387 of file class.ilObjPortfolioGUI.php.

388 {
389 // create 1st page / blog
390 include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
391 $page = $this->getPageInstance(null, $a_new_object->getId());
392 if($_POST["ptype"] == "page")
393 {
394 $page->setType(ilPortfolioPage::TYPE_PAGE);
395 $page->setTitle($_POST["fpage"]);
396
397 // use template as basis
398 $layout_id = $_POST["tmpl"];
399 if($layout_id)
400 {
401 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
402 $layout_obj = new ilPageLayout($layout_id);
403 $page->setXMLContent($layout_obj->getXMLContent());
404 }
405 }
406 else
407 {
408 $page->setType(ilPortfolioPage::TYPE_BLOG);
409 $page->setTitle($_POST["blog"]);
410 }
411 $page->create();
412
413 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
414 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
415 $this->ctrl->redirect($this, "view");
416 }
$_POST["username"]
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.

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 656 of file class.ilObjPortfolioGUI.php.

657 {
658 $title = trim($_REQUEST["pt"]);
659 $prtt_id = (int)$_REQUEST["prtt"];
660
661 // valid template?
662 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
664 if(!sizeof($templates) || !in_array($prtt_id, $templates))
665 {
666 $this->toRepository();
667 }
668 unset($templates);
669
670 $this->ctrl->setParameter($this, "prtt", $prtt_id);
671
672 if(!$a_form)
673 {
674 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
675 }
676 if($a_form)
677 {
678 $this->tpl->setContent($a_form->getHTML());
679 }
680 else
681 {
683 }
684 }
createPortfolioFromTemplateProcess($a_process_form=true)
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
static getAvailablePortfolioTemplates($a_permission="read")

References $title, 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 846 of file class.ilObjPortfolioGUI.php.

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

References $ilSetting, $ilUser, $target, $target_id, $title, createPortfolioFromTemplate(), ilPortfolioPage\getAllPortfolioPages(), 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 global $lng;
48
49 $this->checkPermission("read");
50
51 // goto link to portfolio page
52 if($_GET["gtp"])
53 {
54 $_GET["user_page"] = $_GET["gtp"];
55 }
56
58
59 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd("view");
61
62 /*
63 if($_REQUEST["ecal"])
64 {
65 $cmd = "preview";
66 $next_class = "";
67 }
68 */
69
70 switch($next_class)
71 {
72 case "ilworkspaceaccessgui";
73 if($this->checkPermissionBool("write"))
74 {
75 $this->setTabs();
76 $this->tabs_gui->activateTab("share");
77
78 if($this->access_handler->getPermissions($this->object->getId()) &&
79 !$this->object->isOnline())
80 {
81 ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
82 }
83
84 $this->tpl->setPermanentLink("prtf", $this->object->getId());
85
86 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
87 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
88 $this->ctrl->forwardCommand($wspacc);
89 }
90 break;
91
92 case 'ilportfoliopagegui':
93 if($this->determinePageCall())
94 {
95 // only in edit mode
96 $this->addLocator();
97
98 include_once "Services/Form/classes/class.ilFileInputGUI.php";
100 }
101 $this->handlePageCall($cmd);
102 break;
103
104 case "ilnotegui";
105 $this->preview();
106 break;
107
108 case "ilobjstylesheetgui":
109 include_once ("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
110 $this->ctrl->setReturn($this, "editStyleProperties");
111 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
112 $style_gui->omitLocator();
113 if ($cmd == "create" || $_GET["new_type"]=="sty")
114 {
115 $style_gui->setCreationMode(true);
116 }
117
118 if ($cmd == "confirmedDelete")
119 {
120 $this->object->setStyleSheetId(0);
121 $this->object->update();
122 }
123
124 $ret = $this->ctrl->forwardCommand($style_gui);
125
126 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
127 {
128 $style_id = $ret;
129 $this->object->setStyleSheetId($style_id);
130 $this->object->update();
131 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
132 }
133 break;
134
135 case "ilportfolioexercisegui":
136 $this->ctrl->setReturn($this, "view");
137 include_once "Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
138 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
139 $this->ctrl->forwardCommand($gui);
140 break;
141
142 default:
143
144 if($cmd != "preview")
145 {
146 $this->addLocator();
147 $this->setTabs();
148 }
149 $this->$cmd();
150 break;
151 }
152
153 return true;
154 }
static 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="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Class ilPortfolioExerciseGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, ilObjectGUI\$lng, $ret, addLocator(), ilObject2GUI\checkPermission(), checkPermissionBool(), ilObjPortfolioBaseGUI\determinePageCall(), ilObjPortfolioBaseGUI\handlePageCall(), ilObjPortfolioBaseGUI\preview(), ilUtil\sendInfo(), 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 470 of file class.ilObjPortfolioGUI.php.

471 {
472 $a_values["online"] = $this->object->isOnline();
473
474 parent::getEditFormCustomValues($a_values);
475 }

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

Reimplemented from ilObjPortfolioBaseGUI.

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

535 {
536 return "ilportfoliopagegui";
537 }

◆ 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 521 of file class.ilObjPortfolioGUI.php.

522 {
523 include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
524 $page_gui = new ilPortfolioPageGUI(
525 $this->object->getId(),
526 $a_page_id,
527 0,
528 $this->object->hasPublicComments()
529 );
530 $page_gui->setAdditional($this->getAdditional());
531 return $page_gui;
532 }
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 502 of file class.ilObjPortfolioGUI.php.

503 {
504 // #11531
505 if(!$a_portfolio_id && $this->object)
506 {
507 $a_portfolio_id = $this->object->getId();
508 }
509 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
510 $page = new ilPortfolioPage($a_page_id);
511 $page->setPortfolioId($a_portfolio_id);
512 return $page;
513 }
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 581 of file class.ilObjPortfolioGUI.php.

582 {
583 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
584 $form = new ilPropertyFormGUI();
585 $form->setFormAction($this->ctrl->getFormAction($this));
586
587 $options = array();
588 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
589 $tree = new ilWorkspaceTree($this->user_id);
590 $root = $tree->readRootId();
591 if($root)
592 {
593 $root = $tree->getNodeData($root);
594 foreach ($tree->getSubTree($root, true, "blog") as $node)
595 {
596 $options[$node["obj_id"]] = $node["title"];
597 }
598 asort($options);
599 }
600
601 // no blogs to add?
602 if(!sizeof($options))
603 {
604 // #17218
605 $this->lng->loadLanguageModule('pd');
606 $url = $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumpToWorkspace");
607 $url = '<a href="'.$url.'">'.$this->lng->txt("pd_personal_workspace").'</a>';
608
609 ilUtil::sendInfo(sprintf($this->lng->txt("prtf_no_blogs_info"), $url), true);
610 $this->ctrl->redirect($this, "view");
611 }
612
613 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
614 $obj->setRequired(true);
615 $obj->setOptions($options);
616 $form->addItem($obj);
617
618 $form->setTitle($this->lng->txt("prtf_add_blog").": ".
619 $this->object->getTitle());
620 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
621 $form->addCommandButton("view", $this->lng->txt("cancel"));
622
623 return $form;
624 }
sprintf('%.4f', $callTime)
This class represents a property form user interface.
This class represents a selection list property in a property form.
Tree handler for personal workspace.
$url
Definition: shib_logout.php:72
if(!is_array($argv)) $options

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

Referenced by saveBlog().

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

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from ilObjPortfolioBaseGUI.

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

540 {
541
542 $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
543 $a_tgt->setRequired(true);
544 $a_form->addItem($a_tgt);
545
546 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
547 $a_tgt->addOption($old);
548
549 $options = array();
550 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
551 foreach($all as $item)
552 {
553 $options[$item["id"]] = $item["title"];
554 }
555 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
556 $prtf->setRequired(true);
557 $prtf->setOptions($options);
558 $old->addSubItem($prtf);
559
560 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
561 $a_tgt->addOption($new);
562
563 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
564 $tf->setMaxLength(128);
565 $tf->setSize(40);
566 $tf->setRequired(true);
567 $new->addSubItem($tf);
568 }
static getPortfoliosOfUser($a_user_id)
Get views of user.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text property in a property form.
$old

References $new, $old, $options, ilPropertyFormGUI\addItem(), 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 229 of file class.ilObjPortfolioGUI.php.

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

References $ilSetting, $options, ilObject2GUI\$tree, $url, ilPageLayout\activeLayouts(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getType(), ilPageLayout\MODULE_PORTFOLIO, ilUtil\sendInfo(), sprintf, 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 686 of file class.ilObjPortfolioGUI.php.

687 {
688 global $ilSetting, $ilUser;
689
690 if((int)$_REQUEST["exc_id"])
691 {
692 $this->ctrl->setParameter($this, "exc_id", (int)$_REQUEST["exc_id"]);
693 $this->ctrl->setParameter($this, "ass_id", (int)$_REQUEST["ass_id"]);
694 }
695
696 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
697 $form = new ilPropertyFormGUI();
698 $form->setFormAction($this->ctrl->getFormAction($this));
699
700 $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
701 $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
702 $form->addItem($tmpl);
703
704 $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
705 $title->setValue($a_title);
706 $form->addItem($title);
707
708 // gather user blogs
709 if(!$ilSetting->get('disable_wsp_blogs'))
710 {
711 $blog_options = array();
712 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
713 $tree = new ilWorkspaceTree($this->user_id);
714 $root = $tree->readRootId();
715 if($root)
716 {
717 $root = $tree->getNodeData($root);
718 foreach ($tree->getSubTree($root, true, "blog") as $node)
719 {
720 $blog_options[$node["obj_id"]] = $node["title"];
721 }
722 asort($blog_options);
723 }
724 }
725
726 $has_form_content = false;
727
728 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
730 $quota_sum = 0;
731
732 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
733 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
734 $skill_ids = array();
735
736 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
737 foreach(ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page)
738 {
739 switch($page["type"])
740 {
742 // skills
743 $source_page = new ilPortfolioTemplatePage($page["id"]);
744 $source_page->buildDom(true);
745 $dom = $source_page->getDom();
746 if($dom instanceof php4DOMDocument)
747 {
748 $dom = $dom->myDOMDocument;
749 }
750 $xpath = new DOMXPath($dom);
751 $nodes = $xpath->query("//PageContent/Skills");
752 foreach($nodes as $node)
753 {
754 $skill_id = $node->getAttribute("Id");
755 if(!in_array($skill_id, $pskills))
756 {
757 $skill_ids[] = $skill_id;
758 }
759 }
760 unset($nodes);
761 unset($xpath);
762 unset($dom);
763 if($check_quota)
764 {
765 $quota_sum += $source_page->getPageDiskSize();
766 }
767 if(sizeof($skill_ids))
768 {
769 $has_form_content = true;
770 }
771 break;
772
774 if(!$ilSetting->get('disable_wsp_blogs'))
775 {
776 $has_form_content = true;
777
778 $field_id = "blog_".$page["id"];
779
780 $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog").": ".
781 $page["title"], $field_id);
782 $blog->setRequired(true);
783 $blog->setValue("blog_create");
784 $form->addItem($blog);
785
786 $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
787 $blog->addOption($new_blog);
788
789 $title = new ilTextInputGUI($this->lng->txt("title"), $field_id."_create_title");
790 $title->setRequired(true);
791 $new_blog->addSubItem($title);
792
793 if(sizeof($blog_options))
794 {
795 $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
796 $blog->addOption($reuse_blog);
797
798 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id."_reuse_blog");
799 $obj->setRequired(true);
800 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
801 $reuse_blog->addSubItem($obj);
802 }
803
804 $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
805 }
806 break;
807 }
808 }
809
810 if($skill_ids)
811 {
812 include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
813 $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
814 $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
815 $skills->setValue($skill_ids);
816 foreach($skill_ids as $skill_id)
817 {
818 $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
819 }
820 $form->addItem($skills);
821 }
822
823 if($quota_sum)
824 {
825 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
827 {
828 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
829 $this->ctrl->redirect($this, "create");
830 }
831 }
832
833 // no dialog needed, go ahead
834 if(!$has_form_content)
835 {
836 return;
837 }
838
839 $form->setTitle($this->lng->txt("prtf_creation_mode").": ".$this->lng->txt("prtf_creation_mode_template"));
840 $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
841 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
842
843 return $form;
844 }
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 $ilSetting, $ilUser, $title, ilObject2GUI\$tree, ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObject\_lookupTitle(), ilSkillTreeNode\_lookupTitle(), ilPortfolioPage\getAllPortfolioPages(), 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 224 of file class.ilObjPortfolioGUI.php.

225 {
226 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
227 }
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 434 of file class.ilObjPortfolioGUI.php.

435 {
436 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
437 $form = new ilPropertyFormGUI();
438 $form->setFormAction($this->ctrl->getFormAction($this));
439
440 // title
441 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
442 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
443 $ti->setMaxLength(ilObject::TITLE_LENGTH);
444 $ti->setRequired(true);
445 $ti->setValue($this->object->getTitle());
446 $form->addItem($ti);
447
448 /* description
449 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
450 $ta->setCols(40);
451 $ta->setRows(2);
452 $ta->setValue($this->object->getDescription());
453 $form->addItem($ta);
454 */
455
456 // :TODO: online
457 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
458 $online->setChecked($this->object->isOnline());
459 $form->addItem($online);
460
461 $this->initEditCustomForm($form);
462
463 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
464 $form->addCommandButton("update", $this->lng->txt("save"));
465 $form->addCommandButton("view", $this->lng->txt("cancel"));
466
467 return $form;
468 }
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 371 of file class.ilObjPortfolioGUI.php.

372 {
373 $form = $this->initCreateForm("prtf");
374 if($form->checkInput())
375 {
376 // trigger portfolio template "import" process
377 if($form->getInput("mode") == "mode_tmpl")
378 {
379 $_REQUEST["pt"] = $form->getInput("title");
380 return $this->createPortfolioFromTemplate();
381 }
382 }
383
384 return parent::save();
385 }

References 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 629 of file class.ilObjPortfolioGUI.php.

630 {
631 $form = $this->initBlogForm();
632 if ($form->checkInput() && $this->checkPermissionBool("write"))
633 {
634 $page = $this->getPageInstance();
635 $page->setType(ilPortfolioPage::TYPE_BLOG);
636 $page->setTitle($form->getInput("blog"));
637 $page->create();
638
639 ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
640 $this->ctrl->redirect($this, "view");
641 }
642
643 $this->tabs_gui->clearTargets();
644 $this->tabs_gui->setBackTarget($this->lng->txt("back"),
645 $this->ctrl->getLinkTarget($this, "view"));
646
647 $form->setValuesByPost();
648 $this->tpl->setContent($form->getHtml());
649 }
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 156 of file class.ilObjPortfolioGUI.php.

157 {
158 global $ilHelp;
159
160 $ilHelp->setScreenIdComponent("prtf");
161
162 if($this->checkPermissionBool("write"))
163 {
164 $this->tabs_gui->addTab("pages",
165 $this->lng->txt("content"),
166 $this->ctrl->getLinkTarget($this, "view"));
167
168 $this->tabs_gui->addTab("settings",
169 $this->lng->txt("settings"),
170 $this->ctrl->getLinkTarget($this, "edit"));
171
172 $this->tabs_gui->addNonTabbedLink("preview",
173 $this->lng->txt("user_profile_preview"),
174 $this->ctrl->getLinkTarget($this, "preview"));
175
176 $this->lng->loadLanguageModule("wsp");
177 $this->tabs_gui->addTab("share",
178 $this->lng->txt("wsp_permissions"),
179 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share"));
180 }
181 }

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 195 of file class.ilObjPortfolioGUI.php.

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

References $title, and 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 418 of file class.ilObjPortfolioGUI.php.

419 {
420 global $ilAccess;
421
422 // return to exercise (portfolio assignment)
423 $exc_ref_id = (int)$_REQUEST["exc_id"];
424 if($exc_ref_id &&
425 $ilAccess->checkAccess("read", "", $exc_ref_id))
426 {
427 include_once "Services/Link/classes/class.ilLink.php";
428 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
429 }
430
431 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
432 }
static redirect($a_script)
http redirect to other script

References 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 477 of file class.ilObjPortfolioGUI.php.

478 {
479 $this->object->setOnline($a_form->getInput("online"));
480
481 // if portfolio is not online, it cannot be default
482 if(!$a_form->getInput("online"))
483 {
484 ilObjPortfolio::setUserDefault($this->user_id, 0);
485 }
486
487 parent::updateCustom($a_form);
488 }
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: