ILIAS  release_4-4 Revision
ilObjPortfolioGUI Class Reference

Portfolio view gui class. More...

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

Public Member Functions

 __construct ($a_id=0)
 
 getType ()
 
 executeCommand ()
 
 save ()
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getPageGUIClassName ()
 
 initBlogForm ()
 Init blog page form. More...
 
 saveBlog ()
 Create new portfolio blog page. More...
 
 getExerciseInfo ($a_assignment_id, $a_add_submit=false)
 
 downloadExcAssFile ()
 
 downloadExcSubFile ()
 
 _goto ($a_target)
 
- Public Member Functions inherited from ilObjPortfolioBaseGUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
 setAdditional ($a_additional)
 Set Additonal Information (used in public profile?) More...
 
 getAdditional ()
 Get Additonal Information. More...
 
 setPermaLink ($a_link)
 Set custom perma link (used in public profile?) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getPageGUIClassName ()
 
 view ()
 Show list of portfolio pages. More...
 
 initPageForm ($a_mode="create")
 Init portfolio page form. More...
 
 savePage ()
 Create new portfolio page. More...
 
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages. More...
 
 confirmPortfolioPageDeletion ()
 Confirm portfolio deletion. More...
 
 deletePortfolioPages ()
 Delete portfolio pages. More...
 
 preview ($a_return=false, $a_content=false, $a_show_notes=true)
 Show user page. More...
 
 export ()
 
 copyPageForm ($a_form=null)
 Select target portfolio for page(s) copy. More...
 
 copyPage ()
 
 initCopyPageForm ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 
 getCreationMode ()
 
 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 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 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...
 

Protected Member Functions

 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 
 setTabs ()
 
 addLocator ()
 
 initCreationForms ($a_new_type)
 
 initCreateForm ($a_new_type)
 
 afterSave (ilObject $a_new_object)
 
 toRepository ()
 
 initEditForm ()
 
 getEditFormCustomValues (array &$a_values)
 
 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 ()
 
 determinePageCall ()
 
 handlePageCall ($a_cmd)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 
 getPageGUIInstance ($a_page_id)
 
 addPage ()
 Show portfolio page creation form. More...
 
 addBlog ()
 Show portfolio blog page creation form. More...
 
 initBlogForm ()
 
 saveBlog ()
 
 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 ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 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)
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 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

- 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 ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- 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 21 of file class.ilObjPortfolioGUI.php.

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

Member Function Documentation

◆ _goto()

ilObjPortfolioGUI::_goto (   $a_target)

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

References $_GET, and exit.

1082  {
1083  $id = explode("_", $a_target);
1084 
1085  $_GET["baseClass"] = "ilsharedresourceGUI";
1086  $_GET["prt_id"] = $id[0];
1087  if(sizeof($id) == 2)
1088  {
1089  $_GET["gtp"] = $id[1];
1090  }
1091 
1092  include("ilias.php");
1093  exit;
1094  }
exit
Definition: login.php:54
$_GET["client_id"]

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

Referenced by executeCommand().

174  {
175  if(!$this->creation_mode)
176  {
177  $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
178  }
179 
180  parent::addLocatorItems();
181 
182  $this->tpl->setLocator();
183  }
+ Here is the caller graph for this function:

◆ afterSave()

ilObjPortfolioGUI::afterSave ( ilObject  $a_new_object)
protected

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

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

349  {
350  // create 1st page / blog
351  include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
352  $page = $this->getPageInstance(null, $a_new_object->getId());
353  if($_POST["ptype"] == "page")
354  {
355  $page->setType(ilPortfolioPage::TYPE_PAGE);
356  $page->setTitle($_POST["fpage"]);
357 
358  // use template as basis
359  $layout_id = $_POST["tmpl"];
360  if($layout_id)
361  {
362  include_once("./Services/Style/classes/class.ilPageLayout.php");
363  $layout_obj = new ilPageLayout($layout_id);
364  $page->setXMLContent($layout_obj->getXMLContent());
365  }
366  }
367  else
368  {
369  $page->setType(ilPortfolioPage::TYPE_BLOG);
370  $page->setTitle($_POST["blog"]);
371  }
372  $page->create();
373 
374  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
375  $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
376  $this->ctrl->redirect($this, "view");
377  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
Class ilPageLayout.
getId()
get object id public
+ Here is the call graph for this function:

◆ checkPermissionBool()

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

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

References ilObjectGUI\$obj_id.

Referenced by executeCommand(), saveBlog(), and setTabs().

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  }
+ Here is the caller graph for this function:

◆ createPortfolioFromTemplate()

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

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

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

Referenced by createPortfolioFromTemplateProcess(), and save().

791  {
792  $title = trim($_REQUEST["pt"]);
793  $prtt_id = (int)$_REQUEST["prtt"];
794 
795  // valid template?
796  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
798  if(!sizeof($templates) || !in_array($prtt_id, $templates))
799  {
800  $this->toRepository();
801  }
802  unset($templates);
803 
804  $this->ctrl->setParameter($this, "prtt", $prtt_id);
805 
806  if(!$a_form)
807  {
808  $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
809  }
810  if($a_form)
811  {
812  $this->tpl->setContent($a_form->getHTML());
813  }
814  else
815  {
817  }
818  }
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
+ 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 983 of file class.ilObjPortfolioGUI.php.

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().

984  {
985  global $ilSetting, $ilAccess, $ilUser;
986 
987  $title = trim($_REQUEST["pt"]);
988  $prtt_id = (int)$_REQUEST["prtt"];
989 
990  // valid template?
991  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
993  if(!sizeof($templates) || !in_array($prtt_id, $templates))
994  {
995  $this->toRepository();
996  }
997  unset($templates);
998 
999  // build page recipe (aka import form values)
1000  $recipe = null;
1001  if($a_process_form)
1002  {
1003  $this->ctrl->setParameter($this, "prtt", $prtt_id);
1004 
1005  $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
1006  if($form->checkInput())
1007  {
1008  include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
1009  foreach(ilPortfolioTemplatePage::getAllPages($prtt_id) as $page)
1010  {
1011  switch($page["type"])
1012  {
1014  if(!$ilSetting->get('disable_wsp_blogs'))
1015  {
1016  $field_id = "blog_".$page["id"];
1017  switch($form->getInput($field_id))
1018  {
1019  case "blog_create":
1020  $recipe[$page["id"]] = array("blog", "create",
1021  trim($form->getInput($field_id."_create_title")));
1022  break;
1023 
1024  case "blog_resuse":
1025  $recipe[$page["id"]] = array("blog", "reuse",
1026  (int)$form->getInput($field_id."_reuse_blog"));
1027  break;
1028 
1029  case "blog_ignore":
1030  $recipe[$page["id"]] = array("blog", "ignore");
1031  break;
1032  }
1033  }
1034  break;
1035  }
1036  }
1037 
1038  $recipe["skills"] = (array)$form->getInput("skill_ids");
1039  }
1040  else
1041  {
1042  $form->setValuesByPost();
1043  return $this->createPortfolioFromTemplate($form);
1044  }
1045  }
1046 
1047  $source = new ilObjPortfolioTemplate($prtt_id, false);
1048 
1049  // create portfolio
1050  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
1051  $target = new ilObjPortfolio();
1052  $target->setTitle($title);
1053  $target->create();
1054  $target_id = $target->getId();
1055 
1056  $source->clonePagesAndSettings($source, $target, $recipe);
1057 
1058  // link portfolio to exercise assignment
1059  $exc_ref_id = (int)$_REQUEST["exc_id"];
1060  $ass_id = (int)$_REQUEST["ass_id"];
1061  if($exc_ref_id &&
1062  $ass_id &&
1063  $ilAccess->checkAccess("read", "", $exc_ref_id))
1064  {
1065  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1066  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1067  $exc = new ilObjExercise($exc_ref_id);
1068  $ass = new ilExAssignment($ass_id);
1069  if($ass->getExerciseId() == $exc->getId() &&
1070  $ass->getType() == ilExAssignment::TYPE_PORTFOLIO)
1071  {
1072  $exc->addResourceObject($target_id, $ass_id, $ilUser->getId());
1073  }
1074  }
1075 
1076  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1077  $this->ctrl->setParameter($this, "prt_id", $target_id);
1078  $this->ctrl->redirect($this, "view");
1079  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
Exercise assignment.
$target_id
Definition: goto.php:88
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
Class ilObjExercise.
static getAvailablePortfolioTemplates($a_permission="read")
static getAllPages($a_portfolio_id)
Get pages of portfolio.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadExcAssFile()

ilObjPortfolioGUI::downloadExcAssFile ( )

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

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

722  {
723  if($_GET["ass"] && $_GET["file"])
724  {
725  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
726  $ass = new ilExAssignment((int)$_GET["ass"]);
727 
728  $ass_files = ilExAssignment::getFiles($ass->getExerciseId(), $ass->getId());
729  if (count($ass_files) > 0)
730  {
731  foreach($ass_files as $file)
732  {
733  if($file["name"] == $_GET["file"])
734  {
735  ilUtil::deliverFile($file["fullpath"], $file["name"]);
736  }
737  }
738  }
739  }
740  }
print $file
Exercise assignment.
$_GET["client_id"]
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.
+ Here is the call graph for this function:

◆ downloadExcSubFile()

ilObjPortfolioGUI::downloadExcSubFile ( )

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

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

743  {
744  if($_GET["ass"])
745  {
746  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
747  $ass = new ilExAssignment((int)$_GET["ass"]);
748 
749  $submitted = ilExAssignment::getDeliveredFiles($ass->getExerciseId(), $ass->getId(), $this->user_id);
750  if (count($submitted) > 0)
751  {
752  $submitted = array_pop($submitted);
753 
754  $user_data = ilObjUser::_lookupName($submitted["user_id"]);
755  $title = ilObject::_lookupTitle($submitted["obj_id"])." - ".
756  $ass->getTitle()." - ".
757  $user_data["firstname"]." ".
758  $user_data["lastname"]." (".
759  $user_data["login"].").zip";
760 
761  ilUtil::deliverFile($submitted["filename"], $title);
762  }
763  }
764  }
static _lookupName($a_user_id)
lookup user name
Exercise assignment.
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

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

References $_GET, ilObject2GUI\$access_handler, $cmd, $ret, addLocator(), checkPermissionBool(), ilObjPortfolioBaseGUI\determinePageCall(), ilPermanentLinkGUI\getHTML(), ilUtil\getImagePath(), ilObjPortfolioBaseGUI\handlePageCall(), ilObjectGUI\omitLocator(), ilObjPortfolioBaseGUI\preview(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), and setTabs().

45  {
46  // goto link to portfolio page
47  if($_GET["gtp"])
48  {
49  $_GET["user_page"] = $_GET["gtp"];
50  }
51 
52  $title = $this->lng->txt("portfolio");
53  if($this->object)
54  {
55  $title .= ": ".$this->object->getTitle();
56  }
57  $this->tpl->setTitle($title);
58  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_prtf_b.png"),
59  $this->lng->txt("portfolio"));
60 
61  $next_class = $this->ctrl->getNextClass($this);
62  $cmd = $this->ctrl->getCmd("view");
63 
64  /*
65  if($_REQUEST["ecal"])
66  {
67  $cmd = "preview";
68  $next_class = "";
69  }
70  */
71 
72  switch($next_class)
73  {
74  case "ilworkspaceaccessgui";
75  if($this->checkPermissionBool("write"))
76  {
77  $this->setTabs();
78  $this->tabs_gui->activateTab("share");
79 
80  include_once('Services/PermanentLink/classes/class.ilPermanentLinkGUI.php');
81  $plink = new ilPermanentLinkGUI("prtf", $this->object->getId());
82  $plink = $plink->getHTML();
83 
84  include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
85  $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true, $plink);
86  $this->ctrl->forwardCommand($wspacc);
87  }
88  break;
89 
90  case 'ilportfoliopagegui':
91  if($this->determinePageCall())
92  {
93  // only in edit mode
94  $this->addLocator();
95 
96  include_once "Services/Form/classes/class.ilFileInputGUI.php";
98  }
99  $this->handlePageCall($cmd);
100  break;
101 
102  case "ilnotegui";
103  $this->preview();
104  break;
105 
106  case "ilobjstylesheetgui":
107  include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
108  $this->ctrl->setReturn($this, "editStyleProperties");
109  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
110  $style_gui->omitLocator();
111  if ($cmd == "create" || $_GET["new_type"]=="sty")
112  {
113  $style_gui->setCreationMode(true);
114  }
115 
116  if ($cmd == "confirmedDelete")
117  {
118  $this->object->setStyleSheetId(0);
119  $this->object->update();
120  }
121 
122  $ret = $this->ctrl->forwardCommand($style_gui);
123 
124  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
125  {
126  $style_id = $ret;
127  $this->object->setStyleSheetId($style_id);
128  $this->object->update();
129  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
130  }
131  break;
132 
133  default:
134  if($cmd != "preview")
135  {
136  $this->addLocator();
137  $this->setTabs();
138  }
139  $this->$cmd();
140  break;
141  }
142 
143  return true;
144  }
Class for permanent links.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
getHTML()
Get HTML for link.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
omitLocator($a_omit=true)
ACL access handler GUI.
Class ilObjStyleSheetGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
setPersonalWorkspaceQuotaCheck($a_value)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
+ Here is the call graph for this function:

◆ finalize()

ilObjPortfolioGUI::finalize ( )
protected

Finalize and submit portfolio to exercise.

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

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

770  {
771  // to make exercise gui load assignment
772  $_GET["ass_id"] = $_REQUEST["ass"];
773 
774  // #11173 - ref_id is needed for notifications
775  $exc_ref_id = array_shift(ilObject::_getAllReferences($_REQUEST["exc"]));
776 
777  include_once "Modules/Exercise/classes/class.ilObjExerciseGUI.php";
778  $exc_gui = new ilObjExerciseGUI(null, $exc_ref_id, true);
779  $exc_gui->submitPortfolio($this->object->getId());
780 
781  ilUtil::sendSuccess($this->lng->txt("prtf_finalized"), true);
782  $this->ctrl->redirect($this, "view");
783  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
Class ilObjExerciseGUI.
static _getAllReferences($a_id)
get all reference ids of object
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

432  {
433  $a_values["online"] = $this->object->isOnline();
434 
435  parent::getEditFormCustomValues($a_values);
436  }

◆ getExerciseInfo()

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

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

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

611  {
612  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
613  $ass = new ilExAssignment($a_assignment_id);
614  $exercise_id = $ass->getExerciseId();
615  if(!$exercise_id)
616  {
617  return;
618  }
619 
620  // is the assignment still open?
621  $times_up = false;
622  if($ass->getDeadline() && $ass->getDeadline() - time() <= 0)
623  {
624  $times_up = true;
625  }
626 
627  // exercise goto
628  include_once "./Services/Link/classes/class.ilLink.php";
629  $exc_ref_id = array_shift(ilObject::_getAllReferences($exercise_id));
630  $exc_link = ilLink::_getStaticLink($exc_ref_id, "exc");
631 
632  $info = sprintf($this->lng->txt("prtf_exercise_info"),
633  $ass->getTitle(),
634  "<a href=\"".$exc_link."\">".
635  ilObject::_lookupTitle($exercise_id)."</a>");
636 
637  // submit button
638  if($a_add_submit && !$times_up)
639  {
640  $this->ctrl->setParameter($this, "exc", $exercise_id);
641  $this->ctrl->setParameter($this, "ass", $a_assignment_id);
642  $submit_link = $this->ctrl->getLinkTarget($this, "finalize");
643  $this->ctrl->setParameter($this, "ass", "");
644  $this->ctrl->setParameter($this, "exc", "");
645  $info .= " <a class=\"submit emphsubmit\" href=\"".$submit_link."\">".$this->lng->txt("prtf_finalize_portfolio")."</a>";
646  }
647 
648  // submitted files
649  $submitted = ilExAssignment::getDeliveredFiles($exercise_id, $a_assignment_id, $this->user_id, true);
650  if($submitted)
651  {
652  $submitted = array_pop($submitted);
653 
654  $this->ctrl->setParameter($this, "ass", $a_assignment_id);
655  $dl_link = $this->ctrl->getLinkTarget($this, "downloadExcSubFile");
656  $this->ctrl->setParameter($this, "ass", "");
657 
660 
661  $info .= "<br />".sprintf($this->lng->txt("prtf_exercise_submitted_info"),
663  "<a href=\"".$dl_link."\" class=\"submit\">".$this->lng->txt("download")."</a>");
664 
666  }
667 
668 
669  // work instructions incl. files
670 
671  $tooltip = "";
672 
673  $ass = $ass->getInstruction();
674  if($ass)
675  {
676  $tooltip .= nl2br($ass);
677  }
678 
679  $ass_files = ilExAssignment::getFiles($exercise_id, $a_assignment_id);
680  if (count($ass_files) > 0)
681  {
682  $tooltip .= "<br /><br />";
683 
684  foreach($ass_files as $file)
685  {
686  $this->ctrl->setParameter($this, "ass", $a_assignment_id);
687  $this->ctrl->setParameter($this, "file", urlencode($file["name"]));
688  $dl_link = $this->ctrl->getLinkTarget($this, "downloadExcAssFile");
689  $this->ctrl->setParameter($this, "file", "");
690  $this->ctrl->setParameter($this, "ass", "");
691 
692  $tooltip .= $file["name"].": <a href=\"".$dl_link."\">".
693  $this->lng->txt("download")."</a>";
694  }
695  }
696 
697  if($tooltip)
698  {
699  $ol_id = "exc_ass_".$a_assignment_id;
700 
701  include_once "Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php";
702  $overlay = new ilOverlayGUI($ol_id);
703 
704  // overlay
705  $overlay->setAnchor($ol_id."_tr");
706  $overlay->setTrigger($ol_id."_tr", "click", $ol_id."_tr");
707  $overlay->setAutoHide(false);
708  // $overlay->setCloseElementId($cl_id);
709  $overlay->add();
710 
711  // trigger
712  $overlay->addTrigger($ol_id."_tr", "click", $ol_id."_tr");
713 
714  $info .= "<div id=\"".$ol_id."_tr\"><a href=\"#\">".$this->lng->txt("exc_instruction")."</a></div>".
715  "<div id=\"".$ol_id."\" style=\"display:none; background-color:white; border: 1px solid #bbb; padding: 10px;\">".$tooltip."</div>";
716  }
717 
718  return $info;
719  }
print $file
Exercise assignment.
const IL_CAL_DATETIME
static getFiles($a_exc_id, $a_ass_id)
Get files.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static useRelativeDates()
check if relative dates are used
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
This is a utility class for the yui overlays.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
+ Here is the call graph for this function:

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

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

496  {
497  return "ilportfoliopagegui";
498  }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance (   $a_page_id)
protected

Get portfolio template page gui instance.

Parameters
int$a_page_id
Returns
ilPortfolioPageGUI

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

References ilObjPortfolioBaseGUI\getAdditional(), and ilPortfolioPageGUI\setAdditional().

483  {
484  include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
485  $page_gui = new ilPortfolioPageGUI(
486  $this->object->getId(),
487  $a_page_id,
488  0,
489  $this->object->hasPublicComments()
490  );
491  $page_gui->setAdditional($this->getAdditional());
492  return $page_gui;
493  }
Portfolio page gui class.
getAdditional()
Get Additonal Information.
setAdditional($a_additional)
Set Additonal Information.
+ 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

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

Referenced by afterSave(), and saveBlog().

464  {
465  // #11531
466  if(!$a_portfolio_id && $this->object)
467  {
468  $a_portfolio_id = $this->object->getId();
469  }
470  include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
471  $page = new ilPortfolioPage($a_page_id);
472  $page->setPortfolioId($a_portfolio_id);
473  return $page;
474  }
Page for user portfolio.
+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

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

Referenced by initCreateForm().

27  {
28  return "prtf";
29  }
+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )

Init blog page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

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

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

Referenced by saveBlog().

538  {
539  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
540  $form = new ilPropertyFormGUI();
541  $form->setFormAction($this->ctrl->getFormAction($this));
542 
543  $options = array();
544  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
545  $tree = new ilWorkspaceTree($this->user_id);
546  $root = $tree->readRootId();
547  if($root)
548  {
549  $root = $tree->getNodeData($root);
550  foreach ($tree->getSubTree($root) as $node)
551  {
552  if ($node["type"] == "blog")
553  {
554  $options[$node["obj_id"]] = $node["title"];
555  }
556  }
557  asort($options);
558  }
559 
560  // no blogs to add?
561  if(!sizeof($options))
562  {
563  ilUtil::sendInfo($this->lng->txt("prtf_no_blogs_info"), true);
564  $this->ctrl->redirect($this, "view");
565  }
566 
567  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
568  $obj->setRequired(true);
569  $obj->setOptions($options);
570  $form->addItem($obj);
571 
572  $form->setTitle($this->lng->txt("prtf_add_blog").": ".
573  $this->object->getTitle());
574  $form->addCommandButton("saveBlog", $this->lng->txt("save"));
575  $form->addCommandButton("view", $this->lng->txt("cancel"));
576 
577  return $form;
578  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilFormPropertyGUI  $a_tgt)
protected

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

References $options, ilObjPortfolio\getPortfoliosOfUser(), ilTextInputGUI\setMaxLength(), and ilFormPropertyGUI\setRequired().

501  {
502  $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
503  $a_tgt->addOption($old);
504 
505  $options = array();
506  $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
507  foreach($all as $item)
508  {
509  $options[$item["id"]] = $item["title"];
510  }
511  $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
512  $prtf->setRequired(true);
513  $prtf->setOptions($options);
514  $old->addSubItem($prtf);
515 
516  $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
517  $a_tgt->addOption($new);
518 
519  $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
520  $tf->setMaxLength(128);
521  $tf->setSize(40);
522  $tf->setRequired(true);
523  $new->addSubItem($tf);
524  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
static getPortfoliosOfUser($a_user_id)
Get views of user.
if(!is_array($argv)) $options
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm (   $a_new_type)
protected

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

References $_REQUEST, $ilSetting, $options, ilObject2GUI\$tree, ilPageLayout\activeLayouts(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getType(), ilPageLayout\MODULE_PORTFOLIO, ilUtil\sendInfo(), ilTextInputGUI\setMaxLength(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), ilRadioGroupInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and save().

196  {
197  global $ilSetting;
198 
199  $this->ctrl->setParameter($this, "new_type", $this->getType());
200 
201  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
202  $form = new ilPropertyFormGUI();
203  $form->setFormAction($this->ctrl->getFormAction($this));
204 
205  // title
206  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
207  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
208  $ti->setMaxLength(ilObject::TITLE_LENGTH);
209  $ti->setRequired(true);
210  $form->addItem($ti);
211 
212  /* description
213  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
214  $ta->setCols(40);
215  $ta->setRows(2);
216  $form->addItem($ta);
217  */
218 
219  $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
220  $main->setValue("mode_scratch");
221  $form->addItem($main);
222 
223  $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
224  $main->addOption($opt_scratch);
225 
226 
227  // 1st page
228 
229  $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
230  $type->setRequired(true);
231  $opt_scratch->addSubItem($type);
232 
233  $type_page = new ilRadioOption($this->lng->txt("page"), "page");
234  $type->addOption($type_page);
235 
236  // page type: page
237  $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
238  $tf->setMaxLength(128);
239  $tf->setSize(40);
240  $tf->setRequired(true);
241  $type_page->addSubItem($tf);
242 
243  // page templates
244  include_once "Services/Style/classes/class.ilPageLayout.php";
246  if($templates)
247  {
248  $options = array(0 => $this->lng->txt("none"));
249  foreach ($templates as $templ)
250  {
251  $templ->readObject();
252  $options[$templ->getId()] = $templ->getTitle();
253  }
254 
255  $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
256  $use_template->setRequired(true);
257  $use_template->setOptions($options);
258  $type_page->addSubItem($use_template);
259  }
260 
261  // page type: blog
262  if(!$ilSetting->get('disable_wsp_blogs'))
263  {
264  $options = array();
265  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
266  $tree = new ilWorkspaceTree($this->user_id);
267  $root = $tree->readRootId();
268  if($root)
269  {
270  $root = $tree->getNodeData($root);
271  foreach ($tree->getSubTree($root) as $node)
272  {
273  if ($node["type"] == "blog")
274  {
275  $options[$node["obj_id"]] = $node["title"];
276  }
277  }
278  asort($options);
279  }
280  if(sizeof($options))
281  {
282  $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
283  $type->addOption($type_blog);
284 
285  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
286  $obj->setRequired(true);
287  $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$options);
288  $type_blog->addSubItem($obj);
289  }
290  else
291  {
292  ilUtil::sendInfo($this->lng->txt("prtf_no_blogs_info"));
293  $type->setValue("page");
294  }
295  }
296 
297 
298  // portfolio templates
299 
300  $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
301  $main->addOption($opt_tmpl);
302 
303  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
305  if(!sizeof($templates))
306  {
307  $opt_tmpl->setDisabled(true);
308  }
309  else
310  {
311  $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
312  $tmpl->setRequired(true);
313  $tmpl->setOptions(array(""=>$this->lng->txt("please_select"))+$templates);
314  $opt_tmpl->addSubItem($tmpl);
315 
316  // incoming from repository
317  if((int)$_REQUEST["prtt_pre"])
318  {
319  $tmpl->setValue((int)$_REQUEST["prtt_pre"]);
320  $main->setValue("mode_tmpl");
321  }
322  }
323 
324 
325  $form->setTitle($this->lng->txt("prtf_create_portfolio"));
326  $form->addCommandButton("save", $this->lng->txt("save"));
327  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
328 
329  return $form;
330  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
Tree handler for personal workspace.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a property in a property form.
if(!is_array($argv)) $options
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static getAvailablePortfolioTemplates($a_permission="read")
setMaxLength($a_maxlength)
Set Max Length.
global $ilSetting
Definition: privfeed.php:40
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setRequired($a_required)
Set Required.
+ 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 820 of file class.ilObjPortfolioGUI.php.

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

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

821  {
822  global $ilSetting, $ilUser;
823 
824  if((int)$_REQUEST["exc_id"])
825  {
826  $this->ctrl->setParameter($this, "exc_id", (int)$_REQUEST["exc_id"]);
827  $this->ctrl->setParameter($this, "ass_id", (int)$_REQUEST["ass_id"]);
828  }
829 
830  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
831  $form = new ilPropertyFormGUI();
832  $form->setFormAction($this->ctrl->getFormAction($this));
833 
834  $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
835  $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
836  $form->addItem($tmpl);
837 
838  $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
839  $title->setValue($a_title);
840  $form->addItem($title);
841 
842  // gather user blogs
843  if(!$ilSetting->get('disable_wsp_blogs'))
844  {
845  $blog_options = array();
846  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
847  $tree = new ilWorkspaceTree($this->user_id);
848  $root = $tree->readRootId();
849  if($root)
850  {
851  $root = $tree->getNodeData($root);
852  foreach ($tree->getSubTree($root) as $node)
853  {
854  if ($node["type"] == "blog")
855  {
856  $blog_options[$node["obj_id"]] = $node["title"];
857  }
858  }
859  asort($blog_options);
860  }
861  }
862 
863  $has_form_content = false;
864 
865  include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
867  $quota_sum = 0;
868 
869  include_once "Services/Skill/classes/class.ilPersonalSkill.php";
870  $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
871  $skill_ids = array();
872 
873  include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
874  foreach(ilPortfolioTemplatePage::getAllPages($a_prtt_id) as $page)
875  {
876  switch($page["type"])
877  {
879  // skills
880  $source_page = new ilPortfolioTemplatePage($page["id"]);
881  $source_page->buildDom(true);
882  $dom = $source_page->getDom();
883  if($dom instanceof php4DOMDocument)
884  {
885  $dom = $dom->myDOMDocument;
886  }
887  $xpath = new DOMXPath($dom);
888  $nodes = $xpath->query("//PageContent/Skills");
889  foreach($nodes as $node)
890  {
891  $skill_id = $node->getAttribute("Id");
892  if(!in_array($skill_id, $pskills))
893  {
894  $skill_ids[] = $skill_id;
895  }
896  }
897  unset($nodes);
898  unset($xpath);
899  unset($dom);
900  if($check_quota)
901  {
902  $quota_sum += $source_page->getPageDiskSize();
903  }
904  if(sizeof($skill_ids))
905  {
906  $has_form_content = true;
907  }
908  break;
909 
911  if(!$ilSetting->get('disable_wsp_blogs'))
912  {
913  $has_form_content = true;
914 
915  $field_id = "blog_".$page["id"];
916 
917  $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog").": ".
918  $page["title"], $field_id);
919  $blog->setRequired(true);
920  $blog->setValue("blog_create");
921  $form->addItem($blog);
922 
923  $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
924  $blog->addOption($new_blog);
925 
926  $title = new ilTextInputGUI($this->lng->txt("title"), $field_id."_create_title");
927  $title->setRequired(true);
928  $new_blog->addSubItem($title);
929 
930  if(sizeof($blog_options))
931  {
932  $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
933  $blog->addOption($reuse_blog);
934 
935  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id."_reuse_blog");
936  $obj->setRequired(true);
937  $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
938  $reuse_blog->addSubItem($obj);
939  }
940 
941  $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
942  }
943  break;
944  }
945  }
946 
947  if($skill_ids)
948  {
949  include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
950  $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
951  $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
952  $skills->setValue($skill_ids);
953  foreach($skill_ids as $skill_id)
954  {
955  $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
956  }
957  $form->addItem($skills);
958  }
959 
960  if($quota_sum)
961  {
962  include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
963  if(!ilDiskQuotaHandler::isUploadPossible($quota_sum))
964  {
965  ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
966  $this->ctrl->redirect($this, "create");
967  }
968  }
969 
970  // no dialog needed, go ahead
971  if(!$has_form_content)
972  {
973  return;
974  }
975 
976  $form->setTitle($this->lng->txt("prtf_creation_mode").": ".$this->lng->txt("prtf_creation_mode_template"));
977  $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
978  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
979 
980  return $form;
981  }
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _lookupTitle($a_id)
lookup object title
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
Tree handler for personal workspace.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
This class represents a text property in a property form.
static isUploadPossible($a_additional_size=null)
Page for portfolio template.
This class represents a property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static getAllPages($a_portfolio_id)
Get pages of portfolio.
global $ilUser
Definition: imgupload.php:15
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjPortfolioGUI::initCreationForms (   $a_new_type)
protected

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

References initCreateForm().

191  {
192  return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
193  }
+ Here is the call graph for this function:

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

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

References ilObjPortfolioBaseGUI\initEditCustomForm(), ilCheckboxInputGUI\setChecked(), ilTextInputGUI\setSize(), and ilObject\TITLE_LENGTH.

396  {
397  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
398  $form = new ilPropertyFormGUI();
399  $form->setFormAction($this->ctrl->getFormAction($this));
400 
401  // title
402  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
403  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
404  $ti->setMaxLength(ilObject::TITLE_LENGTH);
405  $ti->setRequired(true);
406  $ti->setValue($this->object->getTitle());
407  $form->addItem($ti);
408 
409  /* description
410  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
411  $ta->setCols(40);
412  $ta->setRows(2);
413  $ta->setValue($this->object->getDescription());
414  $form->addItem($ta);
415  */
416 
417  // :TODO: online
418  $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
419  $online->setChecked($this->object->isOnline());
420  $form->addItem($online);
421 
422  $this->initEditCustomForm($form);
423 
424  $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
425  $form->addCommandButton("update", $this->lng->txt("save"));
426  $form->addCommandButton("view", $this->lng->txt("cancel"));
427 
428  return $form;
429  }
This class represents a property form user interface.
const TITLE_LENGTH
max length of object title
This class represents a checkbox property in a property form.
setChecked($a_checked)
Set Checked.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
initEditCustomForm(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:

◆ save()

ilObjPortfolioGUI::save ( )

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

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

333  {
334  $form = $this->initCreateForm("prtf");
335  if($form->checkInput())
336  {
337  // trigger portfolio template "import" process
338  if($form->getInput("mode") == "mode_tmpl")
339  {
340  $_REQUEST["pt"] = $form->getInput("title");
341  return $this->createPortfolioFromTemplate();
342  }
343  }
344 
345  return parent::save();
346  }
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )

Create new portfolio blog page.

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

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

584  {
585  $form = $this->initBlogForm();
586  if ($form->checkInput() && $this->checkPermissionBool("write"))
587  {
588  $page = $this->getPageInstance();
589  $page->setType(ilPortfolioPage::TYPE_BLOG);
590  $page->setTitle($form->getInput("blog"));
591  $page->create();
592 
593  ilUtil::sendSuccess($this->lng->txt("prtf_page_created"), true);
594  $this->ctrl->redirect($this, "view");
595  }
596 
597  $this->tabs_gui->clearTargets();
598  $this->tabs_gui->setBackTarget($this->lng->txt("back"),
599  $this->ctrl->getLinkTarget($this, "view"));
600 
601  $form->setValuesByPost();
602  $this->tpl->setContent($form->getHtml());
603  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
initBlogForm()
Init blog page form.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
+ Here is the call graph for this function:

◆ setTabs()

ilObjPortfolioGUI::setTabs ( )
protected

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

References checkPermissionBool().

Referenced by executeCommand().

147  {
148  global $ilHelp;
149 
150  $ilHelp->setScreenIdComponent("prtf");
151 
152  if($this->checkPermissionBool("write"))
153  {
154  $this->tabs_gui->addTab("pages",
155  $this->lng->txt("content"),
156  $this->ctrl->getLinkTarget($this, "view"));
157 
158  $this->tabs_gui->addTab("settings",
159  $this->lng->txt("settings"),
160  $this->ctrl->getLinkTarget($this, "edit"));
161 
162  $this->tabs_gui->addNonTabbedLink("preview",
163  $this->lng->txt("user_profile_preview"),
164  $this->ctrl->getLinkTarget($this, "preview"));
165 
166  $this->lng->loadLanguageModule("wsp");
167  $this->tabs_gui->addTab("share",
168  $this->lng->txt("wsp_permissions"),
169  $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share"));
170  }
171  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

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

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

380  {
381  global $ilAccess;
382 
383  // return to exercise (portfolio assignment)
384  $exc_ref_id = (int)$_REQUEST["exc_id"];
385  if($exc_ref_id &&
386  $ilAccess->checkAccess("read", "", $exc_ref_id))
387  {
388  include_once "Services/Link/classes/class.ilLink.php";
389  ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
390  }
391 
392  $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
393  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $a_form)

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

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

439  {
440  $this->object->setOnline($a_form->getInput("online"));
441 
442  // if portfolio is not online, it cannot be default
443  if(!$a_form->getInput("online"))
444  {
445  ilObjPortfolio::setUserDefault($this->user_id, 0);
446  }
447 
448  parent::updateCustom($a_form);
449  }
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.
+ 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: