ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjPortfolioGUI Class Reference

ilObjPortfolioGUI: ilPortfolioPageGUI, ilPageObjectGUI ilObjPortfolioGUI: ilWorkspaceAccessGUI, ilCommentGUI, ilCommonActionDispatcherGUI ilObjPortfolioGUI: ilObjectContentStyleSettingsGUI, ilPortfolioExerciseGUI ilObjPortfolioGUI: ILIAS More...

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

Public Member Functions

 __construct (int $a_id=0)
 
 getType ()
 
 executeCommand ()
 
 edit ()
 
 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 ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 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)
 
 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)
 
- 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 ()
 
 getCreationForm ()
 
 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)
 
 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...
 
 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...
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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 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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioGUI::__construct ( int  $a_id = 0)

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

38  {
39  global $DIC;
40 
41  $this->lng = $DIC->language();
42  $this->help = $DIC["ilHelp"];
43  $this->settings = $DIC->settings();
44  $this->access = $DIC->access();
45  $this->user = $DIC->user();
46  $this->ctrl = $DIC->ctrl();
47  $this->ui = $DIC->ui();
48 
49  $this->tool_context = $DIC->globalScreen()->tool()->context();
50 
51  parent::__construct($a_id, self::PORTFOLIO_OBJECT_ID, 0);
52  $this->declaration_authorship = new ilPortfolioDeclarationOfAuthorship();
53 
54  $this->ctrl->saveParameter($this, "exc_back_ref_id");
55  $this->notes_gui = $DIC->notes()->gui();
56  $this->skill_personal_service = $DIC->skills()->personal();
57  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
__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 723 of file class.ilObjPortfolioGUI.php.

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

723  : void
724  {
725  global $DIC;
726 
727  $ctrl = $DIC->ctrl();
728 
729  $id = explode("_", $a_target);
730 
731  $ctrl->setParameterByClass("ilobjportfoliogui", "prt_id", $id[0]);
732  if (count($id) === 2) {
733  $ctrl->setParameterByClass("ilobjportfoliogui", "user_page", $id[1]);
734  }
735  $ctrl->redirectByClass(["ilsharedresourceGUI", "ilobjportfoliogui"], "preview");
736  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ addLocator()

ilObjPortfolioGUI::addLocator ( )
protected

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

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

Referenced by executeCommand().

222  : void
223  {
224  if (!$this->creation_mode) {
225  $this->ctrl->setParameter($this, "prt_id", $this->object->getId());
226  }
227 
228  $this->addLocatorItems();
229 
230  $this->tpl->setLocator();
231  }
+ 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 399 of file class.ilObjPortfolioGUI.php.

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

399  : void
400  {
401  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
402  $this->ctrl->setParameter($this, "prt_id", $new_object->getId());
403  $this->ctrl->redirect($this, "view");
404  }
+ 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 64 of file class.ilObjPortfolioGUI.php.

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

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

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

◆ create()

ilObjPortfolioGUI::create ( )

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

References ilObject2GUI\$error, $ilErr, ilObject2GUI\$tpl, checkPermissionBool(), ILIAS\Repository\ctrl(), getCreationForm(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

262  : void
263  {
264  $tpl = $this->tpl;
266 
267  $new_type = $this->port_request->getNewType();
268 
269  // add new object to custom parent container
270  $this->ctrl->saveParameter($this, "crtptrefid");
271  // use forced callback after object creation
272  $this->ctrl->saveParameter($this, "crtcb");
273 
274  if (!$this->checkPermissionBool("create", "", $new_type)) {
275  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
276  } else {
277  $this->lng->loadLanguageModule($new_type);
278  $this->ctrl->setParameter($this, "new_type", $new_type);
279 
280  $form = $this->getCreationForm();
281 
282  $tpl->setContent($form->render());
283  }
284  }
ilErrorHandling $error
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setContent(string $a_html)
Sets content for standard template.
$ilErr
Definition: raiseError.php:33
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ createFromTemplate()

ilObjPortfolioGUI::createFromTemplate ( )

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

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

286  : void
287  {
288  $tpl = $this->tpl;
290 
291  $new_type = $this->port_request->getNewType();
292 
293  // add new object to custom parent container
294  $this->ctrl->saveParameter($this, "crtptrefid");
295  // use forced callback after object creation
296  $this->ctrl->saveParameter($this, "crtcb");
297 
298  if (!$this->checkPermissionBool("create", "", $new_type)) {
299  $ilErr->raiseError($this->lng->txt("permission_denied"), $ilErr->MESSAGE);
300  } else {
301  $this->lng->loadLanguageModule($new_type);
302  $this->ctrl->setParameter($this, "new_type", $new_type);
303  $form = $this->initCreateFromTemplateForm();
304  $tpl->setContent($form->getHTML());
305  }
306  }
ilErrorHandling $error
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
setContent(string $a_html)
Sets content for standard template.
$ilErr
Definition: raiseError.php:33
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 686 of file class.ilObjPortfolioGUI.php.

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

Referenced by saveFromTemplate().

689  : void {
690  if ($prtt_id === 0) {
691  $prtt_id = $this->port_request->getPortfolioTemplateId();
692  }
693  if ($title === "") {
694  $title = ilObject::_lookupTitle($prtt_id);
695  }
696 
697  // valid template?
699  if (!count($templates) || !in_array($prtt_id, $templates)) {
700  $this->toRepository();
701  }
702  unset($templates);
703 
704  $source = new ilObjPortfolioTemplate($prtt_id, false);
705 
706  // create portfolio
707  $target = new ilObjPortfolio();
708  $target->setTitle($title);
709  $target->create();
710  $target_id = $target->getId();
711 
712  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, null, true);
713 
714  // link portfolio to exercise assignment
715  //$this->linkPortfolioToAssignment($target_id);
716 
717  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
718  $this->ctrl->setParameter($this, "prt_id", $target_id);
719  $this->ctrl->redirect($this, "preview");
720  }
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")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 738 of file class.ilObjPortfolioGUI.php.

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

738  : void
739  {
740  $ilUser = $this->user;
742 
743  $recipe = [];
744 
745  $title = $this->port_request->getPortfolioTitle();
746  $prtt_id = $this->port_request->getPortfolioTemplate();
747 
748  // get assignment template
749  $ass_template_id = 0;
750  $ass_id = $this->port_request->getExcAssId();
751  if ($ass_id > 0) {
752  $ass = new ilExAssignment($ass_id);
753  $ass_template_id = ilObject::_lookupObjectId($ass->getPortfolioTemplateId());
754  }
755 
756  if ($prtt_id > 0) {
758  if (!count($templates) || !in_array($prtt_id, $templates)) {
759  if ($ass_template_id !== $prtt_id) {
760  $this->toRepository();
761  }
762  }
763 
764  //skills manipulation
765  $pskills = array_keys($this->skill_personal_service->getSelectedUserSkills($ilUser->getId()));
766  $skill_ids = array();
767 
768  $recipe = array();
769  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($prtt_id) as $page) {
770  switch ($page["type"]) {
772  $source_page = new ilPortfolioTemplatePage($page["id"]);
773  $source_page->buildDom(true);
774  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
775  break;
776  }
777  }
778 
779  if ($skill_ids) {
780  $recipe["skills"] = $skill_ids;
781  }
782  }
783 
784  // create portfolio
785  $target = new ilObjPortfolio();
786  $target->setTitle($title);
787  $target->create();
788  $target_id = $target->getId();
789 
790  if ($prtt_id) {
791  $source = new ilObjPortfolioTemplate($prtt_id, false);
792  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, $recipe);
793  }
794 
795  // link portfolio to exercise assignment
796  $this->linkPortfolioToAssignment($target_id);
797 
798  $this->ctrl->setParameter($this, "prt_id", $target_id);
799  if ($prtt_id) {
800  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
801  $this->ctrl->redirect($this, "preview");
802  } else {
803  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created"), true);
804  $this->ctrl->redirect($this, "view");
805  }
806  }
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:31
ilSetting $settings
+ Here is the call graph for this function:

◆ createPortfolioFromTemplate()

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

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

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

Referenced by createPortfolioFromTemplateProcess().

545  : void {
546  $title = $this->port_request->getPortfolioTitle();
547  $prtt_id = $this->port_request->getPortfolioTemplate();
548 
549  // valid template?
551  if (!count($templates) || !in_array($prtt_id, $templates)) {
552  $this->toRepository();
553  }
554  unset($templates);
555 
556  $this->ctrl->setParameter($this, "prtt", $prtt_id);
557 
558  if (!$a_form) {
559  $a_form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
560  }
561  if ($a_form) {
562  $this->tpl->setContent($a_form->getHTML());
563  } else {
565  }
566  }
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 634 of file class.ilObjPortfolioGUI.php.

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

Referenced by createPortfolioFromTemplate().

636  : void {
638 
639  $title = $this->port_request->getPortfolioTitle();
640  $prtt_id = $this->port_request->getPortfolioTemplate();
641 
642  // valid template?
644  if (!count($templates) || !in_array($prtt_id, $templates)) {
645  $this->toRepository();
646  }
647  unset($templates);
648 
649  // build page recipe (aka import form values)
650  $recipe = null;
651  if ($a_process_form) {
652  $this->ctrl->setParameter($this, "prtt", $prtt_id);
653 
654  $form = $this->initCreatePortfolioFromTemplateForm($prtt_id, $title);
655  if ($form->checkInput()) {
656 
657  $recipe["skills"] = (array) $form->getInput("skill_ids");
658  } else {
659  $form->setValuesByPost();
660  $this->createPortfolioFromTemplate($form);
661  return;
662  }
663  }
664 
665  $source = new ilObjPortfolioTemplate($prtt_id, false);
666 
667  // create portfolio
668  $target = new ilObjPortfolio();
669  $target->setTitle($title);
670  $target->create();
671  $target_id = $target->getId();
672 
673  ilObjPortfolioTemplate::clonePagesAndSettings($source, $target, $recipe);
674 
675  // link portfolio to exercise assignment
676  $this->linkPortfolioToAssignment($target_id);
677 
678  $this->tpl->setOnScreenMessage('success', $this->lng->txt("prtf_portfolio_created_from_template"), true);
679  $this->ctrl->setParameter($this, "prt_id", $target_id);
680  $this->ctrl->redirect($this, "preview");
681  }
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")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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.
createPortfolioFromTemplate(?ilPropertyFormGUI $a_form=null)
global $ilSetting
Definition: privfeed.php:31
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:

◆ edit()

ilObjPortfolioGUI::edit ( )

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

References ILIAS\Repository\ctrl().

165  : void
166  {
167  $this->ctrl->redirectByClass(SettingsGUI::class);
168  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjPortfolioGUI::executeCommand ( )

Definition at line 79 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(), null, ILIAS\Repository\object(), ILIAS\UI\examples\Symbol\Glyph\Preview\preview(), ilWorkspaceAccessGUI\setBlockingMessage(), ilObjPortfolioBaseGUI\setSettingsSubTabs(), setTabs(), setTitleAndDescription(), and triggerAssignmentTool().

79  : void
80  {
81  $this->checkPermission("read");
82  $this->setTitleAndDescription();
83 
84  $next_class = $this->ctrl->getNextClass($this);
85  $cmd = $this->ctrl->getCmd("view");
86 
87  // trigger assignment tool
88  $this->triggerAssignmentTool();
89  switch ($next_class) {
90  case "ilworkspaceaccessgui":
91  if ($this->checkPermissionBool("write")) {
92  $this->setTabs();
93  $this->tabs_gui->activateTab("share");
94 
95  $this->tpl->setPermanentLink("prtf", $this->object->getId());
96 
97  $wspacc = new ilWorkspaceAccessGUI($this->object->getId(), $this->access_handler, true);
98  $wspacc->setBlockingMessage($this->getOfflineMessage());
99  $this->ctrl->forwardCommand($wspacc);
100  }
101  break;
102 
103  case 'ilportfoliopagegui':
104  if ($this->determinePageCall()) {
105  // only in edit mode
106  $this->addLocator();
107  }
108  $this->handlePageCall($cmd);
109  break;
110 
111  case "ilcommentgui":
112  $this->preview();
113  break;
114 
115  case "ilcommonactiondispatchergui":
116  //$this->prepareOutput();
118  $this->ctrl->forwardCommand($gui);
119  break;
120 
121  case "ilobjectcontentstylesettingsgui":
122  $this->checkPermission("write");
123  $this->addLocator();
124  $this->setTabs();
125  $this->tabs_gui->activateTab("settings");
126  $this->setSettingsSubTabs("style");
127  $settings_gui = $this->content_style_gui
128  ->objectSettingsGUIForObjId(
129  null,
130  $this->object->getId()
131  );
132  $this->ctrl->forwardCommand($settings_gui);
133  break;
134 
135  case "ilportfolioexercisegui":
136  $this->ctrl->setReturn($this, "view");
137  $gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
138  $this->ctrl->forwardCommand($gui);
139  break;
140 
141  case strtolower(SettingsGUI::class):
142  $this->checkPermission("write");
143  $this->addLocator();
144  $this->setTabs();
145  $this->tabs_gui->activateTab("settings");
146  $this->setSettingsSubTabs("properties");
147  $gui = $this->gui->settings()->settingsGUI(
148  $this->object->getId(),
149  false
150  );
151  $this->ctrl->forwardCommand($gui);
152  break;
153 
154  default:
155 
156  if ($cmd !== "preview") {
157  $this->addLocator();
158  $this->setTabs();
159  }
160  $this->$cmd();
161  break;
162  }
163  }
ILIAS Portfolio InternalGUIService $gui
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
getOfflineMessage()
Get offline message for sharing tab.
Class ilPortfolioExerciseGUI.
preview()
description: > Example for rendering a Preview Glyph.
Definition: preview.php:41
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
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 308 of file class.ilObjPortfolioGUI.php.

References $DIC, $ilSetting, $message, and ilObjPortfolioBaseGUI\$ui.

308  : string
309  {
310  global $DIC;
311 
312  $ui = $DIC->ui();
313  $ilSetting = $DIC->settings();
314 
315  $message = "";
316  return $message;
317  }
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
$message
Definition: xapiexit.php:31

◆ getCreationForm()

ilObjPortfolioGUI::getCreationForm ( )
protected

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

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

Referenced by create(), and save().

320  {
322  $this->ctrl->setParameter($this, "new_type", $this->getType());
323 
324  return $this->gui->form([static::class], "save")
325  ->section("prop", $this->lng->txt("prtf_create_portfolio"))
326  ->addStdTitle(
327  0,
328  "prtf"
329  );
330  }
global $ilSetting
Definition: privfeed.php:31
ilSetting $settings
addStdTitle(int $obj_id, string $type)
+ 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 447 of file class.ilObjPortfolioGUI.php.

447  : void
448  {
449  $a_values["online"] = $this->object->isOnline();
450 
451  parent::getEditFormCustomValues($a_values);
452  }

◆ getOfflineMessage()

ilObjPortfolioGUI::getOfflineMessage ( )
protected

Get offline message for sharing tab.

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

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

Referenced by executeCommand().

871  : string
872  {
873  $ui = $this->ui;
874  $lng = $this->lng;
875  $ctrl = $this->ctrl;
876 
877  if (!$this->object->isOnline()) {
878  $f = $ui->factory();
879  $renderer = $ui->renderer();
880 
881  $buttons = [$f->button()->standard(
882  $lng->txt("prtf_set_online"),
883  $ctrl->getLinkTarget($this, "setOnlineAndShare")
884  )];
885 
886  return $renderer->render($f->messageBox()->info($lng->txt("prtf_no_offline_share_info"))
887  ->withButtons($buttons));
888  }
889  return "";
890  }
$renderer
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 504 of file class.ilObjPortfolioGUI.php.

504  : string
505  {
506  return "ilportfoliopagegui";
507  }

◆ getPageGUIInstance()

ilObjPortfolioGUI::getPageGUIInstance ( int  $a_page_id)
protected

Get portfolio template page gui instance.

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

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

493  $page_gui = new ilPortfolioPageGUI(
494  $this->object->getId(),
495  $a_page_id,
496  0,
497  $this->object->hasPublicComments()
498  );
499  $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
500  $page_gui->setAdditional($this->getAdditional());
501  return $page_gui;
502  }
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 474 of file class.ilObjPortfolioGUI.php.

References ilPageObject\getId().

477  : ilPortfolioPage {
478  // #11531
479  if (!$a_portfolio_id && $this->object) {
480  $a_portfolio_id = $this->object->getId();
481  }
482  $page = new ilPortfolioPage((int) $a_page_id);
483  $page->setPortfolioId($a_portfolio_id);
484  return $page;
485  }
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:

◆ getSkillsToPortfolioAssignment()

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

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

References ilPageObject\getDomDoc().

Referenced by createPortfolioFromAssignment(), and initCreatePortfolioFromTemplateForm().

834  : array {
835  $dom = $a_source_page->getDomDoc();
836  $xpath = new DOMXPath($dom);
837  $nodes = $xpath->query("//PageContent/Skills");
838  foreach ($nodes as $node) {
839  $skill_id = $node->getAttribute("Id");
840  if (!in_array($skill_id, $a_pskills)) {
841  $a_skill_ids[] = $skill_id;
842  }
843  }
844  unset($nodes, $xpath, $dom);
845 
846  return $a_skill_ids;
847  }
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 59 of file class.ilObjPortfolioGUI.php.

Referenced by getCreationForm(), and initCreateFromTemplateForm().

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

◆ initCopyPageFormOptions()

ilObjPortfolioGUI::initCopyPageFormOptions ( ilPropertyFormGUI  $a_form)
protected

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

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

509  : void
510  {
511  $a_tgt = new ilRadioGroupInputGUI($this->lng->txt("target"), "target");
512  $a_tgt->setRequired(true);
513  $a_form->addItem($a_tgt);
514 
515  $old = new ilRadioOption($this->lng->txt("prtf_existing_portfolio"), "old");
516  $a_tgt->addOption($old);
517 
518  $options = array();
519  $all = ilObjPortfolio::getPortfoliosOfUser($this->user_id);
520  foreach ($all as $item) {
521  $options[$item["id"]] = $item["title"];
522  }
523  $prtf = new ilSelectInputGUI($this->lng->txt("portfolio"), "prtf");
524  $prtf->setRequired(true);
525  $prtf->setOptions($options);
526  $old->addSubItem($prtf);
527 
528  $new = new ilRadioOption($this->lng->txt("prtf_new_portfolio"), "new");
529  $a_tgt->addOption($new);
530 
531  $tf = new ilTextInputGUI($this->lng->txt("title"), "title");
532  $tf->setMaxLength(128);
533  $tf->setSize(40);
534  $tf->setRequired(true);
535  $new->addSubItem($tf);
536  }
This class represents an option in a radio group.
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:

◆ initCreateFromTemplateForm()

ilObjPortfolioGUI::initCreateFromTemplateForm ( )
protected

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

333  {
335 
336  $this->ctrl->setParameter($this, "new_type", $this->getType());
337 
338  $form = new ilPropertyFormGUI();
339  $form->setFormAction($this->ctrl->getFormAction($this));
340 
341  // title
342  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
343  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
344  $ti->setMaxLength(ilObject::TITLE_LENGTH);
345  $ti->setRequired(true);
346  $form->addItem($ti);
347 
348  // portfolio templates
350  if (count($templates)) {
351  $tmpl = new ilSelectInputGUI($this->lng->txt("obj_prtt"), "prtt");
352  $tmpl->setRequired(true);
353  $tmpl->setOptions(array("" => $this->lng->txt("please_select")) + $templates);
354  $form->addItem($tmpl);
355 
356  // incoming from repository
357  $template_id = $this->port_request->getPortfolioTemplateId();
358  if ($template_id > 0) {
359  $tmpl->setValue($template_id);
360  }
361  }
362 
363  $form->setTitle($this->lng->txt("prtf_add_portfolio_from_template"));
364  $form->addCommandButton("saveFromTemplate", $this->lng->txt("create"));
365  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
366 
367  return $form;
368  }
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:31
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 568 of file class.ilObjPortfolioGUI.php.

References $ass_id, $ilSetting, ilObjectGUI\$settings, ilObject2GUI\$user, ilSkillTreeNode\_lookupTitle(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ilPortfolioPage\getAllPortfolioPages(), getSkillsToPortfolioAssignment(), ILIAS\Repository\lng(), null, ilFormPropertyGUI\setInfo(), and ilPortfolioPage\TYPE_PAGE.

Referenced by createPortfolioFromTemplate(), and createPortfolioFromTemplateProcess().

571  : ?ilPropertyFormGUI {
573  $ilUser = $this->user;
574 
575  $exc_id = $this->port_request->getExerciseRefId();
576  $ass_id = $this->port_request->getExcAssId();
577  if ($exc_id > 0) {
578  $this->ctrl->setParameter($this, "exc_id", $exc_id);
579  $this->ctrl->setParameter($this, "ass_id", $ass_id);
580  }
581 
582  $form = new ilPropertyFormGUI();
583  $form->setFormAction($this->ctrl->getFormAction($this));
584 
585  $tmpl = new ilNonEditableValueGUI($this->lng->txt("obj_prtt"));
586  $tmpl->setValue(ilObject::_lookupTitle($a_prtt_id));
587  $form->addItem($tmpl);
588 
589  $title = new ilNonEditableValueGUI($this->lng->txt("title"), "pt");
590  $title->setValue($a_title);
591  $form->addItem($title);
592 
593  $has_form_content = false;
594 
595  $pskills = array_keys($this->skill_personal_service->getSelectedUserSkills($ilUser->getId()));
596  $skill_ids = array();
597 
598  foreach (ilPortfolioTemplatePage::getAllPortfolioPages($a_prtt_id) as $page) {
599  switch ($page["type"]) {
601  // skills
602  $source_page = new ilPortfolioTemplatePage($page["id"]);
603  $source_page->buildDom(true);
604  $skill_ids = $this->getSkillsToPortfolioAssignment($pskills, $skill_ids, $source_page);
605 
606  if (count($skill_ids)) {
607  $has_form_content = true;
608  }
609  break;
610  }
611  }
612 
613  if ($skill_ids) {
614  $skills = new ilCheckboxGroupInputGUI($this->lng->txt("skills"), "skill_ids");
615  $skills->setInfo($this->lng->txt("prtf_template_import_new_skills"));
616  $skills->setValue($skill_ids);
617  foreach ($skill_ids as $skill_id) {
618  $skills->addOption(new ilCheckboxOption(ilSkillTreeNode::_lookupTitle($skill_id), $skill_id));
619  }
620  $form->addItem($skills);
621  }
622  // no dialog needed, go ahead
623  if (!$has_form_content) {
624  return null;
625  }
626 
627  $form->setTitle($this->lng->txt("prtf_creation_mode") . ": " . $this->lng->txt("prtf_creation_mode_template"));
628  $form->addCommandButton("createPortfolioFromTemplateProcess", $this->lng->txt("continue"));
629  $form->addCommandButton("toRepository", $this->lng->txt("cancel"));
630 
631  return $form;
632  }
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
getSkillsToPortfolioAssignment(array $a_pskills, array $a_skill_ids, ilPortfolioTemplatePage $a_source_page)
This class represents an option in a checkbox group.
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
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.
global $ilSetting
Definition: privfeed.php:31
ilSetting $settings
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initEditForm()

ilObjPortfolioGUI::initEditForm ( )
protected

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

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

421  {
422  $form = new ilPropertyFormGUI();
423  $form->setFormAction($this->ctrl->getFormAction($this));
424 
425  // title
426  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
427  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
428  $ti->setMaxLength(ilObject::TITLE_LENGTH);
429  $ti->setRequired(true);
430  $ti->setValue($this->object->getTitle());
431  $form->addItem($ti);
432 
433  // :TODO: online
434  $online = new ilCheckboxInputGUI($this->lng->txt("online"), "online");
435  $online->setChecked($this->object->isOnline());
436  $form->addItem($online);
437 
438  $this->initEditCustomForm($form);
439 
440  $form->setTitle($this->lng->txt("prtf_edit_portfolio"));
441  $form->addCommandButton("update", $this->lng->txt("save"));
442  $form->addCommandButton("view", $this->lng->txt("cancel"));
443 
444  return $form;
445  }
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 808 of file class.ilObjPortfolioGUI.php.

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

Referenced by createPortfolioFromAssignment(), and createPortfolioFromTemplateProcess().

808  : void
809  {
810  $ilAccess = $this->access;
811  $ilUser = $this->user;
812 
813  $exc_ref_id = $this->port_request->getExerciseRefId();
814  $ass_id = $this->port_request->getExcAssId();
815 
816  if ($exc_ref_id &&
817  $ass_id &&
818  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
819  $exc = new ilObjExercise($exc_ref_id);
820  $ass = new ilExAssignment($ass_id);
821  if ($ass->getExerciseId() === $exc->getId() &&
822  $ass->getType() === ilExAssignment::TYPE_PORTFOLIO) {
823  // #16205
824  $sub = new ilExSubmission($ass, $ilUser->getId());
825  $sub->addResourceObject($a_target_id);
826  }
827  }
828  }
Exercise assignment.
addResourceObject(string $a_wsp_id, ?string $a_text=null)
Add personal resource or repository object (ref_id) to assigment.
Class ilObjExercise.
Exercise submission //TODO: This class has many static methods related to delivered "files"...
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 852 of file class.ilObjPortfolioGUI.php.

852  : void
853  {
854  $view = $this->getPrintView();
855  $view->sendForm();
856  }

◆ save()

ilObjPortfolioGUI::save ( )

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

References ILIAS\Repository\ctrl(), and getCreationForm().

370  : void
371  {
372  $form = $this->getCreationForm();
373  if ($form->isValid()) {
374  $port = new ilObjPortfolio();
375  $port->setTitle($form->getData("title"));
376  $port->create();
377  $this->ctrl->setParameter($this, "prt_id", $port->getId());
378  $this->ctrl->redirect($this, "view");
379  }
380  $this->tpl->setContent($form->render());
381  }
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:

◆ saveFromTemplate()

ilObjPortfolioGUI::saveFromTemplate ( )

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

References createFromTemplateDirect(), and initCreateFromTemplateForm().

383  : void
384  {
385  $form = $this->initCreateFromTemplateForm();
386  // trigger portfolio template "import" process
387  if ($form->checkInput()) {
389  $form->getInput("title"),
390  $this->port_request->getPortfolioTemplate()
391  );
392  return;
393  } else {
394  $form->setValuesByPost();
395  $this->tpl->setContent($form->getHTML());
396  }
397  }
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 895 of file class.ilObjPortfolioGUI.php.

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

895  : void
896  {
897  $ilCtrl = $this->ctrl;
898  $lng = $this->lng;
899 
900  if (ilObjPortfolio::_lookupOwner($this->object->getId()) === $this->user_id) {
901  $this->object->setOnline(true);
902  $this->object->update();
903  $this->tpl->setOnScreenMessage('success', $lng->txt("prtf_has_been_set_online"), true);
904  }
905  $ilCtrl->redirectByClass("ilworkspaceaccessgui", "");
906  }
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 188 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

188  : void
189  {
190  $ilHelp = $this->help;
191 
192  $ilHelp->setScreenIdComponent("prtf");
193 
194  if ($this->checkPermissionBool("write")) {
195  $this->tabs_gui->addTab(
196  "pages",
197  $this->lng->txt("content"),
198  $this->ctrl->getLinkTarget($this, "view")
199  );
200 
201  $this->tabs_gui->addTab(
202  "settings",
203  $this->lng->txt("settings"),
204  $this->ctrl->getLinkTargetByClass(SettingsGUI::class)
205  );
206 
207  $this->tabs_gui->addNonTabbedLink(
208  "preview",
209  $this->lng->txt("preview"),
210  $this->ctrl->getLinkTarget($this, "preview")
211  );
212 
213  $this->lng->loadLanguageModule("wsp");
214  $this->tabs_gui->addTab(
215  "share",
216  $this->lng->txt("wsp_permissions"),
217  $this->ctrl->getLinkTargetByClass("ilworkspaceaccessgui", "share")
218  );
219  }
220  }
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 233 of file class.ilObjPortfolioGUI.php.

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

Referenced by executeCommand().

233  : void
234  {
235  // parent::setTitleAndDescription();
236 
237  $title = $this->lng->txt("portfolio");
238  if ($this->object) {
239  $title .= ": " . $this->object->getTitle();
240  }
241  $this->tpl->setTitle($title);
242  $this->tpl->setTitleIcon(
243  ilUtil::getImagePath("standard/icon_prtf.svg"),
244  $this->lng->txt("portfolio")
245  );
246 
247  if ($this->object &&
248  !$this->object->isOnline()) {
249  $this->tpl->setAlertProperties(array(
250  array("alert" => true,
251  "property" => $this->lng->txt("status"),
252  "value" => $this->lng->txt("offline"))
253  ));
254  }
255  }
static getImagePath(string $image_name, 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 862 of file class.ilObjPortfolioGUI.php.

863  : void {
864  $printview = $this->getPrintView();
865  $printview->sendPrintView();
866  }

◆ toRepository()

ilObjPortfolioGUI::toRepository ( )
protected

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

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

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

406  : void
407  {
408  $ilAccess = $this->access;
409 
410  // return to exercise (portfolio assignment)
411  $exc_ref_id = $this->port_request->getExerciseRefId();
412  if ($exc_ref_id &&
413  $ilAccess->checkAccess("read", "", $exc_ref_id)) {
414  ilUtil::redirect(ilLink::_getLink($exc_ref_id, "exc"));
415  }
416 
417  $this->ctrl->redirectByClass("ilportfoliorepositorygui", "show");
418  }
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 170 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().

170  : void
171  {
172  if (!is_object($this->object) || $this->object->getId() <= 0) {
173  return;
174  }
175  $pe = new ilPortfolioExercise($this->user_id, $this->object->getId());
176  $pe_gui = new ilPortfolioExerciseGUI($this->user_id, $this->object->getId());
177  $assignments = $pe->getAssignmentsOfPortfolio();
178  if (count($assignments) > 0) {
179  $ass_ids = array_map(static function ($i) {
180  return $i["ass_id"];
181  }, $assignments);
182  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
183  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
184  $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_BUTTONS, $pe_gui->getActionButtons());
185  }
186  }
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 454 of file class.ilObjPortfolioGUI.php.

References ilPropertyFormGUI\getInput().

454  : void
455  {
456  $this->object->setOnline($form->getInput("online"));
457 
458  // if portfolio is not online, it cannot be default
459  if (!$form->getInput("online")) {
460  ilObjPortfolio::setUserDefault($this->user_id, 0);
461  }
462 
463  parent::updateCustom($form);
464  }
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-...
+ Here is the call graph for this function:

Field Documentation

◆ $declaration_authorship

ilPortfolioDeclarationOfAuthorship ilObjPortfolioGUI::$declaration_authorship
protected

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

◆ $notes_gui

ILIAS Notes GUIService ilObjPortfolioGUI::$notes_gui
protected

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

◆ $skill_personal_service

ILIAS Skill Service SkillPersonalService ilObjPortfolioGUI::$skill_personal_service
protected

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

◆ $tool_context

ContextServices ilObjPortfolioGUI::$tool_context
protected

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

◆ $ws_access

ilWorkspaceAccessHandler ilObjPortfolioGUI::$ws_access
protected

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


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