ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ($a_with_comments=false)
 
 exportWithComments ()
 
 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...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

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 = ""
 
 $ui
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

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
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5

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

232 {
233 if (!$this->creation_mode) {
234 $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
235 }
236
237 parent::addLocatorItems();
238
239 $this->tpl->setLocator();
240 }

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

490 {
491 // create 1st page / blog
492 $page = $this->getPageInstance(null, $a_new_object->getId());
493 if ($_POST["ptype"] == "page") {
494 $page->setType(ilPortfolioPage::TYPE_PAGE);
495 $page->setTitle($_POST["fpage"]);
496
497 // use template as basis
498 $layout_id = $_POST["tmpl"];
499 if ($layout_id) {
500 $layout_obj = new ilPageLayout($layout_id);
501 $page->setXMLContent($layout_obj->getXMLContent());
502 }
503 } else {
504 $page->setType(ilPortfolioPage::TYPE_BLOG);
505 $page->setTitle($_POST["blog"]);
506 }
507 $page->create();
508
509 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
510 $this->ctrl->setParameter($this, "prt_id", $a_new_object->getId());
511 $this->ctrl->redirect($this, "view");
512 }
$_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 276 of file class.ilObjPortfolioGUI.php.

277 {
280
281 $new_type = $_REQUEST["new_type"];
282
283 // add new object to custom parent container
284 $this->ctrl->saveParameter($this, "crtptrefid");
285 // use forced callback after object creation
286 $this->ctrl->saveParameter($this, "crtcb");
287
288 if (!$this->checkPermissionBool("create", "", $new_type)) {
289 $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
290 } else {
291 $this->lng->loadLanguageModule($new_type);
292 $this->ctrl->setParameter($this, "new_type", $new_type);
293
294 $forms = $this->initCreationForms($new_type);
295
296 // copy form validation error: do not show other creation forms
297 if ($_GET["cpfl"] && isset($forms[self::CFORM_CLONE])) {
298 $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
299 }
300 $tpl->setContent($this->getCreateInfoMessage() . $this->getCreationFormsHTML($forms));
301 }
302 }
$_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 984 of file class.ilObjPortfolioGUI.php.

985 {
986 $prtt_id = (int) $_REQUEST["prtt_pre"];
987 if ($title == "") {
988 $title = ilObject::_lookupTitle($prtt_id);
989 }
990
991 // valid template?
993 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
994 $this->toRepository();
995 }
996 unset($templates);
997
998 $source = new ilObjPortfolioTemplate($prtt_id, false);
999
1000 // create portfolio
1001 $target = new ilObjPortfolio();
1002 $target->setTitle($title);
1003 $target->create();
1004 $target_id = $target->getId();
1005
1006 $source->clonePagesAndSettings($source, $target, null, true);
1007
1008 // link portfolio to exercise assignment
1009 //$this->linkPortfolioToAssignment($target_id);
1010
1011 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1012 $this->ctrl->setParameter($this, "prt_id", $target_id);
1013 $this->ctrl->redirect($this, "preview");
1014 }
static getAvailablePortfolioTemplates($a_permission="read")
static _lookupTitle($a_id)
lookup object title
$target_id
Definition: goto.php:51
$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 1034 of file class.ilObjPortfolioGUI.php.

1035 {
1038
1039 $title = trim($_REQUEST["pt"]);
1040 $prtt_id = (int) $_REQUEST["prtt"];
1041
1042 // get assignment template
1043 $ass_template_id = 0;
1044 if ((int) $_REQUEST["ass_id"] > 0) {
1045 $ass = new ilExAssignment((int) $_REQUEST["ass_id"]);
1046 $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
1047 }
1048
1049 if ($prtt_id > 0) {
1051 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
1052 if ($ass_template_id != $prtt_id) {
1053 $this->toRepository();
1054 }
1055 }
1056
1057 //skills manipulation
1058 $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
1059 $skill_ids = array();
1060
1061 $recipe = array();
1062 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
1063 switch ($page["type"]) {
1065 if (!$ilSetting->get('disable_wsp_blogs')) {
1066 $recipe[$page["id"]] = array("blog", "create", $page['title']);
1067 }
1068 break;
1070 $source_page = new ilPortfolioTemplatePage($page["id"]);
1071 $source_page->buildDom(true);
1072 $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
1073 break;
1074 }
1075 }
1076
1077 if ($skill_ids) {
1078 $recipe["skills"] = $skill_ids;
1079 }
1080 }
1081
1082 // create portfolio
1083 $target = new ilObjPortfolio();
1084 $target->setTitle($title);
1085 $target->create();
1086 $target_id = $target->getId();
1087
1088 if ($prtt_id) {
1089 $source = new ilObjPortfolioTemplate($prtt_id, false);
1090 $source->clonePagesAndSettings($source, $target, $recipe);
1091 }
1092
1093 // link portfolio to exercise assignment
1095
1096 $this->ctrl->setParameter($this, "prt_id", $target_id);
1097 if ($prtt_id) {
1098 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
1099 $this->ctrl->redirect($this, "preview");
1100 } else {
1101 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created"), true);
1102 $this->ctrl->redirect($this, "view");
1103 }
1104 }
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.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17

References $ilSetting, $ilUser, ilObjectGUI\$settings, $source, $target_id, ilObjectGUI\$user, ilObject\_lookupObjectId(), ilPortfolioPage\getAllPortfolioPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ilPersonalSkill\getSelectedUserSkills(), getSkillsToPortfolioAssignment(), linkPortfolioToAssignment(), 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 775 of file class.ilObjPortfolioGUI.php.

776 {
777 $title = trim($_REQUEST["pt"]);
778 $prtt_id = (int) $_REQUEST["prtt"];
779
780 // valid template?
782 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
783 $this->toRepository();
784 }
785 unset($templates);
786
787 $this->ctrl->setParameter($this, "prtt", $prtt_id);
788
789 if (!$a_form) {
790 $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
791 }
792 if ($a_form) {
793 $this->tpl->setContent($a_form->getHTML());
794 } else {
796 }
797 }
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 908 of file class.ilObjPortfolioGUI.php.

909 {
912 $ilAccess = $this->access;
913
914 $title = trim($_REQUEST["pt"]);
915 $prtt_id = (int) $_REQUEST["prtt"];
916
917 // valid template?
919 if (!sizeof($templates) || !in_array($prtt_id, $templates)) {
920 $this->toRepository();
921 }
922 unset($templates);
923
924 // build page recipe (aka import form values)
925 $recipe = null;
926 if ($a_process_form) {
927 $this->ctrl->setParameter($this, "prtt", $prtt_id);
928
929 $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
930 if ($form->checkInput()) {
931 foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
932 switch ($page["type"]) {
934 if (!$ilSetting->get('disable_wsp_blogs')) {
935 $field_id = "blog_" . $page["id"];
936 switch ($form->getInput($field_id)) {
937 case "blog_create":
938 $recipe[$page["id"]] = array("blog", "create",
939 trim($form->getInput($field_id . "_create_title")));
940 break;
941
942 case "blog_resuse":
943 $recipe[$page["id"]] = array("blog", "reuse",
944 (int) $form->getInput($field_id . "_reuse_blog"));
945 break;
946
947 case "blog_ignore":
948 $recipe[$page["id"]] = array("blog", "ignore");
949 break;
950 }
951 }
952 break;
953 }
954 }
955
956 $recipe["skills"] = (array) $form->getInput("skill_ids");
957 } else {
958 $form->setValuesByPost();
959 return $this->createPortfolioFromTemplate($form);
960 }
961 }
962
963 $source = new ilObjPortfolioTemplate($prtt_id, false);
964
965 // create portfolio
966 $target = new ilObjPortfolio();
967 $target->setTitle($title);
968 $target->create();
969 $target_id = $target->getId();
970
971 $source->clonePagesAndSettings($source, $target, $recipe);
972
973 // link portfolio to exercise assignment
975
976 ilUtil::sendSuccess($this->lng->txt("prtf_portfolio_created_from_template"), true);
977 $this->ctrl->setParameter($this, "prt_id", $target_id);
978 $this->ctrl->redirect($this, "preview");
979 }
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 // we have to init the note js handling here, might go to
86 // a better place in the future
88 $this->ctrl->getLinkTargetByClass(
89 array("ilnotegui"),
90 "",
91 "",
92 true,
93 false
94 )
95 );
96
97 // trigger assignment tool
98 $this->triggerAssignmentTool();
99
100 switch ($next_class) {
101 case "ilworkspaceaccessgui":
102 if ($this->checkPermissionBool("write")) {
103 $this->setTabs();
104 $this->tabs_gui->activateTab("share");
105
106 if ($this->access_handler->getPermissions($this->object->getId()) &&
107 !$this->object->isOnline()) {
108 //ilUtil::sendInfo($lng->txt("prtf_shared_offline_info"));
109 }
110
111 $this->tpl->setPermanentLink("prtf", $this->object->getId());
112
113 $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
114 $wspacc->setBlockingMessage($this->getOfflineMessage());
115 $this->ctrl->forwardCommand($wspacc);
116 }
117 break;
118
119 case 'ilportfoliopagegui':
120 if ($this->determinePageCall()) {
121 // only in edit mode
122 $this->addLocator();
123 }
124 $this->handlePageCall($cmd);
125 break;
126
127 case "ilnotegui":
128 $this->preview();
129 break;
130
131 case "ilobjstylesheetgui":
132 $this->ctrl->setReturn($this, "editStyleProperties");
133 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
134 $style_gui->enableWrite(true);
135 $style_gui->omitLocator();
136 if ($cmd == "create" || $_GET["new_type"] == "sty") {
137 $style_gui->setCreationMode(true);
138 }
139
140 if ($cmd == "confirmedDelete") {
141 $this->object->setStyleSheetId(0);
142 $this->object->update();
143 }
144
145 $ret = $this->ctrl->forwardCommand($style_gui);
146
147 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
148 $style_id = $ret;
149 $this->object->setStyleSheetId($style_id);
150 $this->object->update();
151 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
152 }
153 break;
154
155 case "ilportfolioexercisegui":
156 $this->ctrl->setReturn($this, "view");
157 $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
158 $this->ctrl->forwardCommand($gui);
159 break;
160
161 default:
162
163 if ($cmd != "preview") {
164 $this->addLocator();
165 $this->setTabs();
166 }
167 $this->$cmd();
168 break;
169 }
170
171 return true;
172 }
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilGlobalTemplateInterface $a_main_tpl=null)
Init javascript.
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(), ilNoteGUI\initJavascript(), ilObjPortfolioBaseGUI\preview(), 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 1279 of file class.ilObjPortfolioGUI.php.

1280 {
1282
1283 // prepare generation before contents are processed (for mathjax)
1284 ilPDFGeneratorUtils::prepareGenerationRequest("Portfolio", "ContentExport");
1285
1286 $html = $this->printView(true);
1287
1288 // :TODO: fixing css dummy parameters
1289 $html = preg_replace("/\?dummy\=[0-9]+/", "", $html);
1290 $html = preg_replace("/\?vers\=[0-9A-Za-z\-]+/", "", $html);
1291
1292 $html = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $html);
1293 $html = preg_replace("/href=\"\\.\\//ims", "href=\"" . ILIAS_HTTP_PATH . "/", $html);
1294
1295
1296 if ($a_dev_mode) {
1297 echo $html;
1298 exit;
1299 }
1300
1301 //$html = str_replace("&", "&", $html);
1302
1303 $pdf_factory = new ilHtmlToPdfTransformerFactory();
1304 $pdf_factory->deliverPDFFromHTMLString($html, "portfolio.pdf", ilHtmlToPdfTransformerFactory::PDF_OUTPUT_DOWNLOAD, "Portfolio", "ContentExport");
1305 }
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, 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 1270 of file class.ilObjPortfolioGUI.php.

1271 {
1272 $this->exportPDF(true);
1273 }
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 1160 of file class.ilObjPortfolioGUI.php.

1161 {
1162 global $DIC;
1163
1164 $tpl = $DIC["tpl"];
1165
1166 $form = $this->initPDFSelectionForm();
1167
1168 $tpl->setContent($form->getHTML());
1169 }
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 310 of file class.ilObjPortfolioGUI.php.

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

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

564 {
565 $a_values["online"] = $this->object->isOnline();
566
567 parent::getEditFormCustomValues($a_values);
568 }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

Returns
string

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

1460 {
1461 $ui = $this->ui;
1462 $lng = $this->lng;
1464
1465 if (!$this->object->isOnline()) {
1466 $f = $ui->factory();
1467 $renderer = $ui->renderer();
1468
1469 $buttons = [$f->button()->standard(
1470 $lng->txt("prtf_set_online"),
1471 $ctrl->getLinkTarget($this, "setOnlineAndShare")
1472 )];
1473
1474 return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
1475 ->withButtons($buttons));
1476 }
1477 return "";
1478 }

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

624 {
625 return "ilportfoliopagegui";
626 }

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

612 {
613 $page_gui = new ilPortfolioPageGUI(
614 $this->object->getId(),
615 $a_page_id,
616 0,
617 $this->object->hasPublicComments()
618 );
619 $page_gui->setAdditional($this->getAdditional());
620 return $page_gui;
621 }
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 594 of file class.ilObjPortfolioGUI.php.

595 {
596 // #11531
597 if (!$a_portfolio_id && $this->object) {
598 $a_portfolio_id = $this->object->getId();
599 }
600 $page = new ilPortfolioPage($a_page_id);
601 $page->setPortfolioId($a_portfolio_id);
602 return $page;
603 }
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 1134 of file class.ilObjPortfolioGUI.php.

1135 {
1136 $dom = $a_source_page->getDom();
1137 if ($dom instanceof php4DOMDocument) {
1138 $dom = $dom->myDOMDocument;
1139 }
1140 $xpath = new DOMXPath($dom);
1141 $nodes = $xpath->query("//PageContent/Skills");
1142 foreach ($nodes as $node) {
1143 $skill_id = $node->getAttribute("Id");
1144 if (!in_array($skill_id, $a_pskills)) {
1145 $a_skill_ids[] = $skill_id;
1146 }
1147 }
1148 unset($nodes);
1149 unset($xpath);
1150 unset($dom);
1151
1152 return $a_skill_ids;
1153 }

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

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

629 {
630 $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
631 $a_tgt->setRequired(true);
632 $a_form->addItem($a_tgt);
633
634 $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
635 $a_tgt->addOption($old);
636
637 $options = array();
638 $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
639 foreach ($all as $item) {
640 $options[$item["id"]] = $item["title"];
641 }
642 $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
643 $prtf->setRequired(true);
644 $prtf->setOptions($options);
645 $old->addSubItem($prtf);
646
647 $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
648 $a_tgt->addOption($new);
649
650 $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
651 $tf->setMaxLength(128);
652 $tf->setSize(40);
653 $tf->setRequired(true);
654 $new->addSubItem($tf);
655 }
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 361 of file class.ilObjPortfolioGUI.php.

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

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

357 {
358 return array(self::CFORM_NEW => $this->initCreateForm($a_new_type));
359 }
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 528 of file class.ilObjPortfolioGUI.php.

529 {
530 $form = new ilPropertyFormGUI();
531 $form->setFormAction($this->ctrl->getFormAction($this));
532
533 // title
534 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
535 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
536 $ti->setMaxLength(ilObject::TITLE_LENGTH);
537 $ti->setRequired(true);
538 $ti->setValue($this->object->getTitle());
539 $form->addItem($ti);
540
541 /* description
542 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
543 $ta->setCols(40);
544 $ta->setRows(2);
545 $ta->setValue($this->object->getDescription());
546 $form->addItem($ta);
547 */
548
549 // :TODO: online
550 $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
551 $online->setChecked($this->object->isOnline());
552 $form->addItem($online);
553
554 $this->initEditCustomForm($form);
555
556 $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
557 $form->addCommandButton("update", $this->lng->txt("save"));
558 $form->addCommandButton("view", $this->lng->txt("cancel"));
559
560 return $form;
561 }
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 1174 of file class.ilObjPortfolioGUI.php.

1175 {
1176 global $DIC;
1177
1178 $lng = $this->lng;
1179 $ilCtrl = $this->ctrl;
1180
1181 $tabs = $DIC->tabs();
1182
1183 $tabs->clearTargets();
1184 $tabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "view"));
1185
1186 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1187
1188
1189 $form = new ilPropertyFormGUI();
1190
1191 // because of PDF export
1192 $form->setPreventDoubleSubmission(false);
1193
1194 // declaration of authorship
1195 if ($this->declaration_authorship->getForUser($this->user) != "") {
1196 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_decl_authorship"), "decl_author");
1197 $cb->setInfo($this->declaration_authorship->getForUser($this->user));
1198 $form->addItem($cb);
1199 }
1200
1201 // signature
1202 $cb = new ilCheckboxInputGUI($this->lng->txt("prtf_signature"), "signature");
1203 $cb->setInfo($this->lng->txt("prtf_signature_info"));
1204 $form->addItem($cb);
1205
1206
1207 // selection type
1208 $radg = new ilRadioGroupInputGUI($lng->txt("prtf_print_selection"), "sel_type");
1209 $radg->setValue("all_pages");
1210 $op2 = new ilRadioOption($lng->txt("prtf_all_pages"), "all_pages");
1211 $radg->addOption($op2);
1212 $op3 = new ilRadioOption($lng->txt("prtf_selected_pages"), "selection");
1213 $radg->addOption($op3);
1214
1215 $nl = new ilNestedListInputGUI("", "obj_id");
1216 $op3->addSubItem($nl);
1217
1218 foreach ($pages as $p) {
1219 if ($p["type"] != ilPortfolioPage::TYPE_BLOG) {
1220 $nl->addListNode(
1221 $p["id"],
1222 $p["title"],
1223 0,
1224 false,
1225 false,
1226 ilUtil::getImagePath("icon_pg.svg"),
1227 $lng->txt("page")
1228 );
1229 } else {
1230 $nl->addListNode(
1231 $p["id"],
1232 $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($p["title"]),
1233 0,
1234 false,
1235 false,
1236 ilUtil::getImagePath("icon_blog.svg"),
1237 $lng->txt("obj_blog")
1238 );
1239 $pages2 = ilBlogPosting::getAllPostings($p["title"]);
1240 foreach ($pages2 as $p2) {
1241 $nl->addListNode(
1242 "b" . $p2["id"],
1243 $p2["title"],
1244 $p["id"],
1245 false,
1246 false,
1247 ilUtil::getImagePath("icon_pg.svg"),
1248 $lng->txt("page")
1249 );
1250 }
1251 }
1252 }
1253
1254 $form->addItem($radg);
1255
1256 $form->addCommandButton("exportPDF", $lng->txt("prtf_pdf"));
1257 if (DEVMODE == "1") {
1258 $form->addCommandButton("exportPDFDev", $lng->txt("prtf_pdf") . " (DEV)");
1259 }
1260
1261 $form->setTitle($lng->txt("prtf_print_options"));
1262 $form->setFormAction($ilCtrl->getFormAction($this, "exportPDF"));
1263
1264 return $form;
1265 }
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)

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

1107 {
1108 $ilAccess = $this->access;
1110
1111 $exc_ref_id = (int) $_REQUEST["exc_id"];
1112 $ass_id = (int) $_REQUEST["ass_id"];
1113
1114 if ($exc_ref_id &&
1115 $ass_id &&
1116 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1117 $exc = new ilObjExercise($exc_ref_id);
1118 $ass = new ilExAssignment($ass_id);
1119 if ($ass->getExerciseId() == $exc->getId() &&
1120 $ass->getType() == ilExAssignment::TYPE_PORTFOLIO) {
1121 // #16205
1122 $sub = new ilExSubmission($ass, $ilUser->getId());
1123 $sub->addResourceObject($a_target_id);
1124 }
1125 }
1126 }
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 1307 of file class.ilObjPortfolioGUI.php.

1308 {
1309 //global $tpl;
1310
1311 $lng = $this->lng;
1312
1313 $pages = ilPortfolioPage::getAllPortfolioPages($this->object->getId());
1314
1315
1316 $tpl = new ilGlobalTemplate("tpl.pdf_print_view.html", true, true, "Services/Export/PDF");
1317
1318 $resource_collector = new \ILIAS\COPage\ResourcesCollector(
1320 new ilPortfolioPage()
1321 );
1322 $resource_injector = new \ILIAS\COPage\ResourcesInjector($resource_collector);
1323
1324 $tpl->setBodyClass("ilPrtfPdfBody");
1325
1326 $tpl->addCss(ilUtil::getStyleSheetLocation("filesystem"));
1327 $tpl->addCss(ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId(), false));
1330
1331 $resource_injector->inject($tpl);
1332
1333
1334 $page_content = "";
1335
1336 // cover page
1337 $cover_tpl = new ilTemplate("tpl.prtf_cover.html", true, true, "Modules/Portfolio");
1338 foreach ($pages as $page) {
1339 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1340 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1341 continue;
1342 }
1343 $cover_tpl->setCurrentBlock("content_item");
1344 $cover_tpl->setVariable("ITEM_TITLE", $page["title"]);
1345 $cover_tpl->parseCurrentBlock();
1346 } else {
1347 $cover_tpl->setCurrentBlock("content_item");
1348 $cover_tpl->setVariable("ITEM_TITLE", $lng->txt("obj_blog") . ": " . ilObject::_lookupTitle($page["title"]));
1349 $cover_tpl->parseCurrentBlock();
1350 }
1351 }
1352
1353 if ($_POST["signature"]) {
1354 $cover_tpl->setCurrentBlock("signature");
1355 $cover_tpl->setVariable("TXT_SIGNATURE", $lng->txt("prtf_signature_date"));
1356 $cover_tpl->parseCurrentBlock();
1357 }
1358
1359 if ($_POST["decl_author"]) {
1360 $cover_tpl->setCurrentBlock("decl_author");
1361 $cover_tpl->setVariable(
1362 "TXT_DECL_AUTHOR",
1363 nl2br($this->declaration_authorship->getForUser($this->user))
1364 );
1365 $cover_tpl->parseCurrentBlock();
1366 }
1367
1368 $cover_tpl->setVariable("PORTFOLIO_TITLE", $this->object->getTitle());
1369 $cover_tpl->setVariable("PORTFOLIO_ICON", ilUtil::getImagePath("icon_prtf.svg"));
1370
1371 $cover_tpl->setVariable("TXT_AUTHOR", $lng->txt("prtf_author"));
1372 $cover_tpl->setVariable("TXT_LINK", $lng->txt("prtf_link"));
1373 $cover_tpl->setVariable("TXT_DATE", $lng->txt("prtf_date_of_print"));
1374
1375 $author = ilObjUser::_lookupName($this->object->getOwner());
1376 $author_str = $author["firstname"] . " " . $author["lastname"];
1377 $cover_tpl->setVariable("AUTHOR", $author_str);
1378
1379 $href = ilLink::_getStaticLink($this->object->getId(), "prtf");
1380 $cover_tpl->setVariable("LINK", $href);
1381
1383 $date_str = ilDatePresentation::formatDate(new ilDate(date("Y-m-d"), IL_CAL_DATE));
1384 $cover_tpl->setVariable("DATE", $date_str);
1385
1386 $page_content .= $cover_tpl->get();
1387 $page_content .= '<p style="page-break-after:always;"></p>';
1388
1389 $page_head_tpl = new ilTemplate("tpl.prtf_page_head.html", true, true, "Modules/Portfolio");
1390 $page_head_tpl->setVariable("AUTHOR", $author_str);
1391 $page_head_tpl->setVariable("DATE", $date_str);
1392 $page_head_str = $page_head_tpl->get();
1393
1394 foreach ($pages as $page) {
1395 if ($page["type"] != ilPortfolioPage::TYPE_BLOG) {
1396 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array($page["id"], $_POST["obj_id"]))) {
1397 continue;
1398 }
1399
1400 $page_gui = new ilPortfolioPageGUI($this->object->getId(), $page["id"]);
1401 $page_gui->setOutputMode("print");
1402 $page_gui->setPresentationTitle($page["title"]);
1403 $html = $this->ctrl->getHTML($page_gui);
1404 $page_content .= $page_head_str . $html;
1405
1406 if ($a_pdf_export) {
1407 $page_content .= '<p style="page-break-after:always;"></p>';
1408 }
1409 } else {
1410 $pages2 = ilBlogPosting::getAllPostings($page["title"]);
1411 foreach ($pages2 as $p2) {
1412 if ($_POST["sel_type"] == "selection" && (!is_array($_POST["obj_id"]) || !in_array("b" . $p2["id"], $_POST["obj_id"]))) {
1413 continue;
1414 }
1415 $page_gui = new ilBlogPostingGUI(0, null, $p2["id"]);
1416 $page_gui->setFileDownloadLink("#");
1417 $page_gui->setFullscreenLink("#");
1418 $page_gui->setSourcecodeDownloadScript("#");
1419 $page_gui->setOutputMode("print");
1420 $page_content .= $page_head_str . $page_gui->showPage(ilObject::_lookupTitle($page["title"]) . ": " . $page_gui->getBlogPosting()->getTitle());
1421
1422 if ($a_pdf_export) {
1423 $page_content .= '<p style="page-break-after:always;"></p>';
1424 }
1425 }
1426 }
1427 }
1428
1429 $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>';
1430
1431 if (!$a_pdf_export) {
1432 $page_content .= '<script type="text/javascript" language="javascript1.2">
1433 <!--
1434 il.Util.addOnLoad(function () {
1435 il.Util.print();
1436 });
1437 //-->
1438 </script>';
1439 }
1440
1441 $tpl->setVariable("CONTENT", $page_content);
1442
1443 if (!$a_pdf_export) {
1444 $tpl->printToStdout(false);
1445 exit;
1446 } else {
1447 $ret = $tpl->printToString();
1448 //$tpl->fillJavaScriptFiles();
1449 //$ret = $tpl->getSpecial("DEFAULT", false, false, false, true, false, false);
1450 return $ret;
1451 }
1452 }
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 473 of file class.ilObjPortfolioGUI.php.

474 {
475 $form = $this->initCreateForm("prtf");
476 if ($form->checkInput()) {
477 // trigger portfolio template "import" process
478 if ($form->getInput("mode") == "mode_tmpl") {
479 $_REQUEST["pt"] = $form->getInput("title");
480 $_REQUEST["prtt_pre"] = (int) $_REQUEST["prtt"];
481 return $this->createFromTemplateDirect($form->getInput("title"));
482 //return $this->createPortfolioFromTemplate();
483 }
484 }
485
486 return parent::save();
487 }
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 720 of file class.ilObjPortfolioGUI.php.

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

References ilObject2GUI\$access_handler, $DIC, $ilUser, ilObject2GUI\$node_id, ilObjectGUI\$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 1483 of file class.ilObjPortfolioGUI.php.

1484 {
1485 $ilCtrl = $this->ctrl;
1486 $lng = $this->lng;
1487
1488 if (ilObjPortfolio::_lookupOwner($this->object->getId()) == $this->user_id) {
1489 $this->object->setOnline(true);
1490 $this->object->update();
1491 ilUtil::sendSuccess($lng->txt("prtf_has_been_set_online"), true);
1492 }
1493 $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
1494 }
static _lookupOwner($a_id)
lookup object owner

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

198 {
199 $ilHelp = $this->help;
200
201 $ilHelp->setScreenIdComponent("prtf");
202
203 if ($this->checkPermissionBool("write")) {
204 $this->tabs_gui->addTab(
205 "pages",
206 $this->lng->txt("content"),
207 $this->ctrl->getLinkTarget($this, "view")
208 );
209
210 $this->tabs_gui->addTab(
211 "settings",
212 $this->lng->txt("settings"),
213 $this->ctrl->getLinkTarget($this, "edit")
214 );
215
216 $this->tabs_gui->addNonTabbedLink(
217 "preview",
218 $this->lng->txt("preview"),
219 $this->ctrl->getLinkTarget($this, "preview")
220 );
221
222 $this->lng->loadLanguageModule("wsp");
223 $this->tabs_gui->addTab(
224 "share",
225 $this->lng->txt("wsp_permissions"),
226 $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
227 );
228 }
229 }

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

243 {
244 // parent::setTitleAndDescription();
245
246 $title = $this->lng->txt("portfolio");
247 if ($this->object) {
248 $title .= ": " . $this->object->getTitle();
249 }
250 $this->tpl->setTitle($title);
251 $this->tpl->setTitleIcon(
252 ilUtil::getImagePath("icon_prtf.svg"),
253 $this->lng->txt("portfolio")
254 );
255
256 if ($this->object &&
257 !$this->object->isOnline()) {
258 $this->tpl->setAlertProperties(array(
259 array("alert" => true,
260 "property" => $this->lng->txt("status"),
261 "value" => $this->lng->txt("offline"))
262 ));
263 }
264 }

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

515 {
516 $ilAccess = $this->access;
517
518 // return to exercise (portfolio assignment)
519 $exc_ref_id = (int) $_REQUEST["exc_id"];
520 if ($exc_ref_id &&
521 $ilAccess->checkAccess("read", "", $exc_ref_id)) {
522 ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
523 }
524
525 $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
526 }
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 179 of file class.ilObjPortfolioGUI.php.

180 {
181 if (!is_object($this->object) || $this->object->getId() <= 0) {
182 return;
183 }
184 $pe = new ilPortfolioExercise($this->user_id, $this->object->getId());
185 $pe_gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
186 $assignments = $pe->getAssignmentsOfPortfolio();
187 if (count($assignments) > 0) {
188 $ass_ids = array_map(function ($i) {
189 return $i["ass_id"];
190 }, $assignments);
191 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
192 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
193 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_BUTTONS, $pe_gui->getActionButtons());
194 }
195 }
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 570 of file class.ilObjPortfolioGUI.php.

571 {
572 $this->object->setOnline($a_form->getInput("online"));
573
574 // if portfolio is not online, it cannot be default
575 if (!$a_form->getInput("online")) {
576 ilObjPortfolio::setUserDefault($this->user_id, 0);
577 }
578
579 parent::updateCustom($a_form);
580 }
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: