ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
ilObjFileGUI Class Reference

GUI class for file objects. More...

+ Inheritance diagram for ilObjFileGUI:
+ Collaboration diagram for ilObjFileGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 Constructor. More...
 
 getType ()
 Functions that must be overwritten. More...
 
 getParentId ()
 
 initUploadForm ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 edit ()
 
 sendFile ()
 
 showSummary ()
 
 showSummaryForced ()
 
 versions ()
 
 unzipCurrentRevision ()
 
 infoScreenForward ()
 show information screen More...
 
 buildInfoScreen (bool $kiosk_mode)
 
- 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)
 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)
 
 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 ($a_target, $a_additional=null)
 
- 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)
 

Data Fields

const UPLOAD_MAX_FILES = 100
 
const PARAM_FILES = 'files'
 
const PARAM_TITLE = 'title'
 
const PARAM_DESCRIPTION = 'description'
 
const PARAM_COPYRIGHT_ID = "copyright_id"
 
const PARAM_UPLOAD_ORIGIN = 'origin'
 
const UPLOAD_ORIGIN_STANDARD = 'standard'
 
const UPLOAD_ORIGIN_DROPZONE = 'dropzone'
 
const CMD_EDIT = Capabilities::EDIT_SETTINGS->value
 
const CMD_VERSIONS = Capabilities::MANAGE_VERSIONS->value
 
const CMD_UPLOAD_FILES = "uploadFiles"
 
const CMD_SEND_FILE = Capabilities::DOWNLOAD->value
 
ilObject $object = null
 
ilLanguage $lng
 
- 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]
 

Protected Member Functions

 recordReadEvent ()
 
 updateLearningProgress ()
 
 addUIFormToAccordion (ilAccordionGUI $accordion, Standard $form, int $form_type)
 
 addLegacyFormToAccordion (ilAccordionGUI $accordion, ilPropertyFormGUI $form, int $form_type)
 
 initCreateForm (string $new_type)
 
 getCreationFormTitle ()
 
 uploadFiles ()
 MUST be protected, since this is Called from ilObject2GUI when used in Personal Workspace. More...
 
 initPropertiesForm ()
 
 editExternal ()
 
 viewExternal ()
 
 toggleLearningProgress ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 initSettingsTab ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initHeaderAction (?string $a_sub_type=null, ?int $a_sub_id=null)
 Add header action menu. More...
 
 getCtrl ()
 
 getFileObj ()
 
 getFileStakeholder ()
 
 getGeneralSettings ()
 
 getLanguage ()
 
 getNodeID ()
 
 getRefinery ()
 
 getUIFactory ()
 
 getUser ()
 
- 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="")
 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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) 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...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 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 ()
 @abstract 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

UIServices $ui
 
UploadHandler $upload_handler
 
ResourceStakeholder $stakeholder
 
Services $storage
 
ilLogger $log = null
 
ilObjectService $obj_service
 
ILIAS Refinery Factory $refinery
 
General $general_settings
 
ilFileServicesSettings $file_service_settings
 
IconDatabaseRepository $icon_repo
 
ILIAS UI Component Input Factory $inputs
 
Renderer $renderer
 
ServerRequestInterface $request
 
Factory $data_factory
 
LOMServices $lom_services
 
- 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
 
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
 
GlobalHttpState $http
 
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
 
CustomIconFactory $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 = ""
 

Private Attributes

CapabilityCollection $capabilities
 
ActionDBRepository $action_repo
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjFileGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Constructor.

Reimplemented from ilObject2GUI.

Definition at line 101 of file class.ilObjFileGUI.php.

102 {
103 global $DIC;
104 $this->refinery = $DIC->refinery();
105 $this->file_service_settings = $DIC->fileServiceSettings();
106 $this->user = $DIC->user();
107 $this->lng = $DIC->language();
109 $this->ui = $DIC->ui();
110 $this->storage = $DIC->resourceStorage();
111 $this->upload_handler = new ilObjFileUploadHandlerGUI();
112 $this->stakeholder = new ilObjFileStakeholder();
113 $this->general_settings = new General();
114 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
115 $this->obj_service = $DIC->object();
116 $this->lng->loadLanguageModule(ilObjFile::OBJECT_TYPE);
117 $this->icon_repo = new IconDatabaseRepository();
118 $this->inputs = $DIC->ui()->factory()->input();
119 $this->renderer = $DIC->ui()->renderer();
120 $this->request = $DIC->http()->request();
121 $this->data_factory = new Factory();
122 $this->action_repo = new ActionDBRepository($DIC->database());
123 $this->lom_services = $DIC->learningObjectMetadata();
124
125 $capability_builder = new CapabilityBuilder(
127 $this->access,
128 $this->ctrl,
129 $this->action_repo,
130 $DIC->http(),
131 $DIC['static_url.uri_builder']
132 );
133
134 $capability_context = new Context(
135 $this->object_id,
136 $this->ref_id,
137 ($a_id_type === self::WORKSPACE_NODE_ID) ? Context::CONTEXT_WORKSPACE : Context::CONTEXT_REPO
138 );
139
140 $this->capabilities = $capability_builder->get($capability_context);
141 }
renderer()
Builds data types.
Definition: Factory.php:36
static getLogger(string $a_component_id)
Get component logger.
Class ilObjFileStakeholder.
const OBJECT_TYPE
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ilObjFile\OBJECT_TYPE, ILIAS\Repository\refinery(), renderer(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjFileGUI::_goto (   $a_target,
  $a_additional = null 
)
static

Definition at line 1108 of file class.ilObjFileGUI.php.

1108 : void
1109 {
1110 global $DIC;
1111 $main_tpl = $DIC->ui()->mainTemplate();
1112 $ilErr = $DIC['ilErr'];
1113 $lng = $DIC['lng'];
1114 $ilAccess = $DIC['ilAccess'];
1115
1116 if ($a_additional && str_ends_with((string) $a_additional, "wsp")) {
1118 }
1119
1120 // added support for direct download goto links
1121 if ($a_additional && str_ends_with((string) $a_additional, "download")) {
1122 ilObjectGUI::_gotoRepositoryNode($a_target, "sendfile");
1123 }
1124
1125 // static method, no workspace support yet
1126
1127 if ($ilAccess->checkAccess("visible", "", $a_target)
1128 || $ilAccess->checkAccess("read", "", $a_target)) {
1129 ilObjectGUI::_gotoRepositoryNode($a_target, Capabilities::INFO_PAGE->value);
1130 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1131 $main_tpl->setOnScreenMessage(
1132 'failure',
1133 sprintf(
1134 $lng->txt("msg_no_perm_read_item"),
1136 ),
1137 true
1138 );
1140 }
1141
1142 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1143 }
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 _gotoSharedWorkspaceNode(int $wsp_id)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
$ilErr
Definition: raiseError.php:33

References $DIC, $ilErr, $lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObjectGUI\_gotoSharedWorkspaceNode(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ addLegacyFormToAccordion()

ilObjFileGUI::addLegacyFormToAccordion ( ilAccordionGUI  $accordion,
ilPropertyFormGUI  $form,
int  $form_type 
)
protected

Definition at line 409 of file class.ilObjFileGUI.php.

413 : void {
414 // abort if form-type is unknown
415 if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
416 return;
417 }
418 $title = $form->getTitle();
419 $form->setTitle(''); // see https://mantis.ilias.de/view.php?id=37786
420
421 $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
422 $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
423
424 $accordion->addItem($tpl->get(), $form->getHTML());
425 }
addItem(string $a_header, string $a_content, bool $a_force_open=false)
ilGlobalTemplateInterface $tpl
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

◆ addLocatorItems()

ilObjFileGUI::addLocatorItems ( )
protected

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 1148 of file class.ilObjFileGUI.php.

1148 : void
1149 {
1150 global $DIC;
1151 $ilLocator = $DIC['ilLocator'];
1152
1153 if (is_object($this->object)) {
1154 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
1155 }
1156 }

References $DIC, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addUIFormToAccordion()

ilObjFileGUI::addUIFormToAccordion ( ilAccordionGUI  $accordion,
Standard  $form,
int  $form_type 
)
protected

Definition at line 388 of file class.ilObjFileGUI.php.

392 : void {
393 // abort if form-type is unknown
394 if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
395 return;
396 }
397
398 $inputs = $form->getInputs();
399 // use label of first input as title, because UI Component forms don't support form-titles yet
400 $title = ($inputs === []) ?
401 '' : $inputs[array_key_first($inputs)]->getLabel();
402
403 $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
404 $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
405
406 $accordion->addItem($tpl->get(), $this->ui->renderer()->render($form));
407 }
ILIAS UI Component Input Factory $inputs
getInputs()
Get the inputs contained in the container.

◆ buildInfoScreen()

ilObjFileGUI::buildInfoScreen ( bool  $kiosk_mode)

Definition at line 881 of file class.ilObjFileGUI.php.

882 {
883 $info = new ilInfoScreenGUI($this);
884
885 if (!$kiosk_mode) { // in kiosk mode we don't want to show the following sections
886 $info->enablePrivateNotes();
887
888 if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
889 $info->enableNews();
890 }
891
892 // no news editing for files, just notifications
893 $info->enableNewsEditing(false);
894 if ($this->capabilities->get(Capabilities::MANAGE_VERSIONS)->isUnlocked()) {
895 $news_set = new ilSetting("news");
896 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
897
898 if ($enable_internal_rss) {
899 $info->setBlockProperty("news", "settings", true);
900 $info->setBlockProperty("news", "public_notifications_option", true);
901 }
902 }
903
904 $obj_id = $this->object->getId();
905 $record_gui = new ilAdvancedMDRecordGUI(
907 'file',
908 $obj_id,
909 '',
910 0,
911 $this->call_by_reference
912 );
913 $record_gui->setInfoObject($info);
914 $record_gui->parse();
915 }
916 // show rating is not possible in kiosk mode
917
918 // Important Information
919 $important_info = $this->object->getImportantInfo();
920 if (!empty($important_info)) {
921 $group = new Group(new Factory(), $this->lng);
922 $markdown_to_html = $group->markdown()->toHTML();
923
924 $info->addSection($this->lng->txt("important_info"));
925 $info->addProperty("", $markdown_to_html->transform($important_info));
926 }
927
928 // Download Launcher
929 if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
930 // get permanent download link for repository
931 if ($this->id_type === self::REPOSITORY_NODE_ID) {
932 $download_target = ilObjFileAccess::_getPermanentDownloadLink($this->node_id);
933 } else {
934 $download_target = rtrim(ILIAS_HTTP_PATH, '/') . '/' . $this->ctrl->getLinkTarget(
935 $this,
936 self::CMD_SEND_FILE
937 );
938 }
939 $url = $this->data_factory->uri($download_target);
940 $link = $this->data_factory->link($this->lng->txt('file_download'), $url);
941 $download_launcher = $this->ui->factory()->launcher()->inline($link);
942 // create own section for download launcher if there is no important info section
943 if (empty($important_info)) {
944 $info->addSection("");
945 }
946 // add download launcher
947 $info->addProperty("", $this->renderer->render($download_launcher));
948 }
949
950 // standard meta data
951 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
952
953 // in kiosk mode we don't want to show the following sections
954 // links to resource
955 if (!$kiosk_mode && ($this->access->checkAccess("write", "", $this->ref_id) ||
956 $this->access->checkAccess("edit_permissions", "", $this->ref_id))) {
957 $rs = ilObject::_getAllReferences($this->obj_id);
958 $refs = [];
959 foreach ($rs as $r) {
960 if ($this->tree->isInTree($r)) {
961 $refs[] = $r;
962 }
963 }
964 if (count($refs) > 1) {
965 $links = $sep = "";
966 foreach ($refs as $r) {
967 $cont_loc = new ilLocatorGUI();
968 $cont_loc->addContextItems($r, true);
969 $links .= $sep . $cont_loc->getHTML();
970 $sep = "<br />";
971 }
972
973 $info->addProperty(
974 $this->lng->txt("res_links"),
975 '<div class="small">' . $links . '</div>'
976 );
977 }
978 }
979
980 // File Info
981 $info->addSection($this->lng->txt("file_info"));
982 if ($kiosk_mode) {
983 $file_info_for_users = $this->getFileInfoForUsers();
984 foreach ($file_info_for_users as $file_info_entry_key => $file_info_entry_value) {
985 if ($file_info_entry_value !== null) {
986 $info->addProperty($file_info_entry_key, $file_info_entry_value);
987 }
988 }
989 } else {
990 $file_info = $this->getAllFileInfoForCurrentUser();
991 foreach ($file_info as $file_info_block) {
992 foreach ($file_info_block as $file_info_entry_key => $file_info_entry_value) {
993 if ($file_info_entry_value !== null) {
994 $info->addProperty($file_info_entry_key, $file_info_entry_value);
995 }
996 }
997 }
998 }
999
1000 $info->hideFurtherSections(false);
1001
1002 return $info;
1003 }
Class ilInfoScreenGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getPermanentDownloadLink(int $ref_id)
Gets the permanent download link for the file.
static _getAllReferences(int $id)
get all reference ids for object ID
ILIAS Setting Class.
$info
Definition: entry_point.php:21
$url
Definition: shib_logout.php:70

References $info, $url, ilObject\_getAllReferences(), ilObjFileAccess\_getPermanentDownloadLink(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\ILIASObject\Creation\Group, ILIAS\Repository\lng(), ilAdvancedMDRecordGUI\MODE_INFO, ILIAS\Repository\object(), renderer(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ edit()

ilObjFileGUI::edit ( )

Reimplemented from ilObject2GUI.

Definition at line 635 of file class.ilObjFileGUI.php.

635 : void
636 {
637 global $DIC;
638 $ilErr = $DIC['ilErr'];
639
640 if (!$this->capabilities->get(Capabilities::EDIT_SETTINGS)->isUnlocked()) {
641 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"));
642 }
643
644 $this->initSettingsTab();
645
646 $form = $this->initPropertiesForm();
647
648 // $ecs = new ilECSFileSettings($this->object);
649 // $ecs->addSettingsToForm($form, ilObjFile::OBJECT_TYPE); TODO: reintroduce usage of ECS file settings once they have been made compatible with the new ui components
650
651 $this->tpl->setContent($this->renderer->render($form));
652 }

References $DIC, $ilErr, ILIAS\Repository\lng(), and renderer().

+ Here is the call graph for this function:

◆ editExternal()

ilObjFileGUI::editExternal ( )
protected

Definition at line 802 of file class.ilObjFileGUI.php.

802 : void
803 {
804 $this->ctrl->redirectToURL(
805 (string) $this->capabilities->get(Capabilities::EDIT_EXTERNAL)->getUri()
806 );
807 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getCreationFormTitle()

ilObjFileGUI::getCreationFormTitle ( )
protected

Reimplemented from ilObjectGUI.

Definition at line 437 of file class.ilObjFileGUI.php.

437 : string
438 {
439 return $this->lng->txt('upload_files');
440 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCtrl()

ilObjFileGUI::getCtrl ( )
protected

Definition at line 1174 of file class.ilObjFileGUI.php.

1174 : \ilCtrl
1175 {
1176 return $this->ctrl;
1177 }
Class ilCtrl provides processing control methods.

◆ getFileObj()

ilObjFileGUI::getFileObj ( )
protected
Exceptions
ilFileException

Definition at line 1182 of file class.ilObjFileGUI.php.

1182 : ilObjFile
1183 {
1184 if (!$this->object instanceof ilObjFile) {
1185 throw new ilFileException("Error: object is not of type ilObjFile or doesn't exist");
1186 }
1187
1188 return $this->object;
1189 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjFile.

◆ getFileStakeholder()

ilObjFileGUI::getFileStakeholder ( )
protected

Definition at line 1191 of file class.ilObjFileGUI.php.

1192 {
1193 return $this->stakeholder;
1194 }
ResourceStakeholder $stakeholder

◆ getGeneralSettings()

ilObjFileGUI::getGeneralSettings ( )
protected

Definition at line 1196 of file class.ilObjFileGUI.php.

1196 : General
1197 {
1199 }
General $general_settings

◆ getLanguage()

ilObjFileGUI::getLanguage ( )
protected

Definition at line 1201 of file class.ilObjFileGUI.php.

1201 : \ilLanguage
1202 {
1203 return $this->lng;
1204 }
language handling

References $lng.

◆ getNodeID()

ilObjFileGUI::getNodeID ( )
protected

Definition at line 1206 of file class.ilObjFileGUI.php.

1206 : int
1207 {
1208 return $this->node_id;
1209 }

◆ getParentId()

ilObjFileGUI::getParentId ( )

Definition at line 173 of file class.ilObjFileGUI.php.

173 : int
174 {
175 return $this->parent_id;
176 }

References ilObject2GUI\$parent_id.

◆ getRefinery()

ilObjFileGUI::getRefinery ( )
protected

Definition at line 1211 of file class.ilObjFileGUI.php.

1212 {
1213 return $this->refinery;
1214 }
ILIAS Refinery Factory $refinery

References ILIAS\UI\examples\Layout\Page\Mail\$refinery.

◆ getType()

ilObjFileGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 168 of file class.ilObjFileGUI.php.

168 : string
169 {
171 }

References ilObjFile\OBJECT_TYPE.

◆ getUIFactory()

ilObjFileGUI::getUIFactory ( )
protected

Definition at line 1216 of file class.ilObjFileGUI.php.

1217 {
1218 return $this->ui->factory();
1219 }
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getUser()

ilObjFileGUI::getUser ( )
protected

Definition at line 1221 of file class.ilObjFileGUI.php.

1221 : ilObjUser
1222 {
1223 return $this->user;
1224 }
User class.

◆ infoScreenForward()

ilObjFileGUI::infoScreenForward ( )

show information screen

Definition at line 818 of file class.ilObjFileGUI.php.

818 : void
819 {
820 $this->tabs_gui->activateTab("id_info");
821
822 if (!$this->capabilities->get(Capabilities::INFO_PAGE)->isUnlocked()) {
823 $GLOBALS['DIC']['ilErr']->raiseError(
824 $this->lng->txt("msg_no_perm_read"),
825 2
826 ); // TODO remove magic number and old ilErr call
827 }
828
829 // add set completed button, if LP mode is active
830 if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_MANUAL) {
831 if (ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId())) {
832 $label = $this->lng->txt('file_btn_lp_toggle_state_completed');
833 } else {
834 $label = $this->lng->txt('file_btn_lp_toggle_state_not_completed');
835 }
836 $this->toolbar->addComponent(
837 $this->ui->factory()->button()->standard(
838 $label,
839 $this->ctrl->getLinkTarget($this, 'toggleLearningProgress')
840 )
841 );
842 }
843
844 // Add WOPI editor Button
845 if ($this->capabilities->get(Capabilities::EDIT_EXTERNAL)->isUnlocked()) {
846 $external_editor = $this->ui->factory()
847 ->button()
848 ->standard(
849 $this->lng->txt('open_external_editor'),
850 $this->ctrl->getLinkTargetByClass(
851 \ilWOPIEmbeddedApplicationGUI::class,
853 )
854 );
855 $this->toolbar->addComponent($external_editor);
856 }
857
858 $info = $this->buildInfoScreen(false);
859 $this->ctrl->forwardCommand($info);
860 }
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
buildInfoScreen(bool $kiosk_mode)
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, $info, ilLPStatus\_hasUserCompleted(), ilWOPIEmbeddedApplicationGUI\CMD_EDIT, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_MANUAL, ILIAS\Repository\object(), ILIAS\Repository\toolbar(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ initCreateForm()

ilObjFileGUI::initCreateForm ( string  $new_type)
protected
Returns
array

Reimplemented from ilObjectGUI.

Definition at line 431 of file class.ilObjFileGUI.php.

431 : Standard
432 {
433 return $this->initUploadForm();
434 }
This describes a standard form.
Definition: Standard.php:30

◆ initHeaderAction()

ilObjFileGUI::initHeaderAction ( ?string  $sub_type = null,
?int  $sub_id = null 
)
protected

Add header action menu.

Reimplemented from ilObject2GUI.

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

1160 {
1161 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1162 if ($lg instanceof ilObjectListGUI && $this->object->hasRating()) {
1163 $lg->enableRating(
1164 true,
1165 null,
1166 false,
1167 [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
1168 );
1169 }
1170
1171 return $lg;
1172 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ initPropertiesForm()

ilObjFileGUI::initPropertiesForm ( )
protected

Definition at line 654 of file class.ilObjFileGUI.php.

654 : Standard
655 {
656 $title_and_description = $this->object->getObjectProperties()->getPropertyTitleAndDescription()->toForm(
657 $this->lng,
658 $this->ui->factory()->input()->field(),
659 $this->refinery
660 );
661
662 $important_info = $this->inputs->field()->markdown(
664 $this->lng->txt('important_info'),
665 $this->lng->txt('important_info_byline')
666 )->withValue(
667 $this->object->getImportantInfo() ?? ""
668 );
669
670 $on_click_action = $this->inputs->field()->radio(
671 $this->lng->txt('on_click_action')
672 )->withOption(
674 $this->lng->txt('file_action_download'),
675 $this->lng->txt('file_action_download_info'),
676 )->withOption(
678 $this->lng->txt('file_action_show'),
679 $this->lng->txt('file_action_show_info'),
680 )->withValue(
681 (string) $this->object->getOnClickMode()
682 );
683
684 $input_groups = array_filter([
685 "title_and_description" => $title_and_description,
686 "important_info" => $important_info,
687 "on_click_action" => $on_click_action
688 ], static fn(FormInput $input): bool => null !== $input);
689
690 $file_info_section = $this->inputs->field()->section(
691 $input_groups,
692 $this->lng->txt('file_info')
693 );
694
695 $online_status = $this->object->getObjectProperties()->getPropertyIsOnline()->toForm(
696 $this->lng,
697 $this->ui->factory()->input()->field(),
698 $this->refinery
699 );
700 $availability_section = $this->inputs->field()->section(
701 ["online_status" => $online_status],
702 $this->lng->txt('rep_activation_availability')
703 );
704
705 $presentation_section = null;
706 if ($this->id_type === self::REPOSITORY_NODE_ID) {
707 $tile_image = $this->object->getObjectProperties()->getPropertyTileImage()->toForm(
708 $this->lng,
709 $this->ui->factory()->input()->field(),
710 $this->refinery
711 );
712 $presentation_section = $this->inputs->field()->section(
713 ["tile_image" => $tile_image],
714 $this->lng->txt('settings_presentation_header')
715 );
716 }
717
718 $additional_features_section = null;
719 if ($this->id_type === self::REPOSITORY_NODE_ID) {
720 $this->lng->loadLanguageModule('rating');
721
722 $enable_rating = $this->inputs->field()->checkbox(
723 $this->lng->txt('rating_activate_rating'),
724 $this->lng->txt('rating_activate_rating_info')
725 )->withValue(
726 $this->object->hasRating()
727 );
728 $additional_features_section = $this->inputs->field()->section(
729 ["rating" => $enable_rating],
730 $this->lng->txt('obj_features')
731 );
732 }
733
734 $inputs = array_filter([
735 "file_info" => $file_info_section,
736 "availability" => $availability_section,
737 "presentation" => $presentation_section,
738 "obj_features" => $additional_features_section
739 ], static fn(?Section $input): bool => null !== $input);
740
741 return $this->inputs->container()->form()->standard(
742 $this->ctrl->getLinkTargetByClass(self::class, 'update'),
743 $inputs
744 );
745 }
const CLICK_MODE_DOWNLOAD
const CLICK_MODE_INFOPAGE
This describes inputs that can be used in forms.
Definition: FormInput.php:33
This describes section inputs.
Definition: Section.php:29

References ILIAS\UI\Implementation\Component\Input\$inputs, ilObjFile\CLICK_MODE_DOWNLOAD, ilObjFile\CLICK_MODE_INFOPAGE, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ initSettingsTab()

ilObjFileGUI::initSettingsTab ( )
protected

Definition at line 1088 of file class.ilObjFileGUI.php.

1088 : void
1089 {
1090 $this->tabs_gui->activateTab("settings");
1091 // add subtab for common settings
1092 $this->tabs_gui->addSubTab(
1093 'file_settings',
1094 $this->lng->txt('settings'),
1095 $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT)
1096 );
1097 if (in_array('file', ilAdvancedMDRecord::_getActivatedObjTypes(), true)) {
1098 $this->tabs_gui->addSubTab(
1099 'service_settings',
1100 $this->lng->txt('service_settings'),
1101 $this->ctrl->getLinkTargetByClass(ilFileCommonSettingsGUI::class, ilFileCommonSettingsGUI::CMD_EDIT)
1102 );
1103 }
1104
1105 $this->tabs_gui->activateSubTab("file_settings");
1106 }
static _getActivatedObjTypes()
get activated obj types

References ilAdvancedMDRecord\_getActivatedObjTypes(), ilFileCommonSettingsGUI\CMD_EDIT, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initUploadForm()

ilObjFileGUI::initUploadForm ( )

Definition at line 442 of file class.ilObjFileGUI.php.

442 : Standard
443 {
444 $this->getLanguage()->loadLanguageModule('file');
445 $inputs = [];
446
447 $this->ctrl->setParameterByClass(self::class, 'new_type', $this->getType());
448 $this->ctrl->setParameterByClass(
449 self::class,
450 self::PARAM_UPLOAD_ORIGIN,
451 self::UPLOAD_ORIGIN_STANDARD
452 );
453
454
455 $inputs[self::PARAM_FILES] = $this->ui->factory()->input()->field()->file(
456 $this->upload_handler,
457 $this->lng->txt('upload_files'),
458 null,
459 $this->ui->factory()->input()->field()->group([
460 self::PARAM_TITLE => $this->ui->factory()->input()->field()->text(
461 $this->lng->txt('title')
462 )->withAdditionalTransformation(
463 $this->getEmptyStringToNullTransformation()
464 ),
465 self::PARAM_DESCRIPTION => $this->ui->factory()->input()->field()->textarea(
466 $this->lng->txt('description')
467 )->withAdditionalTransformation(
468 $this->getEmptyStringToNullTransformation()
469 ),
470 ])
471 )->withMaxFiles(
472 self::UPLOAD_MAX_FILES
473 )->withRequired(true);
474
475 if ($this->lom_services->copyrightHelper()->isCopyrightSelectionActive()) {
476 $inputs[self::PARAM_COPYRIGHT_ID] = $this->getCopyrightSelectionInput('set_license_for_all_files');
477 }
478
479 return $this->ui->factory()->input()->container()->form()->standard(
480 $this->ctrl->getFormActionByClass(self::class, self::CMD_UPLOAD_FILES),
481 $inputs
482 )->withSubmitLabel($this->lng->txt('upload_files'));
483 }
getType()
Functions that must be overwritten.

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\ctrl(), getLanguage(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ putObjectInTree()

ilObjFileGUI::putObjectInTree ( ilObject  $obj,
?int  $parent_node_id = null 
)

Add object to tree at given position.

Reimplemented from ilObject2GUI.

Definition at line 567 of file class.ilObjFileGUI.php.

567 : void
568 {
569 // this is needed to support multi fileuploads in personal and shared resources
570 $backup_node_id = $this->node_id;
571 parent::putObjectInTree($obj, $parent_node_id);
572 $this->node_id = $backup_node_id;
573 }

◆ recordReadEvent()

ilObjFileGUI::recordReadEvent ( )
protected

Definition at line 143 of file class.ilObjFileGUI.php.

143 : void
144 {
145 // Record read event and catchup with write events
147 $this->object->getType(),
148 $this->object->getRefId(),
149 $this->object->getId(),
150 $this->user->getId()
151 );
152 $this->updateLearningProgress();
153 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)

References ilChangeEvent\_recordReadEvent(), ILIAS\Repository\object(), and updateLearningProgress().

+ Here is the call graph for this function:

◆ sendFile()

ilObjFileGUI::sendFile ( )

Definition at line 747 of file class.ilObjFileGUI.php.

747 : bool
748 {
749 $hist_entry_id = $this->request_wrapper->has('hist_id')
750 ? $this->request_wrapper->retrieve('hist_id', $this->refinery->kindlyTo()->int())
751 : null;
752 try {
753 if (ANONYMOUS_USER_ID === $this->user->getId() && $this->request_wrapper->has('transaction')) {
754 $this->object->sendFile($hist_entry_id);
755 }
756
757 if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
758 // Record read event and catchup with write events
759 $this->recordReadEvent();
760
761 $this->object->sendFile($hist_entry_id);
762 } else {
763 $this->error->raiseError($this->lng->txt("permission_denied"), $this->error->MESSAGE);
764 }
765 } catch (FileNotFoundException $e) {
766 $this->error->raiseError($e->getMessage(), $this->error->MESSAGE);
767 }
768
769 return true;
770 }
Indicates that a file is missing or not found.
error(string $a_errmsg)
const ANONYMOUS_USER_ID
Definition: constants.php:27

References Vendor\Package\$e, ANONYMOUS_USER_ID, error(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ setTabs()

ilObjFileGUI::setTabs ( )
protected

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 1007 of file class.ilObjFileGUI.php.

1007 : void
1008 {
1009 global $DIC;
1010 $ilHelp = $DIC['ilHelp'];
1011 $ilHelp->setScreenIdComponent(ilObjFile::OBJECT_TYPE);
1012
1013 $this->ctrl->setParameter($this, "ref_id", $this->node_id);
1014
1015 if (($c = $this->capabilities->get(Capabilities::VIEW_EXTERNAL)) && $c->isUnlocked()) {
1016 $this->tabs_gui->addTab(
1017 "content",
1018 $this->lng->txt("content"),
1019 $c->getURI()
1020 );
1021 }
1022
1023 if (($c = $this->capabilities->get(Capabilities::MANAGE_VERSIONS)) && $c->isUnlocked()) {
1024 $this->tabs_gui->addTab(
1025 "id_versions",
1026 $this->lng->txt(self::CMD_VERSIONS),
1027 $this->ctrl->getLinkTargetByClass(ilFileVersionsGUI::class, ilFileVersionsGUI::CMD_DEFAULT)
1028 );
1029 }
1030
1031 if (($c = $this->capabilities->get(Capabilities::INFO_PAGE)) && $c->isUnlocked()) {
1032 $this->tabs_gui->addTab(
1033 "id_info",
1034 $this->lng->txt("info_short"),
1035 $this->ctrl->getLinkTargetByClass(["ilobjfilegui", "ilinfoscreengui"], "showSummary")
1036 );
1037 }
1038
1039 if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1040 $this->tabs_gui->addTab(
1041 "settings",
1042 $this->lng->txt("settings"),
1043 $this->ctrl->getLinkTarget($this, self::CMD_EDIT)
1044 );
1045 }
1046
1047 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1048 $this->tabs_gui->addTab(
1049 'learning_progress',
1050 $this->lng->txt('learning_progress'),
1051 $this->ctrl->getLinkTargetByClass([self::class, 'illearningprogressgui'], '')
1052 );
1053 }
1054
1055 // meta data
1056 if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1057 $mdgui = new ilObjectMetaDataGUI($this->object, null, null, $this->call_by_reference);
1058 $mdtab = $mdgui->getTab();
1059 if ($mdtab) {
1060 $this->tabs_gui->addTab(
1061 "id_meta",
1062 $this->lng->txt("meta_data"),
1063 $mdtab
1064 );
1065 }
1066 }
1067
1068 // export
1069 if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1070 $this->tabs_gui->addTab(
1071 "export",
1072 $this->lng->txt("export"),
1073 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1074 );
1075 }
1076
1077 // Permissions-tabs, had to add it here, see https://mantis.ilias.de/view.php?id=47417
1078 if ($this->access->checkAccess('edit_permission', '', $this->ref_id)) {
1079 $this->tabs_gui->addTarget(
1080 "perm_settings",
1081 $this->ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], "perm"),
1082 ["perm", "info", "owner"],
1083 ilPermissionGUI::class
1084 );
1085 }
1086 }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Class ilObjectMetaDataGUI.
$c
Definition: deliver.php:25

References $c, $DIC, ILIAS\Repository\access(), ilLearningProgressAccess\checkAccess(), ilFileVersionsGUI\CMD_DEFAULT, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilObjFile\OBJECT_TYPE.

+ Here is the call graph for this function:

◆ showSummary()

ilObjFileGUI::showSummary ( )
Deprecated:
PROXY COMMAND

Definition at line 775 of file class.ilObjFileGUI.php.

775 : void
776 {
777 $this->ctrl->redirectToURL(
778 (string) $this->capabilities->get(Capabilities::INFO_PAGE)->getUri()
779 );
780 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ showSummaryForced()

ilObjFileGUI::showSummaryForced ( )

Definition at line 781 of file class.ilObjFileGUI.php.

781 : void
782 {
783 $this->ctrl->redirectToURL(
784 (string) $this->capabilities->get(Capabilities::FORCED_INFO_PAGE)->getUri()
785 );
786 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ toggleLearningProgress()

ilObjFileGUI::toggleLearningProgress ( )
protected

Definition at line 862 of file class.ilObjFileGUI.php.

862 : void
863 {
865 $this->user->getId(),
866 $this->obj_id,
867 $this->ref_id,
868 'file'
869 );
870
871 $lp_marks = new ilLPMarks($this->obj_id, $this->user->getId());
872 $lp_marks->setCompleted(!ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId()));
873 $lp_marks->update();
874
875 ilLPStatusWrapper::_updateStatus($this->obj_id, $this->user->getId());
876
877 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
878 $this->ctrl->redirect($this, Capabilities::INFO_PAGE->value);
879 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')

References ilLPStatus\_hasUserCompleted(), ilLearningProgress\_tracProgress(), ilLPStatusWrapper\_updateStatus(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ unzipCurrentRevision()

ilObjFileGUI::unzipCurrentRevision ( )

Definition at line 795 of file class.ilObjFileGUI.php.

795 : void
796 {
797 $this->ctrl->redirectToURL(
798 (string) $this->capabilities->get(Capabilities::UNZIP)->getUri()
799 );
800 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ updateLearningProgress()

ilObjFileGUI::updateLearningProgress ( )
protected

Definition at line 155 of file class.ilObjFileGUI.php.

155 : void
156 {
157 if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_CONTENT_VISITED) {
159 $this->object->getId(),
160 $this->user->getId(),
161 null,
162 false,
163 true
164 );
165 }
166 }

References ilLPStatusWrapper\_updateStatus(), ilLPObjSettings\LP_MODE_CONTENT_VISITED, and ILIAS\Repository\object().

Referenced by recordReadEvent().

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

◆ uploadFiles()

ilObjFileGUI::uploadFiles ( )
protected

MUST be protected, since this is Called from ilObject2GUI when used in Personal Workspace.

Definition at line 488 of file class.ilObjFileGUI.php.

488 : void
489 {
490 $origin = ($this->request_wrapper->has(self::PARAM_UPLOAD_ORIGIN)) ?
491 $this->request_wrapper->retrieve(
492 self::PARAM_UPLOAD_ORIGIN,
493 $this->refinery->kindlyTo()->string()
494 ) : self::UPLOAD_ORIGIN_STANDARD;
495
496 if (self::UPLOAD_ORIGIN_DROPZONE === $origin) {
497 $dropzone = new ilObjFileUploadDropzone($this->parent_id);
498 $dropzone = $dropzone->getDropzone()->withRequest($this->request);
499 $data = $dropzone->getData();
500 } else {
501 $form = $this->initUploadForm()->withRequest($this->request);
502 $data = $form->getData();
503 }
504 $files = $data[self::PARAM_FILES] ?? $data[0] ?? null;
505
506 if (empty($files)) {
507 $form = $this->initUploadForm()->withRequest($this->request);
508 $this->tpl->setContent($this->getCreationFormsHTML($form));
509 return;
510 }
511
512 $processor = new ilObjFileProcessor(
513 $this->stakeholder,
514 $this,
515 $this->storage,
516 $this->file_service_settings
517 );
518
519 $errors = false;
520 foreach ($files as $file_data) {
521 $rid = $this->storage->manage()->find($file_data[0]);
522 if (null !== $rid) {
523 try {
524 $processor->process(
525 $rid,
526 $file_data[1][self::PARAM_TITLE] ?? null,
527 $file_data[1][self::PARAM_DESCRIPTION] ?? null,
528 $data[self::PARAM_COPYRIGHT_ID] ?? null
529 );
530 } catch (Throwable $t) {
531 $errors = true;
532 if (null !== $this->log) {
533 $this->log->error($t->getMessage() . ": " . $t->getTraceAsString());
534 }
535 }
536 }
537 }
538
539 if ($errors) {
540 $this->ui->mainTemplate()->setOnScreenMessage(
541 'failure',
542 $this->lng->txt('could_not_create_file_objs'),
543 true
544 );
545 }
546
547 if ($processor->getInvalidFileNames() !== []) {
548 $this->ui->mainTemplate()->setOnScreenMessage(
549 'info',
550 sprintf(
551 $this->lng->txt('file_upload_info_file_with_critical_extension'),
552 implode(', ', $processor->getInvalidFileNames())
553 ),
554 true
555 );
556 }
557
558 $link = match ($this->id_type) {
559 self::WORKSPACE_NODE_ID => $this->ctrl->getLinkTargetByClass(ilObjWorkspaceRootFolderGUI::class),
560 default => ilLink::_getLink($this->requested_ref_id),
561 };
562
563 $this->ctrl->redirectToURL($link);
564 }
Class ilObjFileProcessorInterface.
getCreationFormsHTML(StandardForm|ilPropertyFormGUI|array $form)

References $data, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ versions()

ilObjFileGUI::versions ( )

Definition at line 788 of file class.ilObjFileGUI.php.

788 : void
789 {
790 $this->ctrl->redirectToURL(
791 (string) $this->capabilities->get(Capabilities::MANAGE_VERSIONS)->getUri()
792 );
793 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ viewExternal()

ilObjFileGUI::viewExternal ( )
protected

Definition at line 808 of file class.ilObjFileGUI.php.

808 : void
809 {
810 $this->ctrl->redirectToURL(
811 (string) $this->capabilities->get(Capabilities::VIEW_EXTERNAL)->getUri()
812 );
813 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

Field Documentation

◆ $action_repo

ActionDBRepository ilObjFileGUI::$action_repo
private

Definition at line 95 of file class.ilObjFileGUI.php.

◆ $capabilities

CapabilityCollection ilObjFileGUI::$capabilities
private

Definition at line 74 of file class.ilObjFileGUI.php.

◆ $data_factory

Factory ilObjFileGUI::$data_factory
protected

Definition at line 94 of file class.ilObjFileGUI.php.

◆ $file_service_settings

ilFileServicesSettings ilObjFileGUI::$file_service_settings
protected

Definition at line 89 of file class.ilObjFileGUI.php.

◆ $general_settings

General ilObjFileGUI::$general_settings
protected

Definition at line 88 of file class.ilObjFileGUI.php.

◆ $icon_repo

IconDatabaseRepository ilObjFileGUI::$icon_repo
protected

Definition at line 90 of file class.ilObjFileGUI.php.

◆ $inputs

ILIAS UI Component Input Factory ilObjFileGUI::$inputs
protected

Definition at line 91 of file class.ilObjFileGUI.php.

◆ $lng

ilLanguage ilObjFileGUI::$lng

Definition at line 80 of file class.ilObjFileGUI.php.

◆ $log

ilLogger ilObjFileGUI::$log = null
protected

Definition at line 85 of file class.ilObjFileGUI.php.

◆ $lom_services

LOMServices ilObjFileGUI::$lom_services
protected

Definition at line 96 of file class.ilObjFileGUI.php.

◆ $obj_service

ilObjectService ilObjFileGUI::$obj_service
protected

Definition at line 86 of file class.ilObjFileGUI.php.

◆ $object

ilObjFile null ilObjFileGUI::$object = null

Definition at line 79 of file class.ilObjFileGUI.php.

◆ $refinery

ILIAS Refinery Factory ilObjFileGUI::$refinery
protected

Definition at line 87 of file class.ilObjFileGUI.php.

◆ $renderer

Renderer ilObjFileGUI::$renderer
protected

Definition at line 92 of file class.ilObjFileGUI.php.

◆ $request

ServerRequestInterface ilObjFileGUI::$request
protected

Definition at line 93 of file class.ilObjFileGUI.php.

◆ $stakeholder

ResourceStakeholder ilObjFileGUI::$stakeholder
protected

Definition at line 83 of file class.ilObjFileGUI.php.

◆ $storage

Services ilObjFileGUI::$storage
protected

Definition at line 84 of file class.ilObjFileGUI.php.

◆ $ui

UIServices ilObjFileGUI::$ui
protected

Definition at line 81 of file class.ilObjFileGUI.php.

◆ $upload_handler

UploadHandler ilObjFileGUI::$upload_handler
protected

Definition at line 82 of file class.ilObjFileGUI.php.

◆ CMD_EDIT

const ilObjFileGUI::CMD_EDIT = Capabilities::EDIT_SETTINGS->value

Definition at line 69 of file class.ilObjFileGUI.php.

◆ CMD_SEND_FILE

const ilObjFileGUI::CMD_SEND_FILE = Capabilities::DOWNLOAD->value

Definition at line 73 of file class.ilObjFileGUI.php.

◆ CMD_UPLOAD_FILES

const ilObjFileGUI::CMD_UPLOAD_FILES = "uploadFiles"

Definition at line 71 of file class.ilObjFileGUI.php.

◆ CMD_VERSIONS

const ilObjFileGUI::CMD_VERSIONS = Capabilities::MANAGE_VERSIONS->value

Definition at line 70 of file class.ilObjFileGUI.php.

◆ PARAM_COPYRIGHT_ID

const ilObjFileGUI::PARAM_COPYRIGHT_ID = "copyright_id"

Definition at line 63 of file class.ilObjFileGUI.php.

◆ PARAM_DESCRIPTION

const ilObjFileGUI::PARAM_DESCRIPTION = 'description'

Definition at line 62 of file class.ilObjFileGUI.php.

◆ PARAM_FILES

const ilObjFileGUI::PARAM_FILES = 'files'

Definition at line 60 of file class.ilObjFileGUI.php.

◆ PARAM_TITLE

const ilObjFileGUI::PARAM_TITLE = 'title'

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

◆ PARAM_UPLOAD_ORIGIN

const ilObjFileGUI::PARAM_UPLOAD_ORIGIN = 'origin'

Definition at line 65 of file class.ilObjFileGUI.php.

◆ UPLOAD_MAX_FILES

const ilObjFileGUI::UPLOAD_MAX_FILES = 100

Definition at line 59 of file class.ilObjFileGUI.php.

◆ UPLOAD_ORIGIN_DROPZONE

const ilObjFileGUI::UPLOAD_ORIGIN_DROPZONE = 'dropzone'

Definition at line 67 of file class.ilObjFileGUI.php.

◆ UPLOAD_ORIGIN_STANDARD

const ilObjFileGUI::UPLOAD_ORIGIN_STANDARD = 'standard'

Definition at line 66 of file class.ilObjFileGUI.php.


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