ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Member Functions

 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 addLocator ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 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 ()
 
 initCopyPageFormOptions (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 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...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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
 
 $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
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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

38 {
39 global $DIC;
40
41 $this->lng = $DIC->language();
42 $this->help = $DIC["ilHelp"];
43 $this->settings = $DIC->settings();
44 $this->access = $DIC->access();
45 $this->user = $DIC->user();
46 $this->ctrl = $DIC->ctrl();
47 $this->ui = $DIC->ui();
48
49 parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
50 $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
51
52 $this->ctrl->saveParameter($this, "exc_back_ref_id");
53 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

204 {
205 if (!$this->creation_mode) {
206 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
207 }
208
209 parent::addLocatorItems();
210
211 $this->tpl->setLocator();
212 }

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

474 {
475 // create 1st page / blog
476 include_once("Modules/Portfolio/classes/class.ilPortfolioPage.php");
477 $page = $this->getPageInstance(null, $a_new_object->getId());
478 if ($_POST["ptype"] == "page") {
479 $page->setType(ilPortfolioPage::TYPE_PAGE);
480 $page->setTitle($_POST["fpage"]);
481
482 // use template as basis
483 $layout_id = $_POST["tmpl"];
484 if ($layout_id) {
485 include_once("./Services/COPage/Layout/classes/class.ilPageLayout.php");
486 $layout_obj = new ilPageLayout($layout_id);
487 $page->setXMLContent($layout_obj->getXMLContent());
488 }
489 } else {
490 $page->setType(ilPortfolioPage::TYPE_BLOG);
491 $page->setTitle($_POST["blog"]);
492 }
493 $page->create();
494
495 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
496 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
497 $this->ctrl->redirect($this, "view");
498 }
$_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 60 of file class.ilObjPortfolioGUI.php.

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

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

249 {
252
253 $new_type = $_REQUEST["new_type"];
254
255 // add new object to custom parent container
256 $this->ctrl->saveParameter($this, "crtptrefid");
257 // use forced callback after object creation
258 $this->ctrl->saveParameter($this, "crtcb");
259
260 if (!$this->checkPermissionBool("create", "", $new_type)) {
261 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
262 } else {
263 $this->lng->loadLanguageModule($new_type);
264 $this->ctrl->setParameter($this, "new_type", $new_type);
265
266 $forms = $this->initCreationForms($new_type);
267
268 // copy form validation error: do not show other creation forms
269 if ($_GET["cpfl"] && isset($forms[self::CFORM_CLONE])) {
270 $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
271 }
272 $tpl->setContent($this->getCreateInfoMessage() . $this->getCreationFormsHTML($forms));
273 }
274 }
$_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 1003 of file class.ilObjPortfolioGUI.php.

1004 {
1005 $prtt_id = (int) $_REQUEST["prtt_pre"];
1006 if ($title == "") {
1007 $title = ilObject::_lookupTitle($prtt_id);
1008 }
1009
1010 // valid template?
1011 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
1013 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
1014 $this->toRepository();
1015 }
1016 unset($templates);
1017
1018 $source = new ilObjPortfolioTemplate($prtt_id, false);
1019
1020 // create portfolio
1021 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
1022 $target = new ilObjPortfolio();
1023 $target->setTitle($title);
1024 $target->create();
1025 $target_id = $target->getId();
1026
1027 $source->clonePagesAndSettings($source, $target, null, true);
1028
1029 // link portfolio to exercise assignment
1030 //$this->linkPortfolioToAssignment($target_id);
1031
1032 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1033 $this->ctrl->setParameter($this, "prt_id", $target_id);
1034 $this->ctrl->redirect($this, "preview");
1035 }
$source
Definition: linkback.php:22
static getAvailablePortfolioTemplates($a_permission="read")
static _lookupTitle($a_id)
lookup object title
$target_id
Definition: goto.php:49
$target
Definition: test.php:19

References $source, $target, $target_id, $title, 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 1055 of file class.ilObjPortfolioGUI.php.

1056 {
1059
1060 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
1061 include_once "Modules/Portfolio/classes/class.ilPortfolioTemplatePage.php";
1062 include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
1063
1064 $title = trim($_REQUEST["pt"]);
1065 $prtt_id = (int) $_REQUEST["prtt"];
1066
1067 // get assignment template
1068 $ass_template_id = 0;
1069 if ((int) $_REQUEST["ass_id"] > 0) {
1070 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1071 $ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
1072 $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
1073 }
1074
1075 if ($prtt_id > 0) {
1077 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
1078 if ($ass_template_id != $prtt_id) {
1079 $this->toRepository();
1080 }
1081 }
1082
1083 //quota manipulation
1084 include_once "Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php";
1086 $quota_sum = 0;
1087
1088 //skills manipulation
1089 include_once "Services/Skill/classes/class.ilPersonalSkill.php";
1090 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
1091 $skill_ids = array();
1092
1093 $recipe = array();
1094 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
1095 switch ($page["type"]) {
1097 if (!$ilSetting->get('disable_wsp_blogs')) {
1098 $recipe[$page["id"]] = array("blog", "create", $page['title']);
1099 }
1100 break;
1102 $source_page = new ilPortfolioTemplatePage($page["id"]);
1103 $source_page->buildDom(true);
1104 if ($check_quota) {
1105 $quota_sum += $source_page->getPageDiskSize();
1106 }
1107 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
1108 break;
1109 }
1110 }
1111
1112 if ($quota_sum) {
1113 include_once "Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1114 if (!ilDiskQuotaHandler::isUploadPossible($quota_sum)) {
1115 ilUtil::sendFailure($this->lng->txt("prtf_template_import_quota_failure"), true);
1116 $this->ctrl->redirect($this, "create");
1117 }
1118 }
1119
1120 if ($skill_ids) {
1121 $recipe["skills"] = $skill_ids;
1122 }
1123 }
1124
1125 // create portfolio
1126 $target = new ilObjPortfolio();
1127 $target->setTitle($title);
1128 $target->create();
1129 $target_id = $target->getId();
1130
1131 if ($prtt_id) {
1132 $source = new ilObjPortfolioTemplate($prtt_id, false);
1133 $source->clonePagesAndSettings($source, $target, $recipe);
1134 }
1135
1136 // link portfolio to exercise assignment
1138
1139 $this->ctrl->setParameter($this, "prt_id", $target_id);
1140 if ($prtt_id) {
1141 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1142 $this->ctrl->redirect($this, "preview");
1143 } else {
1144 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1145 $this->ctrl->redirect($this, "view");
1146 }
1147 }
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, $target_id, $title, 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 769 of file class.ilObjPortfolioGUI.php.

770 {
771 $title = trim($_REQUEST["pt"]);
772 $prtt_id = (int) $_REQUEST["prtt"];
773
774 // valid template?
775 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
777 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
778 $this->toRepository();
779 }
780 unset($templates);
781
782 $this->ctrl->setParameter($this, "prtt", $prtt_id);
783
784 if (!$a_form) {
785 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
786 }
787 if ($a_form) {
788 $this->tpl->setContent($a_form->getHTML());
789 } else {
791 }
792 }
createPortfolioFromTemplateProcess($a_process_form=true)
initCreatePortfolioFromTemplateForm($a_prtt_id, $a_title)

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

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

References ilObjectGUI\$access, $form, $ilSetting, $ilUser, ilObjectGUI\$settings, $source, $target, $target_id, $title, 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 71 of file class.ilObjPortfolioGUI.php.

72 {
74
75 $this->checkPermission("read");
76
78
79 $next_class = $this->ctrl->getNextClass($this);
80 $cmd = $this->ctrl->getCmd("view");
81
82 /*
83 if($_REQUEST["ecal"])
84 {
85 $cmd = "preview";
86 $next_class = "";
87 }
88 */
89
90 switch ($next_class) {
91 case "ilworkspaceaccessgui":
92 if ($this->checkPermissionBool("write")) {
93 $this->setTabs();
94 $this->tabs_gui->activateTab("share");
95
96 if ($this->access_handler->getPermissions($this->object->getId()) &&
97 !$this->object->isOnline()) {
98 //ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
99 }
100
101 $this->tpl->setPermanentLink("prtf", $this->object->getId());
102
103 include_once('./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
104 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
105 $wspacc->setBlockingMessage($this->getOfflineMessage());
106 $this->ctrl->forwardCommand($wspacc);
107 }
108 break;
109
110 case 'ilportfoliopagegui':
111 if ($this->determinePageCall()) {
112 // only in edit mode
113 $this->addLocator();
114
115 include_once "Services/Form/classes/class.ilFileInputGUI.php";
117 }
118 $this->handlePageCall($cmd);
119 break;
120
121 case "ilnotegui":
122 $this->preview();
123 break;
124
125 case "ilobjstylesheetgui":
126 include_once("./Services/Style/Content/classes/class.ilObjStyleSheetGUI.php");
127 $this->ctrl->setReturn($this, "editStyleProperties");
128 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
129 $style_gui->omitLocator();
130 if ($cmd == "create" || $_GET["new_type"] == "sty") {
131 $style_gui->setCreationMode(true);
132 }
133
134 if ($cmd == "confirmedDelete") {
135 $this->object->setStyleSheetId(0);
136 $this->object->update();
137 }
138
139 $ret = $this->ctrl->forwardCommand($style_gui);
140
141 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
142 $style_id = $ret;
143 $this->object->setStyleSheetId($style_id);
144 $this->object->update();
145 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
146 }
147 break;
148
149 case "ilportfolioexercisegui":
150 $this->ctrl->setReturn($this, "view");
151 include_once "Modules/Portfolio/classes/class.ilPortfolioExerciseGUI.php";
152 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
153 $this->ctrl->forwardCommand($gui);
154 break;
155
156 default:
157
158 if ($cmd != "preview") {
159 $this->addLocator();
160 $this->setTabs();
161 }
162 $this->$cmd();
163 break;
164 }
165
166 return true;
167 }
static setPersonalWorkspaceQuotaCheck($a_value)
preview($a_return=false, $a_content=false, $a_show_notes=true)
Show user page.
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(), and setTitleAndDescription().

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

1328 {
1329 require_once 'Services/WebAccessChecker/classes/class.ilWACSignedPath.php';
1331
1332 // prepare generation before contents are processed (for mathjax)
1333 ilPDFGeneratorUtils::prepareGenerationRequest("Portfolio", "ContentExport");
1334
1335 $html = $this->printView(true);
1336
1337 // :TODO: fixing css dummy parameters
1338 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1339 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1340
1341 $html = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
1342 $html = preg_replace("/href=\"\\.\\//ims", "href=\"" . ILIAS_HTTP_PATH . "/", $html);
1343
1344
1345 if ($a_dev_mode) {
1346 echo $html;
1347 exit;
1348 }
1349
1350 //$html = str_replace("&", "&", $html);
1351
1352 $pdf_factory = new ilHtmlToPdfTransformerFactory();
1353 $pdf_factory->deliverPDFFromHTMLString($html, "portfolio.pdf", ilHtmlToPdfTransformerFactory::PDF_OUTPUT_DOWNLOAD, "Portfolio", "ContentExport");
1354 }
exit
Definition: backend.php:16
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)
$html
Definition: example_001.php:87

References $html, exit, 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 1318 of file class.ilObjPortfolioGUI.php.

1319 {
1320 $this->exportPDF(true);
1321 }
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 1206 of file class.ilObjPortfolioGUI.php.

1207 {
1208 global $DIC;
1209
1210 $tpl = $DIC["tpl"];
1211
1212 $form = $this->initPDFSelectionForm();
1213
1214 $tpl->setContent($form->getHTML());
1215 }
initPDFSelectionForm()
Init print view selection form.

References $DIC, $form, 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 282 of file class.ilObjPortfolioGUI.php.

283 {
284 global $DIC;
285
288 $ui = $DIC->ui();
289 $ilSetting = $DIC->settings();
290
291 $message = "";
292 // page type: blog
293 if (!$ilSetting->get('disable_wsp_blogs')) {
294 $options = array();
295 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
296 $tree = new ilWorkspaceTree($this->user_id);
297 $root = $tree->readRootId();
298 if ($root) {
299 $root = $tree->getNodeData($root);
300 foreach ($tree->getSubTree($root) as $node) {
301 if ($node["type"] == "blog") {
302 $options[$node["obj_id"]] = $node["title"];
303 }
304 }
305 asort($options);
306 }
307 if (!sizeof($options)) {
308
309 // #18147
310 $this->lng->loadLanguageModule('pd');
311 $url = $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui", "jumpToWorkspace");
312 $text = $this->lng->txt("pd_personal_workspace");
313
314 $text = sprintf($this->lng->txt("prtf_no_blogs_info"), $text);
315
316 $mbox = $ui->factory()->messageBox()->info($text)
317 ->withLinks([$ui->factory()->link()->standard(
318 $this->lng->txt("pd_personal_workspace"),
319 $url
320 )]);
321
322 $message = $ui->renderer()->render($mbox);
323 }
324 }
325 return $message;
326 }
Tree handler for personal workspace.
catch(Exception $e) $message
$url
$root
Definition: sabredav.php:45
$text
Definition: errorreport.php:18

References ilObjectGUI\$ctrl, $DIC, $ilSetting, ilObjectGUI\$lng, $message, PHPMailer\PHPMailer\$options, $root, $text, 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 551 of file class.ilObjPortfolioGUI.php.

552 {
553 $a_values["online"] = $this->object->isOnline();
554
555 parent::getEditFormCustomValues($a_values);
556 }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

Returns
string

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

1520 {
1521 $ui = $this->ui;
1522 $lng = $this->lng;
1524
1525 if (!$this->object->isOnline()) {
1526 $f = $ui->factory();
1527 $renderer = $ui->renderer();
1528
1529 $buttons = [$f->button()->standard(
1530 $lng->txt("prtf_set_online"),
1531 $ctrl->getLinkTarget($this, "setOnlineAndShare")
1532 )];
1533
1534 return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
1535 ->withButtons($buttons));
1536 }
1537 return "";
1538 }

References ilObjectGUI\$ctrl, $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 613 of file class.ilObjPortfolioGUI.php.

614 {
615 return "ilportfoliopagegui";
616 }

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

601 {
602 include_once("Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
603 $page_gui = new ilPortfolioPageGUI(
604 $this->object->getId(),
605 $a_page_id,
606 0,
607 $this->object->hasPublicComments()
608 );
609 $page_gui->setAdditional($this->getAdditional());
610 return $page_gui;
611 }
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 582 of file class.ilObjPortfolioGUI.php.

583 {
584 // #11531
585 if (!$a_portfolio_id && $this->object) {
586 $a_portfolio_id = $this->object->getId();
587 }
588 include_once "Modules/Portfolio/classes/class.ilPortfolioPage.php";
589 $page = new ilPortfolioPage($a_page_id);
590 $page->setPortfolioId($a_portfolio_id);
591 return $page;
592 }
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 1180 of file class.ilObjPortfolioGUI.php.

1181 {
1182 $dom = $a_source_page->getDom();
1183 if ($dom instanceof php4DOMDocument) {
1184 $dom = $dom->myDOMDocument;
1185 }
1186 $xpath = new DOMXPath($dom);
1187 $nodes = $xpath->query("//PageContent/Skills");
1188 foreach ($nodes as $node) {
1189 $skill_id = $node->getAttribute("Id");
1190 if (!in_array($skill_id, $a_pskills)) {
1191 $a_skill_ids[] = $skill_id;
1192 }
1193 }
1194 unset($nodes);
1195 unset($xpath);
1196 unset($dom);
1197
1198 return $a_skill_ids;
1199 }

References $nodes.

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

56 {
57 return "prtf";
58 }

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

659 {
660 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
661 $form = new ilPropertyFormGUI();
662 $form->setFormAction($this->ctrl->getFormAction($this));
663
664 $options = array();
665 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
666 $tree = new ilWorkspaceTree($this->user_id);
667 $root = $tree->readRootId();
668 if ($root) {
669 $root = $tree->getNodeData($root);
670 foreach ($tree->getSubTree($root, true, "blog") as $node) {
671 $options[$node["obj_id"]] = $node["title"];
672 }
673 asort($options);
674 }
675
676 // add blog
677 $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
678 $radg->setInfo($this->lng->txt(""));
679 $radg->setValue("new");
680 $radg->setInfo($this->lng->txt(""));
681
682 $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
683 $radg->addOption($op1);
684 $form->addItem($radg);
685
686 // Blog title
687 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
688 $ti->setRequired(true);
689 $op1->addSubItem($ti);
690
691
692 if (sizeof($options)) {
693 $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
694 $radg->addOption($op2);
695
696 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
697 $obj->setOptions($options);
698 $op2->addSubItem($obj);
699 }
700
701 $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
702 $this->object->getTitle());
703 $form->addCommandButton("saveBlog", $this->lng->txt("save"));
704 $form->addCommandButton("view", $this->lng->txt("cancel"));
705
706 return $form;
707 }
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 $form, PHPMailer\PHPMailer\$options, $root, and 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 618 of file class.ilObjPortfolioGUI.php.

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

References PHPMailer\PHPMailer\$options, ilPropertyFormGUI\addItem(), and ilObjPortfolio\getPortfoliosOfUser().

+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm (   $a_new_type)
protected

Init object creation form.

Parameters
string$a_new_type
Returns
ilPropertyFormGUI

Reimplemented from ilObjectGUI.

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

335 {
337
338 $this->ctrl->setParameter($this, "new_type", $this->getType());
339
340 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
341 $form = new ilPropertyFormGUI();
342 $form->setFormAction($this->ctrl->getFormAction($this));
343
344 // title
345 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
346 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
347 $ti->setMaxLength(ilObject::TITLE_LENGTH);
348 $ti->setRequired(true);
349 $form->addItem($ti);
350
351 /* description
352 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
353 $ta->setCols(40);
354 $ta->setRows(2);
355 $form->addItem($ta);
356 */
357
358 $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
359 $main->setValue("mode_scratch");
360 $form->addItem($main);
361
362 $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
363 $main->addOption($opt_scratch);
364
365
366 // 1st page
367
368 $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
369 $type->setRequired(true);
370 $opt_scratch->addSubItem($type);
371
372 $type_page = new ilRadioOption($this->lng->txt("page"), "page");
373 $type->addOption($type_page);
374
375 // page type: page
376 $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
377 $tf->setMaxLength(128);
378 $tf->setSize(40);
379 $tf->setRequired(true);
380 $type_page->addSubItem($tf);
381
382 // page templates
383 include_once "Services/COPage/Layout/classes/class.ilPageLayout.php";
385 if ($templates) {
386 $options = array(0 => $this->lng->txt("none"));
387 foreach ($templates as $templ) {
388 $templ->readObject();
389 $options[$templ->getId()] = $templ->getTitle();
390 }
391
392 $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
393 $use_template->setRequired(true);
394 $use_template->setOptions($options);
395 $type_page->addSubItem($use_template);
396 }
397
398 // page type: blog
399 if (!$ilSetting->get('disable_wsp_blogs')) {
400 $options = array();
401 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
402 $tree = new ilWorkspaceTree($this->user_id);
403 $root = $tree->readRootId();
404 if ($root) {
405 $root = $tree->getNodeData($root);
406 foreach ($tree->getSubTree($root) as $node) {
407 if ($node["type"] == "blog") {
408 $options[$node["obj_id"]] = $node["title"];
409 }
410 }
411 asort($options);
412 }
413 if (sizeof($options)) {
414 $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
415 $type->addOption($type_blog);
416
417 $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
418 $obj->setRequired(true);
419 $obj->setOptions(array("" => $this->lng->txt("please_select")) + $options);
420 $type_blog->addSubItem($obj);
421 } else {
422 $type->setValue("page");
423 }
424 }
425
426
427 // portfolio templates
428
429 $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
430 $main->addOption($opt_tmpl);
431
432 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
434 if (!sizeof($templates)) {
435 $opt_tmpl->setDisabled(true);
436 } else {
437 $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
438 $tmpl->setRequired(true);
439 $tmpl->setOptions(array("" => $this->lng->txt("please_select")) + $templates);
440 $opt_tmpl->addSubItem($tmpl);
441
442 // incoming from repository
443 if ((int) $_REQUEST["prtt_pre"]) {
444 $tmpl->setValue((int) $_REQUEST["prtt_pre"]);
445 $main->setValue("mode_tmpl");
446 }
447 }
448
449
450 $form->setTitle($this->lng->txt("prtf_create_portfolio"));
451 $form->addCommandButton("save", $this->lng->txt("create"));
452 $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
453
454 return $form;
455 }
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 $form, $ilSetting, PHPMailer\PHPMailer\$options, $root, 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 794 of file class.ilObjPortfolioGUI.php.

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

330 {
331 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
332 }
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 515 of file class.ilObjPortfolioGUI.php.

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

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

1221 {
1222 global $DIC;
1223
1224 $lng = $this->lng;
1226
1227 $tabs = $DIC->tabs();
1228
1229 $tabs->clearTargets();
1230 $tabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "view"));
1231
1232 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1233
1234
1235 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1236 $form = new ilPropertyFormGUI();
1237
1238 // because of PDF export
1239 $form->setPreventDoubleSubmission(false);
1240
1241 // declaration of authorship
1242 if ($this->declaration_authorship->getForUser($this->user) != "") {
1243 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_decl_authorship"), "decl_author");
1244 $cb->setInfo($this->declaration_authorship->getForUser($this->user));
1245 $form->addItem($cb);
1246 }
1247
1248 // signature
1249 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_signature"), "signature");
1250 $cb->setInfo($this->lng->txt("prtf_signature_info"));
1251 $form->addItem($cb);
1252
1253
1254 // selection type
1255 $radg = new ilRadioGroupInputGUI($lng->txt("prtf_print_selection"), "sel_type");
1256 $radg->setValue("all_pages");
1257 $op2 = new ilRadioOption($lng->txt("prtf_all_pages"), "all_pages");
1258 $radg->addOption($op2);
1259 $op3 = new ilRadioOption($lng->txt("prtf_selected_pages"), "selection");
1260 $radg->addOption($op3);
1261
1262 include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
1263 $nl = new ilNestedListInputGUI("", "obj_id");
1264 $op3->addSubItem($nl);
1265
1266 foreach ($pages as $p) {
1267 if ($p["type"] != ilPortfolioPage::TYPE_BLOG) {
1268 $nl->addListNode(
1269 $p["id"],
1270 $p["title"],
1271 0,
1272 false,
1273 false,
1274 ilUtil::getImagePath("icon_pg.svg"),
1275 $lng->txt("page")
1276 );
1277 } else {
1278 $nl->addListNode(
1279 $p["id"],
1280 $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($p["title"]),
1281 0,
1282 false,
1283 false,
1284 ilUtil::getImagePath("icon_blog.svg"),
1285 $lng->txt("obj_blog")
1286 );
1287 $pages2 = ilBlogPosting::getAllPostings($p["title"]);
1288 foreach ($pages2 as $p2) {
1289 $nl->addListNode(
1290 "b" . $p2["id"],
1291 $p2["title"],
1292 $p["id"],
1293 false,
1294 false,
1295 ilUtil::getImagePath("icon_pg.svg"),
1296 $lng->txt("page")
1297 );
1298 }
1299 }
1300 }
1301
1302 $form->addItem($radg);
1303
1304 $form->addCommandButton("exportPDF", $lng->txt("prtf_pdf"));
1305 if (DEVMODE == "1") {
1306 $form->addCommandButton("exportPDFDev", $lng->txt("prtf_pdf") . " (DEV)");
1307 }
1308
1309 $form->setTitle($lng->txt("prtf_print_options"));
1310 $form->setFormAction($ilCtrl->getFormAction($this, "exportPDF"));
1311
1312 return $form;
1313 }
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)
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124
global $ilCtrl
Definition: ilias.php:18

References ilObjectGUI\$ctrl, $DIC, $form, $ilCtrl, ilObjectGUI\$lng, $tabs, 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 1149 of file class.ilObjPortfolioGUI.php.

1150 {
1151 $ilAccess = $this->access;
1153
1154 $exc_ref_id = (int) $_REQUEST["exc_id"];
1155 $ass_id = (int) $_REQUEST["ass_id"];
1156
1157 if ($exc_ref_id &&
1158 $ass_id &&
1159 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1160 include_once "Modules/Exercise/classes/class.ilObjExercise.php";
1161 include_once "Modules/Exercise/classes/class.ilExAssignment.php";
1162 $exc = new ilObjExercise($exc_ref_id);
1163 $ass = new ilExAssignment($ass_id);
1164 if ($ass->getExerciseId() == $exc->getId() &&
1165 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO) {
1166 // #16205
1167 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
1168 $sub = new ilExSubmission($ass, $ilUser->getId());
1169 $sub->addResourceObject($a_target_id);
1170 }
1171 }
1172 }
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 1356 of file class.ilObjPortfolioGUI.php.

1357 {
1358 global $tpl;
1359
1360 $lng = $this->lng;
1361
1362 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1363
1364
1365 $tpl = new ilTemplate("tpl.main.html", true, true);
1366
1367 $tpl->setBodyClass("ilPrtfPdfBody");
1368
1369 $tpl->setCurrentBlock("AdditionalStyle");
1370 $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilUtil::getStyleSheetLocation("filesystem"));
1371 $tpl->parseCurrentBlock();
1372
1373 $tpl->setCurrentBlock("ContentStyle");
1374 $tpl->setVariable(
1375 "LOCATION_CONTENT_STYLESHEET",
1376 ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId(), false)
1377 );
1378 $tpl->parseCurrentBlock();
1379
1380 $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1381 //$this->setContentStyleSheet($tpl);
1382
1383 // syntax style
1384 $tpl->setCurrentBlock("SyntaxStyle");
1385 $tpl->setVariable(
1386 "LOCATION_SYNTAX_STYLESHEET",
1388 );
1389 $tpl->parseCurrentBlock();
1390
1391
1392 include_once("./Modules/Portfolio/classes/class.ilPortfolioPageGUI.php");
1393
1394 $page_content = "";
1395
1396 // cover page
1397 $cover_tpl = new ilTemplate("tpl.prtf_cover.html", true, true, "Modules/Portfolio");
1398 foreach ($pages as $page) {
1399 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1400 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1401 continue;
1402 }
1403 $cover_tpl->setCurrentBlock("content_item");
1404 $cover_tpl->setVariable("ITEM_TITLE", $page["title"]);
1405 $cover_tpl->parseCurrentBlock();
1406 } else {
1407 $cover_tpl->setCurrentBlock("content_item");
1408 $cover_tpl->setVariable("ITEM_TITLE", $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($page["title"]));
1409 $cover_tpl->parseCurrentBlock();
1410 }
1411 }
1412
1413 if ($_POST["signature"]) {
1414 $cover_tpl->setCurrentBlock("signature");
1415 $cover_tpl->setVariable("TXT_SIGNATURE", $lng->txt("prtf_signature_date"));
1416 $cover_tpl->parseCurrentBlock();
1417 }
1418
1419 if ($_POST["decl_author"]) {
1420 $cover_tpl->setCurrentBlock("decl_author");
1421 $cover_tpl->setVariable(
1422 "TXT_DECL_AUTHOR",
1423 nl2br($this->declaration_authorship->getForUser($this->user))
1424 );
1425 $cover_tpl->parseCurrentBlock();
1426 }
1427
1428 $cover_tpl->setVariable("PORTFOLIO_TITLE", $this->object->getTitle());
1429 $cover_tpl->setVariable("PORTFOLIO_ICON", ilUtil::getImagePath("icon_prtf.svg"));
1430
1431 $cover_tpl->setVariable("TXT_AUTHOR", $lng->txt("prtf_author"));
1432 $cover_tpl->setVariable("TXT_LINK", $lng->txt("prtf_link"));
1433 $cover_tpl->setVariable("TXT_DATE", $lng->txt("prtf_date_of_print"));
1434
1435 $author = ilObjUser::_lookupName($this->object->getOwner());
1436 $author_str = $author["firstname"] . " " . $author["lastname"];
1437 $cover_tpl->setVariable("AUTHOR", $author_str);
1438
1439 include_once('./Services/Link/classes/class.ilLink.php');
1440 $href = ilLink::_getStaticLink($this->object->getId(), "prtf");
1441 $cover_tpl->setVariable("LINK", $href);
1442
1444 $date_str = ilDatePresentation::formatDate(new ilDate(date("Y-m-d"), IL_CAL_DATE));
1445 $cover_tpl->setVariable("DATE", $date_str);
1446
1447 $page_content .= $cover_tpl->get();
1448 $page_content .= '<p style="page-break-after:always;"></p>';
1449
1450 $page_head_tpl = new ilTemplate("tpl.prtf_page_head.html", true, true, "Modules/Portfolio");
1451 $page_head_tpl->setVariable("AUTHOR", $author_str);
1452 $page_head_tpl->setVariable("DATE", $date_str);
1453 $page_head_str = $page_head_tpl->get();
1454
1455 foreach ($pages as $page) {
1456 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1457 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1458 continue;
1459 }
1460
1461 $page_gui = new ilPortfolioPageGUI($this->object->getId(), $page["id"]);
1462 $page_gui->setOutputMode("print");
1463 $page_gui->setPresentationTitle($page["title"]);
1464 $html = $this->ctrl->getHTML($page_gui);
1465 $page_content .= $page_head_str . $html;
1466
1467 if ($a_pdf_export) {
1468 $page_content .= '<p style="page-break-after:always;"></p>';
1469 }
1470 } else {
1471 $pages2 = ilBlogPosting::getAllPostings($page["title"]);
1472 foreach ($pages2 as $p2) {
1473 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array("b" . $p2["id"], $_POST["obj_id"]))) {
1474 continue;
1475 }
1476 $page_gui = new ilBlogPostingGUI(0, null, $p2["id"]);
1477 $page_gui->setFileDownloadLink("#");
1478 $page_gui->setFullscreenLink("#");
1479 $page_gui->setSourcecodeDownloadScript("#");
1480 $page_gui->setOutputMode("print");
1481 $page_content .= $page_head_str . $page_gui->showPage(ilObject::_lookupTitle($page["title"]) . ": " . $page_gui->getBlogPosting()->getTitle());
1482
1483 if ($a_pdf_export) {
1484 $page_content .= '<p style="page-break-after:always;"></p>';
1485 }
1486 }
1487 }
1488 }
1489
1490 $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>';
1491
1492 if (!$a_pdf_export) {
1493 $page_content .= '<script type="text/javascript" language="javascript1.2">
1494 <!--
1495 il.Util.addOnLoad(function () {
1496 il.Util.print();
1497 });
1498 //-->
1499 </script>';
1500 }
1501
1502 $tpl->setVariable("CONTENT", $page_content);
1503
1504 if (!$a_pdf_export) {
1505 $tpl->show(false);
1506 exit;
1507 } else {
1508 $tpl->fillJavaScriptFiles();
1509 $ret = $tpl->get("DEFAULT", false, false, false, true, false, false);
1510 return $ret;
1511 }
1512 }
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.
static getContentPrintStyle()
get content print style
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=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, $html, 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, 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 457 of file class.ilObjPortfolioGUI.php.

458 {
459 $form = $this->initCreateForm("prtf");
460 if ($form->checkInput()) {
461 // trigger portfolio template "import" process
462 if ($form->getInput("mode") == "mode_tmpl") {
463 $_REQUEST["pt"] = $form->getInput("title");
464 $_REQUEST["prtt_pre"] = (int) $_REQUEST["prtt"];
465 return $this->createFromTemplateDirect($form->getInput("title"));
466 //return $this->createPortfolioFromTemplate();
467 }
468 }
469
470 return parent::save();
471 }
createFromTemplateDirect($title="")
Create portfolio template direct.

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

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

References ilObject2GUI\$access_handler, $DIC, $form, $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 1543 of file class.ilObjPortfolioGUI.php.

1544 {
1546 $lng = $this->lng;
1547
1548 if (ilObjPortfolio::_lookupOwner($this->object->getId()) == $this->user_id) {
1549 $this->object->setOnline(true);
1550 $this->object->update();
1551 ilUtil::sendSuccess($lng->txt("prtf_has_been_set_online"), true);
1552 }
1553 $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
1554 }
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 169 of file class.ilObjPortfolioGUI.php.

170 {
171 $ilHelp = $this->help;
172
173 $ilHelp->setScreenIdComponent("prtf");
174
175 if ($this->checkPermissionBool("write")) {
176 $this->tabs_gui->addTab(
177 "pages",
178 $this->lng->txt("content"),
179 $this->ctrl->getLinkTarget($this, "view")
180 );
181
182 $this->tabs_gui->addTab(
183 "settings",
184 $this->lng->txt("settings"),
185 $this->ctrl->getLinkTarget($this, "edit")
186 );
187
188 $this->tabs_gui->addNonTabbedLink(
189 "preview",
190 $this->lng->txt("user_profile_preview"),
191 $this->ctrl->getLinkTarget($this, "preview")
192 );
193
194 $this->lng->loadLanguageModule("wsp");
195 $this->tabs_gui->addTab(
196 "share",
197 $this->lng->txt("wsp_permissions"),
198 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
199 );
200 }
201 }

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

215 {
216 // parent::setTitleAndDescription();
217
218 $title = $this->lng->txt("portfolio");
219 if ($this->object) {
220 $title .= ": " . $this->object->getTitle();
221 }
222 $this->tpl->setTitle($title);
223 $this->tpl->setTitleIcon(
224 ilUtil::getImagePath("icon_prtf.svg"),
225 $this->lng->txt("portfolio")
226 );
227
228 if ($this->object &&
229 !$this->object->isOnline()) {
230 $this->tpl->setAlertProperties(array(
231 array("alert" => true,
232 "property" => $this->lng->txt("status"),
233 "value" => $this->lng->txt("offline"))
234 ));
235 }
236 }

References $title, and ilUtil\getImagePath().

Referenced by executeCommand().

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

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

501 {
502 $ilAccess = $this->access;
503
504 // return to exercise (portfolio assignment)
505 $exc_ref_id = (int) $_REQUEST["exc_id"];
506 if ($exc_ref_id &&
507 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
508 include_once "Services/Link/classes/class.ilLink.php";
509 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
510 }
511
512 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
513 }
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:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $a_form)

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjPortfolioBaseGUI.

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

559 {
560 $this->object->setOnline($a_form->getInput("online"));
561
562 // if portfolio is not online, it cannot be default
563 if (!$a_form->getInput("online")) {
564 ilObjPortfolio::setUserDefault($this->user_id, 0);
565 }
566
567 parent::updateCustom($a_form);
568 }
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 35 of file class.ilObjPortfolioGUI.php.

◆ $help

ilObjPortfolioGUI::$help
protected

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

Referenced by setTabs().

◆ $ui

ilObjPortfolioGUI::$ui
protected

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

Referenced by getCreateInfoMessage(), and getOfflineMessage().

◆ $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: