ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 createPortfolioFromAssignment ()
 
 linkPortfolioToAssignment ($a_target_id)
 
 getSkillsToPortfolioAssignment ($a_pskills, $a_skill_ids, $a_source_page)
 
 exportPDFSelection ()
 Export PDF selection. More...
 
 initPDFSelectionForm ()
 Init print view selection form. More...
 
 exportPDFDev ()
 
 exportPDF ($a_dev_mode=false)
 
 printView ($a_pdf_export=false)
 
- 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_obj_id, $a_type)
 Set custom perma link (used in public profile?) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 
 getPageGUIClassName ()
 
 view ()
 Show list of portfolio pages. More...
 
 initPageForm ($a_mode="create")
 Init portfolio page form. More...
 
 savePage ()
 Create new portfolio page. More...
 
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages. More...
 
 confirmPortfolioPageDeletion ()
 Confirm portfolio deletion. More...
 
 deletePortfolioPages ()
 Delete portfolio pages. More...
 
 preview ($a_return=false, $a_content=false, $a_show_notes=true)
 Show user page. More...
 
 export ()
 
 copyPageForm ($a_form=null)
 Select target portfolio for page(s) copy. More...
 
 copyPage ()
 
 initCopyPageForm ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 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)
 
 setTabs ()
 
 addLocator ()
 
 setTitleAndDescription ()
 
 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 (ilPropertyFormGUI $a_form)
 
 createPortfolioFromTemplate (ilPropertyFormGUI $a_form=null)
 
 initCreatePortfolioFromTemplateForm ($a_prtt_id, $a_title)
 
 createPortfolioFromTemplateProcess ($a_process_form=true)
 
- Protected Member Functions inherited from ilObjPortfolioBaseGUI
 addLocatorItems ()
 
 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 (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

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

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $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 27 of file class.ilObjPortfolioGUI.php.

References $DIC, settings(), and user().

28  {
29  global $DIC;
30 
31  $this->lng = $DIC->language();
32  $this->help = $DIC["ilHelp"];
33  $this->settings = $DIC->settings();
34  $this->access = $DIC->access();
35  $this->user = $DIC->user();
36  $this->ctrl = $DIC->ctrl();
37  parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
38 
39  $this->ctrl->saveParameter($this, "exc_back_ref_id");
40  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjPortfolioGUI::_goto (   $a_target)
static

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

References $_GET, $id, and exit.

910  {
911  $id = explode("_", $a_target);
912 
913  $_GET["baseClass"] = "ilsharedresourceGUI";
914  $_GET["prt_id"] = $id[0];
915  if (sizeof($id) == 2) {
916  $_GET["gtp"] = $id[1];
917  }
918 
919  include("ilias.php");
920  exit;
921  }
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

References object.

Referenced by executeCommand().

195  {
196  if (!$this->creation_mode) {
197  $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
198  }
199 
200  parent::addLocatorItems();
201 
202  $this->tpl->setLocator();
203  }
Create new PHPExcel object
obj_idprivate
+ Here is the caller graph for this function:

◆ afterSave()

ilObjPortfolioGUI::afterSave ( ilObject  $a_new_object)
protected

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

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

383  {
384  // create 1st page / blog
385  include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
386  $page = $this->getPageInstance(null, $a_new_object->getId());
387  if ($_POST["ptype"] == "page") {
388  $page->setType(ilPortfolioPage::TYPE_PAGE);
389  $page->setTitle($_POST["fpage"]);
390 
391  // use template as basis
392  $layout_id = $_POST["tmpl"];
393  if ($layout_id) {
394  include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
395  $layout_obj = new ilPageLayout($layout_id);
396  $page->setXMLContent($layout_obj->getXMLContent());
397  }
398  } else {
399  $page->setType(ilPortfolioPage::TYPE_BLOG);
400  $page->setTitle($_POST["blog"]);
401  }
402  $page->create();
403 
404  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
405  $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
406  $this->ctrl->redirect($this, "view");
407  }
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.
Class ilPageLayout.
getId()
get object id public
$_POST["username"]
+ 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 47 of file class.ilObjPortfolioGUI.php.

References ilObjectGUI\$obj_id.

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

48  {
49  if ($a_perm == "create") {
50  return true;
51  }
52  if (!$a_node_id) {
53  $a_node_id = $this->obj_id;
54  }
55  return $this->access_handler->checkAccess($a_perm, "", $a_node_id);
56  }
+ Here is the caller graph for this function:

◆ createPortfolioFromAssignment()

ilObjPortfolioGUI::createPortfolioFromAssignment ( )

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

References $ilSetting, $ilUser, ilObjectGUI\$settings, $source, $target, $target_id, $title, ilObjectGUI\$user, ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilObject\_lookupObjectId(), array, ilPortfolioPage\getAllPortfolioPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ilPersonalSkill\getSelectedUserSkills(), getSkillsToPortfolioAssignment(), ilDiskQuotaHandler\isUploadPossible(), linkPortfolioToAssignment(), ilUtil\sendFailure(), ilUtil\sendSuccess(), toRepository(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilPortfolioPage\TYPE_PAGE.

924  {
927 
928  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
929  include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
930  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
931 
932  $title = trim($_REQUEST["pt"]);
933  $prtt_id = (int) $_REQUEST["prtt"];
934 
935  // get assignment template
936  $ass_template_id = 0;
937  if ((int) $_REQUEST["ass_id"] > 0) {
938  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
939  $ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
940  $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
941  }
942 
943  if ($prtt_id > 0) {
945  if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
946  if ($ass_template_id != $prtt_id) {
947  $this->toRepository();
948  }
949  }
950 
951  //quota manipulation
952  include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
954  $quota_sum = 0;
955 
956  //skills manipulation
957  include_once "Services/Skill/classes/class.ilPersonalSkill.php";
958  $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
959  $skill_ids = array();
960 
961  $recipe = array();
962  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
963  switch ($page["type"]) {
965  if (!$ilSetting->get('disable_wsp_blogs')) {
966  $recipe[$page["id"]] = array("blog", "create", $page['title']);
967  }
968  break;
970  $source_page = new ilPortfolioTemplatePage($page["id"]);
971  $source_page->buildDom(true);
972  if ($check_quota) {
973  $quota_sum += $source_page->getPageDiskSize();
974  }
975  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
976  break;
977  }
978  }
979 
980  if ($quota_sum) {
981  include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
982  if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
983  ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
984  $this->ctrl->redirect($this, "create");
985  }
986  }
987 
988  if ($skill_ids) {
989  $recipe["skills"] = $skill_ids;
990  }
991  }
992 
993  // create portfolio
994  $target = new ilObjPortfolio();
995  $target->setTitle($title);
996  $target->create();
997  $target_id = $target->getId();
998 
999  if ($prtt_id) {
1000  $source = new ilObjPortfolioTemplate($prtt_id, false);
1001  $source->clonePagesAndSettings($source, $target, $recipe);
1002  }
1003 
1004  // link portfolio to exercise assignment
1006 
1007  $this->ctrl->setParameter($this, "prt_id", $target_id);
1008  if ($prtt_id) {
1009  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1010  $this->ctrl->redirect($this, "preview");
1011  } else {
1012  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1013  $this->ctrl->redirect($this, "view");
1014  }
1015  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
Exercise assignment.
getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
$target_id
Definition: goto.php:49
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
static _lookupObjectId($a_ref_id)
lookup object id
static isUploadPossible($a_additional_size=null)
$ilUser
Definition: imgupload.php:18
Page for portfolio template.
static getAvailablePortfolioTemplates($a_permission="read")
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
linkPortfolioToAssignment($a_target_id)
global $ilSetting
Definition: privfeed.php:17
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

◆ createPortfolioFromTemplate()

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

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

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

Referenced by createPortfolioFromTemplateProcess(), and save().

679  {
680  $title = trim($_REQUEST["pt"]);
681  $prtt_id = (int) $_REQUEST["prtt"];
682 
683  // valid template?
684  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
686  if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
687  $this->toRepository();
688  }
689  unset($templates);
690 
691  $this->ctrl->setParameter($this, "prtt", $prtt_id);
692 
693  if (!$a_form) {
694  $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
695  }
696  if ($a_form) {
697  $this->tpl->setContent($a_form->getHTML());
698  } else {
700  }
701  }
createPortfolioFromTemplateProcess($a_process_form=true)
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
static getAvailablePortfolioTemplates($a_permission="read")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioFromTemplateProcess()

ilObjPortfolioGUI::createPortfolioFromTemplateProcess (   $a_process_form = true)
protected

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

References ilObjectGUI\$access, $form, $ilSetting, $ilUser, ilObjectGUI\$settings, $source, $target, $target_id, $title, ilObjectGUI\$user, array, createPortfolioFromTemplate(), ilPortfolioPage\getAllPortfolioPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initCreatePortfolioFromTemplateForm(), linkPortfolioToAssignment(), ilUtil\sendSuccess(), toRepository(), and ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE.

Referenced by createPortfolioFromTemplate().

834  {
837  $ilAccess = $this->access;
838 
839  $title = trim($_REQUEST["pt"]);
840  $prtt_id = (int) $_REQUEST["prtt"];
841 
842  // valid template?
843  include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
845  if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
846  $this->toRepository();
847  }
848  unset($templates);
849 
850  // build page recipe (aka import form values)
851  $recipe = null;
852  if ($a_process_form) {
853  $this->ctrl->setParameter($this, "prtt", $prtt_id);
854 
856  if ($form->checkInput()) {
857  include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
858  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
859  switch ($page["type"]) {
861  if (!$ilSetting->get('disable_wsp_blogs')) {
862  $field_id = "blog_" . $page["id"];
863  switch ($form->getInput($field_id)) {
864  case "blog_create":
865  $recipe[$page["id"]] = array("blog", "create",
866  trim($form->getInput($field_id . "_create_title")));
867  break;
868 
869  case "blog_resuse":
870  $recipe[$page["id"]] = array("blog", "reuse",
871  (int) $form->getInput($field_id . "_reuse_blog"));
872  break;
873 
874  case "blog_ignore":
875  $recipe[$page["id"]] = array("blog", "ignore");
876  break;
877  }
878  }
879  break;
880  }
881  }
882 
883  $recipe["skills"] = (array) $form->getInput("skill_ids");
884  } else {
885  $form->setValuesByPost();
886  return $this->createPortfolioFromTemplate($form);
887  }
888  }
889 
890  $source = new ilObjPortfolioTemplate($prtt_id, false);
891 
892  // create portfolio
893  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
894  $target = new ilObjPortfolio();
895  $target->setTitle($title);
896  $target->create();
897  $target_id = $target->getId();
898 
899  $source->clonePagesAndSettings($source, $target, $recipe);
900 
901  // link portfolio to exercise assignment
903 
904  ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
905  $this->ctrl->setParameter($this, "prt_id", $target_id);
906  $this->ctrl->redirect($this, "preview");
907  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
$target_id
Definition: goto.php:49
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
static getAvailablePortfolioTemplates($a_permission="read")
Create styles array
The data for the language used.
linkPortfolioToAssignment($a_target_id)
global $ilSetting
Definition: privfeed.php:17
$source
Definition: linkback.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

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

References $_GET, ilObject2GUI\$access_handler, ilObjectGUI\$lng, $ret, addLocator(), ilObject2GUI\checkPermission(), checkPermissionBool(), ilObjPortfolioBaseGUI\determinePageCall(), ilObjPortfolioBaseGUI\handlePageCall(), object, ilObjectGUI\omitLocator(), ilObjPortfolioBaseGUI\preview(), ilUtil\sendInfo(), ilFileInputGUI\setPersonalWorkspaceQuotaCheck(), setTabs(), and setTitleAndDescription().

59  {
60  $lng = $this->lng;
61 
62  $this->checkPermission("read");
63 
64  // goto link to portfolio page
65  if ($_GET["gtp"]) {
66  $_GET["user_page"] = $_GET["gtp"];
67  }
68 
69  $this->setTitleAndDescription();
70 
71  $next_class = $this->ctrl->getNextClass($this);
72  $cmd = $this->ctrl->getCmd("view");
73 
74  /*
75  if($_REQUEST["ecal"])
76  {
77  $cmd = "preview";
78  $next_class = "";
79  }
80  */
81 
82  switch ($next_class) {
83  case "ilworkspaceaccessgui":
84  if ($this->checkPermissionBool("write")) {
85  $this->setTabs();
86  $this->tabs_gui->activateTab("share");
87 
88  if ($this->access_handler->getPermissions($this->object->getId()) &&
89  !$this->object->isOnline()) {
90  ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
91  }
92 
93  $this->tpl->setPermanentLink("prtf", $this->object->getId());
94 
95  include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
96  $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
97  $this->ctrl->forwardCommand($wspacc);
98  }
99  break;
100 
101  case 'ilportfoliopagegui':
102  if ($this->determinePageCall()) {
103  // only in edit mode
104  $this->addLocator();
105 
106  include_once "Services/Form/classes/class.ilFileInputGUI.php";
108  }
109  $this->handlePageCall($cmd);
110  break;
111 
112  case "ilnotegui":
113  $this->preview();
114  break;
115 
116  case "ilobjstylesheetgui":
117  include_once("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
118  $this->ctrl->setReturn($this, "editStyleProperties");
119  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
120  $style_gui->omitLocator();
121  if ($cmd == "create" || $_GET["new_type"]=="sty") {
122  $style_gui->setCreationMode(true);
123  }
124 
125  if ($cmd == "confirmedDelete") {
126  $this->object->setStyleSheetId(0);
127  $this->object->update();
128  }
129 
130  $ret = $this->ctrl->forwardCommand($style_gui);
131 
132  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
133  $style_id = $ret;
134  $this->object->setStyleSheetId($style_id);
135  $this->object->update();
136  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
137  }
138  break;
139 
140  case "ilportfolioexercisegui":
141  $this->ctrl->setReturn($this, "view");
142  include_once "Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
143  $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
144  $this->ctrl->forwardCommand($gui);
145  break;
146 
147  default:
148 
149  if ($cmd != "preview") {
150  $this->addLocator();
151  $this->setTabs();
152  }
153  $this->$cmd();
154  break;
155  }
156 
157  return true;
158  }
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
$_GET["client_id"]
Class ilPortfolioExerciseGUI.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static setPersonalWorkspaceQuotaCheck($a_value)
omitLocator($a_omit=true)
ACL access handler GUI.
Create new PHPExcel object
obj_idprivate
Class ilObjStyleSheetGUI.
$ret
Definition: parser.php:6
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
+ Here is the call graph for this function:

◆ exportPDF()

ilObjPortfolioGUI::exportPDF (   $a_dev_mode = false)
Parameters
bool$a_dev_mode
Exceptions
ilWACException

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

References $html, exit, ilHtmlToPdfTransformerFactory\PDF_OUTPUT_DOWNLOAD, printView(), and ilWACSignedPath\setTokenMaxLifetimeInSeconds().

Referenced by exportPDFDev().

1189  {
1190  require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
1192 
1193  $html = $this->printView(true);
1194 
1195  // :TODO: fixing css dummy parameters
1196  $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1197  $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1198 
1199  $html = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
1200  $html = preg_replace("/href=\"\\.\\//ims", "href=\"" . ILIAS_HTTP_PATH . "/", $html);
1201 
1202 
1203  if ($a_dev_mode) {
1204  echo $html;
1205  exit;
1206  }
1207 
1208  //$html = str_replace("&", "&", $html);
1209 
1210  $pdf_factory = new ilHtmlToPdfTransformerFactory();
1211  $pdf_factory->deliverPDFFromHTMLString($html, "portfolio.pdf", ilHtmlToPdfTransformerFactory::PDF_OUTPUT_DOWNLOAD, "Portfolio", "ContentExport");
1212  }
Class ilHtmlToPdfTransformerFactory.
printView($a_pdf_export=false)
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPDFDev()

ilObjPortfolioGUI::exportPDFDev ( )
Exceptions
ilWACException

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

References exportPDF().

1180  {
1181  $this->exportPDF(true);
1182  }
exportPDF($a_dev_mode=false)
+ Here is the call graph for this function:

◆ exportPDFSelection()

ilObjPortfolioGUI::exportPDFSelection ( )

Export PDF selection.

Parameters

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

References $DIC, $form, ilObjectGUI\$tpl, and initPDFSelectionForm().

1075  {
1076  global $DIC;
1077 
1078  $tpl = $DIC["tpl"];
1079 
1080  $form = $this->initPDFSelectionForm();
1081 
1082  $tpl->setContent($form->getHTML());
1083  }
global $DIC
Definition: saml.php:7
if(isset($_POST['submit'])) $form
initPDFSelectionForm()
Init print view selection form.
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array $a_values)
protected

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

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

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

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

523  {
524  return "ilportfoliopagegui";
525  }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance (   $a_page_id)
protected

Get portfolio template page gui instance.

Parameters
int$a_page_id
Returns
ilPortfolioPageGUI

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

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

510  {
511  include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
512  $page_gui = new ilPortfolioPageGUI(
513  $this->object->getId(),
514  $a_page_id,
515  0,
516  $this->object->hasPublicComments()
517  );
518  $page_gui->setAdditional($this->getAdditional());
519  return $page_gui;
520  }
Portfolio page gui class.
getAdditional()
Get Additonal Information.
Create new PHPExcel object
obj_idprivate
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 491 of file class.ilObjPortfolioGUI.php.

Referenced by afterSave(), and saveBlog().

492  {
493  // #11531
494  if (!$a_portfolio_id && $this->object) {
495  $a_portfolio_id = $this->object->getId();
496  }
497  include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
498  $page = new ilPortfolioPage($a_page_id);
499  $page->setPortfolioId($a_portfolio_id);
500  return $page;
501  }
Page for user portfolio.
+ Here is the caller graph for this function:

◆ getSkillsToPortfolioAssignment()

ilObjPortfolioGUI::getSkillsToPortfolioAssignment (   $a_pskills,
  $a_skill_ids,
  $a_source_page 
)
Parameters
arraya_pskills
arraya_skill_ids
ilPortfolioTemplatePage$a_source_page
Returns
array

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

Referenced by createPortfolioFromAssignment(), and initCreatePortfolioFromTemplateForm().

1049  {
1050  $dom = $a_source_page->getDom();
1051  if ($dom instanceof php4DOMDocument) {
1052  $dom = $dom->myDOMDocument;
1053  }
1054  $xpath = new DOMXPath($dom);
1055  $nodes = $xpath->query("//PageContent/Skills");
1056  foreach ($nodes as $node) {
1057  $skill_id = $node->getAttribute("Id");
1058  if (!in_array($skill_id, $a_pskills)) {
1059  $a_skill_ids[] = $skill_id;
1060  }
1061  }
1062  unset($nodes);
1063  unset($xpath);
1064  unset($dom);
1065 
1066  return $a_skill_ids;
1067  }
+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

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

Referenced by initCreateForm().

43  {
44  return "prtf";
45  }
+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )

Init blog page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

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

References $form, $options, ilObject2GUI\$tree, array, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilFormPropertyGUI\setRequired().

Referenced by saveBlog().

568  {
569  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
570  $form = new ilPropertyFormGUI();
571  $form->setFormAction($this->ctrl->getFormAction($this));
572 
573  $options = array();
574  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
575  $tree = new ilWorkspaceTree($this->user_id);
576  $root = $tree->readRootId();
577  if ($root) {
578  $root = $tree->getNodeData($root);
579  foreach ($tree->getSubTree($root, true, "blog") as $node) {
580  $options[$node["obj_id"]] = $node["title"];
581  }
582  asort($options);
583  }
584 
585  // add blog
586  $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
587  $radg->setInfo($this->lng->txt(""));
588  $radg->setValue("new");
589  $radg->setInfo($this->lng->txt(""));
590 
591  $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
592  $radg->addOption($op1);
593  $form->addItem($radg);
594 
595  // Blog title
596  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
597  $ti->setRequired(true);
598  $op1->addSubItem($ti);
599 
600 
601  if (sizeof($options)) {
602  $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
603  $radg->addOption($op2);
604 
605  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
606  $obj->setOptions($options);
607  $op2->addSubItem($obj);
608  }
609 
610  $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
611  $this->object->getTitle());
612  $form->addCommandButton("saveBlog", $this->lng->txt("save"));
613  $form->addCommandButton("view", $this->lng->txt("cancel"));
614 
615  return $form;
616  }
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.
Tree handler for personal workspace.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
setRequired($a_required)
Set Required.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
protected

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

References $new, $old, $options, ilPropertyFormGUI\addItem(), array, ilObjPortfolio\getPortfoliosOfUser(), ilTextInputGUI\setMaxLength(), and ilFormPropertyGUI\setRequired().

528  {
529  $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
530  $a_tgt->setRequired(true);
531  $a_form->addItem($a_tgt);
532 
533  $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
534  $a_tgt->addOption($old);
535 
536  $options = array();
537  $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
538  foreach ($all as $item) {
539  $options[$item["id"]] = $item["title"];
540  }
541  $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
542  $prtf->setRequired(true);
543  $prtf->setOptions($options);
544  $old->addSubItem($prtf);
545 
546  $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
547  $a_tgt->addOption($new);
548 
549  $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
550  $tf->setMaxLength(128);
551  $tf->setSize(40);
552  $tf->setRequired(true);
553  $new->addSubItem($tf);
554  }
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.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
$old
Create styles array
The data for the language used.
setRequired($a_required)
Set Required.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm (   $a_new_type)
protected

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

References $form, $ilSetting, $options, ilObjectGUI\$settings, ilObject2GUI\$tree, $type, $url, ilPageLayout\activeLayouts(), array, 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().

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

References $form, $ilSetting, $ilUser, ilObjectGUI\$settings, $title, ilObject2GUI\$tree, ilObjectGUI\$user, ilDiskQuotaActivationChecker\_isPersonalWorkspaceActive(), ilSkillTreeNode\_lookupTitle(), ilObject\_lookupTitle(), array, ilPortfolioPage\getAllPortfolioPages(), ilPersonalSkill\getSelectedUserSkills(), getSkillsToPortfolioAssignment(), ilDiskQuotaHandler\isUploadPossible(), ilUtil\sendFailure(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilNonEditableValueGUI\setValue(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilPortfolioPage\TYPE_PAGE.

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

704  {
707 
708  if ((int) $_REQUEST["exc_id"]) {
709  $this->ctrl->setParameter($this, "exc_id", (int) $_REQUEST["exc_id"]);
710  $this->ctrl->setParameter($this, "ass_id", (int) $_REQUEST["ass_id"]);
711  }
712 
713  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
714  $form = new ilPropertyFormGUI();
715  $form->setFormAction($this->ctrl->getFormAction($this));
716 
717  $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
718  $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
719  $form->addItem($tmpl);
720 
721  $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
722  $title->setValue($a_title);
723  $form->addItem($title);
724 
725  // gather user blogs
726  if (!$ilSetting->get('disable_wsp_blogs')) {
727  $blog_options = array();
728  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
729  $tree = new ilWorkspaceTree($this->user_id);
730  $root = $tree->readRootId();
731  if ($root) {
732  $root = $tree->getNodeData($root);
733  foreach ($tree->getSubTree($root, true, "blog") as $node) {
734  $blog_options[$node["obj_id"]] = $node["title"];
735  }
736  asort($blog_options);
737  }
738  }
739 
740  $has_form_content = false;
741 
742  include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
744  $quota_sum = 0;
745 
746  include_once "Services/Skill/classes/class.ilPersonalSkill.php";
747  $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
748  $skill_ids = array();
749 
750  include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
751  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
752  switch ($page["type"]) {
754  // skills
755  $source_page = new ilPortfolioTemplatePage($page["id"]);
756  $source_page->buildDom(true);
757  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
758 
759  if ($check_quota) {
760  $quota_sum += $source_page->getPageDiskSize();
761  }
762  if (sizeof($skill_ids)) {
763  $has_form_content = true;
764  }
765  break;
766 
768  if (!$ilSetting->get('disable_wsp_blogs')) {
769  $has_form_content = true;
770 
771  $field_id = "blog_" . $page["id"];
772 
773  $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " .
774  $page["title"], $field_id);
775  $blog->setRequired(true);
776  $blog->setValue("blog_create");
777  $form->addItem($blog);
778 
779  $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
780  $blog->addOption($new_blog);
781 
782  $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
783  $title->setRequired(true);
784  $new_blog->addSubItem($title);
785 
786  if (sizeof($blog_options)) {
787  $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
788  $blog->addOption($reuse_blog);
789 
790  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
791  $obj->setRequired(true);
792  $obj->setOptions(array(""=>$this->lng->txt("please_select"))+$blog_options);
793  $reuse_blog->addSubItem($obj);
794  }
795 
796  $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
797  }
798  break;
799  }
800  }
801 
802  if ($skill_ids) {
803  include_once "Services/Skill/classes/class.ilSkillTreeNode.php";
804  $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
805  $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
806  $skills->setValue($skill_ids);
807  foreach ($skill_ids as $skill_id) {
808  $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
809  }
810  $form->addItem($skills);
811  }
812 
813  if ($quota_sum) {
814  include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
815  if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
816  ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
817  $this->ctrl->redirect($this, "create");
818  }
819  }
820 
821  // no dialog needed, go ahead
822  if (!$has_form_content) {
823  return;
824  }
825 
826  $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
827  $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
828  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
829 
830  return $form;
831  }
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
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.
getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
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.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
static isUploadPossible($a_additional_size=null)
$ilUser
Definition: imgupload.php:18
Page for portfolio template.
This class represents a property in a property form.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
This class represents a non editable value in a property form.
global $ilSetting
Definition: privfeed.php:17
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 234 of file class.ilObjPortfolioGUI.php.

References array, and initCreateForm().

235  {
236  return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
237  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

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

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

425  {
426  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
427  $form = new ilPropertyFormGUI();
428  $form->setFormAction($this->ctrl->getFormAction($this));
429 
430  // title
431  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
432  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
433  $ti->setMaxLength(ilObject::TITLE_LENGTH);
434  $ti->setRequired(true);
435  $ti->setValue($this->object->getTitle());
436  $form->addItem($ti);
437 
438  /* description
439  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
440  $ta->setCols(40);
441  $ta->setRows(2);
442  $ta->setValue($this->object->getDescription());
443  $form->addItem($ta);
444  */
445 
446  // :TODO: online
447  $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
448  $online->setChecked($this->object->isOnline());
449  $form->addItem($online);
450 
451  $this->initEditCustomForm($form);
452 
453  $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
454  $form->addCommandButton("update", $this->lng->txt("save"));
455  $form->addCommandButton("view", $this->lng->txt("cancel"));
456 
457  return $form;
458  }
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.
if(isset($_POST['submit'])) $form
setSize($a_size)
Set Size.
This class represents a text property in a property form.
Create new PHPExcel object
obj_idprivate
initEditCustomForm(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:

◆ initPDFSelectionForm()

ilObjPortfolioGUI::initPDFSelectionForm ( )

Init print view selection form.

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

References ilObjectGUI\$ctrl, $DIC, $form, $ilCtrl, ilObjectGUI\$lng, $tabs, ilObject\_lookupTitle(), ilPortfolioPage\getAllPortfolioPages(), ilBlogPosting\getAllPostings(), ilUtil\getImagePath(), object, ilFormPropertyGUI\setInfo(), ilRadioGroupInputGUI\setValue(), and ilPortfolioPage\TYPE_BLOG.

Referenced by exportPDFSelection().

1089  {
1090  global $DIC;
1091 
1092  $lng = $this->lng;
1093  $ilCtrl = $this->ctrl;
1094 
1095  $tabs = $DIC->tabs();
1096 
1097  $tabs->clearTargets();
1098  $tabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "view"));
1099 
1100  $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1101 
1102 
1103  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1104  $form = new ilPropertyFormGUI();
1105 
1106  // because of PDF export
1107  $form->setPreventDoubleSubmission(false);
1108 
1109  // signature
1110  $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_signature"), "signature");
1111  $cb->setInfo($this->lng->txt("prtf_signature_info"));
1112  $form->addItem($cb);
1113 
1114 
1115  // selection type
1116  $radg = new ilRadioGroupInputGUI($lng->txt("prtf_print_selection"), "sel_type");
1117  $radg->setValue("all_pages");
1118  $op2 = new ilRadioOption($lng->txt("prtf_all_pages"), "all_pages");
1119  $radg->addOption($op2);
1120  $op3= new ilRadioOption($lng->txt("prtf_selected_pages"), "selection");
1121  $radg->addOption($op3);
1122 
1123  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1124  $nl = new ilNestedListInputGUI("", "obj_id");
1125  $op3->addSubItem($nl);
1126 
1127  foreach ($pages as $p) {
1128  if ($p["type"] != ilPortfolioPage::TYPE_BLOG) {
1129  $nl->addListNode(
1130  $p["id"],
1131  $p["title"],
1132  0,
1133  false,
1134  false,
1135  ilUtil::getImagePath("icon_pg.svg"),
1136  $lng->txt("page")
1137  );
1138  } else {
1139  $nl->addListNode(
1140  $p["id"],
1141  $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($p["title"]),
1142  0,
1143  false,
1144  false,
1145  ilUtil::getImagePath("icon_blog.svg"),
1146  $lng->txt("obj_blog")
1147  );
1148  $pages2 = ilBlogPosting::getAllPostings($p["title"]);
1149  foreach ($pages2 as $p2) {
1150  $nl->addListNode(
1151  "b" . $p2["id"],
1152  $p2["title"],
1153  $p["id"],
1154  false,
1155  false,
1156  ilUtil::getImagePath("icon_pg.svg"),
1157  $lng->txt("page")
1158  );
1159  }
1160  }
1161  }
1162 
1163  $form->addItem($radg);
1164 
1165  $form->addCommandButton("exportPDF", $lng->txt("prtf_pdf"));
1166  if (DEVMODE == "1") {
1167  $form->addCommandButton("exportPDFDev", $lng->txt("prtf_pdf") . " (DEV)");
1168  }
1169 
1170  $form->setTitle($lng->txt("prtf_print_options"));
1171  $form->setFormAction($ilCtrl->getFormAction($this, "exportPDF"));
1172 
1173  return $form;
1174  }
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
This class represents an option in a radio group.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124
Create new PHPExcel object
obj_idprivate
This class represents a (nested) list of checkboxes (could be extended for radio items, too)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ linkPortfolioToAssignment()

ilObjPortfolioGUI::linkPortfolioToAssignment (   $a_target_id)

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

References ilObjectGUI\$access, $ilUser, ilObjectGUI\$user, ilExSubmission\addResourceObject(), and ilExAssignment\TYPE_PORTFOLIO.

Referenced by createPortfolioFromAssignment(), and createPortfolioFromTemplateProcess().

1018  {
1019  $ilAccess = $this->access;
1020  $ilUser = $this->user;
1021 
1022  $exc_ref_id = (int) $_REQUEST["exc_id"];
1023  $ass_id = (int) $_REQUEST["ass_id"];
1024 
1025  if ($exc_ref_id &&
1026  $ass_id &&
1027  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1028  include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1029  include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1030  $exc = new ilObjExercise($exc_ref_id);
1031  $ass = new ilExAssignment($ass_id);
1032  if ($ass->getExerciseId() == $exc->getId() &&
1033  $ass->getType() == ilExAssignment::TYPE_PORTFOLIO) {
1034  // #16205
1035  include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1036  $sub = new ilExSubmission($ass, $ilUser->getId());
1037  $sub->addResourceObject($a_target_id);
1038  }
1039  }
1040  }
Exercise assignment.
addResourceObject($a_wsp_id, $a_text=null)
Add personal resource to assigment.
Class ilObjExercise.
$ilUser
Definition: imgupload.php:18
Exercise submission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printView()

ilObjPortfolioGUI::printView (   $a_pdf_export = false)

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

References $_POST, ilObjectGUI\$lng, $ret, ilObjectGUI\$tpl, ilLink\_getStaticLink(), ilObjUser\_lookupName(), ilObject\_lookupTitle(), date, exit, ilDatePresentation\formatDate(), ilPortfolioPage\getAllPortfolioPages(), ilBlogPosting\getAllPostings(), ilObjStyleSheet\getContentPrintStyle(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), IL_CAL_DATE, object, ilPageObjectGUI\setOutputMode(), ilDatePresentation\setUseRelativeDates(), and ilPortfolioPage\TYPE_BLOG.

Referenced by exportPDF().

1215  {
1216  global $tpl;
1217 
1218  $lng = $this->lng;
1219 
1220  $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1221 
1222 
1223  $tpl = new ilTemplate("tpl.main.html", true, true);
1224 
1225  $tpl->setBodyClass("ilPrtfPdfBody");
1226 
1227  $tpl->setCurrentBlock("AdditionalStyle");
1228  $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilUtil::getStyleSheetLocation("filesystem"));
1229  $tpl->parseCurrentBlock();
1230 
1231  $tpl->setCurrentBlock("ContentStyle");
1232  $tpl->setVariable(
1233  "LOCATION_CONTENT_STYLESHEET",
1234  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId(), false)
1235  );
1236  $tpl->parseCurrentBlock();
1237 
1238  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1239  //$this->setContentStyleSheet($tpl);
1240 
1241  // syntax style
1242  $tpl->setCurrentBlock("SyntaxStyle");
1243  $tpl->setVariable(
1244  "LOCATION_SYNTAX_STYLESHEET",
1246  );
1247  $tpl->parseCurrentBlock();
1248 
1249 
1250  include_once("./Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
1251 
1252  $page_content = "";
1253 
1254  // cover page
1255  $cover_tpl = new ilTemplate("tpl.prtf_cover.html", true, true, "Modules/Portfolio");
1256  foreach ($pages as $page) {
1257  if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1258  if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1259  continue;
1260  }
1261  $cover_tpl->setCurrentBlock("content_item");
1262  $cover_tpl->setVariable("ITEM_TITLE", $page["title"]);
1263  $cover_tpl->parseCurrentBlock();
1264  } else {
1265  $cover_tpl->setCurrentBlock("content_item");
1266  $cover_tpl->setVariable("ITEM_TITLE", $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($page["title"]));
1267  $cover_tpl->parseCurrentBlock();
1268  }
1269  }
1270 
1271  if ($_POST["signature"]) {
1272  $cover_tpl->setCurrentBlock("signature");
1273  $cover_tpl->setVariable("TXT_SIGNATURE", $lng->txt("prtf_signature_date"));
1274  $cover_tpl->parseCurrentBlock();
1275  }
1276 
1277  $cover_tpl->setVariable("PORTFOLIO_TITLE", $this->object->getTitle());
1278  $cover_tpl->setVariable("PORTFOLIO_ICON", ilUtil::getImagePath("icon_prtf.svg"));
1279 
1280  $cover_tpl->setVariable("TXT_AUTHOR", $lng->txt("prtf_author"));
1281  $cover_tpl->setVariable("TXT_LINK", $lng->txt("prtf_link"));
1282  $cover_tpl->setVariable("TXT_DATE", $lng->txt("prtf_date_of_print"));
1283 
1284  $author = ilObjUser::_lookupName($this->object->getOwner());
1285  $author_str = $author["firstname"] . " " . $author["lastname"];
1286  $cover_tpl->setVariable("AUTHOR", $author_str);
1287 
1288  include_once('./Services/Link/classes/class.ilLink.php');
1289  $href = ilLink::_getStaticLink($this->object->getId(), "prtf");
1290  $cover_tpl->setVariable("LINK", $href);
1291 
1293  $date_str = ilDatePresentation::formatDate(new ilDate(date("Y-m-d"), IL_CAL_DATE));
1294  $cover_tpl->setVariable("DATE", $date_str);
1295 
1296  $page_content .= $cover_tpl->get();
1297  $page_content .= '<p style="page-break-after:always;"></p>';
1298 
1299  $page_head_tpl = new ilTemplate("tpl.prtf_page_head.html", true, true, "Modules/Portfolio");
1300  $page_head_tpl->setVariable("AUTHOR", $author_str);
1301  $page_head_tpl->setVariable("DATE", $date_str);
1302  $page_head_str = $page_head_tpl->get();
1303 
1304  foreach ($pages as $page) {
1305  if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1306  if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1307  continue;
1308  }
1309 
1310  $page_gui = new ilPortfolioPageGUI($this->object->getId(), $page["id"]);
1311  $page_gui->setOutputMode("print");
1312  $page_gui->setPresentationTitle($page["title"]);
1313  $page_content .= $page_head_str . $page_gui->showPage();
1314 
1315  if ($a_pdf_export) {
1316  $page_content .= '<p style="page-break-after:always;"></p>';
1317  }
1318  } else {
1319  $pages2 = ilBlogPosting::getAllPostings($page["title"]);
1320  foreach ($pages2 as $p2) {
1321  if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array("b" . $p2["id"], $_POST["obj_id"]))) {
1322  continue;
1323  }
1324  $page_gui = new ilBlogPostingGUI(0, null, $p2["id"]);
1325  $page_gui->setFileDownloadLink("#");
1326  $page_gui->setFullscreenLink("#");
1327  $page_gui->setSourcecodeDownloadScript("#");
1328  $page_gui->setOutputMode("print");
1329  $page_content .= $page_head_str . $page_gui->showPage(ilObject::_lookupTitle($page["title"]) . ": " . $page_gui->getBlogPosting()->getTitle());
1330 
1331  if ($a_pdf_export) {
1332  $page_content .= '<p style="page-break-after:always;"></p>';
1333  }
1334  }
1335  }
1336  }
1337 
1338  $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>';
1339 
1340  if (!$a_pdf_export) {
1341  $page_content .= '<script type="text/javascript" language="javascript1.2">
1342  <!--
1343  il.Util.addOnLoad(function () {
1344  il.Util.print();
1345  });
1346  //-->
1347  </script>';
1348  }
1349 
1350  $tpl->setVariable("CONTENT", $page_content);
1351 
1352  if (!$a_pdf_export) {
1353  $tpl->show(false);
1354  exit;
1355  } else {
1356  $tpl->fillJavaScriptFiles();
1357  $ret = $tpl->get("DEFAULT", false, false, false, true, false, false);
1358  return $ret;
1359  }
1360  }
static _lookupName($a_user_id)
lookup user name
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
static getContentPrintStyle()
get content print style
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
Class ilBlogPosting GUI class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
Portfolio page gui class.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
Class for single dates.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
const IL_CAL_DATE
Create new PHPExcel object
obj_idprivate
$ret
Definition: parser.php:6
$_POST["username"]
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjPortfolioGUI::save ( )

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

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

369  {
370  $form = $this->initCreateForm("prtf");
371  if ($form->checkInput()) {
372  // trigger portfolio template "import" process
373  if ($form->getInput("mode") == "mode_tmpl") {
374  $_REQUEST["pt"] = $form->getInput("title");
375  return $this->createPortfolioFromTemplate();
376  }
377  }
378 
379  return parent::save();
380  }
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )

Create new portfolio blog page.

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

References ilObject2GUI\$access_handler, $DIC, $form, $ilUser, ilObject2GUI\$node_id, ilObject2GUI\$tree, checkPermissionBool(), getPageInstance(), initBlogForm(), ilUtil\sendSuccess(), and ilPortfolioPage\TYPE_BLOG.

622  {
623  global $DIC;
624 
625  $ilUser = $DIC->user();
626 
627  $form = $this->initBlogForm();
628  if ($form->checkInput() && $this->checkPermissionBool("write")) {
629  if ($form->getInput("creation_mode") == "existing") {
630  $page = $this->getPageInstance();
631  $page->setType(ilPortfolioPage::TYPE_BLOG);
632  $page->setTitle($form->getInput("blog"));
633  $page->create();
634  } else {
635  $blog = new ilObjBlog();
636  $blog->setTitle($form->getInput("title"));
637  $blog->create();
638 
639  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
640  $tree = new ilWorkspaceTree($ilUser->getId());
641 
642  // @todo: see also e.g. ilExSubmissionObjectGUI->getOverviewContentBlog, this needs refactoring, consumer should not
643  // be responsibel to handle this
644  if (!$tree->getRootId()) {
645  $tree->createTreeForUser($ilUser->getId());
646  }
647 
648  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
650  $node_id = $tree->insertObject($tree->readRootId(), $blog->getId());
651  $access_handler->setPermissions($tree->readRootId(), $node_id);
652 
653  $page = $this->getPageInstance();
654  $page->setType(ilPortfolioPage::TYPE_BLOG);
655  $page->setTitle($blog->getId());
656  $page->create();
657  }
658 
659  ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
660  $this->ctrl->redirect($this, "view");
661  }
662 
663  $this->tabs_gui->clearTargets();
664  $this->tabs_gui->setBackTarget(
665  $this->lng->txt("back"),
666  $this->ctrl->getLinkTarget($this, "view")
667  );
668 
669  $form->setValuesByPost();
670  $this->tpl->setContent($form->getHtml());
671  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $DIC
Definition: saml.php:7
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
Access handler for personal workspace.
Tree handler for personal workspace.
if(isset($_POST['submit'])) $form
Class ilObjBlog.
$ilUser
Definition: imgupload.php:18
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 160 of file class.ilObjPortfolioGUI.php.

References $help, and checkPermissionBool().

Referenced by executeCommand().

161  {
162  $ilHelp = $this->help;
163 
164  $ilHelp->setScreenIdComponent("prtf");
165 
166  if ($this->checkPermissionBool("write")) {
167  $this->tabs_gui->addTab(
168  "pages",
169  $this->lng->txt("content"),
170  $this->ctrl->getLinkTarget($this, "view")
171  );
172 
173  $this->tabs_gui->addTab(
174  "settings",
175  $this->lng->txt("settings"),
176  $this->ctrl->getLinkTarget($this, "edit")
177  );
178 
179  $this->tabs_gui->addNonTabbedLink(
180  "preview",
181  $this->lng->txt("user_profile_preview"),
182  $this->ctrl->getLinkTarget($this, "preview")
183  );
184 
185  $this->lng->loadLanguageModule("wsp");
186  $this->tabs_gui->addTab(
187  "share",
188  $this->lng->txt("wsp_permissions"),
189  $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
190  );
191  }
192  }
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:

◆ setTitleAndDescription()

ilObjPortfolioGUI::setTitleAndDescription ( )
protected

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

References $title, array, ilUtil\getImagePath(), and object.

Referenced by executeCommand().

206  {
207  // parent::setTitleAndDescription();
208 
209  $title = $this->lng->txt("portfolio");
210  if ($this->object) {
211  $title .= ": " . $this->object->getTitle();
212  }
213  $this->tpl->setTitle($title);
214  $this->tpl->setTitleIcon(
215  ilUtil::getImagePath("icon_prtf.svg"),
216  $this->lng->txt("portfolio")
217  );
218 
219  if ($this->object &&
220  !$this->object->isOnline()) {
221  $this->tpl->setAlertProperties(array(
222  array("alert" => true,
223  "property" => $this->lng->txt("status"),
224  "value" => $this->lng->txt("offline"))
225  ));
226  }
227  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

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

Referenced by createPortfolioFromAssignment(), createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

410  {
411  $ilAccess = $this->access;
412 
413  // return to exercise (portfolio assignment)
414  $exc_ref_id = (int) $_REQUEST["exc_id"];
415  if ($exc_ref_id &&
416  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
417  include_once "Services/Link/classes/class.ilLink.php";
418  ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
419  }
420 
421  $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
422  }
static redirect($a_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 467 of file class.ilObjPortfolioGUI.php.

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

468  {
469  $this->object->setOnline($a_form->getInput("online"));
470 
471  // if portfolio is not online, it cannot be default
472  if (!$a_form->getInput("online")) {
473  ilObjPortfolio::setUserDefault($this->user_id, 0);
474  }
475 
476  parent::updateCustom($a_form);
477  }
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

◆ $help

ilObjPortfolioGUI::$help
protected

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

Referenced by setTabs().

◆ $ws_access

ilObjPortfolioGUI::$ws_access
protected

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


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