ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 createFromTemplate ()
 
 save ()
 
 saveFromTemplate ()
 
 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)
 
 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] does belong to the parent 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 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)
 
 initCreateFromTemplateForm ()
 
 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 ()
 
 getCurrentPage ()
 
 getCommentGUI ()
 
 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="")
 
 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...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 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...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 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...
 
 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...
 

Protected Attributes

ILIAS Notes GUIService $notes_gui
 
ilWorkspaceAccessHandler $ws_access
 
ContextServices $tool_context
 
ilPortfolioDeclarationOfAuthorship $declaration_authorship
 
ILIAS Skill Service SkillPersonalService $skill_personal_service
 
- Protected Attributes inherited from ilObjPortfolioBaseGUI
ILIAS Notes Service $notes
 
ILIAS Portfolio InternalGUIService $gui
 
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
 
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 = []
 
 $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
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
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 36 of file class.ilObjPortfolioGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

37  {
38  global $DIC;
39 
40  $this->lng = $DIC->language();
41  $this->help = $DIC["ilHelp"];
42  $this->settings = $DIC->settings();
43  $this->access = $DIC->access();
44  $this->user = $DIC->user();
45  $this->ctrl = $DIC->ctrl();
46  $this->ui = $DIC->ui();
47 
48  $this->tool_context = $DIC->globalScreen()->tool()->context();
49 
50  parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
51  $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
52 
53  $this->ctrl->saveParameter($this, "exc_back_ref_id");
54  $this->notes_gui = $DIC->notes()->gui();
55  $this->skill_personal_service = $DIC->skills()->personal();
56  }
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(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjPortfolioGUI::_goto ( string  $a_target)
static

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

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

965  : void
966  {
967  global $DIC;
968 
969  $ctrl = $DIC->ctrl();
970 
971  $id = explode("_", $a_target);
972 
973  $ctrl->setParameterByClass("ilobjportfoliogui", "prt_id", $id[0]);
974  if (count($id) === 2) {
975  $ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $id[1]);
976  }
977  $ctrl->redirectByClass(["ilsharedresourceGUI", "ilobjportfoliogui"], "preview");
978  }
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 241 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

241  : void
242  {
243  if (!$this->creation_mode) {
244  $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
245  }
246 
247  $this->addLocatorItems();
248 
249  $this->tpl->setLocator();
250  }
+ 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 462 of file class.ilObjPortfolioGUI.php.

References ILIAS\Repository\ctrl(), ilObject\getId(), and ILIAS\Repository\lng().

462  : void
463  {
464  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
465  $this->ctrl->setParameter($this, "prt_id", $new_object->getId());
466  $this->ctrl->redirect($this, "view");
467  }
+ 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 63 of file class.ilObjPortfolioGUI.php.

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

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

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

◆ create()

ilObjPortfolioGUI::create ( )

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

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

281  : void
282  {
283  $tpl = $this->tpl;
285 
286  $new_type = $this->port_request->getNewType();
287 
288  // add new object to custom parent container
289  $this->ctrl->saveParameter($this, "crtptrefid");
290  // use forced callback after object creation
291  $this->ctrl->saveParameter($this, "crtcb");
292 
293  if (!$this->checkPermissionBool("create", "", $new_type)) {
294  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
295  } else {
296  $this->lng->loadLanguageModule($new_type);
297  $this->ctrl->setParameter($this, "new_type", $new_type);
298 
299  $forms = $this->initCreationForms($new_type);
300 
301  // copy form validation error: do not show other creation forms
302  if ($this->port_request->getCopyFormProcess() && isset($forms[self::CFORM_CLONE])) {
303  $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
304  }
305  $tpl->setContent($this->getCreationFormsHTML($forms));
306  }
307  }
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:

◆ createFromTemplate()

ilObjPortfolioGUI::createFromTemplate ( )

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

References ilObject2GUI\$error, $ilErr, ilObject2GUI\$tpl, checkPermissionBool(), ILIAS\Repository\ctrl(), initCreateFromTemplateForm(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

309  : void
310  {
311  $tpl = $this->tpl;
313 
314  $new_type = $this->port_request->getNewType();
315 
316  // add new object to custom parent container
317  $this->ctrl->saveParameter($this, "crtptrefid");
318  // use forced callback after object creation
319  $this->ctrl->saveParameter($this, "crtcb");
320 
321  if (!$this->checkPermissionBool("create", "", $new_type)) {
322  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
323  } else {
324  $this->lng->loadLanguageModule($new_type);
325  $this->ctrl->setParameter($this, "new_type", $new_type);
326  $form = $this->initCreateFromTemplateForm();
327  $tpl->setContent($form->getHTML());
328  }
329  }
ilErrorHandling $error
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
$ilErr
Definition: raiseError.php:17
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 928 of file class.ilObjPortfolioGUI.php.

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

Referenced by saveFromTemplate().

931  : void {
932  if ($prtt_id === 0) {
933  $prtt_id = $this->port_request->getPortfolioTemplateId();
934  }
935  if ($title === "") {
936  $title = ilObject::_lookupTitle($prtt_id);
937  }
938 
939  // valid template?
941  if (!count($templates) || !in_array($prtt_id, $templates)) {
942  $this->toRepository();
943  }
944  unset($templates);
945 
946  $source = new ilObjPortfolioTemplate($prtt_id, false);
947 
948  // create portfolio
949  $target = new ilObjPortfolio();
950  $target->setTitle($title);
951  $target->create();
952  $target_id = $target->getId();
953 
954  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, null, true);
955 
956  // link portfolio to exercise assignment
957  //$this->linkPortfolioToAssignment($target_id);
958 
959  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
960  $this->ctrl->setParameter($this, "prt_id", $target_id);
961  $this->ctrl->redirect($this, "preview");
962  }
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createPortfolioFromAssignment()

ilObjPortfolioGUI::createPortfolioFromAssignment ( )

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

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

980  : void
981  {
982  $ilUser = $this->user;
984 
985  $recipe = [];
986 
987  $title = $this->port_request->getPortfolioTitle();
988  $prtt_id = $this->port_request->getPortfolioTemplate();
989 
990  // get assignment template
991  $ass_template_id = 0;
992  $ass_id = $this->port_request->getExcAssId();
993  if ($ass_id > 0) {
994  $ass = new ilExAssignment($ass_id);
995  $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
996  }
997 
998  if ($prtt_id > 0) {
1000  if (!count($templates) || !in_array($prtt_id, $templates)) {
1001  if ($ass_template_id !== $prtt_id) {
1002  $this->toRepository();
1003  }
1004  }
1005 
1006  //skills manipulation
1007  $pskills = array_keys($this->skill_personal_service->getSelectedUserSkills($ilUser->getId()));
1008  $skill_ids = array();
1009 
1010  $recipe = array();
1011  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
1012  switch ($page["type"]) {
1014  if (!$ilSetting->get('disable_wsp_blogs')) {
1015  $recipe[$page["id"]] = array("blog", "create", $page['title']);
1016  }
1017  break;
1019  $source_page = new ilPortfolioTemplatePage($page["id"]);
1020  $source_page->buildDom(true);
1021  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
1022  break;
1023  }
1024  }
1025 
1026  if ($skill_ids) {
1027  $recipe["skills"] = $skill_ids;
1028  }
1029  }
1030 
1031  // create portfolio
1032  $target = new ilObjPortfolio();
1033  $target->setTitle($title);
1034  $target->create();
1035  $target_id = $target->getId();
1036 
1037  if ($prtt_id) {
1038  $source = new ilObjPortfolioTemplate($prtt_id, false);
1039  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, $recipe);
1040  }
1041 
1042  // link portfolio to exercise assignment
1043  $this->linkPortfolioToAssignment($target_id);
1044 
1045  $this->ctrl->setParameter($this, "prt_id", $target_id);
1046  if ($prtt_id) {
1047  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
1048  $this->ctrl->redirect($this, "preview");
1049  } else {
1050  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
1051  $this->ctrl->redirect($this, "view");
1052  }
1053  }
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
Exercise assignment.
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...
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...
global $ilSetting
Definition: privfeed.php:18
ilSetting $settings
+ Here is the call graph for this function:

◆ createPortfolioFromTemplate()

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

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

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

Referenced by createPortfolioFromTemplateProcess().

714  : void {
715  $title = $this->port_request->getPortfolioTitle();
716  $prtt_id = $this->port_request->getPortfolioTemplate();
717 
718  // valid template?
720  if (!count($templates) || !in_array($prtt_id, $templates)) {
721  $this->toRepository();
722  }
723  unset($templates);
724 
725  $this->ctrl->setParameter($this, "prtt", $prtt_id);
726 
727  if (!$a_form) {
728  $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
729  }
730  if ($a_form) {
731  $this->tpl->setContent($a_form->getHTML());
732  } else {
734  }
735  }
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 852 of file class.ilObjPortfolioGUI.php.

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

Referenced by createPortfolioFromTemplate().

854  : void {
856 
857  $title = $this->port_request->getPortfolioTitle();
858  $prtt_id = $this->port_request->getPortfolioTemplate();
859 
860  // valid template?
862  if (!count($templates) || !in_array($prtt_id, $templates)) {
863  $this->toRepository();
864  }
865  unset($templates);
866 
867  // build page recipe (aka import form values)
868  $recipe = null;
869  if ($a_process_form) {
870  $this->ctrl->setParameter($this, "prtt", $prtt_id);
871 
872  $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
873  if ($form->checkInput()) {
874  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
875  if (($page["type"] == ilPortfolioTemplatePage::TYPE_BLOG_TEMPLATE) && !$ilSetting->get('disable_wsp_blogs')) {
876  $field_id = "blog_" . $page["id"];
877  switch ($form->getInput($field_id)) {
878  case "blog_create":
879  $recipe[$page["id"]] = array("blog",
880  "create",
881  trim($form->getInput($field_id . "_create_title"))
882  );
883  break;
884 
885  case "blog_resuse":
886  $recipe[$page["id"]] = array("blog",
887  "reuse",
888  (int) $form->getInput($field_id . "_reuse_blog")
889  );
890  break;
891 
892  case "blog_ignore":
893  $recipe[$page["id"]] = array("blog", "ignore");
894  break;
895  }
896  }
897  }
898 
899  $recipe["skills"] = (array) $form->getInput("skill_ids");
900  } else {
901  $form->setValuesByPost();
902  $this->createPortfolioFromTemplate($form);
903  return;
904  }
905  }
906 
907  $source = new ilObjPortfolioTemplate($prtt_id, false);
908 
909  // create portfolio
910  $target = new ilObjPortfolio();
911  $target->setTitle($title);
912  $target->create();
913  $target_id = $target->getId();
914 
915  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, $recipe);
916 
917  // link portfolio to exercise assignment
918  $this->linkPortfolioToAssignment($target_id);
919 
920  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
921  $this->ctrl->setParameter($this, "prt_id", $target_id);
922  $this->ctrl->redirect($this, "preview");
923  }
createPortfolioFromTemplate(ilPropertyFormGUI $a_form=null)
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...
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:18
ilSetting $settings
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 78 of file class.ilObjPortfolioGUI.php.

References ilObject2GUI\$access_handler, ilObjPortfolioBaseGUI\$gui, 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().

78  : void
79  {
80  $this->checkPermission("read");
81  $this->setTitleAndDescription();
82 
83  $next_class = $this->ctrl->getNextClass($this);
84  $cmd = $this->ctrl->getCmd("view");
85 
86  // we have to init the note js handling here, might go to
87  // a better place in the future
88  /*
89  $this->notes_gui->initJavascript(
90  $this->ctrl->getLinkTargetByClass(
91  array("ilnotegui"),
92  "",
93  "",
94  true,
95  false
96  )
97  );*/
98 
99  // trigger assignment tool
100  $this->triggerAssignmentTool();
101  switch ($next_class) {
102  case "ilworkspaceaccessgui":
103  if ($this->checkPermissionBool("write")) {
104  $this->setTabs();
105  $this->tabs_gui->activateTab("share");
106 
107  $this->tpl->setPermanentLink("prtf", $this->object->getId());
108 
109  $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
110  $wspacc->setBlockingMessage($this->getOfflineMessage());
111  $this->ctrl->forwardCommand($wspacc);
112  }
113  break;
114 
115  case 'ilportfoliopagegui':
116  if ($this->determinePageCall()) {
117  // only in edit mode
118  $this->addLocator();
119  }
120  $this->handlePageCall($cmd);
121  break;
122 
123  case "ilcommentgui":
124  $this->preview();
125  break;
126 
127  case "ilcommonactiondispatchergui":
128  //$this->prepareOutput();
130  $this->ctrl->forwardCommand($gui);
131  break;
132 
133  /*
134  case "ilobjstylesheetgui":
135  $this->ctrl->setReturn($this, "editStyleProperties");
136  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
137  $style_gui->enableWrite(true);
138  $style_gui->omitLocator();
139  if ($cmd == "create" || $this->port_request->getNewType() == "sty") {
140  $style_gui->setCreationMode(true);
141  }
142 
143  if ($cmd == "confirmedDelete") {
144  $this->object->setStyleSheetId(0);
145  $this->object->update();
146  }
147 
148  $ret = $this->ctrl->forwardCommand($style_gui);
149 
150  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
151  $style_id = $ret;
152  $this->object->setStyleSheetId($style_id);
153  $this->object->update();
154  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
155  }
156  break;*/
157 
158  case "ilobjectcontentstylesettingsgui":
159  $this->checkPermission("write");
160  $this->addLocator();
161  $this->setTabs();
162  $this->tabs_gui->activateTab("settings");
163  $this->setSettingsSubTabs("style");
164  $settings_gui = $this->content_style_gui
165  ->objectSettingsGUIForObjId(
166  null,
167  $this->object->getId()
168  );
169  $this->ctrl->forwardCommand($settings_gui);
170  break;
171 
172  case "ilportfolioexercisegui":
173  $this->ctrl->setReturn($this, "view");
174  $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
175  $this->ctrl->forwardCommand($gui);
176  break;
177 
178  default:
179 
180  if ($cmd !== "preview") {
181  $this->addLocator();
182  $this->setTabs();
183  }
184  $this->$cmd();
185  break;
186  }
187  }
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
ILIAS Portfolio InternalGUIService $gui
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 331 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().

331  : string
332  {
333  global $DIC;
334 
335  $ui = $DIC->ui();
336  $ilSetting = $DIC->settings();
337 
338  $message = "";
339  // page type: blog
340  if (!$ilSetting->get('disable_wsp_blogs')) {
341  $options = array();
342  $tree = new ilWorkspaceTree($this->user_id);
343  $root = $tree->readRootId();
344  if ($root) {
345  $root = $tree->getNodeData($root);
346  foreach ($tree->getSubTree($root) as $node) {
347  if ($node["type"] == "blog") {
348  $options[$node["obj_id"]] = $node["title"];
349  }
350  }
351  asort($options);
352  }
353  if (!count($options)) {
354  // #18147
355  $this->lng->loadLanguageModule('pd');
356  $url = $this->ctrl->getLinkTargetByClass("ilDashboardGUI", "jumpToWorkspace");
357  $text = $this->lng->txt("mm_personal_and_shared_r");
358 
359  $text = sprintf($this->lng->txt("prtf_no_blogs_info"), $text);
360 
361  $mbox = $ui->factory()->messageBox()->info($text)
362  ->withLinks([$ui->factory()->link()->standard(
363  $this->lng->txt("mm_personal_and_shared_r"),
364  $url
365  )]);
366 
367  $message = $ui->renderer()->render($mbox);
368  }
369  }
370  return $message;
371  }
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
$url
Definition: ltiregstart.php:35
global $ilSetting
Definition: privfeed.php:18
$message
Definition: xapiexit.php:32
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:

◆ getEditFormCustomValues()

ilObjPortfolioGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

510  : void
511  {
512  $a_values["online"] = $this->object->isOnline();
513 
514  parent::getEditFormCustomValues($a_values);
515  }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

Definition at line 1118 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().

1118  : string
1119  {
1120  $ui = $this->ui;
1121  $lng = $this->lng;
1122  $ctrl = $this->ctrl;
1123 
1124  if (!$this->object->isOnline()) {
1125  $f = $ui->factory();
1126  $renderer = $ui->renderer();
1127 
1128  $buttons = [$f->button()->standard(
1129  $lng->txt("prtf_set_online"),
1130  $ctrl->getLinkTarget($this, "setOnlineAndShare")
1131  )];
1132 
1133  return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
1134  ->withButtons($buttons));
1135  }
1136  return "";
1137  }
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 567 of file class.ilObjPortfolioGUI.php.

567  : string
568  {
569  return "ilportfoliopagegui";
570  }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance ( int  $a_page_id)
protected

Get portfolio template page gui instance.

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

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

556  $page_gui = new ilPortfolioPageGUI(
557  $this->object->getId(),
558  $a_page_id,
559  0,
560  $this->object->hasPublicComments()
561  );
562  $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
563  $page_gui->setAdditional($this->getAdditional());
564  return $page_gui;
565  }
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 537 of file class.ilObjPortfolioGUI.php.

References ilPageObject\getId().

Referenced by saveBlog().

540  : ilPortfolioPage {
541  // #11531
542  if (!$a_portfolio_id && $this->object) {
543  $a_portfolio_id = $this->object->getId();
544  }
545  $page = new ilPortfolioPage((int) $a_page_id);
546  $page->setPortfolioId($a_portfolio_id);
547  return $page;
548  }
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 1077 of file class.ilObjPortfolioGUI.php.

References ilPageObject\getDomDoc().

Referenced by createPortfolioFromAssignment(), and initCreatePortfolioFromTemplateForm().

1081  : array {
1082  $dom = $a_source_page->getDomDoc();
1083  $xpath = new DOMXPath($dom);
1084  $nodes = $xpath->query("//PageContent/Skills");
1085  foreach ($nodes as $node) {
1086  $skill_id = $node->getAttribute("Id");
1087  if (!in_array($skill_id, $a_pskills)) {
1088  $a_skill_ids[] = $skill_id;
1089  }
1090  }
1091  unset($nodes, $xpath, $dom);
1092 
1093  return $a_skill_ids;
1094  }
getDomDoc()
Get dom doc (DOMDocument)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjPortfolioGUI::getType ( )

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

Referenced by initCreateForm(), and initCreateFromTemplateForm().

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

◆ initBlogForm()

ilObjPortfolioGUI::initBlogForm ( )
protected

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

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

Referenced by saveBlog().

607  {
608  $form = new ilPropertyFormGUI();
609  $form->setFormAction($this->ctrl->getFormAction($this));
610 
611  $options = array();
612  $tree = new ilWorkspaceTree($this->user_id);
613  $root = $tree->readRootId();
614  if ($root) {
615  $root = $tree->getNodeData($root);
616  foreach ($tree->getSubTree($root, true, ["blog"]) as $node) {
617  $options[$node["obj_id"]] = $node["title"];
618  }
619  asort($options);
620  }
621 
622  // add blog
623  $radg = new ilRadioGroupInputGUI($this->lng->txt("obj_blog"), "creation_mode");
624  $radg->setInfo($this->lng->txt(""));
625  $radg->setValue("new");
626  $radg->setInfo($this->lng->txt(""));
627 
628  $op1 = new ilRadioOption($this->lng->txt("prtf_add_new_blog"), "new", $this->lng->txt("prtf_add_new_blog_info"));
629  $radg->addOption($op1);
630  $form->addItem($radg);
631 
632  // Blog title
633  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
634  $ti->setRequired(true);
635  $op1->addSubItem($ti);
636 
637 
638  if (count($options)) {
639  $op2 = new ilRadioOption($this->lng->txt("prtf_add_existing_blog"), "existing");
640  $radg->addOption($op2);
641 
642  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), "blog");
643  $obj->setOptions($options);
644  $op2->addSubItem($obj);
645  }
646 
647  $form->setTitle($this->lng->txt("prtf_add_blog") . ": " .
648  $this->object->getTitle());
649  $form->addCommandButton("saveBlog", $this->lng->txt("save"));
650  $form->addCommandButton("view", $this->lng->txt("cancel"));
651 
652  return $form;
653  }
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 class represents a selection list property in a property form.
setOptions(array $a_options)
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 572 of file class.ilObjPortfolioGUI.php.

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

572  : void
573  {
574  $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
575  $a_tgt->setRequired(true);
576  $a_form->addItem($a_tgt);
577 
578  $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
579  $a_tgt->addOption($old);
580 
581  $options = array();
582  $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
583  foreach ($all as $item) {
584  $options[$item["id"]] = $item["title"];
585  }
586  $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
587  $prtf->setRequired(true);
588  $prtf->setOptions($options);
589  $old->addSubItem($prtf);
590 
591  $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
592  $a_tgt->addOption($new);
593 
594  $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
595  $tf->setMaxLength(128);
596  $tf->setSize(40);
597  $tf->setRequired(true);
598  $new->addSubItem($tf);
599  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
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 379 of file class.ilObjPortfolioGUI.php.

References $ilSetting, ilObjectGUI\$settings, ILIAS\Repository\ctrl(), getType(), ILIAS\Repository\lng(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and save().

380  {
382 
383  $this->ctrl->setParameter($this, "new_type", $this->getType());
384 
385  $form = new ilPropertyFormGUI();
386  $form->setFormAction($this->ctrl->getFormAction($this));
387 
388  // title
389  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
390  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
391  $ti->setMaxLength(ilObject::TITLE_LENGTH);
392  $ti->setRequired(true);
393  $form->addItem($ti);
394 
395  $form->setTitle($this->lng->txt("prtf_create_portfolio"));
396  $form->addCommandButton("save", $this->lng->txt("create"));
397  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
398 
399  return $form;
400  }
const TITLE_LENGTH
global $ilSetting
Definition: privfeed.php:18
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateFromTemplateForm()

ilObjPortfolioGUI::initCreateFromTemplateForm ( )
protected

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

References $ilSetting, ilObjectGUI\$settings, ILIAS\Repository\ctrl(), ilObjPortfolioTemplate\getAvailablePortfolioTemplates(), getType(), ILIAS\Repository\lng(), ilFormPropertyGUI\setRequired(), and ilObject\TITLE_LENGTH.

Referenced by createFromTemplate(), and saveFromTemplate().

403  {
405 
406  $this->ctrl->setParameter($this, "new_type", $this->getType());
407 
408  $form = new ilPropertyFormGUI();
409  $form->setFormAction($this->ctrl->getFormAction($this));
410 
411  // title
412  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
413  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
414  $ti->setMaxLength(ilObject::TITLE_LENGTH);
415  $ti->setRequired(true);
416  $form->addItem($ti);
417 
418  // portfolio templates
420  if (count($templates)) {
421  $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
422  $tmpl->setRequired(true);
423  $tmpl->setOptions(array("" => $this->lng->txt("please_select")) + $templates);
424  $form->addItem($tmpl);
425 
426  // incoming from repository
427  $template_id = $this->port_request->getPortfolioTemplateId();
428  if ($template_id > 0) {
429  $tmpl->setValue($template_id);
430  }
431  }
432 
433  $form->setTitle($this->lng->txt("prtf_add_portfolio_from_template"));
434  $form->addCommandButton("saveFromTemplate", $this->lng->txt("create"));
435  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
436 
437  return $form;
438  }
This class represents a selection list property in a property form.
const TITLE_LENGTH
static getAvailablePortfolioTemplates(string $a_permission="read")
setRequired(bool $a_required)
global $ilSetting
Definition: privfeed.php:18
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 737 of file class.ilObjPortfolioGUI.php.

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

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

740  : ?ilPropertyFormGUI {
742  $ilUser = $this->user;
743 
744  $blog_options = [];
745 
746  $exc_id = $this->port_request->getExerciseRefId();
747  $ass_id = $this->port_request->getExcAssId();
748  if ($exc_id > 0) {
749  $this->ctrl->setParameter($this, "exc_id", $exc_id);
750  $this->ctrl->setParameter($this, "ass_id", $ass_id);
751  }
752 
753  $form = new ilPropertyFormGUI();
754  $form->setFormAction($this->ctrl->getFormAction($this));
755 
756  $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
757  $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
758  $form->addItem($tmpl);
759 
760  $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
761  $title->setValue($a_title);
762  $form->addItem($title);
763 
764  // gather user blogs
765  if (!$ilSetting->get('disable_wsp_blogs')) {
766  $blog_options = array();
767  $tree = new ilWorkspaceTree($this->user_id);
768  $root = $tree->readRootId();
769  if ($root) {
770  $root = $tree->getNodeData($root);
771  foreach ($tree->getSubTree($root, true, ["blog"]) as $node) {
772  $blog_options[$node["obj_id"]] = $node["title"];
773  }
774  asort($blog_options);
775  }
776  }
777 
778  $has_form_content = false;
779 
780  $pskills = array_keys($this->skill_personal_service->getSelectedUserSkills($ilUser->getId()));
781  $skill_ids = array();
782 
783  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
784  switch ($page["type"]) {
786  // skills
787  $source_page = new ilPortfolioTemplatePage($page["id"]);
788  $source_page->buildDom(true);
789  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
790 
791  if (count($skill_ids)) {
792  $has_form_content = true;
793  }
794  break;
795 
797  if (!$ilSetting->get('disable_wsp_blogs')) {
798  $has_form_content = true;
799 
800  $field_id = "blog_" . $page["id"];
801 
802  $blog = new ilRadioGroupInputGUI($this->lng->txt("obj_blog") . ": " .
803  $page["title"], $field_id);
804  $blog->setRequired(true);
805  $blog->setValue("blog_create");
806  $form->addItem($blog);
807 
808  $new_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_create"), "blog_create");
809  $blog->addOption($new_blog);
810 
811  $title = new ilTextInputGUI($this->lng->txt("title"), $field_id . "_create_title");
812  $title->setRequired(true);
813  $new_blog->addSubItem($title);
814 
815  if (count($blog_options)) {
816  $reuse_blog = new ilRadioOption($this->lng->txt("prtf_template_import_blog_reuse"), "blog_resuse");
817  $blog->addOption($reuse_blog);
818 
819  $obj = new ilSelectInputGUI($this->lng->txt("obj_blog"), $field_id . "_reuse_blog");
820  $obj->setRequired(true);
821  $obj->setOptions(array("" => $this->lng->txt("please_select")) + $blog_options);
822  $reuse_blog->addSubItem($obj);
823  }
824 
825  $blog->addOption(new ilRadioOption($this->lng->txt("prtf_template_import_blog_ignore"), "blog_ignore"));
826  }
827  break;
828  }
829  }
830 
831  if ($skill_ids) {
832  $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
833  $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
834  $skills->setValue($skill_ids);
835  foreach ($skill_ids as $skill_id) {
836  $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
837  }
838  $form->addItem($skills);
839  }
840  // no dialog needed, go ahead
841  if (!$has_form_content) {
842  return null;
843  }
844 
845  $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
846  $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
847  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
848 
849  return $form;
850  }
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...
This class represents a selection list property in a property form.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
global $ilSetting
Definition: privfeed.php:18
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 374 of file class.ilObjPortfolioGUI.php.

References initCreateForm().

Referenced by create().

374  : array
375  {
376  return array(self::CFORM_NEW => $this->initCreateForm($new_type));
377  }
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 483 of file class.ilObjPortfolioGUI.php.

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

484  {
485  $form = new ilPropertyFormGUI();
486  $form->setFormAction($this->ctrl->getFormAction($this));
487 
488  // title
489  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
490  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
491  $ti->setMaxLength(ilObject::TITLE_LENGTH);
492  $ti->setRequired(true);
493  $ti->setValue($this->object->getTitle());
494  $form->addItem($ti);
495 
496  // :TODO: online
497  $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
498  $online->setChecked($this->object->isOnline());
499  $form->addItem($online);
500 
501  $this->initEditCustomForm($form);
502 
503  $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
504  $form->addCommandButton("update", $this->lng->txt("save"));
505  $form->addCommandButton("view", $this->lng->txt("cancel"));
506 
507  return $form;
508  }
const TITLE_LENGTH
initEditCustomForm(ilPropertyFormGUI $a_form)
+ Here is the call graph for this function:

◆ linkPortfolioToAssignment()

ilObjPortfolioGUI::linkPortfolioToAssignment ( int  $a_target_id)

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

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

Referenced by createPortfolioFromAssignment(), and createPortfolioFromTemplateProcess().

1055  : void
1056  {
1057  $ilAccess = $this->access;
1058  $ilUser = $this->user;
1059 
1060  $exc_ref_id = $this->port_request->getExerciseRefId();
1061  $ass_id = $this->port_request->getExcAssId();
1062 
1063  if ($exc_ref_id &&
1064  $ass_id &&
1065  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
1066  $exc = new ilObjExercise($exc_ref_id);
1067  $ass = new ilExAssignment($ass_id);
1068  if ($ass->getExerciseId() === $exc->getId() &&
1069  $ass->getType() === ilExAssignment::TYPE_PORTFOLIO) {
1070  // #16205
1071  $sub = new ilExSubmission($ass, $ilUser->getId());
1072  $sub->addResourceObject($a_target_id);
1073  }
1074  }
1075  }
Exercise assignment.
Class ilObjExercise.
addResourceObject(string $a_wsp_id, string $a_text=null)
Add personal resource or repository object (ref_id) to assigment.
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 1099 of file class.ilObjPortfolioGUI.php.

1099  : void
1100  {
1101  $view = $this->getPrintView();
1102  $view->sendForm();
1103  }

◆ save()

ilObjPortfolioGUI::save ( )

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

References initCreateForm().

440  : void
441  {
442  $form = $this->initCreateForm("prtf");
443  parent::save();
444  }
initCreateForm(string $new_type)
+ Here is the call graph for this function:

◆ saveBlog()

ilObjPortfolioGUI::saveBlog ( )
protected

Create new portfolio blog page.

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

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

658  : void
659  {
660  global $DIC;
661 
662  $ilUser = $DIC->user();
663 
664  $form = $this->initBlogForm();
665  if ($form->checkInput() && $this->checkPermissionBool("write")) {
666  if ($form->getInput("creation_mode") == "existing") {
667  $page = $this->getPageInstance();
668  $page->setType(ilPortfolioPage::TYPE_BLOG);
669  $page->setTitle($form->getInput("blog"));
670  } else {
671  $blog = new ilObjBlog();
672  $blog->setTitle($form->getInput("title"));
673  $blog->create();
674 
675  $tree = new ilWorkspaceTree($ilUser->getId());
676 
677  // @todo: see also e.g. ilExSubmissionObjectGUI->getOverviewContentBlog, this needs refactoring, consumer should not
678  // be responsibel to handle this
679  if (!$tree->getRootId()) {
680  $tree->createTreeForUser($ilUser->getId());
681  }
682 
684  $node_id = $tree->insertObject($tree->readRootId(), $blog->getId());
685  $access_handler->setPermissions($tree->readRootId(), $node_id);
686 
687  $page = $this->getPageInstance();
688  $page->setType(ilPortfolioPage::TYPE_BLOG);
689  $page->setTitle($blog->getId());
690  }
691  $page->create(false);
692 
693  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_blog_page_created"), true);
694  $this->ctrl->redirect($this, "view");
695  }
696 
697  $this->tabs_gui->clearTargets();
698  $this->tabs_gui->setBackTarget(
699  $this->lng->txt("back"),
700  $this->ctrl->getLinkTarget($this, "view")
701  );
702 
703  $form->setValuesByPost();
704  $this->tpl->setContent($form->getHTML());
705  }
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
Class ilObjBlog.
getPageInstance(?int $a_page_id=null, ?int $a_portfolio_id=null)
Get portfolio template page instance.
+ Here is the call graph for this function:

◆ saveFromTemplate()

ilObjPortfolioGUI::saveFromTemplate ( )

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

References createFromTemplateDirect(), and initCreateFromTemplateForm().

446  : void
447  {
448  $form = $this->initCreateFromTemplateForm();
449  // trigger portfolio template "import" process
450  if ($form->checkInput()) {
452  $form->getInput("title"),
453  $this->port_request->getPortfolioTemplate()
454  );
455  return;
456  } else {
457  $form->setValuesByPost();
458  $this->tpl->setContent($form->getHTML());
459  }
460  }
createFromTemplateDirect(string $title="", int $prtt_id=0)
Create portfolio template direct.
+ Here is the call graph for this function:

◆ setOnlineAndShare()

ilObjPortfolioGUI::setOnlineAndShare ( )
protected

Set online and switch to share screen.

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

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

1142  : void
1143  {
1144  $ilCtrl = $this->ctrl;
1145  $lng = $this->lng;
1146 
1147  if (ilObjPortfolio::_lookupOwner($this->object->getId()) === $this->user_id) {
1148  $this->object->setOnline(true);
1149  $this->object->update();
1150  $this->tpl->setOnScreenMessage('success', $lng->txt("prtf_has_been_set_online"), true);
1151  }
1152  $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
1153  }
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 207 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

207  : void
208  {
209  $ilHelp = $this->help;
210 
211  $ilHelp->setScreenIdComponent("prtf");
212 
213  if ($this->checkPermissionBool("write")) {
214  $this->tabs_gui->addTab(
215  "pages",
216  $this->lng->txt("content"),
217  $this->ctrl->getLinkTarget($this, "view")
218  );
219 
220  $this->tabs_gui->addTab(
221  "settings",
222  $this->lng->txt("settings"),
223  $this->ctrl->getLinkTarget($this, "edit")
224  );
225 
226  $this->tabs_gui->addNonTabbedLink(
227  "preview",
228  $this->lng->txt("preview"),
229  $this->ctrl->getLinkTarget($this, "preview")
230  );
231 
232  $this->lng->loadLanguageModule("wsp");
233  $this->tabs_gui->addTab(
234  "share",
235  $this->lng->txt("wsp_permissions"),
236  $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
237  );
238  }
239  }
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 252 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

252  : void
253  {
254  // parent::setTitleAndDescription();
255 
256  $title = $this->lng->txt("portfolio");
257  if ($this->object) {
258  $title .= ": " . $this->object->getTitle();
259  }
260  $this->tpl->setTitle($title);
261  $this->tpl->setTitleIcon(
262  ilUtil::getImagePath("standard/icon_prtf.svg"),
263  $this->lng->txt("portfolio")
264  );
265 
266  if ($this->object &&
267  !$this->object->isOnline()) {
268  $this->tpl->setAlertProperties(array(
269  array("alert" => true,
270  "property" => $this->lng->txt("status"),
271  "value" => $this->lng->txt("offline"))
272  ));
273  }
274  }
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 1109 of file class.ilObjPortfolioGUI.php.

1110  : void {
1111  $printview = $this->getPrintView();
1112  $printview->sendPrintView();
1113  }

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

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

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

469  : void
470  {
471  $ilAccess = $this->access;
472 
473  // return to exercise (portfolio assignment)
474  $exc_ref_id = $this->port_request->getExerciseRefId();
475  if ($exc_ref_id &&
476  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
477  ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
478  }
479 
480  $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
481  }
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 189 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

189  : void
190  {
191  if (!is_object($this->object) || $this->object->getId() <= 0) {
192  return;
193  }
194  $pe = new ilPortfolioExercise($this->user_id, $this->object->getId());
195  $pe_gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
196  $assignments = $pe->getAssignmentsOfPortfolio();
197  if (count($assignments) > 0) {
198  $ass_ids = array_map(static function ($i) {
199  return $i["ass_id"];
200  }, $assignments);
201  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
202  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
203  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_BUTTONS, $pe_gui->getActionButtons());
204  }
205  }
Class ilPortfolioExerciseGUI.
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:

◆ updateCustom()

ilObjPortfolioGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

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

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

517  : void
518  {
519  $this->object->setOnline($form->getInput("online"));
520 
521  // if portfolio is not online, it cannot be default
522  if (!$form->getInput("online")) {
523  ilObjPortfolio::setUserDefault($this->user_id, 0);
524  }
525 
526  parent::updateCustom($form);
527  }
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.

◆ $skill_personal_service

ILIAS Skill Service SkillPersonalService ilObjPortfolioGUI::$skill_personal_service
protected

Definition at line 34 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: