ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjPortfolioGUI Class Reference

Portfolio view gui class. More...

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

Public Member Functions

 __construct (int $a_id=0)
 
 getType ()
 
 executeCommand ()
 
 create ()
 
 save ()
 
 getPageGUIClassName ()
 
 createPortfolioFromAssignment ()
 
 linkPortfolioToAssignment (int $a_target_id)
 
 getSkillsToPortfolioAssignment (array $a_pskills, array $a_skill_ids, ilPortfolioTemplatePage $a_source_page)
 
 printSelection ()
 
 showPrintView ()
 
- Public Member Functions inherited from ilObjPortfolioBaseGUI
 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 setAdditional (array $a_additional)
 Set Additonal Information (used in public profile?) More...
 
 getAdditional ()
 
 setPermaLink (int $a_obj_id, string $a_type)
 Set custom perma link (used in public profile?) More...
 
 getPageGUIClassName ()
 
 view ()
 Show list of portfolio pages. More...
 
 initPageForm (string $a_mode="create")
 Init portfolio page form. More...
 
 savePage ()
 Create new portfolio page. More...
 
 savePortfolioPagesOrdering ()
 Save ordering of portfolio pages. More...
 
 confirmPortfolioPageDeletion ()
 
 deletePortfolioPages ()
 
 export (bool $a_with_comments=false)
 
 exportWithComments ()
 
 copyPageForm (ilPropertyFormGUI $a_form=null)
 Select target portfolio for page(s) copy. More...
 
 copyPage ()
 
 initCopyPageForm ()
 
 setContentStyleSheet (ilGlobalTemplateInterface $a_tpl=null)
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 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 (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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 More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObjPortfolioBaseGUI
static renderFullscreenHeader (ilObjPortfolioBase $a_portfolio, ilGlobalTemplateInterface $a_tpl, int $a_user_id, bool $a_export=false)
 Render banner, user name. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 triggerAssignmentTool ()
 
 setTabs ()
 
 addLocator ()
 
 setTitleAndDescription ()
 
 getCreateInfoMessage ()
 
 initCreationForms (string $new_type)
 
 initCreateForm (string $new_type)
 
 afterSave (ilObject $new_object)
 
 toRepository ()
 
 initEditForm ()
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $form)
 
 getPageInstance (?int $a_page_id=null, ?int $a_portfolio_id=null)
 Get portfolio template page instance. More...
 
 getPageGUIInstance (int $a_page_id)
 Get portfolio template page gui instance. More...
 
 initCopyPageFormOptions (ilPropertyFormGUI $a_form)
 
 initBlogForm ()
 
 saveBlog ()
 Create new portfolio blog page. More...
 
 createPortfolioFromTemplate (ilPropertyFormGUI $a_form=null)
 
 initCreatePortfolioFromTemplateForm (int $a_prtt_id, string $a_title)
 
 createPortfolioFromTemplateProcess (bool $a_process_form=true)
 
 createFromTemplateDirect (string $title="", int $prtt_id=0)
 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 ()
 
 determinePageCall ()
 
 handlePageCall (string $a_cmd)
 
 setSettingsSubTabs (string $a_active)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $form)
 
 getPageInstance (?int $a_page_id=null, ?int $a_portfolio_id=null)
 
 getPageGUIInstance (int $a_page_id)
 
 addPage ()
 Show portfolio page creation form. More...
 
 addBlog ()
 Show portfolio blog page creation form. More...
 
 initBlogForm ()
 
 saveBlog ()
 
 showEditButton (int $page_id)
 
 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 ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ILIAS Notes GUIService $notes_gui
 
ilWorkspaceAccessHandler $ws_access
 
ContextServices $tool_context
 
ilPortfolioDeclarationOfAuthorship $declaration_authorship
 
- Protected Attributes inherited from ilObjPortfolioBaseGUI
StandardGUIRequest $port_request
 
ilHelpGUI $help
 
int $user_id = 0
 
array $additional = array()
 
array $perma_link = []
 
int $page_id = 0
 
string $page_mode
 
int $requested_ppage
 
int $requested_user_page
 
string $requested_back_url = ""
 
ILIAS DI UIServices $ui
 
ILIAS HTTP Services $http
 
ILIAS Style Content GUIService $content_style_gui
 
ILIAS Style Content Object ObjectFacade $content_style_domain
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = array()
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- 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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioGUI::__construct ( int  $a_id = 0)

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

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

36  {
37  global $DIC;
38 
39  $this->lng = $DIC->language();
40  $this->help = $DIC["ilHelp"];
41  $this->settings = $DIC->settings();
42  $this->access = $DIC->access();
43  $this->user = $DIC->user();
44  $this->ctrl = $DIC->ctrl();
45  $this->ui = $DIC->ui();
46 
47  $this->tool_context = $DIC->globalScreen()->tool()->context();
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  $this->notes_gui = $DIC->notes()->gui();
54  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjPortfolioGUI::_goto ( string  $a_target)
static

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

References ilObject2GUI\$ctrl, $DIC, ilObjectGUI\$id, ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

1012  : void
1013  {
1014  global $DIC;
1015 
1016  $ctrl = $DIC->ctrl();
1017 
1018  $id = explode("_", $a_target);
1019 
1020  $ctrl->setParameterByClass("ilobjportfoliogui", "prt_id", $id[0]);
1021  if (count($id) === 2) {
1022  $ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $id[1]);
1023  }
1024  $ctrl->redirectByClass(["ilsharedresourceGUI", "ilobjportfoliogui"], "preview");
1025  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

References ilObjPortfolioBaseGUI\addLocatorItems(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand().

238  : void
239  {
240  if (!$this->creation_mode) {
241  $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
242  }
243 
244  $this->addLocatorItems();
245 
246  $this->tpl->setLocator();
247  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjPortfolioGUI::afterSave ( ilObject  $new_object)
protected

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

References ILIAS\Repository\ctrl(), ilObject\getId(), getPageInstance(), ILIAS\Repository\lng(), ilPortfolioPage\TYPE_BLOG, and ilPortfolioPage\TYPE_PAGE.

483  : void
484  {
485  // create 1st page / blog
486  $page = $this->getPageInstance(null, $new_object->getId());
487  if ($this->port_request->getPageType() === "page") {
488  $page->setType(ilPortfolioPage::TYPE_PAGE);
489  $page->setTitle($this->port_request->getPageTitle());
490 
491  // use template as basis
492  $layout_id = $this->port_request->getTemplateId();
493  if ($layout_id) {
494  $layout_obj = new ilPageLayout($layout_id);
495  $page->setXMLContent($layout_obj->getXMLContent());
496  }
497  } else {
498  $page->setType(ilPortfolioPage::TYPE_BLOG);
499  $page->setTitle($this->port_request->getBlogTitle());
500  }
501  $page->create();
502 
503  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
504  $this->ctrl->setParameter($this, "prt_id", $new_object->getId());
505  $this->ctrl->redirect($this, "view");
506  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPageInstance(?int $a_page_id=null, ?int $a_portfolio_id=null)
Get portfolio template page instance.
+ Here is the call graph for this function:

◆ checkPermissionBool()

ilObjPortfolioGUI::checkPermissionBool ( string  $perm,
string  $cmd = "",
string  $type = "",
?int  $node_id = null 
)
protected

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

References ilObject2GUI\$node_id, and ilObjectGUI\$obj_id.

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

66  : bool {
67  if ($perm === "create") {
68  return true;
69  }
70  if (!$node_id) {
72  }
73  return $this->access_handler->checkAccess($perm, "", $node_id);
74  }
+ Here is the caller graph for this function:

◆ create()

ilObjPortfolioGUI::create ( )

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

References ilObject2GUI\$error, $ilErr, ilObject2GUI\$tpl, checkPermissionBool(), ILIAS\Repository\ctrl(), getCreateInfoMessage(), ilObjectGUI\getCreationFormsHTML(), initCreationForms(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

278  : void
279  {
280  $tpl = $this->tpl;
282 
283  $new_type = $this->port_request->getNewType();
284 
285  // add new object to custom parent container
286  $this->ctrl->saveParameter($this, "crtptrefid");
287  // use forced callback after object creation
288  $this->ctrl->saveParameter($this, "crtcb");
289 
290  if (!$this->checkPermissionBool("create", "", $new_type)) {
291  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
292  } else {
293  $this->lng->loadLanguageModule($new_type);
294  $this->ctrl->setParameter($this, "new_type", $new_type);
295 
296  $forms = $this->initCreationForms($new_type);
297 
298  // copy form validation error: do not show other creation forms
299  if ($this->port_request->getCopyFormProcess() && isset($forms[self::CFORM_CLONE])) {
300  $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
301  }
302  $tpl->setContent($this->getCreateInfoMessage() . $this->getCreationFormsHTML($forms));
303  }
304  }
ilErrorHandling $error
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
getCreationFormsHTML(array $forms)
Get HTML for creation forms (accordion)
$ilErr
Definition: raiseError.php:17
initCreationForms(string $new_type)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ createFromTemplateDirect()

ilObjPortfolioGUI::createFromTemplateDirect ( string  $title = "",
int  $prtt_id = 0 
)
protected

Create portfolio template direct.

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

References $source, $target_id, ilObject\_lookupTitle(), ilObjPortfolioBase\clonePagesAndSettings(), ILIAS\Repository\ctrl(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ILIAS\Repository\lng(), and toRepository().

Referenced by save().

978  : void {
979  if ($prtt_id === 0) {
980  $prtt_id = $this->port_request->getPortfolioTemplateId();
981  }
982  if ($title === "") {
983  $title = ilObject::_lookupTitle($prtt_id);
984  }
985 
986  // valid template?
988  if (!count($templates) || !in_array($prtt_id, $templates)) {
989  $this->toRepository();
990  }
991  unset($templates);
992 
993  $source = new ilObjPortfolioTemplate($prtt_id, false);
994 
995  // create portfolio
996  $target = new ilObjPortfolio();
997  $target->setTitle($title);
998  $target->create();
999  $target_id = $target->getId();
1000 
1002 
1003  // link portfolio to exercise assignment
1004  //$this->linkPortfolioToAssignment($target_id);
1005 
1006  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
1007  $this->ctrl->setParameter($this, "prt_id", $target_id);
1008  $this->ctrl->redirect($this, "preview");
1009  }
$target_id
Definition: goto.php:52
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAvailablePortfolioTemplates(string $a_permission="read")
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
static _lookupTitle(int $obj_id)
$source
Definition: metadata.php:93
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioFromAssignment()

ilObjPortfolioGUI::createPortfolioFromAssignment ( )

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

References $ilSetting, $ilUser, ilObjectGUI\$settings, $source, $target_id, ilObject2GUI\$user, ilObject\_lookupObjectId(), ilObjPortfolioBase\clonePagesAndSettings(), ILIAS\Repository\ctrl(), ilPortfolioPage\getAllPortfolioPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ilPersonalSkill\getSelectedUserSkills(), getSkillsToPortfolioAssignment(), linkPortfolioToAssignment(), ILIAS\Repository\lng(), toRepository(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilPortfolioPage\TYPE_PAGE.

1027  : void
1028  {
1029  $ilUser = $this->user;
1031 
1032  $recipe = [];
1033 
1034  $title = $this->port_request->getPortfolioTitle();
1035  $prtt_id = $this->port_request->getPortfolioTemplate();
1036 
1037  // get assignment template
1038  $ass_template_id = 0;
1039  $ass_id = $this->port_request->getExcAssId();
1040  if ($ass_id > 0) {
1041  $ass = new ilExAssignment($ass_id);
1042  $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
1043  }
1044 
1045  if ($prtt_id > 0) {
1046  $templates = array_keys(ilObjPortfolioTemplate::getAvailablePortfolioTemplates());
1047  if (!count($templates) || !in_array($prtt_id, $templates)) {
1048  if ($ass_template_id !== $prtt_id) {
1049  $this->toRepository();
1050  }
1051  }
1052 
1053  //skills manipulation
1054  $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
1055  $skill_ids = array();
1056 
1057  $recipe = array();
1058  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
1059  switch ($page["type"]) {
1061  if (!$ilSetting->get('disable_wsp_blogs')) {
1062  $recipe[$page["id"]] = array("blog", "create", $page['title']);
1063  }
1064  break;
1066  $source_page = new ilPortfolioTemplatePage($page["id"]);
1067  $source_page->buildDom(true);
1068  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
1069  break;
1070  }
1071  }
1072 
1073  if ($skill_ids) {
1074  $recipe["skills"] = $skill_ids;
1075  }
1076  }
1077 
1078  // create portfolio
1079  $target = new ilObjPortfolio();
1080  $target->setTitle($title);
1081  $target->create();
1082  $target_id = $target->getId();
1083 
1084  if ($prtt_id) {
1085  $source = new ilObjPortfolioTemplate($prtt_id, false);
1087  }
1088 
1089  // link portfolio to exercise assignment
1091 
1092  $this->ctrl->setParameter($this, "prt_id", $target_id);
1093  if ($prtt_id) {
1094  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
1095  $this->ctrl->redirect($this, "preview");
1096  } else {
1097  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
1098  $this->ctrl->redirect($this, "view");
1099  }
1100  }
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
Exercise assignment.
getSkillsToPortfolioAssignment(array $a_pskills, array $a_skill_ids, ilPortfolioTemplatePage $a_source_page)
$target_id
Definition: goto.php:52
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAvailablePortfolioTemplates(string $a_permission="read")
linkPortfolioToAssignment(int $a_target_id)
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
static _lookupObjectId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSelectedUserSkills(int $a_user_id)
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:34
ilSetting $settings
$source
Definition: metadata.php:93
+ Here is the call graph for this function:

◆ createPortfolioFromTemplate()

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

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

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

Referenced by createPortfolioFromTemplateProcess().

761  : void {
762  $title = $this->port_request->getPortfolioTitle();
763  $prtt_id = $this->port_request->getPortfolioTemplate();
764 
765  // valid template?
767  if (!count($templates) || !in_array($prtt_id, $templates)) {
768  $this->toRepository();
769  }
770  unset($templates);
771 
772  $this->ctrl->setParameter($this, "prtt", $prtt_id);
773 
774  if (!$a_form) {
775  $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
776  }
777  if ($a_form) {
778  $this->tpl->setContent($a_form->getHTML());
779  } else {
781  }
782  }
createPortfolioFromTemplateProcess(bool $a_process_form=true)
static getAvailablePortfolioTemplates(string $a_permission="read")
initCreatePortfolioFromTemplateForm(int $a_prtt_id, string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioFromTemplateProcess()

ilObjPortfolioGUI::createPortfolioFromTemplateProcess ( bool  $a_process_form = true)
protected

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

References $ilSetting, ilObjectGUI\$settings, $source, $target_id, ilObjPortfolioBase\clonePagesAndSettings(), createPortfolioFromTemplate(), ILIAS\Repository\ctrl(), ilPortfolioPage\getAllPortfolioPages(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), initCreatePortfolioFromTemplateForm(), linkPortfolioToAssignment(), ILIAS\Repository\lng(), toRepository(), and ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE.

Referenced by createPortfolioFromTemplate().

901  : void {
903 
904  $title = $this->port_request->getPortfolioTitle();
905  $prtt_id = $this->port_request->getPortfolioTemplate();
906 
907  // valid template?
909  if (!count($templates) || !in_array($prtt_id, $templates)) {
910  $this->toRepository();
911  }
912  unset($templates);
913 
914  // build page recipe (aka import form values)
915  $recipe = null;
916  if ($a_process_form) {
917  $this->ctrl->setParameter($this, "prtt", $prtt_id);
918 
919  $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
920  if ($form->checkInput()) {
921  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
922  if (($page["type"] == ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE) && !$ilSetting->get('disable_wsp_blogs')) {
923  $field_id = "blog_" . $page["id"];
924  switch ($form->getInput($field_id)) {
925  case "blog_create":
926  $recipe[$page["id"]] = array("blog",
927  "create",
928  trim($form->getInput($field_id . "_create_title"))
929  );
930  break;
931 
932  case "blog_resuse":
933  $recipe[$page["id"]] = array("blog",
934  "reuse",
935  (int) $form->getInput($field_id . "_reuse_blog")
936  );
937  break;
938 
939  case "blog_ignore":
940  $recipe[$page["id"]] = array("blog", "ignore");
941  break;
942  }
943  }
944  }
945 
946  $recipe["skills"] = (array) $form->getInput("skill_ids");
947  } else {
948  $form->setValuesByPost();
949  $this->createPortfolioFromTemplate($form);
950  return;
951  }
952  }
953 
954  $source = new ilObjPortfolioTemplate($prtt_id, false);
955 
956  // create portfolio
957  $target = new ilObjPortfolio();
958  $target->setTitle($title);
959  $target->create();
960  $target_id = $target->getId();
961 
963 
964  // link portfolio to exercise assignment
966 
967  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
968  $this->ctrl->setParameter($this, "prt_id", $target_id);
969  $this->ctrl->redirect($this, "preview");
970  }
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
$target_id
Definition: goto.php:52
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAvailablePortfolioTemplates(string $a_permission="read")
linkPortfolioToAssignment(int $a_target_id)
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
global $ilSetting
Definition: privfeed.php:17
ilSetting $settings
$source
Definition: metadata.php:93
initCreatePortfolioFromTemplateForm(int $a_prtt_id, string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

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

References ilObject2GUI\$access_handler, addLocator(), ilObject2GUI\checkPermission(), checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjPortfolioBaseGUI\determinePageCall(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getOfflineMessage(), ilObjPortfolioBaseGUI\handlePageCall(), ILIAS\Repository\object(), ilWorkspaceAccessGUI\setBlockingMessage(), ilObjPortfolioBaseGUI\setSettingsSubTabs(), setTabs(), setTitleAndDescription(), and triggerAssignmentTool().

76  : void
77  {
78  $this->checkPermission("read");
79  $this->setTitleAndDescription();
80 
81  $next_class = $this->ctrl->getNextClass($this);
82  $cmd = $this->ctrl->getCmd("view");
83 
84  // we have to init the note js handling here, might go to
85  // a better place in the future
86  $this->notes_gui->initJavascript(
87  $this->ctrl->getLinkTargetByClass(
88  array("ilnotegui"),
89  "",
90  "",
91  true,
92  false
93  )
94  );
95 
96  // trigger assignment tool
97  $this->triggerAssignmentTool();
98  switch ($next_class) {
99  case "ilworkspaceaccessgui":
100  if ($this->checkPermissionBool("write")) {
101  $this->setTabs();
102  $this->tabs_gui->activateTab("share");
103 
104  $this->tpl->setPermanentLink("prtf", $this->object->getId());
105 
106  $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
107  $wspacc->setBlockingMessage($this->getOfflineMessage());
108  $this->ctrl->forwardCommand($wspacc);
109  }
110  break;
111 
112  case 'ilportfoliopagegui':
113  if ($this->determinePageCall()) {
114  // only in edit mode
115  $this->addLocator();
116  }
117  $this->handlePageCall($cmd);
118  break;
119 
120  case "ilnotegui":
121  $this->preview();
122  break;
123 
124  case "ilcommonactiondispatchergui":
125  //$this->prepareOutput();
127  $this->ctrl->forwardCommand($gui);
128  break;
129 
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" || $this->port_request->getNewType() == "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 "ilobjectcontentstylesettingsgui":
156  $this->checkPermission("write");
157  $this->addLocator();
158  $this->setTabs();
159  $this->tabs_gui->activateTab("settings");
160  $this->setSettingsSubTabs("style");
161  $settings_gui = $this->content_style_gui
162  ->objectSettingsGUIForObjId(
163  null,
164  $this->object->getId()
165  );
166  $this->ctrl->forwardCommand($settings_gui);
167  break;
168 
169  case "ilportfolioexercisegui":
170  $this->ctrl->setReturn($this, "view");
171  $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
172  $this->ctrl->forwardCommand($gui);
173  break;
174 
175  default:
176 
177  if ($cmd !== "preview") {
178  $this->addLocator();
179  $this->setTabs();
180  }
181  $this->$cmd();
182  break;
183  }
184  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
getOfflineMessage()
Get offline message for sharing tab.
Class ilPortfolioExerciseGUI.
ACL access handler GUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getCreateInfoMessage()

ilObjPortfolioGUI::getCreateInfoMessage ( )
protected

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

References $DIC, $ilSetting, $message, ilObjectGUI\$tree, ilObjPortfolioBaseGUI\$ui, $url, ILIAS\Repository\ctrl(), ilTree\getNodeData(), ilTree\getSubTree(), ILIAS\Repository\lng(), and ilTree\readRootId().

Referenced by create().

306  : string
307  {
308  global $DIC;
309 
310  $ui = $DIC->ui();
311  $ilSetting = $DIC->settings();
312 
313  $message = "";
314  // page type: blog
315  if (!$ilSetting->get('disable_wsp_blogs')) {
316  $options = array();
317  $tree = new ilWorkspaceTree($this->user_id);
318  $root = $tree->readRootId();
319  if ($root) {
320  $root = $tree->getNodeData($root);
321  foreach ($tree->getSubTree($root) as $node) {
322  if ($node["type"] == "blog") {
323  $options[$node["obj_id"]] = $node["title"];
324  }
325  }
326  asort($options);
327  }
328  if (!count($options)) {
329 
330  // #18147
331  $this->lng->loadLanguageModule('pd');
332  $url = $this->ctrl->getLinkTargetByClass("ilDashboardGUI", "jumpToWorkspace");
333  $text = $this->lng->txt("mm_personal_and_shared_r");
334 
335  $text = sprintf($this->lng->txt("prtf_no_blogs_info"), $text);
336 
337  $mbox = $ui->factory()->messageBox()->info($text)
338  ->withLinks([$ui->factory()->link()->standard(
339  $this->lng->txt("mm_personal_and_shared_r"),
340  $url
341  )]);
342 
343  $message = $ui->renderer()->render($mbox);
344  }
345  }
346  return $message;
347  }
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
$message
Definition: xapiexit.php:32
$url
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

557  : void
558  {
559  $a_values["online"] = $this->object->isOnline();
560 
561  parent::getEditFormCustomValues($a_values);
562  }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

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

References ilObject2GUI\$ctrl, Vendor\Package\$f, ilObject2GUI\$lng, ilObjPortfolioBaseGUI\$ui, ilCtrl\getLinkTarget(), ILIAS\Repository\object(), and ilLanguage\txt().

Referenced by executeCommand().

1168  : string
1169  {
1170  $ui = $this->ui;
1171  $lng = $this->lng;
1172  $ctrl = $this->ctrl;
1173 
1174  if (!$this->object->isOnline()) {
1175  $f = $ui->factory();
1176  $renderer = $ui->renderer();
1177 
1178  $buttons = [$f->button()->standard(
1179  $lng->txt("prtf_set_online"),
1180  $ctrl->getLinkTarget($this, "setOnlineAndShare")
1181  )];
1182 
1183  return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
1184  ->withButtons($buttons));
1185  }
1186  return "";
1187  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageGUIClassName()

ilObjPortfolioGUI::getPageGUIClassName ( )

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

614  : string
615  {
616  return "ilportfoliopagegui";
617  }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance ( int  $a_page_id)
protected

Get portfolio template page gui instance.

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

References ilObjPortfolioBaseGUI\getAdditional(), ILIAS\Repository\object(), and ilPageObjectGUI\setStyleId().

603  $page_gui = new ilPortfolioPageGUI(
604  $this->object->getId(),
605  $a_page_id,
606  0,
607  $this->object->hasPublicComments()
608  );
609  $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
610  $page_gui->setAdditional($this->getAdditional());
611  return $page_gui;
612  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setStyleId(int $a_styleid)
+ Here is the call graph for this function:

◆ getPageInstance()

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

Get portfolio template page instance.

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

References ilPageObject\getId().

Referenced by afterSave(), and saveBlog().

587  : ilPortfolioPage {
588  // #11531
589  if (!$a_portfolio_id && $this->object) {
590  $a_portfolio_id = $this->object->getId();
591  }
592  $page = new ilPortfolioPage((int) $a_page_id);
593  $page->setPortfolioId($a_portfolio_id);
594  return $page;
595  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSkillsToPortfolioAssignment()

ilObjPortfolioGUI::getSkillsToPortfolioAssignment ( array  $a_pskills,
array  $a_skill_ids,
ilPortfolioTemplatePage  $a_source_page 
)

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

References ilPageObject\getDom().

Referenced by createPortfolioFromAssignment(), and initCreatePortfolioFromTemplateForm().

1128  : array {
1129  $dom = $a_source_page->getDom();
1130  if ($dom instanceof php4DOMDocument) {
1131  $dom = $dom->myDOMDocument;
1132  }
1133  $xpath = new DOMXPath($dom);
1134  $nodes = $xpath->query("//PageContent/Skills");
1135  foreach ($nodes as $node) {
1136  $skill_id = $node->getAttribute("Id");
1137  if (!in_array($skill_id, $a_pskills)) {
1138  $a_skill_ids[] = $skill_id;
1139  }
1140  }
1141  unset($nodes, $xpath, $dom);
1142 
1143  return $a_skill_ids;
1144  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

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

Referenced by initCreateForm().

56  : string
57  {
58  return "prtf";
59  }
+ Here is the caller graph for this function:

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )
protected

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

References ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ilTree\getNodeData(), ilTree\getSubTree(), ILIAS\Repository\lng(), ilTree\readRootId(), and ilFormPropertyGUI\setInfo().

Referenced by saveBlog().

654  {
655  $form = new ilPropertyFormGUI();
656  $form->setFormAction($this->ctrl->getFormAction($this));
657 
658  $options = array();
659  $tree = new ilWorkspaceTree($this->user_id);
660  $root = $tree->readRootId();
661  if ($root) {
662  $root = $tree->getNodeData($root);
663  foreach ($tree->getSubTree($root, true, ["blog"]) as $node) {
664  $options[$node["obj_id"]] = $node["title"];
665  }
666  asort($options);
667  }
668 
669  // add blog
670  $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
671  $radg->setInfo($this->lng->txt(""));
672  $radg->setValue("new");
673  $radg->setInfo($this->lng->txt(""));
674 
675  $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
676  $radg->addOption($op1);
677  $form->addItem($radg);
678 
679  // Blog title
680  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
681  $ti->setRequired(true);
682  $op1->addSubItem($ti);
683 
684 
685  if (count($options)) {
686  $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
687  $radg->addOption($op2);
688 
689  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
690  $obj->setOptions($options);
691  $op2->addSubItem($obj);
692  }
693 
694  $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
695  $this->object->getTitle());
696  $form->addCommandButton("saveBlog", $this->lng->txt("save"));
697  $form->addCommandButton("view", $this->lng->txt("cancel"));
698 
699  return $form;
700  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
protected

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

References ilPropertyFormGUI\addItem(), ilObjPortfolio\getPortfoliosOfUser(), ILIAS\Repository\lng(), and ilFormPropertyGUI\setRequired().

619  : void
620  {
621  $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
622  $a_tgt->setRequired(true);
623  $a_form->addItem($a_tgt);
624 
625  $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
626  $a_tgt->addOption($old);
627 
628  $options = array();
629  $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
630  foreach ($all as $item) {
631  $options[$item["id"]] = $item["title"];
632  }
633  $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
634  $prtf->setRequired(true);
635  $prtf->setOptions($options);
636  $old->addSubItem($prtf);
637 
638  $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
639  $a_tgt->addOption($new);
640 
641  $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
642  $tf->setMaxLength(128);
643  $tf->setSize(40);
644  $tf->setRequired(true);
645  $new->addSubItem($tf);
646  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
static getPortfoliosOfUser(int $a_user_id)
Get portfolios of user.
setRequired(bool $a_required)
+ Here is the call graph for this function:

◆ initCreateForm()

ilObjPortfolioGUI::initCreateForm ( string  $new_type)
protected

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

References $ilSetting, ilObjectGUI\$settings, ilObjectGUI\$tree, ilObject2GUI\$type, ilPageLayout\activeLayouts(), ILIAS\Repository\ctrl(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), ilTree\getNodeData(), ilTree\getSubTree(), getType(), ILIAS\Repository\lng(), ilPageLayout\MODULE_PORTFOLIO, ilTree\readRootId(), ilRadioGroupInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and save().

356  {
358 
359  $this->ctrl->setParameter($this, "new_type", $this->getType());
360 
361  $form = new ilPropertyFormGUI();
362  $form->setFormAction($this->ctrl->getFormAction($this));
363 
364  // title
365  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
366  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
367  $ti->setMaxLength(ilObject::TITLE_LENGTH);
368  $ti->setRequired(true);
369  $form->addItem($ti);
370 
371  $main = new ilRadioGroupInputGUI($this->lng->txt("prtf_creation_mode"), "mode");
372  $main->setValue("mode_scratch");
373  $form->addItem($main);
374 
375  $opt_scratch = new ilRadioOption($this->lng->txt("prtf_creation_mode_scratch"), "mode_scratch");
376  $main->addOption($opt_scratch);
377 
378 
379  // 1st page
380 
381  $type = new ilRadioGroupInputGUI($this->lng->txt("prtf_first_page_title"), "ptype");
382  $type->setRequired(true);
383  $opt_scratch->addSubItem($type);
384 
385  $type_page = new ilRadioOption($this->lng->txt("page"), "page");
386  $type->addOption($type_page);
387 
388  // page type: page
389  $tf = new ilTextInputGUI($this->lng->txt("title"), "fpage");
390  $tf->setMaxLength(128);
391  $tf->setSize(40);
392  $tf->setRequired(true);
393  $type_page->addSubItem($tf);
394 
395  // page templates
397  if ($templates) {
398  $options = array(0 => $this->lng->txt("none"));
399  foreach ($templates as $templ) {
400  $templ->readObject();
401  $options[$templ->getId()] = $templ->getTitle();
402  }
403 
404  $use_template = new ilSelectInputGUI($this->lng->txt("prtf_use_page_layout"), "tmpl");
405  $use_template->setRequired(true);
406  $use_template->setOptions($options);
407  $type_page->addSubItem($use_template);
408  }
409 
410  // page type: blog
411  if (!$ilSetting->get('disable_wsp_blogs')) {
412  $options = array();
413  $tree = new ilWorkspaceTree($this->user_id);
414  $root = $tree->readRootId();
415  if ($root) {
416  $root = $tree->getNodeData($root);
417  foreach ($tree->getSubTree($root) as $node) {
418  if ($node["type"] == "blog") {
419  $options[$node["obj_id"]] = $node["title"];
420  }
421  }
422  asort($options);
423  }
424  if (count($options)) {
425  $type_blog = new ilRadioOption($this->lng->txt("obj_blog"), "blog");
426  $type->addOption($type_blog);
427 
428  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
429  $obj->setRequired(true);
430  $obj->setOptions(array("" => $this->lng->txt("please_select")) + $options);
431  $type_blog->addSubItem($obj);
432  } else {
433  $type->setValue("page");
434  }
435  }
436 
437 
438  // portfolio templates
439 
440  $opt_tmpl = new ilRadioOption($this->lng->txt("prtf_creation_mode_template"), "mode_tmpl");
441  $main->addOption($opt_tmpl);
442 
444  if (!count($templates)) {
445  $opt_tmpl->setDisabled(true);
446  } else {
447  $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
448  $tmpl->setRequired(true);
449  $tmpl->setOptions(array("" => $this->lng->txt("please_select")) + $templates);
450  $opt_tmpl->addSubItem($tmpl);
451 
452  // incoming from repository
453  $template_id = $this->port_request->getPortfolioTemplateId();
454  if ($template_id > 0) {
455  $tmpl->setValue($template_id);
456  $main->setValue("mode_tmpl");
457  }
458  }
459 
460 
461  $form->setTitle($this->lng->txt("prtf_create_portfolio"));
462  $form->addCommandButton("save", $this->lng->txt("create"));
463  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
464 
465  return $form;
466  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
const TITLE_LENGTH
static getAvailablePortfolioTemplates(string $a_permission="read")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static activeLayouts(int $a_module=0)
Get active layouts.
This class represents a property in a property form.
global $ilSetting
Definition: privfeed.php:17
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreatePortfolioFromTemplateForm()

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

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

References $ilSetting, $ilUser, ilObjectGUI\$settings, ilObjectGUI\$tree, ilObject2GUI\$user, ilSkillTreeNode\_lookupTitle(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ilPortfolioPage\getAllPortfolioPages(), ilTree\getNodeData(), ilPersonalSkill\getSelectedUserSkills(), getSkillsToPortfolioAssignment(), ilTree\getSubTree(), ILIAS\Repository\lng(), ilTree\readRootId(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilNonEditableValueGUI\setValue(), ilPortfolioTemplatePage\TYPE_BLOG_TEMPLATE, and ilPortfolioPage\TYPE_PAGE.

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

787  : ?ilPropertyFormGUI {
790 
791  $blog_options = [];
792 
793  $exc_id = $this->port_request->getExerciseRefId();
794  $ass_id = $this->port_request->getExcAssId();
795  if ($exc_id > 0) {
796  $this->ctrl->setParameter($this, "exc_id", $exc_id);
797  $this->ctrl->setParameter($this, "ass_id", $ass_id);
798  }
799 
800  $form = new ilPropertyFormGUI();
801  $form->setFormAction($this->ctrl->getFormAction($this));
802 
803  $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
804  $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
805  $form->addItem($tmpl);
806 
807  $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
808  $title->setValue($a_title);
809  $form->addItem($title);
810 
811  // gather user blogs
812  if (!$ilSetting->get('disable_wsp_blogs')) {
813  $blog_options = array();
814  $tree = new ilWorkspaceTree($this->user_id);
815  $root = $tree->readRootId();
816  if ($root) {
817  $root = $tree->getNodeData($root);
818  foreach ($tree->getSubTree($root, true, ["blog"]) as $node) {
819  $blog_options[$node["obj_id"]] = $node["title"];
820  }
821  asort($blog_options);
822  }
823  }
824 
825  $has_form_content = false;
826 
827  $pskills = array_keys(ilPersonalSkill::getSelectedUserSkills($ilUser->getId()));
828  $skill_ids = array();
829 
830  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
831  switch ($page["type"]) {
833  // skills
834  $source_page = new ilPortfolioTemplatePage($page["id"]);
835  $source_page->buildDom(true);
836  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
837 
838  if (count($skill_ids)) {
839  $has_form_content = true;
840  }
841  break;
842 
844  if (!$ilSetting->get('disable_wsp_blogs')) {
845  $has_form_content = true;
846 
847  $field_id = "blog_" . $page["id"];
848 
849  $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " .
850  $page["title"], $field_id);
851  $blog->setRequired(true);
852  $blog->setValue("blog_create");
853  $form->addItem($blog);
854 
855  $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
856  $blog->addOption($new_blog);
857 
858  $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
859  $title->setRequired(true);
860  $new_blog->addSubItem($title);
861 
862  if (count($blog_options)) {
863  $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
864  $blog->addOption($reuse_blog);
865 
866  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
867  $obj->setRequired(true);
868  $obj->setOptions(array("" => $this->lng->txt("please_select")) + $blog_options);
869  $reuse_blog->addSubItem($obj);
870  }
871 
872  $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
873  }
874  break;
875  }
876  }
877 
878  if ($skill_ids) {
879  $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
880  $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
881  $skills->setValue($skill_ids);
882  foreach ($skill_ids as $skill_id) {
883  $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
884  }
885  $form->addItem($skills);
886  }
887  // no dialog needed, go ahead
888  if (!$has_form_content) {
889  return null;
890  }
891 
892  $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
893  $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
894  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
895 
896  return $form;
897  }
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getSkillsToPortfolioAssignment(array $a_pskills, array $a_skill_ids, ilPortfolioTemplatePage $a_source_page)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSelectedUserSkills(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilSetting
Definition: privfeed.php:17
$ilUser
Definition: imgupload.php:34
getSubTree(array $a_node, bool $a_with_data=true, array $a_type=[])
get all nodes in the subtree under specified node
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjPortfolioGUI::initCreationForms ( string  $new_type)
protected

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

References initCreateForm().

Referenced by create().

350  : array
351  {
352  return array(self::CFORM_NEW => $this->initCreateForm($new_type));
353  }
initCreateForm(string $new_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

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

References ILIAS\Repository\ctrl(), ilObjPortfolioBaseGUI\initEditCustomForm(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilCheckboxInputGUI\setChecked(), and ilObject\TITLE_LENGTH.

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

◆ linkPortfolioToAssignment()

ilObjPortfolioGUI::linkPortfolioToAssignment ( int  $a_target_id)

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

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

Referenced by createPortfolioFromAssignment(), and createPortfolioFromTemplateProcess().

1102  : void
1103  {
1104  $ilAccess = $this->access;
1105  $ilUser = $this->user;
1106 
1107  $exc_ref_id = $this->port_request->getExerciseRefId();
1108  $ass_id = $this->port_request->getExcAssId();
1109 
1110  if ($exc_ref_id &&
1111  $ass_id &&
1112  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1113  $exc = new ilObjExercise($exc_ref_id);
1114  $ass = new ilExAssignment($ass_id);
1115  if ($ass->getExerciseId() === $exc->getId() &&
1116  $ass->getType() === ilExAssignment::TYPE_PORTFOLIO) {
1117  // #16205
1118  $sub = new ilExSubmission($ass, $ilUser->getId());
1119  $sub->addResourceObject($a_target_id);
1120  }
1121  }
1122  }
Exercise assignment.
Class ilObjExercise.
addResourceObject(string $a_wsp_id, string $a_text=null)
Add personal resource or repository object (ref_id) to assigment.
$ilUser
Definition: imgupload.php:34
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printSelection()

ilObjPortfolioGUI::printSelection ( )
Exceptions

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

1149  : void
1150  {
1151  $view = $this->getPrintView();
1152  $view->sendForm();
1153  }

◆ save()

ilObjPortfolioGUI::save ( )

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

References createFromTemplateDirect(), and initCreateForm().

468  : void
469  {
470  $form = $this->initCreateForm("prtf");
471  // trigger portfolio template "import" process
472  if ($form->checkInput() && $form->getInput("mode") == "mode_tmpl") {
474  $form->getInput("title"),
475  $this->port_request->getPortfolioTemplate()
476  );
477  return;
478  }
479 
480  parent::save();
481  }
createFromTemplateDirect(string $title="", int $prtt_id=0)
Create portfolio template direct.
initCreateForm(string $new_type)
+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )
protected

Create new portfolio blog page.

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

References ilObject2GUI\$access_handler, $DIC, $ilUser, ilObject2GUI\$node_id, ilObjectGUI\$tree, checkPermissionBool(), ILIAS\Repository\ctrl(), getPageInstance(), ilTree\getRootId(), initBlogForm(), ILIAS\Repository\lng(), ilTree\readRootId(), and ilPortfolioPage\TYPE_BLOG.

705  : void
706  {
707  global $DIC;
708 
709  $ilUser = $DIC->user();
710 
711  $form = $this->initBlogForm();
712  if ($form->checkInput() && $this->checkPermissionBool("write")) {
713  if ($form->getInput("creation_mode") == "existing") {
714  $page = $this->getPageInstance();
715  $page->setType(ilPortfolioPage::TYPE_BLOG);
716  $page->setTitle($form->getInput("blog"));
717  } else {
718  $blog = new ilObjBlog();
719  $blog->setTitle($form->getInput("title"));
720  $blog->create();
721 
722  $tree = new ilWorkspaceTree($ilUser->getId());
723 
724  // @todo: see also e.g. ilExSubmissionObjectGUI->getOverviewContentBlog, this needs refactoring, consumer should not
725  // be responsibel to handle this
726  if (!$tree->getRootId()) {
727  $tree->createTreeForUser($ilUser->getId());
728  }
729 
731  $node_id = $tree->insertObject($tree->readRootId(), $blog->getId());
732  $access_handler->setPermissions($tree->readRootId(), $node_id);
733 
734  $page = $this->getPageInstance();
735  $page->setType(ilPortfolioPage::TYPE_BLOG);
736  $page->setTitle($blog->getId());
737  }
738  $page->create(false);
739 
740  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_blog_page_created"), true);
741  $this->ctrl->redirect($this, "view");
742  }
743 
744  $this->tabs_gui->clearTargets();
745  $this->tabs_gui->setBackTarget(
746  $this->lng->txt("back"),
747  $this->ctrl->getLinkTarget($this, "view")
748  );
749 
750  $form->setValuesByPost();
751  $this->tpl->setContent($form->getHTML());
752  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPageInstance(?int $a_page_id=null, ?int $a_portfolio_id=null)
Get portfolio template page instance.
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ setOnlineAndShare()

ilObjPortfolioGUI::setOnlineAndShare ( )
protected

Set online and switch to share screen.

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject\_lookupOwner(), ILIAS\Repository\object(), and ilLanguage\txt().

1192  : void
1193  {
1194  $ilCtrl = $this->ctrl;
1195  $lng = $this->lng;
1196 
1197  if (ilObjPortfolio::_lookupOwner($this->object->getId()) === $this->user_id) {
1198  $this->object->setOnline(true);
1199  $this->object->update();
1200  $this->tpl->setOnScreenMessage('success', $lng->txt("prtf_has_been_set_online"), true);
1201  }
1202  $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
1203  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
+ Here is the call graph for this function:

◆ setTabs()

ilObjPortfolioGUI::setTabs ( )
protected

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

References ilObjPortfolioBaseGUI\$help, checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilHelpGUI\setScreenIdComponent().

Referenced by executeCommand().

204  : void
205  {
206  $ilHelp = $this->help;
207 
208  $ilHelp->setScreenIdComponent("prtf");
209 
210  if ($this->checkPermissionBool("write")) {
211  $this->tabs_gui->addTab(
212  "pages",
213  $this->lng->txt("content"),
214  $this->ctrl->getLinkTarget($this, "view")
215  );
216 
217  $this->tabs_gui->addTab(
218  "settings",
219  $this->lng->txt("settings"),
220  $this->ctrl->getLinkTarget($this, "edit")
221  );
222 
223  $this->tabs_gui->addNonTabbedLink(
224  "preview",
225  $this->lng->txt("preview"),
226  $this->ctrl->getLinkTarget($this, "preview")
227  );
228 
229  $this->lng->loadLanguageModule("wsp");
230  $this->tabs_gui->addTab(
231  "share",
232  $this->lng->txt("wsp_permissions"),
233  $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
234  );
235  }
236  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setScreenIdComponent(string $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTitleAndDescription()

ilObjPortfolioGUI::setTitleAndDescription ( )
protected

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

References ilUtil\getImagePath(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand().

249  : void
250  {
251  // parent::setTitleAndDescription();
252 
253  $title = $this->lng->txt("portfolio");
254  if ($this->object) {
255  $title .= ": " . $this->object->getTitle();
256  }
257  $this->tpl->setTitle($title);
258  $this->tpl->setTitleIcon(
259  ilUtil::getImagePath("icon_prtf.svg"),
260  $this->lng->txt("portfolio")
261  );
262 
263  if ($this->object &&
264  !$this->object->isOnline()) {
265  $this->tpl->setAlertProperties(array(
266  array("alert" => true,
267  "property" => $this->lng->txt("status"),
268  "value" => $this->lng->txt("offline"))
269  ));
270  }
271  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPrintView()

ilObjPortfolioGUI::showPrintView ( )
Parameters
bool$a_dev_mode
Exceptions

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

1160  : void {
1161  $printview = $this->getPrintView();
1162  $printview->sendPrintView();
1163  }

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

References ilObject2GUI\$access, ilLink\_getLink(), ILIAS\Repository\ctrl(), and ilUtil\redirect().

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

508  : void
509  {
510  $ilAccess = $this->access;
511 
512  // return to exercise (portfolio assignment)
513  $exc_ref_id = $this->port_request->getExerciseRefId();
514  if ($exc_ref_id &&
515  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
516  ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
517  }
518 
519  $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
520  }
static redirect(string $a_script)
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ triggerAssignmentTool()

ilObjPortfolioGUI::triggerAssignmentTool ( )
protected

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

References $i, ilExerciseGSToolProvider\EXC_ASS_BUTTONS, ilExerciseGSToolProvider\EXC_ASS_IDS, ILIAS\Repository\object(), and ilExerciseGSToolProvider\SHOW_EXC_ASSIGNMENT_INFO.

Referenced by executeCommand().

186  : void
187  {
188  if (!is_object($this->object) || $this->object->getId() <= 0) {
189  return;
190  }
191  $pe = new ilPortfolioExercise($this->user_id, $this->object->getId());
192  $pe_gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
193  $assignments = $pe->getAssignmentsOfPortfolio();
194  if (count($assignments) > 0) {
195  $ass_ids = array_map(static function ($i) {
196  return $i["ass_id"];
197  }, $assignments);
198  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
199  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
200  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_BUTTONS, $pe_gui->getActionButtons());
201  }
202  }
Class ilPortfolioExerciseGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

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

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

564  : void
565  {
566  $this->object->setOnline($form->getInput("online"));
567 
568  // if portfolio is not online, it cannot be default
569  if (!$form->getInput("online")) {
570  ilObjPortfolio::setUserDefault($this->user_id, 0);
571  }
572 
573  parent::updateCustom($form);
574  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
static setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
+ Here is the call graph for this function:

Field Documentation

◆ $declaration_authorship

ilPortfolioDeclarationOfAuthorship ilObjPortfolioGUI::$declaration_authorship
protected

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

◆ $notes_gui

ILIAS Notes GUIService ilObjPortfolioGUI::$notes_gui
protected

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

◆ $tool_context

ContextServices ilObjPortfolioGUI::$tool_context
protected

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

◆ $ws_access

ilWorkspaceAccessHandler ilObjPortfolioGUI::$ws_access
protected

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


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