ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 getExerciseInfo ($a_assignment_id, $a_add_submit=false)
 
 downloadExcAssFile ()
 
 downloadExcSubFile ()
 
- 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...
 
 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)
 
 finalize ()
 Finalize and submit portfolio to exercise. More...
 
 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)
 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
 

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

Portfolio view gui class.

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

@ilCtrl_Calls ilObjPortfolioGUI: ilPortfolioPageGUI, ilPageObjectGUI @ilCtrl_Calls ilObjPortfolioGUI: ilWorkspaceAccessGUI, ilNoteGUI, ilObjStyleSheetGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioGUI::__construct (   $a_id = 0)

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

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

Member Function Documentation

◆ _goto()

static ilObjPortfolioGUI::_goto (   $a_target)
static

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

1105 {
1106 $id = explode("_", $a_target);
1107
1108 $_GET["baseClass"] = "ilsharedresourceGUI";
1109 $_GET["prt_id"] = $id[0];
1110 if(sizeof($id) == 2)
1111 {
1112 $_GET["gtp"] = $id[1];
1113 }
1114
1115 include("ilias.php");
1116 exit;
1117 }
$_GET["client_id"]
exit
Definition: login.php:54

References $_GET, and exit.

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

168 {
169 if(!$this->creation_mode)
170 {
171 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
172 }
173
174 parent::addLocatorItems();
175
176 $this->tpl->setLocator();
177 }

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

367 {
368 // create 1st page / blog
369 include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
370 $page = $this->getPageInstance(null, $a_new_object->getId());
371 if($_POST["ptype"] == "page")
372 {
373 $page->setType(ilPortfolioPage::TYPE_PAGE);
374 $page->setTitle($_POST["fpage"]);
375
376 // use template as basis
377 $layout_id = $_POST["tmpl"];
378 if($layout_id)
379 {
380 include_once("./Services/Style/classes/class.ilPageLayout.php");
381 $layout_obj = new ilPageLayout($layout_id);
382 $page->setXMLContent($layout_obj->getXMLContent());
383 }
384 }
385 else
386 {
387 $page->setType(ilPortfolioPage::TYPE_BLOG);
388 $page->setTitle($_POST["blog"]);
389 }
390 $page->create();
391
392 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
393 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
394 $this->ctrl->redirect($this, "view");
395 }
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 31 of file class.ilObjPortfolioGUI.php.

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

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

817 {
818 $title = trim($_REQUEST["pt"]);
819 $prtt_id = (int)$_REQUEST["prtt"];
820
821 // valid template?
822 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
824 if(!sizeof($templates) || !in_array($prtt_id, $templates))
825 {
826 $this->toRepository();
827 }
828 unset($templates);
829
830 $this->ctrl->setParameter($this, "prtt", $prtt_id);
831
832 if(!$a_form)
833 {
834 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
835 }
836 if($a_form)
837 {
838 $this->tpl->setContent($a_form->getHTML());
839 }
840 else
841 {
843 }
844 }
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 1006 of file class.ilObjPortfolioGUI.php.

1007 {
1008 global $ilSetting, $ilUser, $ilAccess;
1009
1010 $title = trim($_REQUEST["pt"]);
1011 $prtt_id = (int)$_REQUEST["prtt"];
1012
1013 // valid template?
1014 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
1016 if(!sizeof($templates) || !in_array($prtt_id, $templates))
1017 {
1018 $this->toRepository();
1019 }
1020 unset($templates);
1021
1022 // build page recipe (aka import form values)
1023 $recipe = null;
1024 if($a_process_form)
1025 {
1026 $this->ctrl->setParameter($this, "prtt", $prtt_id);
1027
1028 $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
1029 if($form->checkInput())
1030 {
1031 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
1032 foreach(ilPortfolioTemplatePage::getAllPages($prtt_id) as $page)
1033 {
1034 switch($page["type"])
1035 {
1037 if(!$ilSetting->get('disable_wsp_blogs'))
1038 {
1039 $field_id = "blog_".$page["id"];
1040 switch($form->getInput($field_id))
1041 {
1042 case "blog_create":
1043 $recipe[$page["id"]] = array("blog", "create",
1044 trim($form->getInput($field_id."_create_title")));
1045 break;
1046
1047 case "blog_resuse":
1048 $recipe[$page["id"]] = array("blog", "reuse",
1049 (int)$form->getInput($field_id."_reuse_blog"));
1050 break;
1051
1052 case "blog_ignore":
1053 $recipe[$page["id"]] = array("blog", "ignore");
1054 break;
1055 }
1056 }
1057 break;
1058 }
1059 }
1060
1061 $recipe["skills"] = (array)$form->getInput("skill_ids");
1062 }
1063 else
1064 {
1065 $form->setValuesByPost();
1066 return $this->createPortfolioFromTemplate($form);
1067 }
1068 }
1069
1070 $source = new ilObjPortfolioTemplate($prtt_id, false);
1071
1072 // create portfolio
1073 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
1074 $target = new ilObjPortfolio();
1075 $target->setTitle($title);
1076 $target->create();
1077 $target_id = $target->getId();
1078
1079 $source->clonePagesAndSettings($source, $target, $recipe);
1080
1081 // link portfolio to exercise assignment
1082 $exc_ref_id = (int)$_REQUEST["exc_id"];
1083 $ass_id = (int)$_REQUEST["ass_id"];
1084 if($exc_ref_id &&
1085 $ass_id &&
1086 $ilAccess->checkAccess("read", "", $exc_ref_id))
1087 {
1088 include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1089 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1090 $exc = new ilObjExercise($exc_ref_id);
1091 $ass = new ilExAssignment($ass_id);
1092 if($ass->getExerciseId() == $exc->getId() &&
1093 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO)
1094 {
1095 $exc->addResourceObject($target_id, $ass_id, $ilUser->getId());
1096 }
1097 }
1098
1099 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1100 $this->ctrl->setParameter($this, "prt_id", $target_id);
1101 $this->ctrl->redirect($this, "view");
1102 }
Exercise assignment.
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:

◆ downloadExcAssFile()

ilObjPortfolioGUI::downloadExcAssFile ( )

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

748 {
749 if($_GET["ass"] && $_GET["file"])
750 {
751 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
752 $ass = new ilExAssignment((int)$_GET["ass"]);
753
754 $ass_files = ilExAssignment::getFiles($ass->getExerciseId(), $ass->getId());
755 if (count($ass_files) > 0)
756 {
757 foreach($ass_files as $file)
758 {
759 if($file["name"] == $_GET["file"])
760 {
761 ilUtil::deliverFile($file["fullpath"], $file["name"]);
762 }
763 }
764 }
765 }
766 }
print $file
static getFiles($a_exc_id, $a_ass_id)
Get files.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References $_GET, $file, ilUtil\deliverFile(), and ilExAssignment\getFiles().

+ Here is the call graph for this function:

◆ downloadExcSubFile()

ilObjPortfolioGUI::downloadExcSubFile ( )

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

769 {
770 if($_GET["ass"])
771 {
772 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
773 $ass = new ilExAssignment((int)$_GET["ass"]);
774
775 $submitted = ilExAssignment::getDeliveredFiles($ass->getExerciseId(), $ass->getId(), $this->user_id);
776 if (count($submitted) > 0)
777 {
778 $submitted = array_pop($submitted);
779
780 $user_data = ilObjUser::_lookupName($submitted["user_id"]);
781 $title = ilObject::_lookupTitle($submitted["obj_id"])." - ".
782 $ass->getTitle()." - ".
783 $user_data["firstname"]." ".
784 $user_data["lastname"]." (".
785 $user_data["login"].").zip";
786
787 ilUtil::deliverFile($submitted["filename"], $title);
788 }
789 }
790 }
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
static _lookupName($a_user_id)
lookup user name
static _lookupTitle($a_id)
lookup object title

References $_GET, ilObjUser\_lookupName(), ilObject\_lookupTitle(), ilUtil\deliverFile(), and ilExAssignment\getDeliveredFiles().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

45 {
46 $this->checkPermission("read");
47
48 // goto link to portfolio page
49 if($_GET["gtp"])
50 {
51 $_GET["user_page"] = $_GET["gtp"];
52 }
53
55
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd("view");
58
59 /*
60 if($_REQUEST["ecal"])
61 {
62 $cmd = "preview";
63 $next_class = "";
64 }
65 */
66
67 switch($next_class)
68 {
69 case "ilworkspaceaccessgui";
70 if($this->checkPermissionBool("write"))
71 {
72 $this->setTabs();
73 $this->tabs_gui->activateTab("share");
74
75 $this->tpl->setPermanentLink("prtf", $this->object->getId());
76
77 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
78 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true, $plink);
79 $this->ctrl->forwardCommand($wspacc);
80 }
81 break;
82
83 case 'ilportfoliopagegui':
84 if($this->determinePageCall())
85 {
86 // only in edit mode
87 $this->addLocator();
88
89 include_once "Services/Form/classes/class.ilFileInputGUI.php";
91 }
92 $this->handlePageCall($cmd);
93 break;
94
95 case "ilnotegui";
96 $this->preview();
97 break;
98
99 case "ilobjstylesheetgui":
100 include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
101 $this->ctrl->setReturn($this, "editStyleProperties");
102 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
103 $style_gui->omitLocator();
104 if ($cmd == "create" || $_GET["new_type"]=="sty")
105 {
106 $style_gui->setCreationMode(true);
107 }
108
109 if ($cmd == "confirmedDelete")
110 {
111 $this->object->setStyleSheetId(0);
112 $this->object->update();
113 }
114
115 $ret = $this->ctrl->forwardCommand($style_gui);
116
117 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
118 {
119 $style_id = $ret;
120 $this->object->setStyleSheetId($style_id);
121 $this->object->update();
122 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
123 }
124 break;
125
126 default:
127
128 if($cmd != "preview")
129 {
130 $this->addLocator();
131 $this->setTabs();
132 }
133 $this->$cmd();
134 break;
135 }
136
137 return true;
138 }
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="")
$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:

◆ finalize()

ilObjPortfolioGUI::finalize ( )
protected

Finalize and submit portfolio to exercise.

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

796 {
797 // to make exercise gui load assignment
798 $_GET["ass_id"] = $_REQUEST["ass"];
799
800 // #11173 - ref_id is needed for notifications
801 $exc_ref_id = array_shift(ilObject::_getAllReferences($_REQUEST["exc"]));
802
803 include_once "Modules/Exercise/classes/class.ilObjExerciseGUI.php";
804 $exc_gui = new ilObjExerciseGUI(null, $exc_ref_id, true);
805 $exc_gui->submitPortfolio($this->object->getId());
806
807 ilUtil::sendSuccess($this->lng->txt("prtf_finalized"), true);
808 $this->ctrl->redirect($this, "view");
809 }
Class ilObjExerciseGUI.
static _getAllReferences($a_id)
get all reference ids of object

References $_GET, $_REQUEST, ilObject\_getAllReferences(), and ilUtil\sendSuccess().

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

450 {
451 $a_values["online"] = $this->object->isOnline();
452
453 parent::getEditFormCustomValues($a_values);
454 }

◆ getExerciseInfo()

ilObjPortfolioGUI::getExerciseInfo (   $a_assignment_id,
  $a_add_submit = false 
)

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

626 {
627 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
628 $ass = new ilExAssignment($a_assignment_id);
629 $exercise_id = $ass->getExerciseId();
630 if(!$exercise_id)
631 {
632 return;
633 }
634
635 // is the assignment still open?
636 $times_up = false;
637 if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
638 {
639 $times_up = true;
640 }
641
642 // exercise goto
643 include_once "./Services/Link/classes/class.ilLink.php";
644 $exc_ref_id = array_shift(ilObject::_getAllReferences($exercise_id));
645 $exc_link = ilLink::_getStaticLink($exc_ref_id, "exc");
646
647 $info = sprintf($this->lng->txt("prtf_exercise_info"),
648 $ass->getTitle(),
649 "<a href=\"".$exc_link."\">".
650 ilObject::_lookupTitle($exercise_id)."</a>");
651
652 // submit button
653 if($a_add_submit && !$times_up)
654 {
655 $this->ctrl->setParameter($this, "exc", $exercise_id);
656 $this->ctrl->setParameter($this, "ass", $a_assignment_id);
657 $submit_link = $this->ctrl->getLinkTarget($this, "finalize");
658 $this->ctrl->setParameter($this, "ass", "");
659 $this->ctrl->setParameter($this, "exc", "");
660
661 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
662 $button = ilLinkButton::getInstance();
663 $button->setCaption("prtf_finalize_portfolio");
664 $button->setPrimary(true);
665 $button->setUrl($submit_link);
666 $info .= " ".$button->render();
667 }
668
669 // submitted files
670 $submitted = ilExAssignment::getDeliveredFiles($exercise_id, $a_assignment_id, $this->user_id, true);
671 if($submitted)
672 {
673 $submitted = array_pop($submitted);
674
675 $this->ctrl->setParameter($this, "ass", $a_assignment_id);
676 $dl_link = $this->ctrl->getLinkTarget($this, "downloadExcSubFile");
677 $this->ctrl->setParameter($this, "ass", "");
678
681
682 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
683 $button = ilLinkButton::getInstance();
684 $button->setCaption("download");
685 $button->setUrl($dl_link);
686
687 $info .= "<br />".sprintf($this->lng->txt("prtf_exercise_submitted_info"),
689 $button->render());
690
692 }
693
694
695 // work instructions incl. files
696
697 $tooltip = "";
698
699 $ass = $ass->getInstruction();
700 if($ass)
701 {
702 $tooltip .= nl2br($ass);
703 }
704
705 $ass_files = ilExAssignment::getFiles($exercise_id, $a_assignment_id);
706 if (count($ass_files) > 0)
707 {
708 $tooltip .= "<br /><br />";
709
710 foreach($ass_files as $file)
711 {
712 $this->ctrl->setParameter($this, "ass", $a_assignment_id);
713 $this->ctrl->setParameter($this, "file", urlencode($file["name"]));
714 $dl_link = $this->ctrl->getLinkTarget($this, "downloadExcAssFile");
715 $this->ctrl->setParameter($this, "file", "");
716 $this->ctrl->setParameter($this, "ass", "");
717
718 $tooltip .= $file["name"].": <a href=\"".$dl_link."\">".
719 $this->lng->txt("download")."</a>";
720 }
721 }
722
723 if($tooltip)
724 {
725 $ol_id = "exc_ass_".$a_assignment_id;
726
727 include_once "Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
728 $overlay = new ilOverlayGUI($ol_id);
729
730 // overlay
731 $overlay->setAnchor($ol_id."_tr");
732 $overlay->setTrigger($ol_id."_tr", "click", $ol_id."_tr");
733 $overlay->setAutoHide(false);
734 // $overlay->setCloseElementId($cl_id);
735 $overlay->add();
736
737 // trigger
738 $overlay->addTrigger($ol_id."_tr", "click", $ol_id."_tr");
739
740 $info .= "<div id=\"".$ol_id."_tr\"><a href=\"#\">".$this->lng->txt("exc_instruction")."</a></div>".
741 "<div id=\"".$ol_id."\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip."</div>";
742 }
743
744 return $info;
745 }
const IL_CAL_DATETIME
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
static getInstance()
Factory.
This is a utility class for the yui overlays.

References $file, ilObject\_getAllReferences(), ilLink\_getStaticLink(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilExAssignment\getDeliveredFiles(), ilExAssignment\getFiles(), ilLinkButton\getInstance(), IL_CAL_DATETIME, ilDatePresentation\setUseRelativeDates(), and ilDatePresentation\useRelativeDates().

+ Here is the call graph for this function:

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

Reimplemented from ilObjPortfolioBaseGUI.

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

514 {
515 return "ilportfoliopagegui";
516 }

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

501 {
502 include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
503 $page_gui = new ilPortfolioPageGUI(
504 $this->object->getId(),
505 $a_page_id,
506 0,
507 $this->object->hasPublicComments()
508 );
509 $page_gui->setAdditional($this->getAdditional());
510 return $page_gui;
511 }
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 481 of file class.ilObjPortfolioGUI.php.

482 {
483 // #11531
484 if(!$a_portfolio_id && $this->object)
485 {
486 $a_portfolio_id = $this->object->getId();
487 }
488 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
489 $page = new ilPortfolioPage($a_page_id);
490 $page->setPortfolioId($a_portfolio_id);
491 return $page;
492 }
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 26 of file class.ilObjPortfolioGUI.php.

27 {
28 return "prtf";
29 }

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

556 {
557 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
558 $form = new ilPropertyFormGUI();
559 $form->setFormAction($this->ctrl->getFormAction($this));
560
561 $options = array();
562 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
563 $tree = new ilWorkspaceTree($this->user_id);
564 $root = $tree->readRootId();
565 if($root)
566 {
567 $root = $tree->getNodeData($root);
568 foreach ($tree->getSubTree($root, true, "blog") as $node)
569 {
570 $options[$node["obj_id"]] = $node["title"];
571 }
572 asort($options);
573 }
574
575 // no blogs to add?
576 if(!sizeof($options))
577 {
578 ilUtil::sendInfo($this->lng->txt("prtf_no_blogs_info"), true);
579 $this->ctrl->redirect($this, "view");
580 }
581
582 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
583 $obj->setRequired(true);
584 $obj->setOptions($options);
585 $form->addItem($obj);
586
587 $form->setTitle($this->lng->txt("prtf_add_blog").": ".
588 $this->object->getTitle());
589 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
590 $form->addCommandButton("view", $this->lng->txt("cancel"));
591
592 return $form;
593 }
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.
if(!is_array($argv)) $options

References $options, ilObject2GUI\$tree, 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 518 of file class.ilObjPortfolioGUI.php.

519 {
520 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
521 $a_tgt->addOption($old);
522
523 $options = array();
524 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
525 foreach($all as $item)
526 {
527 $options[$item["id"]] = $item["title"];
528 }
529 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
530 $prtf->setRequired(true);
531 $prtf->setOptions($options);
532 $old->addSubItem($prtf);
533
534 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
535 $a_tgt->addOption($new);
536
537 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
538 $tf->setMaxLength(128);
539 $tf->setSize(40);
540 $tf->setRequired(true);
541 $new->addSubItem($tf);
542 }
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 213 of file class.ilObjPortfolioGUI.php.

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

847 {
848 global $ilSetting, $ilUser;
849
850 if((int)$_REQUEST["exc_id"])
851 {
852 $this->ctrl->setParameter($this, "exc_id", (int)$_REQUEST["exc_id"]);
853 $this->ctrl->setParameter($this, "ass_id", (int)$_REQUEST["ass_id"]);
854 }
855
856 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
857 $form = new ilPropertyFormGUI();
858 $form->setFormAction($this->ctrl->getFormAction($this));
859
860 $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
861 $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
862 $form->addItem($tmpl);
863
864 $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
865 $title->setValue($a_title);
866 $form->addItem($title);
867
868 // gather user blogs
869 if(!$ilSetting->get('disable_wsp_blogs'))
870 {
871 $blog_options = array();
872 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
873 $tree = new ilWorkspaceTree($this->user_id);
874 $root = $tree->readRootId();
875 if($root)
876 {
877 $root = $tree->getNodeData($root);
878 foreach ($tree->getSubTree($root, true, "blog") as $node)
879 {
880 $blog_options[$node["obj_id"]] = $node["title"];
881 }
882 asort($blog_options);
883 }
884 }
885
886 $has_form_content = false;
887
888 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
890 $quota_sum = 0;
891
892 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
893 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
894 $skill_ids = array();
895
896 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
897 foreach(ilPortfolioTemplatePage::getAllPages($a_prtt_id) as $page)
898 {
899 switch($page["type"])
900 {
902 // skills
903 $source_page = new ilPortfolioTemplatePage($page["id"]);
904 $source_page->buildDom(true);
905 $dom = $source_page->getDom();
906 if($dom instanceof php4DOMDocument)
907 {
908 $dom = $dom->myDOMDocument;
909 }
910 $xpath = new DOMXPath($dom);
911 $nodes = $xpath->query("//PageContent/Skills");
912 foreach($nodes as $node)
913 {
914 $skill_id = $node->getAttribute("Id");
915 if(!in_array($skill_id, $pskills))
916 {
917 $skill_ids[] = $skill_id;
918 }
919 }
920 unset($nodes);
921 unset($xpath);
922 unset($dom);
923 if($check_quota)
924 {
925 $quota_sum += $source_page->getPageDiskSize();
926 }
927 if(sizeof($skill_ids))
928 {
929 $has_form_content = true;
930 }
931 break;
932
934 if(!$ilSetting->get('disable_wsp_blogs'))
935 {
936 $has_form_content = true;
937
938 $field_id = "blog_".$page["id"];
939
940 $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog").": ".
941 $page["title"], $field_id);
942 $blog->setRequired(true);
943 $blog->setValue("blog_create");
944 $form->addItem($blog);
945
946 $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
947 $blog->addOption($new_blog);
948
949 $title = new ilTextInputGUI($this->lng->txt("title"), $field_id."_create_title");
950 $title->setRequired(true);
951 $new_blog->addSubItem($title);
952
953 if(sizeof($blog_options))
954 {
955 $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
956 $blog->addOption($reuse_blog);
957
958 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id."_reuse_blog");
959 $obj->setRequired(true);
960 $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
961 $reuse_blog->addSubItem($obj);
962 }
963
964 $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
965 }
966 break;
967 }
968 }
969
970 if($skill_ids)
971 {
972 include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
973 $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
974 $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
975 $skills->setValue($skill_ids);
976 foreach($skill_ids as $skill_id)
977 {
978 $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
979 }
980 $form->addItem($skills);
981 }
982
983 if($quota_sum)
984 {
985 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
987 {
988 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
989 $this->ctrl->redirect($this, "create");
990 }
991 }
992
993 // no dialog needed, go ahead
994 if(!$has_form_content)
995 {
996 return;
997 }
998
999 $form->setTitle($this->lng->txt("prtf_creation_mode").": ".$this->lng->txt("prtf_creation_mode_template"));
1000 $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
1001 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
1002
1003 return $form;
1004 }
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 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 208 of file class.ilObjPortfolioGUI.php.

209 {
210 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
211 }
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 413 of file class.ilObjPortfolioGUI.php.

414 {
415 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
416 $form = new ilPropertyFormGUI();
417 $form->setFormAction($this->ctrl->getFormAction($this));
418
419 // title
420 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
421 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
422 $ti->setMaxLength(ilObject::TITLE_LENGTH);
423 $ti->setRequired(true);
424 $ti->setValue($this->object->getTitle());
425 $form->addItem($ti);
426
427 /* description
428 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
429 $ta->setCols(40);
430 $ta->setRows(2);
431 $ta->setValue($this->object->getDescription());
432 $form->addItem($ta);
433 */
434
435 // :TODO: online
436 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
437 $online->setChecked($this->object->isOnline());
438 $form->addItem($online);
439
440 $this->initEditCustomForm($form);
441
442 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
443 $form->addCommandButton("update", $this->lng->txt("save"));
444 $form->addCommandButton("view", $this->lng->txt("cancel"));
445
446 return $form;
447 }
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 350 of file class.ilObjPortfolioGUI.php.

351 {
352 $form = $this->initCreateForm("prtf");
353 if($form->checkInput())
354 {
355 // trigger portfolio template "import" process
356 if($form->getInput("mode") == "mode_tmpl")
357 {
358 $_REQUEST["pt"] = $form->getInput("title");
359 return $this->createPortfolioFromTemplate();
360 }
361 }
362
363 return parent::save();
364 }

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

599 {
600 $form = $this->initBlogForm();
601 if ($form->checkInput() && $this->checkPermissionBool("write"))
602 {
603 $page = $this->getPageInstance();
604 $page->setType(ilPortfolioPage::TYPE_BLOG);
605 $page->setTitle($form->getInput("blog"));
606 $page->create();
607
608 ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
609 $this->ctrl->redirect($this, "view");
610 }
611
612 $this->tabs_gui->clearTargets();
613 $this->tabs_gui->setBackTarget($this->lng->txt("back"),
614 $this->ctrl->getLinkTarget($this, "view"));
615
616 $form->setValuesByPost();
617 $this->tpl->setContent($form->getHtml());
618 }
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 140 of file class.ilObjPortfolioGUI.php.

141 {
142 global $ilHelp;
143
144 $ilHelp->setScreenIdComponent("prtf");
145
146 if($this->checkPermissionBool("write"))
147 {
148 $this->tabs_gui->addTab("pages",
149 $this->lng->txt("content"),
150 $this->ctrl->getLinkTarget($this, "view"));
151
152 $this->tabs_gui->addTab("settings",
153 $this->lng->txt("settings"),
154 $this->ctrl->getLinkTarget($this, "edit"));
155
156 $this->tabs_gui->addNonTabbedLink("preview",
157 $this->lng->txt("user_profile_preview"),
158 $this->ctrl->getLinkTarget($this, "preview"));
159
160 $this->lng->loadLanguageModule("wsp");
161 $this->tabs_gui->addTab("share",
162 $this->lng->txt("wsp_permissions"),
163 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share"));
164 }
165 }

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

180 {
181 // parent::setTitleAndDescription();
182
183 $title = $this->lng->txt("portfolio");
184 if($this->object)
185 {
186 $title .= ": ".$this->object->getTitle();
187 }
188 $this->tpl->setTitle($title);
189 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_prtf.svg"),
190 $this->lng->txt("portfolio"));
191
192 if($this->object &&
193 !$this->object->isOnline())
194 {
195 $this->tpl->setAlertProperties(array(
196 array("alert" => true,
197 "property" => $this->lng->txt("status"),
198 "value" => $this->lng->txt("offline"))
199 ));
200 }
201 }
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 397 of file class.ilObjPortfolioGUI.php.

398 {
399 global $ilAccess;
400
401 // return to exercise (portfolio assignment)
402 $exc_ref_id = (int)$_REQUEST["exc_id"];
403 if($exc_ref_id &&
404 $ilAccess->checkAccess("read", "", $exc_ref_id))
405 {
406 include_once "Services/Link/classes/class.ilLink.php";
407 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
408 }
409
410 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
411 }
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 456 of file class.ilObjPortfolioGUI.php.

457 {
458 $this->object->setOnline($a_form->getInput("online"));
459
460 // if portfolio is not online, it cannot be default
461 if(!$a_form->getInput("online"))
462 {
463 ilObjPortfolio::setUserDefault($this->user_id, 0);
464 }
465
466 parent::updateCustom($a_form);
467 }
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 19 of file class.ilObjPortfolioGUI.php.


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