ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 ()
 
 getParentId ()
 
 initUploadForm ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 
 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)
 
 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

 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 ()
 
 initSettingsTab ()
 
 addLocatorItems ()
 
 initHeaderAction (?string $a_sub_type=null, ?int $a_sub_id=null)
 
 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="")
 
 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

UIServices $ui
 
UploadHandler $upload_handler
 
ResourceStakeholder $stakeholder
 
Services $storage
 
ilLogger $log = null
 
ilObjectService $obj_service
 
ILIAS Refinery Factory $refinery
 
WrapperFactory $http
 
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
 
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 = ""
 

Private Attributes

CapabilityCollection $capabilities
 
UploadLimitResolver $upload_limit
 
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.

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

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

105  {
106  global $DIC;
107  $this->http = $DIC->http()->wrapper();
108  $this->request = $DIC->http()->request();
109  $this->refinery = $DIC->refinery();
110  $this->file_service_settings = $DIC->fileServiceSettings();
111  $this->user = $DIC->user();
112  $this->lng = $DIC->language();
114  $this->ui = $DIC->ui();
115  $this->storage = $DIC->resourceStorage();
116  $this->upload_handler = new ilObjFileUploadHandlerGUI();
117  $this->stakeholder = new ilObjFileStakeholder();
118  $this->general_settings = new General();
119  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
120  $this->obj_service = $DIC->object();
121  $this->lng->loadLanguageModule(ilObjFile::OBJECT_TYPE);
122  $this->icon_repo = new IconDatabaseRepository();
123  $this->upload_limit = $DIC['ui.upload_limit_resolver'];
124  $this->inputs = $DIC->ui()->factory()->input();
125  $this->renderer = $DIC->ui()->renderer();
126  $this->request = $DIC->http()->request();
127  $this->data_factory = new Factory();
128  $this->action_repo = new ActionDBRepository($DIC->database());
129  $this->lom_services = $DIC->learningObjectMetadata();
130 
131  $capability_builder = new CapabilityBuilder(
133  $this->access,
134  $this->ctrl,
135  $this->action_repo,
136  $DIC->http(),
137  $DIC['static_url.uri_builder']
138  );
139 
140  $capability_context = new Context(
141  $this->object_id,
142  $this->ref_id,
143  ($a_id_type === self::WORKSPACE_NODE_ID) ? Context::CONTEXT_WORKSPACE : Context::CONTEXT_REPO
144  );
145 
146  $this->capabilities = $capability_builder->get($capability_context);
147  }
Class ilObjFileStakeholder.
static getLogger(string $a_component_id)
Get component logger.
const OBJECT_TYPE
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:25
Builds data types.
Definition: Factory.php:35
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

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

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

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

1092  : void
1093  {
1094  global $DIC;
1095  $main_tpl = $DIC->ui()->mainTemplate();
1096  $ilErr = $DIC['ilErr'];
1097  $lng = $DIC['lng'];
1098  $ilAccess = $DIC['ilAccess'];
1099 
1100  if ($a_additional && str_ends_with((string) $a_additional, "wsp")) {
1101  ilObjectGUI::_gotoSharedWorkspaceNode((int) $a_target);
1102  }
1103 
1104  // added support for direct download goto links
1105  if ($a_additional && str_ends_with((string) $a_additional, "download")) {
1106  ilObjectGUI::_gotoRepositoryNode($a_target, "sendfile");
1107  }
1108 
1109  // static method, no workspace support yet
1110 
1111  if ($ilAccess->checkAccess("visible", "", $a_target)
1112  || $ilAccess->checkAccess("read", "", $a_target)) {
1113  ilObjectGUI::_gotoRepositoryNode($a_target, Capabilities::INFO_PAGE->value);
1114  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1115  $main_tpl->setOnScreenMessage(
1116  'failure',
1117  sprintf(
1118  $lng->txt("msg_no_perm_read_item"),
1120  ),
1121  true
1122  );
1124  }
1125 
1126  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1127  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _gotoRepositoryNode(int $ref_id, string $cmd="")
$ilErr
Definition: raiseError.php:17
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:25
static _gotoSharedWorkspaceNode(int $wsp_id)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLegacyFormToAccordion()

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

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

References ilObject2GUI\$tpl, ilAccordionGUI\addItem(), ilGlobalTemplateInterface\get(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getTitle(), ILIAS\Repository\lng(), ilPropertyFormGUI\setTitle(), and ilGlobalTemplateInterface\setVariable().

395  : void {
396  // abort if form-type is unknown
397  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
398  return;
399  }
400  $title = $form->getTitle();
401  $form->setTitle(''); // see https://mantis.ilias.de/view.php?id=37786
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(), $form->getHTML());
407  }
addItem(string $a_header, string $a_content, bool $a_force_open=false)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjFileGUI::addLocatorItems ( )
protected

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

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

1132  : void
1133  {
1134  global $DIC;
1135  $ilLocator = $DIC['ilLocator'];
1136 
1137  if (is_object($this->object)) {
1138  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
1139  }
1140  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ addUIFormToAccordion()

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

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

References ilObject2GUI\$tpl, ilAccordionGUI\addItem(), ilGlobalTemplateInterface\get(), ILIAS\UI\Component\Input\Container\Container\getInputs(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\ui().

374  : void {
375  // abort if form-type is unknown
376  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
377  return;
378  }
379 
380  $inputs = $form->getInputs();
381  // use label of first input as title, because UI Component forms don't support form-titles yet
382  $title = ($inputs === []) ?
383  '' : $inputs[array_key_first($inputs)]->getLabel();
384 
385  $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
386  $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
387 
388  $accordion->addItem($tpl->get(), $this->ui->renderer()->render($form));
389  }
addItem(string $a_header, string $a_content, bool $a_force_open=false)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
ILIAS UI Component Input Factory $inputs
getInputs()
Get the inputs contained in the container.
+ Here is the call graph for this function:

◆ buildInfoScreen()

ilObjFileGUI::buildInfoScreen ( bool  $kiosk_mode)

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

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

Referenced by infoScreenForward().

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

◆ edit()

ilObjFileGUI::edit ( )

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

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

621  : void
622  {
623  global $DIC;
624  $ilErr = $DIC['ilErr'];
625 
626  if (!$this->capabilities->get(Capabilities::EDIT_SETTINGS)->isUnlocked()) {
627  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"));
628  }
629 
630  $this->initSettingsTab();
631 
632  $form = $this->initPropertiesForm();
633 
634  // $ecs = new ilECSFileSettings($this->object);
635  // $ecs->addSettingsToForm($form, ilObjFile::OBJECT_TYPE); TODO: reintroduce usage of ECS file settings once they have been made compatible with the new ui components
636 
637  $this->tpl->setContent($this->renderer->render($form));
638  }
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ editExternal()

ilObjFileGUI::editExternal ( )
protected

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

References ILIAS\Repository\ctrl().

794  : void
795  {
796  $this->ctrl->redirectToURL(
797  (string) $this->capabilities->get(Capabilities::EDIT_EXTERNAL)->getUri()
798  );
799  }
+ Here is the call graph for this function:

◆ getCreationFormTitle()

ilObjFileGUI::getCreationFormTitle ( )
protected

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

References ILIAS\Repository\lng().

417  : string
418  {
419  return $this->lng->txt('upload_files');
420  }
+ Here is the call graph for this function:

◆ getCtrl()

ilObjFileGUI::getCtrl ( )
protected

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

References ilObject2GUI\$ctrl.

1157  : \ilCtrl
1158  {
1159  return $this->ctrl;
1160  }
Class ilCtrl provides processing control methods.

◆ getFileObj()

ilObjFileGUI::getFileObj ( )
protected
Exceptions
ilFileException

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

References $object.

1165  : ilObjFile
1166  {
1167  if (!$this->object instanceof ilObjFile) {
1168  throw new ilFileException("Error: object is not of type ilObjFile or doesn't exist");
1169  }
1170 
1171  return $this->object;
1172  }
Class ilObjFile.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getFileStakeholder()

ilObjFileGUI::getFileStakeholder ( )
protected

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

References $stakeholder.

1175  {
1176  return $this->stakeholder;
1177  }
Class ilObjFileStakeholder.
ResourceStakeholder $stakeholder

◆ getGeneralSettings()

ilObjFileGUI::getGeneralSettings ( )
protected

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

References $general_settings.

1179  : General
1180  {
1181  return $this->general_settings;
1182  }
General $general_settings

◆ getLanguage()

ilObjFileGUI::getLanguage ( )
protected

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

References $lng.

Referenced by initUploadForm().

1184  : \ilLanguage
1185  {
1186  return $this->lng;
1187  }
language handling
+ Here is the caller graph for this function:

◆ getNodeID()

ilObjFileGUI::getNodeID ( )
protected

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

References ilObject2GUI\$node_id.

1189  : int
1190  {
1191  return $this->node_id;
1192  }

◆ getParentId()

◆ getRefinery()

ilObjFileGUI::getRefinery ( )
protected

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

References $refinery.

1195  {
1196  return $this->refinery;
1197  }
Builds data types.
Definition: Factory.php:35
ILIAS Refinery Factory $refinery

◆ getType()

ilObjFileGUI::getType ( )

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

References ilObjFile\OBJECT_TYPE.

Referenced by initUploadForm().

162  : string
163  {
164  return ilObjFile::OBJECT_TYPE;
165  }
const OBJECT_TYPE
+ Here is the caller graph for this function:

◆ getUIFactory()

ilObjFileGUI::getUIFactory ( )
protected

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

References ILIAS\Repository\ui().

1200  {
1201  return $this->ui->factory();
1202  }
+ Here is the call graph for this function:

◆ getUser()

ilObjFileGUI::getUser ( )
protected

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

References ilObject2GUI\$user.

1204  : ilObjUser
1205  {
1206  return $this->user;
1207  }

◆ infoScreenForward()

ilObjFileGUI::infoScreenForward ( )

show information screen

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

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

Referenced by getParentId().

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

◆ initCreateForm()

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

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

References initUploadForm().

412  : Standard
413  {
414  return $this->initUploadForm();
415  }
This describes a standard form.
Definition: Standard.php:28
+ Here is the call graph for this function:

◆ initHeaderAction()

ilObjFileGUI::initHeaderAction ( ?string  $a_sub_type = null,
?int  $a_sub_id = null 
)
protected

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

References ILIAS\Repository\object().

1142  : ?\ilObjectListGUI
1143  {
1144  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1145  if ($lg instanceof ilObjectListGUI && $this->object->hasRating()) {
1146  $lg->enableRating(
1147  true,
1148  null,
1149  false,
1150  [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
1151  );
1152  }
1153 
1154  return $lg;
1155  }
+ Here is the call graph for this function:

◆ initPropertiesForm()

ilObjFileGUI::initPropertiesForm ( )
protected

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

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

Referenced by edit(), and putObjectInTree().

640  : Standard
641  {
642  $title_and_description = $this->object->getObjectProperties()->getPropertyTitleAndDescription()->toForm(
643  $this->lng,
644  $this->ui->factory()->input()->field(),
646  );
647 
648  $important_info = $this->inputs->field()->markdown(
650  $this->lng->txt('important_info'),
651  $this->lng->txt('important_info_byline')
652  )->withValue(
653  $this->object->getImportantInfo() ?? ""
654  );
655 
656  $on_click_action = $this->inputs->field()->radio(
657  $this->lng->txt('on_click_action')
658  )->withOption(
660  $this->lng->txt('file_action_download'),
661  $this->lng->txt('file_action_download_info'),
662  )->withOption(
664  $this->lng->txt('file_action_show'),
665  $this->lng->txt('file_action_show_info'),
666  )->withValue(
667  (string) $this->object->getOnClickMode()
668  );
669 
670  $input_groups = array_filter([
671  "title_and_description" => $title_and_description,
672  "important_info" => $important_info,
673  "on_click_action" => $on_click_action
674  ], static fn($input): bool => null !== $input);
675 
676  $file_info_section = $this->inputs->field()->section(
677  $input_groups,
678  $this->lng->txt('file_info')
679  );
680 
681  $online_status = $this->object->getObjectProperties()->getPropertyIsOnline()->toForm(
682  $this->lng,
683  $this->ui->factory()->input()->field(),
685  );
686  $availability_section = $this->inputs->field()->section(
687  ["online_status" => $online_status],
688  $this->lng->txt('rep_activation_availability')
689  );
690 
691  $presentation_section = null;
692  if ($this->id_type === self::REPOSITORY_NODE_ID) {
693  $tile_image = $this->object->getObjectProperties()->getPropertyTileImage()->toForm(
694  $this->lng,
695  $this->ui->factory()->input()->field(),
697  );
698  $presentation_section = $this->inputs->field()->section(
699  ["tile_image" => $tile_image],
700  $this->lng->txt('settings_presentation_header')
701  );
702  }
703 
704  $additional_features_section = null;
705  if ($this->id_type === self::REPOSITORY_NODE_ID) {
706  $this->lng->loadLanguageModule('rating');
707 
708  $enable_rating = $this->inputs->field()->checkbox(
709  $this->lng->txt('rating_activate_rating'),
710  $this->lng->txt('rating_activate_rating_info')
711  )->withValue(
712  $this->object->hasRating()
713  );
714  $additional_features_section = $this->inputs->field()->section(
715  ["rating" => $enable_rating],
716  $this->lng->txt('obj_features')
717  );
718  }
719 
720  $inputs = array_filter([
721  "file_info" => $file_info_section,
722  "availability" => $availability_section,
723  "presentation" => $presentation_section,
724  "obj_features" => $additional_features_section
725  ], static fn($input): bool => null !== $input);
726 
727  return $this->inputs->container()->form()->standard(
728  $this->ctrl->getLinkTargetByClass(self::class, 'update'),
729  $inputs
730  );
731  }
const CLICK_MODE_DOWNLOAD
ILIAS UI Component Input Factory $inputs
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
This describes a standard form.
Definition: Standard.php:28
ILIAS Refinery Factory $refinery
const CLICK_MODE_INFOPAGE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsTab()

ilObjFileGUI::initSettingsTab ( )
protected

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

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

Referenced by edit(), and getParentId().

1072  : void
1073  {
1074  $this->tabs_gui->activateTab("settings");
1075  // add subtab for common settings
1076  $this->tabs_gui->addSubTab(
1077  'file_settings',
1078  $this->lng->txt('settings'),
1079  $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT)
1080  );
1081  if (in_array('file', ilAdvancedMDRecord::_getActivatedObjTypes(), true)) {
1082  $this->tabs_gui->addSubTab(
1083  'service_settings',
1084  $this->lng->txt('service_settings'),
1085  $this->ctrl->getLinkTargetByClass(ilFileCommonSettingsGUI::class, ilFileCommonSettingsGUI::CMD_EDIT)
1086  );
1087  }
1088 
1089  $this->tabs_gui->activateSubTab("file_settings");
1090  }
static _getActivatedObjTypes()
get activated obj types
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initUploadForm()

ilObjFileGUI::initUploadForm ( )

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

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

Referenced by initCreateForm(), and uploadFiles().

422  : Standard
423  {
424  $this->getLanguage()->loadLanguageModule('file');
425  $inputs = [];
426 
427  $this->ctrl->setParameterByClass(self::class, 'new_type', $this->getType());
428  $this->ctrl->setParameterByClass(
429  self::class,
430  self::PARAM_UPLOAD_ORIGIN,
431  self::UPLOAD_ORIGIN_STANDARD
432  );
433 
434  // add file input
435  $size = new DataSize(
436  $this->upload_limit->getBestPossibleUploadLimitInBytes($this->upload_handler),
437  DataSize::MB
438  );
439 
440  $inputs[self::PARAM_FILES] = $this->ui->factory()->input()->field()->file(
441  $this->upload_handler,
442  $this->lng->txt('upload_files'),
443  sprintf(
444  $this->lng->txt('upload_files_limit'),
445  (string) $size
446  ),
447  $this->ui->factory()->input()->field()->group([
448  self::PARAM_TITLE => $this->ui->factory()->input()->field()->text(
449  $this->lng->txt('title')
451  $this->getEmptyStringToNullTransformation()
452  ),
453  self::PARAM_DESCRIPTION => $this->ui->factory()->input()->field()->textarea(
454  $this->lng->txt('description')
456  $this->getEmptyStringToNullTransformation()
457  ),
458  ])
459  )->withMaxFiles(
460  self::UPLOAD_MAX_FILES
461  )->withRequired(true);
462 
463  if ($this->lom_services->copyrightHelper()->isCopyrightSelectionActive()) {
464  $inputs[self::PARAM_COPYRIGHT_ID] = $this->getCopyrightSelectionInput('set_license_for_all_files');
465  }
466 
467  return $this->ui->factory()->input()->container()->form()->standard(
468  $this->ctrl->getFormActionByClass(self::class, self::CMD_UPLOAD_FILES),
469  $inputs
470  )->withSubmitLabel($this->lng->txt('upload_files'));
471  }
This class provides the data size with additional information to remove the work to calculate the siz...
Definition: DataSize.php:30
ILIAS UI Component Input Factory $inputs
This describes a standard form.
Definition: Standard.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ putObjectInTree()

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

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

References ilObjectGUI\$data, $DIC, $filename, ilObject2GUI\$node_id, ilChangeEvent\_catchupWriteEvents(), ilChangeEvent\_recordWriteEvent(), ILIAS\Repository\ctrl(), initPropertiesForm(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilObject2GUI\update().

554  : void
555  {
556  // this is needed to support multi fileuploads in personal and shared resources
557  $backup_node_id = $this->node_id;
558  parent::putObjectInTree($obj, $parent_node_id);
559  $this->node_id = $backup_node_id;
560  }
+ Here is the call graph for this function:

◆ sendFile()

ilObjFileGUI::sendFile ( )

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

References Vendor\Package\$e, ilChangeEvent\_recordReadEvent(), ANONYMOUS_USER_ID, ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), updateLearningProgress(), and ILIAS\Repository\user().

733  : bool
734  {
735  $hist_entry_id = $this->http->query()->has('hist_id')
736  ? $this->http->query()->retrieve('hist_id', $this->refinery->kindlyTo()->int())
737  : null;
738  try {
739  if (ANONYMOUS_USER_ID === $this->user->getId() && $this->http->query()->has('transaction')) {
740  $this->object->sendFile($hist_entry_id);
741  }
742 
743  if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
744  // Record read event and catchup with write events
746  $this->object->getType(),
747  $this->object->getRefId(),
748  $this->object->getId(),
749  $this->user->getId()
750  );
751  $this->updateLearningProgress();
752 
753  $this->object->sendFile($hist_entry_id);
754  } else {
755  $this->error->raiseError($this->lng->txt("permission_denied"), $this->error->MESSAGE);
756  }
757  } catch (FileNotFoundException $e) {
758  $this->error->raiseError($e->getMessage(), $this->error->MESSAGE);
759  }
760 
761  return true;
762  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static http()
Fetches the global http state from ILIAS.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
Indicates that a file is missing or not found.
+ Here is the call graph for this function:

◆ setTabs()

ilObjFileGUI::setTabs ( )
protected

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

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

998  : void
999  {
1000  global $DIC;
1001  $ilHelp = $DIC['ilHelp'];
1002  $ilHelp->setScreenIdComponent(ilObjFile::OBJECT_TYPE);
1003 
1004  $this->ctrl->setParameter($this, "ref_id", $this->node_id);
1005 
1006  if (($c = $this->capabilities->get(Capabilities::VIEW_EXTERNAL)) && $c->isUnlocked()) {
1007  $this->tabs_gui->addTab(
1008  "content",
1009  $this->lng->txt("content"),
1010  $c->getURI()
1011  );
1012  }
1013 
1014  if (($c = $this->capabilities->get(Capabilities::MANAGE_VERSIONS)) && $c->isUnlocked()) {
1015  $this->tabs_gui->addTab(
1016  "id_versions",
1017  $this->lng->txt(self::CMD_VERSIONS),
1018  $this->ctrl->getLinkTargetByClass(ilFileVersionsGUI::class, ilFileVersionsGUI::CMD_DEFAULT)
1019  );
1020  }
1021 
1022  if (($c = $this->capabilities->get(Capabilities::INFO_PAGE)) && $c->isUnlocked()) {
1023  $this->tabs_gui->addTab(
1024  "id_info",
1025  $this->lng->txt("info_short"),
1026  $this->ctrl->getLinkTargetByClass(["ilobjfilegui", "ilinfoscreengui"], "showSummary")
1027  );
1028  }
1029 
1030  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1031  $this->tabs_gui->addTab(
1032  "settings",
1033  $this->lng->txt("settings"),
1034  $this->ctrl->getLinkTarget($this, self::CMD_EDIT)
1035  );
1036  }
1037 
1038  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1039  $this->tabs_gui->addTab(
1040  'learning_progress',
1041  $this->lng->txt('learning_progress'),
1042  $this->ctrl->getLinkTargetByClass([self::class, 'illearningprogressgui'], '')
1043  );
1044  }
1045 
1046  // meta data
1047  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1048  $mdgui = new ilObjectMetaDataGUI($this->object, null, null, $this->call_by_reference);
1049  $mdtab = $mdgui->getTab();
1050  if ($mdtab) {
1051  $this->tabs_gui->addTab(
1052  "id_meta",
1053  $this->lng->txt("meta_data"),
1054  $mdtab
1055  );
1056  }
1057  }
1058 
1059  // export
1060  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1061  $this->tabs_gui->addTab(
1062  "export",
1063  $this->lng->txt("export"),
1064  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1065  );
1066  }
1067 
1068  // will add permission tab if needed
1069  parent::setTabs();
1070  }
Class ilObjectMetaDataGUI.
const OBJECT_TYPE
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
$c
Definition: deliver.php:9
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ showSummary()

ilObjFileGUI::showSummary ( )
Deprecated:
PROXY COMMAND

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

References ILIAS\Repository\ctrl().

767  : void
768  {
769  $this->ctrl->redirectToURL(
770  (string) $this->capabilities->get(Capabilities::INFO_PAGE)->getUri()
771  );
772  }
+ Here is the call graph for this function:

◆ showSummaryForced()

ilObjFileGUI::showSummaryForced ( )

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

References ILIAS\Repository\ctrl().

773  : void
774  {
775  $this->ctrl->redirectToURL(
776  (string) $this->capabilities->get(Capabilities::FORCED_INFO_PAGE)->getUri()
777  );
778  }
+ Here is the call graph for this function:

◆ toggleLearningProgress()

ilObjFileGUI::toggleLearningProgress ( )
protected

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

References ilObjectGUI\$obj_id, ilObjectGUI\$ref_id, ilLPStatus\_hasUserCompleted(), ilLearningProgress\_tracProgress(), ilLPStatusWrapper\_updateStatus(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilLPMarks\setCompleted(), and ILIAS\Repository\user().

854  : void
855  {
857  $this->user->getId(),
860  'file'
861  );
862 
863  $lp_marks = new ilLPMarks($this->obj_id, $this->user->getId());
864  $lp_marks->setCompleted(!ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId()));
865  $lp_marks->update();
866 
867  ilLPStatusWrapper::_updateStatus($this->obj_id, $this->user->getId());
868 
869  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
870  $this->ctrl->redirect($this, Capabilities::INFO_PAGE->value);
871  }
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
static _tracProgress(int $a_user_id, int $a_obj_id, int $a_ref_id, string $a_obj_type='')
setCompleted(bool $a_status)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:

◆ unzipCurrentRevision()

ilObjFileGUI::unzipCurrentRevision ( )

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

References ILIAS\Repository\ctrl().

787  : void
788  {
789  $this->ctrl->redirectToURL(
790  (string) $this->capabilities->get(Capabilities::UNZIP)->getUri()
791  );
792  }
+ Here is the call graph for this function:

◆ updateLearningProgress()

ilObjFileGUI::updateLearningProgress ( )
protected

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

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

Referenced by getParentId(), and sendFile().

149  : void
150  {
151  if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_CONTENT_VISITED) {
153  $this->object->getId(),
154  $this->user->getId(),
155  null,
156  false,
157  true
158  );
159  }
160  }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ 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 476 of file class.ilObjFileGUI.php.

References ilObjectGUI\$data, ILIAS\Repository\ctrl(), ilObjectGUI\getCreationFormsHTML(), ILIAS\FileDelivery\http(), initUploadForm(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\ui().

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

◆ versions()

ilObjFileGUI::versions ( )

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

References ILIAS\Repository\ctrl().

780  : void
781  {
782  $this->ctrl->redirectToURL(
783  (string) $this->capabilities->get(Capabilities::MANAGE_VERSIONS)->getUri()
784  );
785  }
+ Here is the call graph for this function:

◆ viewExternal()

ilObjFileGUI::viewExternal ( )
protected

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

References ILIAS\Repository\ctrl().

800  : void
801  {
802  $this->ctrl->redirectToURL(
803  (string) $this->capabilities->get(Capabilities::VIEW_EXTERNAL)->getUri()
804  );
805  }
+ Here is the call graph for this function:

Field Documentation

◆ $action_repo

ActionDBRepository ilObjFileGUI::$action_repo
private

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

◆ $capabilities

CapabilityCollection ilObjFileGUI::$capabilities
private

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

◆ $data_factory

Factory ilObjFileGUI::$data_factory
protected

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

◆ $file_service_settings

ilFileServicesSettings ilObjFileGUI::$file_service_settings
protected

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

◆ $general_settings

General ilObjFileGUI::$general_settings
protected

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

Referenced by getGeneralSettings().

◆ $http

WrapperFactory ilObjFileGUI::$http
protected

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

◆ $icon_repo

IconDatabaseRepository ilObjFileGUI::$icon_repo
protected

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

◆ $inputs

ILIAS UI Component Input Factory ilObjFileGUI::$inputs
protected

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

Referenced by initPropertiesForm(), and initUploadForm().

◆ $lng

ilLanguage ilObjFileGUI::$lng

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

Referenced by getLanguage().

◆ $log

ilLogger ilObjFileGUI::$log = null
protected

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

◆ $lom_services

LOMServices ilObjFileGUI::$lom_services
protected

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

◆ $obj_service

ilObjectService ilObjFileGUI::$obj_service
protected

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

◆ $object

ilObjFile null ilObjFileGUI::$object = null

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

Referenced by getFileObj(), and getParentId().

◆ $refinery

ILIAS Refinery Factory ilObjFileGUI::$refinery
protected

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

Referenced by getRefinery(), and initPropertiesForm().

◆ $renderer

Renderer ilObjFileGUI::$renderer
protected

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

◆ $request

ServerRequestInterface ilObjFileGUI::$request
protected

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

◆ $stakeholder

ResourceStakeholder ilObjFileGUI::$stakeholder
protected

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

Referenced by getFileStakeholder().

◆ $storage

Services ilObjFileGUI::$storage
protected

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

◆ $ui

UIServices ilObjFileGUI::$ui
protected

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

◆ $upload_handler

UploadHandler ilObjFileGUI::$upload_handler
protected

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

◆ $upload_limit

UploadLimitResolver ilObjFileGUI::$upload_limit
private

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

◆ CMD_EDIT

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

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

◆ CMD_SEND_FILE

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

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

◆ CMD_UPLOAD_FILES

const ilObjFileGUI::CMD_UPLOAD_FILES = "uploadFiles"

◆ CMD_VERSIONS

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

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

◆ PARAM_COPYRIGHT_ID

const ilObjFileGUI::PARAM_COPYRIGHT_ID = "copyright_id"

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

◆ PARAM_DESCRIPTION

const ilObjFileGUI::PARAM_DESCRIPTION = 'description'

◆ PARAM_FILES

const ilObjFileGUI::PARAM_FILES = 'files'

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

◆ PARAM_TITLE

const ilObjFileGUI::PARAM_TITLE = 'title'

◆ PARAM_UPLOAD_ORIGIN

const ilObjFileGUI::PARAM_UPLOAD_ORIGIN = 'origin'

◆ UPLOAD_MAX_FILES

const ilObjFileGUI::UPLOAD_MAX_FILES = 100

◆ UPLOAD_ORIGIN_DROPZONE

const ilObjFileGUI::UPLOAD_ORIGIN_DROPZONE = 'dropzone'

◆ UPLOAD_ORIGIN_STANDARD

const ilObjFileGUI::UPLOAD_ORIGIN_STANDARD = 'standard'

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


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