ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjPortfolioGUI Class Reference

Portfolio view gui class. More...

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

Public Member Functions

 __construct ($a_id=0)
 
 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 execute command More...
 
 create ()
 create new object form More...
 
 save ()
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 getPageGUIClassName ()
 
 initBlogForm ()
 Init blog page form. More...
 
 saveBlog ()
 Create new portfolio blog page. More...
 
 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)
 Constructor. More...
 
 setAdditional ($a_additional)
 Set Additonal Information (used in public profile?) More...
 
 getAdditional ()
 Get Additonal Information. More...
 
 setPermaLink ($a_obj_id, $a_type)
 Set custom perma link (used in public profile?) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 getPageGUIClassName ()
 
 view ()
 Show list of portfolio pages. More...
 
 initPageForm ($a_mode="create")
 Init portfolio page form. More...
 
 savePage ()
 Create new portfolio page. More...
 
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages. More...
 
 confirmPortfolioPageDeletion ()
 Confirm portfolio deletion. More...
 
 deletePortfolioPages ()
 Delete portfolio pages. More...
 
 preview ($a_return=false, $a_content=false, $a_show_notes=true)
 Show user page. More...
 
 export ()
 
 copyPageForm ($a_form=null)
 Select target portfolio for page(s) copy. More...
 
 copyPage ()
 
 initCopyPageForm ()
 
 setContentStyleSheet ($a_tpl=null)
 
 editStyleProperties ()
 
 initStylePropertiesForm ()
 
 createStyle ()
 
 editStyle ()
 
 deleteStyle ()
 
 saveStyleSettings ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 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 @access 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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 

Protected Member Functions

 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 triggerAssignmentTool ()
 Trigger assignment tool. More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 addLocator ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 getCreateInfoMessage ()
 Get cereat info message. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 toRepository ()
 
 initEditForm ()
 Init object edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 Get portfolio template page instance. More...
 
 getPageGUIInstance ($a_page_id)
 Get portfolio template page gui instance. More...
 
 initCopyPageFormOptions (ilPropertyFormGUI $a_form)
 
 createPortfolioFromTemplate (ilPropertyFormGUI $a_form=null)
 
 initCreatePortfolioFromTemplateForm ($a_prtt_id, $a_title)
 
 createPortfolioFromTemplateProcess ($a_process_form=true)
 
 createFromTemplateDirect ($title="")
 Create portfolio template direct. More...
 
 getOfflineMessage ()
 Get offline message for sharing tab. More...
 
 setOnlineAndShare ()
 Set online and switch to share screen. More...
 
- Protected Member Functions inherited from ilObjPortfolioBaseGUI
 addLocatorItems ()
 Functions to be overwritten. More...
 
 determinePageCall ()
 
 handlePageCall ($a_cmd)
 
 setSettingsSubTabs ($a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 getPageInstance ($a_page_id=null, $a_portfolio_id=null)
 
 getPageGUIInstance ($a_page_id)
 
 addPage ()
 Show portfolio page creation form. More...
 
 addBlog ()
 Show portfolio blog page creation form. More...
 
 initBlogForm ()
 
 saveBlog ()
 
 showEditButton ($page_id)
 Show edit button. More...
 
 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...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 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
 getObjectService ()
 Get object service. More...
 
 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...
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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
 
 $ui
 
 $tool_context
 
 $declaration_authorship
 
- Protected Attributes inherited from ilObjPortfolioBaseGUI
 $help
 
 $main_menu
 
 $user_id
 
 $additional = array()
 
 $perma_link
 
 $page_id
 
 $page_mode
 
 $requested_ppage
 
 $requested_user_page
 
 $requested_back_url = ""
 
- 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
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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

39 {
40 global $DIC;
41
42 $this->lng = $DIC->language();
43 $this->help = $DIC["ilHelp"];
44 $this->settings = $DIC->settings();
45 $this->access = $DIC->access();
46 $this->user = $DIC->user();
47 $this->ctrl = $DIC->ctrl();
48 $this->ui = $DIC->ui();
49
50 $this->tool_context = $DIC->globalScreen()->tool()->context();
51
52 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
53 $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
54
55 $this->ctrl->saveParameter($this, "exc_back_ref_id");
56 }
user()
Definition: user.php:4
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), help(), settings(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

223 {
224 if (!$this->creation_mode) {
225 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
226 }
227
228 parent::addLocatorItems();
229
230 $this->tpl->setLocator();
231 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterSave()

ilObjPortfolioGUI::afterSave ( ilObject  $a_new_object)
protected

Post (successful) object creation hook.

Parameters
ilObject$a_new_object

Reimplemented from ilObjectGUI.

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

481 {
482 // create 1st page / blog
483 $page = $this->getPageInstance(null, $a_new_object->getId());
484 if ($_POST["ptype"] == "page") {
485 $page->setType(ilPortfolioPage::TYPE_PAGE);
486 $page->setTitle($_POST["fpage"]);
487
488 // use template as basis
489 $layout_id = $_POST["tmpl"];
490 if ($layout_id) {
491 $layout_obj = new ilPageLayout($layout_id);
492 $page->setXMLContent($layout_obj->getXMLContent());
493 }
494 } else {
495 $page->setType(ilPortfolioPage::TYPE_BLOG);
496 $page->setTitle($_POST["blog"]);
497 }
498 $page->create();
499
500 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
501 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
502 $this->ctrl->redirect($this, "view");
503 }
$_POST["username"]
getPageInstance($a_page_id=null, $a_portfolio_id=null)
Get portfolio template page instance.
getId()
get object id @access public
Class ilPageLayout.

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

+ Here is the call graph for this function:

◆ checkPermissionBool()

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

Check permission.

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

Reimplemented from ilObject2GUI.

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

64 {
65 if ($a_perm == "create") {
66 return true;
67 }
68 if (!$a_node_id) {
69 $a_node_id = $this->obj_id;
70 }
71 return $this->access_handler->checkAccess($a_perm, "", $a_node_id);
72 }

References ilObjectGUI\$obj_id.

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

+ Here is the caller graph for this function:

◆ create()

ilObjPortfolioGUI::create ( )

create new object form

@access public

Reimplemented from ilObject2GUI.

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

268 {
271
272 $new_type = $_REQUEST["new_type"];
273
274 // add new object to custom parent container
275 $this->ctrl->saveParameter($this, "crtptrefid");
276 // use forced callback after object creation
277 $this->ctrl->saveParameter($this, "crtcb");
278
279 if (!$this->checkPermissionBool("create", "", $new_type)) {
280 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
281 } else {
282 $this->lng->loadLanguageModule($new_type);
283 $this->ctrl->setParameter($this, "new_type", $new_type);
284
285 $forms = $this->initCreationForms($new_type);
286
287 // copy form validation error: do not show other creation forms
288 if ($_GET["cpfl"] && isset($forms[self::CFORM_CLONE])) {
289 $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
290 }
291 $tpl->setContent($this->getCreateInfoMessage() . $this->getCreationFormsHTML($forms));
292 }
293 }
$_GET["client_id"]
getCreateInfoMessage()
Get cereat info message.
initCreationForms($a_new_type)
Init creation froms.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)

References $_GET, ilObjectGUI\$ilErr, ilObjectGUI\$tpl, checkPermissionBool(), getCreateInfoMessage(), ilObjectGUI\getCreationFormsHTML(), and initCreationForms().

+ Here is the call graph for this function:

◆ createFromTemplateDirect()

ilObjPortfolioGUI::createFromTemplateDirect (   $title = "")
protected

Create portfolio template direct.

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

990 {
991 $prtt_id = (int) $_REQUEST["prtt_pre"];
992 if ($title == "") {
993 $title = ilObject::_lookupTitle($prtt_id);
994 }
995
996 // valid template?
998 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
999 $this->toRepository();
1000 }
1001 unset($templates);
1002
1003 $source = new ilObjPortfolioTemplate($prtt_id, false);
1004
1005 // create portfolio
1006 $target = new ilObjPortfolio();
1007 $target->setTitle($title);
1008 $target->create();
1009 $target_id = $target->getId();
1010
1011 $source->clonePagesAndSettings($source, $target, null, true);
1012
1013 // link portfolio to exercise assignment
1014 //$this->linkPortfolioToAssignment($target_id);
1015
1016 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1017 $this->ctrl->setParameter($this, "prt_id", $target_id);
1018 $this->ctrl->redirect($this, "preview");
1019 }
static getAvailablePortfolioTemplates($a_permission="read")
static _lookupTitle($a_id)
lookup object title
$target_id
Definition: goto.php:49
$source
Definition: metadata.php:76

References $source, $target_id, ilObject\_lookupTitle(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), and toRepository().

Referenced by save().

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

◆ createPortfolioFromAssignment()

ilObjPortfolioGUI::createPortfolioFromAssignment ( )

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

1040 {
1043
1044 $title = trim($_REQUEST["pt"]);
1045 $prtt_id = (int) $_REQUEST["prtt"];
1046
1047 // get assignment template
1048 $ass_template_id = 0;
1049 if ((int) $_REQUEST["ass_id"] > 0) {
1050 $ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
1051 $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
1052 }
1053
1054 if ($prtt_id > 0) {
1056 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
1057 if ($ass_template_id != $prtt_id) {
1058 $this->toRepository();
1059 }
1060 }
1061
1062 //quota manipulation
1064 $quota_sum = 0;
1065
1066 //skills manipulation
1067 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
1068 $skill_ids = array();
1069
1070 $recipe = array();
1071 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
1072 switch ($page["type"]) {
1074 if (!$ilSetting->get('disable_wsp_blogs')) {
1075 $recipe[$page["id"]] = array("blog", "create", $page['title']);
1076 }
1077 break;
1079 $source_page = new ilPortfolioTemplatePage($page["id"]);
1080 $source_page->buildDom(true);
1081 if ($check_quota) {
1082 $quota_sum += $source_page->getPageDiskSize();
1083 }
1084 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
1085 break;
1086 }
1087 }
1088
1089 if ($quota_sum) {
1090 if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
1091 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
1092 $this->ctrl->redirect($this, "create");
1093 }
1094 }
1095
1096 if ($skill_ids) {
1097 $recipe["skills"] = $skill_ids;
1098 }
1099 }
1100
1101 // create portfolio
1102 $target = new ilObjPortfolio();
1103 $target->setTitle($title);
1104 $target->create();
1105 $target_id = $target->getId();
1106
1107 if ($prtt_id) {
1108 $source = new ilObjPortfolioTemplate($prtt_id, false);
1109 $source->clonePagesAndSettings($source, $target, $recipe);
1110 }
1111
1112 // link portfolio to exercise assignment
1114
1115 $this->ctrl->setParameter($this, "prt_id", $target_id);
1116 if ($prtt_id) {
1117 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1118 $this->ctrl->redirect($this, "preview");
1119 } else {
1120 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1121 $this->ctrl->redirect($this, "view");
1122 }
1123 }
static isUploadPossible($a_additional_size=null)
Exercise assignment.
getSkillsToPortfolioAssignment($a_pskills, $a_skill_ids, $a_source_page)
linkPortfolioToAssignment($a_target_id)
static _lookupObjectId($a_ref_id)
lookup object id
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
static getAllPortfolioPages($a_portfolio_id)
Get pages of portfolio.
Page for portfolio template.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:18

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

+ Here is the call graph for this function:

◆ createPortfolioFromTemplate()

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

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

767 {
768 $title = trim($_REQUEST["pt"]);
769 $prtt_id = (int) $_REQUEST["prtt"];
770
771 // valid template?
773 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
774 $this->toRepository();
775 }
776 unset($templates);
777
778 $this->ctrl->setParameter($this, "prtt", $prtt_id);
779
780 if (!$a_form) {
781 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
782 }
783 if ($a_form) {
784 $this->tpl->setContent($a_form->getHTML());
785 } else {
787 }
788 }
createPortfolioFromTemplateProcess($a_process_form=true)
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)

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

Referenced by createPortfolioFromTemplateProcess().

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

914 {
917 $ilAccess = $this->access;
918
919 $title = trim($_REQUEST["pt"]);
920 $prtt_id = (int) $_REQUEST["prtt"];
921
922 // valid template?
924 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
925 $this->toRepository();
926 }
927 unset($templates);
928
929 // build page recipe (aka import form values)
930 $recipe = null;
931 if ($a_process_form) {
932 $this->ctrl->setParameter($this, "prtt", $prtt_id);
933
934 $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
935 if ($form->checkInput()) {
936 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
937 switch ($page["type"]) {
939 if (!$ilSetting->get('disable_wsp_blogs')) {
940 $field_id = "blog_" . $page["id"];
941 switch ($form->getInput($field_id)) {
942 case "blog_create":
943 $recipe[$page["id"]] = array("blog", "create",
944 trim($form->getInput($field_id . "_create_title")));
945 break;
946
947 case "blog_resuse":
948 $recipe[$page["id"]] = array("blog", "reuse",
949 (int) $form->getInput($field_id . "_reuse_blog"));
950 break;
951
952 case "blog_ignore":
953 $recipe[$page["id"]] = array("blog", "ignore");
954 break;
955 }
956 }
957 break;
958 }
959 }
960
961 $recipe["skills"] = (array) $form->getInput("skill_ids");
962 } else {
963 $form->setValuesByPost();
964 return $this->createPortfolioFromTemplate($form);
965 }
966 }
967
968 $source = new ilObjPortfolioTemplate($prtt_id, false);
969
970 // create portfolio
971 $target = new ilObjPortfolio();
972 $target->setTitle($title);
973 $target->create();
974 $target_id = $target->getId();
975
976 $source->clonePagesAndSettings($source, $target, $recipe);
977
978 // link portfolio to exercise assignment
980
981 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
982 $this->ctrl->setParameter($this, "prt_id", $target_id);
983 $this->ctrl->redirect($this, "preview");
984 }
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)

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

Referenced by createPortfolioFromTemplate().

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

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

75 {
77
78 $this->checkPermission("read");
79
81
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd("view");
84
85
86 // trigger assignment tool
87 $this->triggerAssignmentTool();
88
89 switch ($next_class) {
90 case "ilworkspaceaccessgui":
91 if ($this->checkPermissionBool("write")) {
92 $this->setTabs();
93 $this->tabs_gui->activateTab("share");
94
95 if ($this->access_handler->getPermissions($this->object->getId()) &&
96 !$this->object->isOnline()) {
97 //ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
98 }
99
100 $this->tpl->setPermanentLink("prtf", $this->object->getId());
101
102 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
103 $wspacc->setBlockingMessage($this->getOfflineMessage());
104 $this->ctrl->forwardCommand($wspacc);
105 }
106 break;
107
108 case 'ilportfoliopagegui':
109 if ($this->determinePageCall()) {
110 // only in edit mode
111 $this->addLocator();
112
114 }
115 $this->handlePageCall($cmd);
116 break;
117
118 case "ilnotegui":
119 $this->preview();
120 break;
121
122 case "ilobjstylesheetgui":
123 $this->ctrl->setReturn($this, "editStyleProperties");
124 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
125 $style_gui->enableWrite(true);
126 $style_gui->omitLocator();
127 if ($cmd == "create" || $_GET["new_type"] == "sty") {
128 $style_gui->setCreationMode(true);
129 }
130
131 if ($cmd == "confirmedDelete") {
132 $this->object->setStyleSheetId(0);
133 $this->object->update();
134 }
135
136 $ret = $this->ctrl->forwardCommand($style_gui);
137
138 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
139 $style_id = $ret;
140 $this->object->setStyleSheetId($style_id);
141 $this->object->update();
142 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
143 }
144 break;
145
146 case "ilportfolioexercisegui":
147 $this->ctrl->setReturn($this, "view");
148 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
149 $this->ctrl->forwardCommand($gui);
150 break;
151
152 default:
153
154 if ($cmd != "preview") {
155 $this->addLocator();
156 $this->setTabs();
157 }
158 $this->$cmd();
159 break;
160 }
161
162 return true;
163 }
static setPersonalWorkspaceQuotaCheck($a_value)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
triggerAssignmentTool()
Trigger assignment tool.
getOfflineMessage()
Get offline message for sharing tab.
setTitleAndDescription()
called by prepare output
setTabs()
create tabs (repository/workspace switch)
Class ilObjStyleSheetGUI.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Class ilPortfolioExerciseGUI.
$ret
Definition: parser.php:6

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

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

1299 {
1301
1302 // prepare generation before contents are processed (for mathjax)
1303 ilPDFGeneratorUtils::prepareGenerationRequest("Portfolio", "ContentExport");
1304
1305 $html = $this->printView(true);
1306
1307 // :TODO: fixing css dummy parameters
1308 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1309 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1310
1311 $html = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
1312 $html = preg_replace("/href=\"\\.\\//ims", "href=\"" . ILIAS_HTTP_PATH . "/", $html);
1313
1314
1315 if ($a_dev_mode) {
1316 echo $html;
1317 exit;
1318 }
1319
1320 //$html = str_replace("&", "&", $html);
1321
1322 $pdf_factory = new ilHtmlToPdfTransformerFactory();
1323 $pdf_factory->deliverPDFFromHTMLString($html, "portfolio.pdf", ilHtmlToPdfTransformerFactory::PDF_OUTPUT_DOWNLOAD, "Portfolio", "ContentExport");
1324 }
Class ilHtmlToPdfTransformerFactory.
printView($a_pdf_export=false)
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
static setTokenMaxLifetimeInSeconds($token_max_lifetime_in_seconds)
exit
Definition: login.php:29

References exit, ILIAS_HTTP_PATH, ilHtmlToPdfTransformerFactory\PDF_OUTPUT_DOWNLOAD, ilPDFGeneratorUtils\prepareGenerationRequest(), printView(), and ilWACSignedPath\setTokenMaxLifetimeInSeconds().

Referenced by exportPDFDev().

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

◆ exportPDFDev()

ilObjPortfolioGUI::exportPDFDev ( )
Exceptions
ilWACException

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

1290 {
1291 $this->exportPDF(true);
1292 }
exportPDF($a_dev_mode=false)

References exportPDF().

+ Here is the call graph for this function:

◆ exportPDFSelection()

ilObjPortfolioGUI::exportPDFSelection ( )

Export PDF selection.

Parameters

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

1180 {
1181 global $DIC;
1182
1183 $tpl = $DIC["tpl"];
1184
1185 $form = $this->initPDFSelectionForm();
1186
1187 $tpl->setContent($form->getHTML());
1188 }
initPDFSelectionForm()
Init print view selection form.

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

+ Here is the call graph for this function:

◆ getCreateInfoMessage()

ilObjPortfolioGUI::getCreateInfoMessage ( )
protected

Get cereat info message.

Parameters

return

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

302 {
303 global $DIC;
304
307 $ui = $DIC->ui();
308 $ilSetting = $DIC->settings();
309
310 $message = "";
311 // page type: blog
312 if (!$ilSetting->get('disable_wsp_blogs')) {
313 $options = array();
314 $tree = new ilWorkspaceTree($this->user_id);
315 $root = $tree->readRootId();
316 if ($root) {
317 $root = $tree->getNodeData($root);
318 foreach ($tree->getSubTree($root) as $node) {
319 if ($node["type"] == "blog") {
320 $options[$node["obj_id"]] = $node["title"];
321 }
322 }
323 asort($options);
324 }
325 if (!sizeof($options)) {
326
327 // #18147
328 $this->lng->loadLanguageModule('pd');
329 $url = $this->ctrl->getLinkTargetByClass("ilDashboardGUI", "jumpToWorkspace");
330 $text = $this->lng->txt("mm_personal_and_shared_r");
331
332 $text = sprintf($this->lng->txt("prtf_no_blogs_info"), $text);
333
334 $mbox = $ui->factory()->messageBox()->info($text)
335 ->withLinks([$ui->factory()->link()->standard(
336 $this->lng->txt("mm_personal_and_shared_r"),
337 $url
338 )]);
339
340 $message = $ui->renderer()->render($mbox);
341 }
342 }
343 return $message;
344 }
Tree handler for personal workspace.
$url
$message
Definition: xapiexit.php:14

References ilObjectGUI\$ctrl, $DIC, $ilSetting, ilObjectGUI\$lng, $message, ilObject2GUI\$tree, $ui, and $url.

Referenced by create().

+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjPortfolioBaseGUI.

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

555 {
556 $a_values["online"] = $this->object->isOnline();
557
558 parent::getEditFormCustomValues($a_values);
559 }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

Returns
string

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

1479 {
1480 $ui = $this->ui;
1481 $lng = $this->lng;
1483
1484 if (!$this->object->isOnline()) {
1485 $f = $ui->factory();
1486 $renderer = $ui->renderer();
1487
1488 $buttons = [$f->button()->standard(
1489 $lng->txt("prtf_set_online"),
1490 $ctrl->getLinkTarget($this, "setOnlineAndShare")
1491 )];
1492
1493 return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
1494 ->withButtons($buttons));
1495 }
1496 return "";
1497 }

References ilObjectGUI\$ctrl, Vendor\Package\$f, ilObjectGUI\$lng, and $ui.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

Reimplemented from ilObjPortfolioBaseGUI.

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

615 {
616 return "ilportfoliopagegui";
617 }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance (   $a_page_id)
protected

Get portfolio template page gui instance.

Parameters
int$a_page_id
Returns
ilPortfolioPageGUI

Reimplemented from ilObjPortfolioBaseGUI.

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

603 {
604 $page_gui = new ilPortfolioPageGUI(
605 $this->object->getId(),
606 $a_page_id,
607 0,
608 $this->object->hasPublicComments()
609 );
610 $page_gui->setAdditional($this->getAdditional());
611 return $page_gui;
612 }
getAdditional()
Get Additonal Information.
Portfolio page gui class.

References ilObjPortfolioBaseGUI\getAdditional().

+ Here is the call graph for this function:

◆ getPageInstance()

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

Get portfolio template page instance.

Parameters
int$a_page_id
int$a_portfolio_id
Returns
ilPortfolioPage

Reimplemented from ilObjPortfolioBaseGUI.

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

586 {
587 // #11531
588 if (!$a_portfolio_id && $this->object) {
589 $a_portfolio_id = $this->object->getId();
590 }
591 $page = new ilPortfolioPage($a_page_id);
592 $page->setPortfolioId($a_portfolio_id);
593 return $page;
594 }
Page for user portfolio.

Referenced by afterSave(), and saveBlog().

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

1154 {
1155 $dom = $a_source_page->getDom();
1156 if ($dom instanceof php4DOMDocument) {
1157 $dom = $dom->myDOMDocument;
1158 }
1159 $xpath = new DOMXPath($dom);
1160 $nodes = $xpath->query("//PageContent/Skills");
1161 foreach ($nodes as $node) {
1162 $skill_id = $node->getAttribute("Id");
1163 if (!in_array($skill_id, $a_pskills)) {
1164 $a_skill_ids[] = $skill_id;
1165 }
1166 }
1167 unset($nodes);
1168 unset($xpath);
1169 unset($dom);
1170
1171 return $a_skill_ids;
1172 }

Referenced by createPortfolioFromAssignment(), and initCreatePortfolioFromTemplateForm().

+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

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

59 {
60 return "prtf";
61 }

Referenced by initCreateForm().

+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )

Init blog page form.

Parameters
string$a_mode
Returns
ilPropertyFormGUI

Reimplemented from ilObjPortfolioBaseGUI.

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

660 {
661 $form = new ilPropertyFormGUI();
662 $form->setFormAction($this->ctrl->getFormAction($this));
663
664 $options = array();
665 $tree = new ilWorkspaceTree($this->user_id);
666 $root = $tree->readRootId();
667 if ($root) {
668 $root = $tree->getNodeData($root);
669 foreach ($tree->getSubTree($root, true, "blog") as $node) {
670 $options[$node["obj_id"]] = $node["title"];
671 }
672 asort($options);
673 }
674
675 // add blog
676 $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
677 $radg->setInfo($this->lng->txt(""));
678 $radg->setValue("new");
679 $radg->setInfo($this->lng->txt(""));
680
681 $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
682 $radg->addOption($op1);
683 $form->addItem($radg);
684
685 // Blog title
686 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
687 $ti->setRequired(true);
688 $op1->addSubItem($ti);
689
690
691 if (sizeof($options)) {
692 $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
693 $radg->addOption($op2);
694
695 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
696 $obj->setOptions($options);
697 $op2->addSubItem($obj);
698 }
699
700 $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
701 $this->object->getTitle());
702 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
703 $form->addCommandButton("view", $this->lng->txt("cancel"));
704
705 return $form;
706 }
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a text property in a property form.

References ilObject2GUI\$tree.

Referenced by saveBlog().

+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from ilObjPortfolioBaseGUI.

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

620 {
621 $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
622 $a_tgt->setRequired(true);
623 $a_form->addItem($a_tgt);
624
625 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
626 $a_tgt->addOption($old);
627
628 $options = array();
629 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
630 foreach ($all as $item) {
631 $options[$item["id"]] = $item["title"];
632 }
633 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
634 $prtf->setRequired(true);
635 $prtf->setOptions($options);
636 $old->addSubItem($prtf);
637
638 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
639 $a_tgt->addOption($new);
640
641 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
642 $tf->setMaxLength(128);
643 $tf->setSize(40);
644 $tf->setRequired(true);
645 $new->addSubItem($tf);
646 }
static getPortfoliosOfUser($a_user_id)
Get views of user.
addItem($a_item)
Add Item (Property, SectionHeader).

References ilPropertyFormGUI\addItem(), and ilObjPortfolio\getPortfoliosOfUser().

+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

353 {
355
356 $this->ctrl->setParameter($this, "new_type", $this->getType());
357
358 $form = new ilPropertyFormGUI();
359 $form->setFormAction($this->ctrl->getFormAction($this));
360
361 // title
362 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
363 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
364 $ti->setMaxLength(ilObject::TITLE_LENGTH);
365 $ti->setRequired(true);
366 $form->addItem($ti);
367
368 $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
369 $main->setValue("mode_scratch");
370 $form->addItem($main);
371
372 $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
373 $main->addOption($opt_scratch);
374
375
376 // 1st page
377
378 $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
379 $type->setRequired(true);
380 $opt_scratch->addSubItem($type);
381
382 $type_page = new ilRadioOption($this->lng->txt("page"), "page");
383 $type->addOption($type_page);
384
385 // page type: page
386 $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
387 $tf->setMaxLength(128);
388 $tf->setSize(40);
389 $tf->setRequired(true);
390 $type_page->addSubItem($tf);
391
392 // page templates
394 if ($templates) {
395 $options = array(0 => $this->lng->txt("none"));
396 foreach ($templates as $templ) {
397 $templ->readObject();
398 $options[$templ->getId()] = $templ->getTitle();
399 }
400
401 $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
402 $use_template->setRequired(true);
403 $use_template->setOptions($options);
404 $type_page->addSubItem($use_template);
405 }
406
407 // page type: blog
408 if (!$ilSetting->get('disable_wsp_blogs')) {
409 $options = array();
410 $tree = new ilWorkspaceTree($this->user_id);
411 $root = $tree->readRootId();
412 if ($root) {
413 $root = $tree->getNodeData($root);
414 foreach ($tree->getSubTree($root) as $node) {
415 if ($node["type"] == "blog") {
416 $options[$node["obj_id"]] = $node["title"];
417 }
418 }
419 asort($options);
420 }
421 if (sizeof($options)) {
422 $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
423 $type->addOption($type_blog);
424
425 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
426 $obj->setRequired(true);
427 $obj->setOptions(array("" => $this->lng->txt("please_select")) + $options);
428 $type_blog->addSubItem($obj);
429 } else {
430 $type->setValue("page");
431 }
432 }
433
434
435 // portfolio templates
436
437 $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
438 $main->addOption($opt_tmpl);
439
441 if (!sizeof($templates)) {
442 $opt_tmpl->setDisabled(true);
443 } else {
444 $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
445 $tmpl->setRequired(true);
446 $tmpl->setOptions(array("" => $this->lng->txt("please_select")) + $templates);
447 $opt_tmpl->addSubItem($tmpl);
448
449 // incoming from repository
450 if ((int) $_REQUEST["prtt_pre"]) {
451 $tmpl->setValue((int) $_REQUEST["prtt_pre"]);
452 $main->setValue("mode_tmpl");
453 }
454 }
455
456
457 $form->setTitle($this->lng->txt("prtf_create_portfolio"));
458 $form->addCommandButton("save", $this->lng->txt("create"));
459 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
460
461 return $form;
462 }
getType()
Functions that must be overwritten.
const TITLE_LENGTH
max length of object title
static activeLayouts($a_special_page=false, $a_module=null)
Get active layouts.
$type

References $ilSetting, ilObjectGUI\$settings, ilObject2GUI\$tree, $type, ilPageLayout\activeLayouts(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getType(), ilPageLayout\MODULE_PORTFOLIO, and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and save().

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

◆ initCreatePortfolioFromTemplateForm()

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

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

791 {
794
795 if ((int) $_REQUEST["exc_id"]) {
796 $this->ctrl->setParameter($this, "exc_id", (int) $_REQUEST["exc_id"]);
797 $this->ctrl->setParameter($this, "ass_id", (int) $_REQUEST["ass_id"]);
798 }
799
800 $form = new ilPropertyFormGUI();
801 $form->setFormAction($this->ctrl->getFormAction($this));
802
803 $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
804 $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
805 $form->addItem($tmpl);
806
807 $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
808 $title->setValue($a_title);
809 $form->addItem($title);
810
811 // gather user blogs
812 if (!$ilSetting->get('disable_wsp_blogs')) {
813 $blog_options = array();
814 $tree = new ilWorkspaceTree($this->user_id);
815 $root = $tree->readRootId();
816 if ($root) {
817 $root = $tree->getNodeData($root);
818 foreach ($tree->getSubTree($root, true, "blog") as $node) {
819 $blog_options[$node["obj_id"]] = $node["title"];
820 }
821 asort($blog_options);
822 }
823 }
824
825 $has_form_content = false;
826
828 $quota_sum = 0;
829
830 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
831 $skill_ids = array();
832
833 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
834 switch ($page["type"]) {
836 // skills
837 $source_page = new ilPortfolioTemplatePage($page["id"]);
838 $source_page->buildDom(true);
839 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
840
841 if ($check_quota) {
842 $quota_sum += $source_page->getPageDiskSize();
843 }
844 if (sizeof($skill_ids)) {
845 $has_form_content = true;
846 }
847 break;
848
850 if (!$ilSetting->get('disable_wsp_blogs')) {
851 $has_form_content = true;
852
853 $field_id = "blog_" . $page["id"];
854
855 $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " .
856 $page["title"], $field_id);
857 $blog->setRequired(true);
858 $blog->setValue("blog_create");
859 $form->addItem($blog);
860
861 $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
862 $blog->addOption($new_blog);
863
864 $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
865 $title->setRequired(true);
866 $new_blog->addSubItem($title);
867
868 if (sizeof($blog_options)) {
869 $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
870 $blog->addOption($reuse_blog);
871
872 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
873 $obj->setRequired(true);
874 $obj->setOptions(array("" => $this->lng->txt("please_select")) + $blog_options);
875 $reuse_blog->addSubItem($obj);
876 }
877
878 $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
879 }
880 break;
881 }
882 }
883
884 if ($skill_ids) {
885 $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
886 $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
887 $skills->setValue($skill_ids);
888 foreach ($skill_ids as $skill_id) {
889 $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
890 }
891 $form->addItem($skills);
892 }
893
894 if ($quota_sum) {
895 if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
896 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
897 $this->ctrl->redirect($this, "create");
898 }
899 }
900
901 // no dialog needed, go ahead
902 if (!$has_form_content) {
903 return;
904 }
905
906 $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
907 $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
908 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
909
910 return $form;
911 }
This class represents a property in a property form.
This class represents an option in a checkbox group.
This class represents a non editable value in a property form.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

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

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

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

◆ initCreationForms()

ilObjPortfolioGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

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

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

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

348 {
349 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
350 }
initCreateForm($a_new_type)
Init object creation form.

References initCreateForm().

Referenced by create().

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

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

Init object edit form.

Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

520 {
521 $form = new ilPropertyFormGUI();
522 $form->setFormAction($this->ctrl->getFormAction($this));
523
524 // title
525 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
526 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
527 $ti->setMaxLength(ilObject::TITLE_LENGTH);
528 $ti->setRequired(true);
529 $ti->setValue($this->object->getTitle());
530 $form->addItem($ti);
531
532 /* description
533 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
534 $ta->setCols(40);
535 $ta->setRows(2);
536 $ta->setValue($this->object->getDescription());
537 $form->addItem($ta);
538 */
539
540 // :TODO: online
541 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
542 $online->setChecked($this->object->isOnline());
543 $form->addItem($online);
544
545 $this->initEditCustomForm($form);
546
547 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
548 $form->addCommandButton("update", $this->lng->txt("save"));
549 $form->addCommandButton("view", $this->lng->txt("cancel"));
550
551 return $form;
552 }
This class represents a checkbox property in a property form.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.

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

+ Here is the call graph for this function:

◆ initPDFSelectionForm()

ilObjPortfolioGUI::initPDFSelectionForm ( )

Init print view selection form.

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

1194 {
1195 global $DIC;
1196
1197 $lng = $this->lng;
1199
1200 $tabs = $DIC->tabs();
1201
1202 $tabs->clearTargets();
1203 $tabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "view"));
1204
1205 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1206
1207
1208 $form = new ilPropertyFormGUI();
1209
1210 // because of PDF export
1211 $form->setPreventDoubleSubmission(false);
1212
1213 // declaration of authorship
1214 if ($this->declaration_authorship->getForUser($this->user) != "") {
1215 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_decl_authorship"), "decl_author");
1216 $cb->setInfo($this->declaration_authorship->getForUser($this->user));
1217 $form->addItem($cb);
1218 }
1219
1220 // signature
1221 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_signature"), "signature");
1222 $cb->setInfo($this->lng->txt("prtf_signature_info"));
1223 $form->addItem($cb);
1224
1225
1226 // selection type
1227 $radg = new ilRadioGroupInputGUI($lng->txt("prtf_print_selection"), "sel_type");
1228 $radg->setValue("all_pages");
1229 $op2 = new ilRadioOption($lng->txt("prtf_all_pages"), "all_pages");
1230 $radg->addOption($op2);
1231 $op3 = new ilRadioOption($lng->txt("prtf_selected_pages"), "selection");
1232 $radg->addOption($op3);
1233
1234 $nl = new ilNestedListInputGUI("", "obj_id");
1235 $op3->addSubItem($nl);
1236
1237 foreach ($pages as $p) {
1238 if ($p["type"] != ilPortfolioPage::TYPE_BLOG) {
1239 $nl->addListNode(
1240 $p["id"],
1241 $p["title"],
1242 0,
1243 false,
1244 false,
1245 ilUtil::getImagePath("icon_pg.svg"),
1246 $lng->txt("page")
1247 );
1248 } else {
1249 $nl->addListNode(
1250 $p["id"],
1251 $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($p["title"]),
1252 0,
1253 false,
1254 false,
1255 ilUtil::getImagePath("icon_blog.svg"),
1256 $lng->txt("obj_blog")
1257 );
1258 $pages2 = ilBlogPosting::getAllPostings($p["title"]);
1259 foreach ($pages2 as $p2) {
1260 $nl->addListNode(
1261 "b" . $p2["id"],
1262 $p2["title"],
1263 $p["id"],
1264 false,
1265 false,
1266 ilUtil::getImagePath("icon_pg.svg"),
1267 $lng->txt("page")
1268 );
1269 }
1270 }
1271 }
1272
1273 $form->addItem($radg);
1274
1275 $form->addCommandButton("exportPDF", $lng->txt("prtf_pdf"));
1276 if (DEVMODE == "1") {
1277 $form->addCommandButton("exportPDFDev", $lng->txt("prtf_pdf") . " (DEV)");
1278 }
1279
1280 $form->setTitle($lng->txt("prtf_print_options"));
1281 $form->setFormAction($ilCtrl->getFormAction($this, "exportPDF"));
1282
1283 return $form;
1284 }
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
This class represents a (nested) list of checkboxes (could be extended for radio items,...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18

References ilObjectGUI\$ctrl, $DIC, $ilCtrl, ilObjectGUI\$lng, ilObject\_lookupTitle(), ilPortfolioPage\getAllPortfolioPages(), ilBlogPosting\getAllPostings(), ilUtil\getImagePath(), and ilPortfolioPage\TYPE_BLOG.

Referenced by exportPDFSelection().

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

1126 {
1127 $ilAccess = $this->access;
1129
1130 $exc_ref_id = (int) $_REQUEST["exc_id"];
1131 $ass_id = (int) $_REQUEST["ass_id"];
1132
1133 if ($exc_ref_id &&
1134 $ass_id &&
1135 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1136 $exc = new ilObjExercise($exc_ref_id);
1137 $ass = new ilExAssignment($ass_id);
1138 if ($ass->getExerciseId() == $exc->getId() &&
1139 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO) {
1140 // #16205
1141 $sub = new ilExSubmission($ass, $ilUser->getId());
1142 $sub->addResourceObject($a_target_id);
1143 }
1144 }
1145 }
Exercise submission //TODO: This class has to much static methods related to delivered "files".
Class ilObjExercise.

References ilObjectGUI\$access, $ilUser, ilObjectGUI\$user, and ilExAssignment\TYPE_PORTFOLIO.

Referenced by createPortfolioFromAssignment(), and createPortfolioFromTemplateProcess().

+ Here is the caller graph for this function:

◆ printView()

ilObjPortfolioGUI::printView (   $a_pdf_export = false)

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

1327 {
1328 //global $tpl;
1329
1330 $lng = $this->lng;
1331
1332 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1333
1334
1335 $tpl = new ilGlobalTemplate("tpl.pdf_print_view.html", true, true, "Services/Export/PDF");
1336
1337 $resource_collector = new \ILIAS\COPage\ResourcesCollector(
1339 new ilPortfolioPage()
1340 );
1341 $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
1342
1343 $tpl->setBodyClass("ilPrtfPdfBody");
1344
1345 $tpl->addCss(ilUtil::getStyleSheetLocation("filesystem"));
1346 $tpl->addCss(ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId(), false));
1349
1350 $resource_injector->inject($tpl);
1351
1352
1353 $page_content = "";
1354
1355 // cover page
1356 $cover_tpl = new ilTemplate("tpl.prtf_cover.html", true, true, "Modules/Portfolio");
1357 foreach ($pages as $page) {
1358 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1359 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1360 continue;
1361 }
1362 $cover_tpl->setCurrentBlock("content_item");
1363 $cover_tpl->setVariable("ITEM_TITLE", $page["title"]);
1364 $cover_tpl->parseCurrentBlock();
1365 } else {
1366 $cover_tpl->setCurrentBlock("content_item");
1367 $cover_tpl->setVariable("ITEM_TITLE", $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($page["title"]));
1368 $cover_tpl->parseCurrentBlock();
1369 }
1370 }
1371
1372 if ($_POST["signature"]) {
1373 $cover_tpl->setCurrentBlock("signature");
1374 $cover_tpl->setVariable("TXT_SIGNATURE", $lng->txt("prtf_signature_date"));
1375 $cover_tpl->parseCurrentBlock();
1376 }
1377
1378 if ($_POST["decl_author"]) {
1379 $cover_tpl->setCurrentBlock("decl_author");
1380 $cover_tpl->setVariable(
1381 "TXT_DECL_AUTHOR",
1382 nl2br($this->declaration_authorship->getForUser($this->user))
1383 );
1384 $cover_tpl->parseCurrentBlock();
1385 }
1386
1387 $cover_tpl->setVariable("PORTFOLIO_TITLE", $this->object->getTitle());
1388 $cover_tpl->setVariable("PORTFOLIO_ICON", ilUtil::getImagePath("icon_prtf.svg"));
1389
1390 $cover_tpl->setVariable("TXT_AUTHOR", $lng->txt("prtf_author"));
1391 $cover_tpl->setVariable("TXT_LINK", $lng->txt("prtf_link"));
1392 $cover_tpl->setVariable("TXT_DATE", $lng->txt("prtf_date_of_print"));
1393
1394 $author = ilObjUser::_lookupName($this->object->getOwner());
1395 $author_str = $author["firstname"] . " " . $author["lastname"];
1396 $cover_tpl->setVariable("AUTHOR", $author_str);
1397
1398 $href = ilLink::_getStaticLink($this->object->getId(), "prtf");
1399 $cover_tpl->setVariable("LINK", $href);
1400
1402 $date_str = ilDatePresentation::formatDate(new ilDate(date("Y-m-d"), IL_CAL_DATE));
1403 $cover_tpl->setVariable("DATE", $date_str);
1404
1405 $page_content .= $cover_tpl->get();
1406 $page_content .= '<p style="page-break-after:always;"></p>';
1407
1408 $page_head_tpl = new ilTemplate("tpl.prtf_page_head.html", true, true, "Modules/Portfolio");
1409 $page_head_tpl->setVariable("AUTHOR", $author_str);
1410 $page_head_tpl->setVariable("DATE", $date_str);
1411 $page_head_str = $page_head_tpl->get();
1412
1413 foreach ($pages as $page) {
1414 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1415 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1416 continue;
1417 }
1418
1419 $page_gui = new ilPortfolioPageGUI($this->object->getId(), $page["id"]);
1420 $page_gui->setOutputMode("print");
1421 $page_gui->setPresentationTitle($page["title"]);
1422 $html = $this->ctrl->getHTML($page_gui);
1423 $page_content .= $page_head_str . $html;
1424
1425 if ($a_pdf_export) {
1426 $page_content .= '<p style="page-break-after:always;"></p>';
1427 }
1428 } else {
1429 $pages2 = ilBlogPosting::getAllPostings($page["title"]);
1430 foreach ($pages2 as $p2) {
1431 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array("b" . $p2["id"], $_POST["obj_id"]))) {
1432 continue;
1433 }
1434 $page_gui = new ilBlogPostingGUI(0, null, $p2["id"]);
1435 $page_gui->setFileDownloadLink("#");
1436 $page_gui->setFullscreenLink("#");
1437 $page_gui->setSourcecodeDownloadScript("#");
1438 $page_gui->setOutputMode("print");
1439 $page_content .= $page_head_str . $page_gui->showPage(ilObject::_lookupTitle($page["title"]) . ": " . $page_gui->getBlogPosting()->getTitle());
1440
1441 if ($a_pdf_export) {
1442 $page_content .= '<p style="page-break-after:always;"></p>';
1443 }
1444 }
1445 }
1446 }
1447
1448 $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>';
1449
1450 if (!$a_pdf_export) {
1451 $page_content .= '<script type="text/javascript" language="javascript1.2">
1452 <!--
1453 il.Util.addOnLoad(function () {
1454 il.Util.print();
1455 });
1456 //-->
1457 </script>';
1458 }
1459
1460 $tpl->setVariable("CONTENT", $page_content);
1461
1462 if (!$a_pdf_export) {
1463 $tpl->printToStdout(false);
1464 exit;
1465 } else {
1466 $ret = $tpl->printToString();
1467 //$tpl->fillJavaScriptFiles();
1468 //$ret = $tpl->getSpecial("DEFAULT", false, false, false, true, false, false);
1469 return $ret;
1470 }
1471 }
const IL_CAL_DATE
Class ilBlogPosting GUI class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
Class for single dates.
special template class to simplify handling of ITX/PEAR
static getContentPrintStyle()
get content print style
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static _lookupName($a_user_id)
lookup user name
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user

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

Referenced by exportPDF().

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

◆ save()

ilObjPortfolioGUI::save ( )

Reimplemented from ilObject2GUI.

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

465 {
466 $form = $this->initCreateForm("prtf");
467 if ($form->checkInput()) {
468 // trigger portfolio template "import" process
469 if ($form->getInput("mode") == "mode_tmpl") {
470 $_REQUEST["pt"] = $form->getInput("title");
471 $_REQUEST["prtt_pre"] = (int) $_REQUEST["prtt"];
472 return $this->createFromTemplateDirect($form->getInput("title"));
473 //return $this->createPortfolioFromTemplate();
474 }
475 }
476
477 return parent::save();
478 }
createFromTemplateDirect($title="")
Create portfolio template direct.

References createFromTemplateDirect(), and initCreateForm().

+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )

Create new portfolio blog page.

Reimplemented from ilObjPortfolioBaseGUI.

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

712 {
713 global $DIC;
714
715 $ilUser = $DIC->user();
716
717 $form = $this->initBlogForm();
718 if ($form->checkInput() && $this->checkPermissionBool("write")) {
719 if ($form->getInput("creation_mode") == "existing") {
720 $page = $this->getPageInstance();
721 $page->setType(ilPortfolioPage::TYPE_BLOG);
722 $page->setTitle($form->getInput("blog"));
723 $page->create();
724 } else {
725 $blog = new ilObjBlog();
726 $blog->setTitle($form->getInput("title"));
727 $blog->create();
728
729 $tree = new ilWorkspaceTree($ilUser->getId());
730
731 // @todo: see also e.g. ilExSubmissionObjectGUI->getOverviewContentBlog, this needs refactoring, consumer should not
732 // be responsibel to handle this
733 if (!$tree->getRootId()) {
734 $tree->createTreeForUser($ilUser->getId());
735 }
736
738 $node_id = $tree->insertObject($tree->readRootId(), $blog->getId());
739 $access_handler->setPermissions($tree->readRootId(), $node_id);
740
741 $page = $this->getPageInstance();
742 $page->setType(ilPortfolioPage::TYPE_BLOG);
743 $page->setTitle($blog->getId());
744 $page->create();
745 }
746
747 ilUtil::sendSuccess($this->lng->txt("prtf_blog_page_created"), true);
748 $this->ctrl->redirect($this, "view");
749 }
750
751 $this->tabs_gui->clearTargets();
752 $this->tabs_gui->setBackTarget(
753 $this->lng->txt("back"),
754 $this->ctrl->getLinkTarget($this, "view")
755 );
756
757 $form->setValuesByPost();
758 $this->tpl->setContent($form->getHtml());
759 }
Class ilObjBlog.
initBlogForm()
Init blog page form.
Access handler for personal workspace.

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

+ Here is the call graph for this function:

◆ setOnlineAndShare()

ilObjPortfolioGUI::setOnlineAndShare ( )
protected

Set online and switch to share screen.

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

1503 {
1505 $lng = $this->lng;
1506
1507 if (ilObjPortfolio::_lookupOwner($this->object->getId()) == $this->user_id) {
1508 $this->object->setOnline(true);
1509 $this->object->update();
1510 ilUtil::sendSuccess($lng->txt("prtf_has_been_set_online"), true);
1511 }
1512 $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
1513 }
static _lookupOwner($a_id)
lookup object owner

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and ilObject2\_lookupOwner().

+ Here is the call graph for this function:

◆ setTabs()

ilObjPortfolioGUI::setTabs ( )
protected

create tabs (repository/workspace switch)

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

Reimplemented from ilObject2GUI.

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

189 {
190 $ilHelp = $this->help;
191
192 $ilHelp->setScreenIdComponent("prtf");
193
194 if ($this->checkPermissionBool("write")) {
195 $this->tabs_gui->addTab(
196 "pages",
197 $this->lng->txt("content"),
198 $this->ctrl->getLinkTarget($this, "view")
199 );
200
201 $this->tabs_gui->addTab(
202 "settings",
203 $this->lng->txt("settings"),
204 $this->ctrl->getLinkTarget($this, "edit")
205 );
206
207 $this->tabs_gui->addNonTabbedLink(
208 "preview",
209 $this->lng->txt("user_profile_preview"),
210 $this->ctrl->getLinkTarget($this, "preview")
211 );
212
213 $this->lng->loadLanguageModule("wsp");
214 $this->tabs_gui->addTab(
215 "share",
216 $this->lng->txt("wsp_permissions"),
217 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
218 );
219 }
220 }

References $help, and checkPermissionBool().

Referenced by executeCommand().

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

◆ setTitleAndDescription()

ilObjPortfolioGUI::setTitleAndDescription ( )
protected

called by prepare output

Reimplemented from ilObject2GUI.

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

234 {
235 // parent::setTitleAndDescription();
236
237 $title = $this->lng->txt("portfolio");
238 if ($this->object) {
239 $title .= ": " . $this->object->getTitle();
240 }
241 $this->tpl->setTitle($title);
242 $this->tpl->setTitleIcon(
243 ilUtil::getImagePath("icon_prtf.svg"),
244 $this->lng->txt("portfolio")
245 );
246
247 if ($this->object &&
248 !$this->object->isOnline()) {
249 $this->tpl->setAlertProperties(array(
250 array("alert" => true,
251 "property" => $this->lng->txt("status"),
252 "value" => $this->lng->txt("offline"))
253 ));
254 }
255 }

References ilUtil\getImagePath().

Referenced by executeCommand().

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

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

506 {
507 $ilAccess = $this->access;
508
509 // return to exercise (portfolio assignment)
510 $exc_ref_id = (int) $_REQUEST["exc_id"];
511 if ($exc_ref_id &&
512 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
513 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
514 }
515
516 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
517 }
static redirect($a_script)

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

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

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

◆ triggerAssignmentTool()

ilObjPortfolioGUI::triggerAssignmentTool ( )
protected

Trigger assignment tool.

Parameters

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

171 {
172 if (!is_object($this->object) || $this->object->getId() <= 0) {
173 return;
174 }
175 $pe = new ilPortfolioExercise($this->user_id, $this->object->getId());
176 $pe_gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
177 $assignments = $pe->getAssignmentsOfPortfolio();
178 if (count($assignments) > 0) {
179 $ass_ids = array_map(function ($i) {
180 return $i["ass_id"];
181 }, $assignments);
182 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
183 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
184 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_BUTTONS, $pe_gui->getActionButtons());
185 }
186 }
Exercise info for portfolios.
$i
Definition: metadata.php:24

References $i, ilExerciseGSToolProvider\EXC_ASS_BUTTONS, ilExerciseGSToolProvider\EXC_ASS_IDS, and ilExerciseGSToolProvider\SHOW_EXC_ASSIGNMENT_INFO.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $a_form)

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjPortfolioBaseGUI.

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

562 {
563 $this->object->setOnline($a_form->getInput("online"));
564
565 // if portfolio is not online, it cannot be default
566 if (!$a_form->getInput("online")) {
567 ilObjPortfolio::setUserDefault($this->user_id, 0);
568 }
569
570 parent::updateCustom($a_form);
571 }
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

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

+ Here is the call graph for this function:

Field Documentation

◆ $declaration_authorship

ilObjPortfolioGUI::$declaration_authorship
protected

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

◆ $help

ilObjPortfolioGUI::$help
protected

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

Referenced by setTabs().

◆ $tool_context

ilObjPortfolioGUI::$tool_context
protected

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

◆ $ui

ilObjPortfolioGUI::$ui
protected

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

Referenced by getCreateInfoMessage(), and getOfflineMessage().

◆ $ws_access

ilObjPortfolioGUI::$ws_access
protected

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


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