ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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
 
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 100 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(), renderer(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

101  {
102  global $DIC;
103  $this->http = $DIC->http()->wrapper();
104  $this->request = $DIC->http()->request();
105  $this->refinery = $DIC->refinery();
106  $this->file_service_settings = $DIC->fileServiceSettings();
107  $this->user = $DIC->user();
108  $this->lng = $DIC->language();
110  $this->ui = $DIC->ui();
111  $this->storage = $DIC->resourceStorage();
112  $this->upload_handler = new ilObjFileUploadHandlerGUI();
113  $this->stakeholder = new ilObjFileStakeholder();
114  $this->general_settings = new General();
115  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
116  $this->obj_service = $DIC->object();
117  $this->lng->loadLanguageModule(ilObjFile::OBJECT_TYPE);
118  $this->icon_repo = new IconDatabaseRepository();
119  $this->inputs = $DIC->ui()->factory()->input();
120  $this->renderer = $DIC->ui()->renderer();
121  $this->request = $DIC->http()->request();
122  $this->data_factory = new Factory();
123  $this->action_repo = new ActionDBRepository($DIC->database());
124  $this->lom_services = $DIC->learningObjectMetadata();
125 
126  $capability_builder = new CapabilityBuilder(
128  $this->access,
129  $this->ctrl,
130  $this->action_repo,
131  $DIC->http(),
132  $DIC['static_url.uri_builder']
133  );
134 
135  $capability_context = new Context(
136  $this->object_id,
137  $this->ref_id,
138  ($a_id_type === self::WORKSPACE_NODE_ID) ? Context::CONTEXT_WORKSPACE : Context::CONTEXT_REPO
139  );
140 
141  $this->capabilities = $capability_builder->get($capability_context);
142  }
Class ilObjFileStakeholder.
static getLogger(string $a_component_id)
Get component logger.
renderer()
const OBJECT_TYPE
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
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 1076 of file class.ilObjFileGUI.php.

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

1076  : void
1077  {
1078  global $DIC;
1079  $main_tpl = $DIC->ui()->mainTemplate();
1080  $ilErr = $DIC['ilErr'];
1081  $lng = $DIC['lng'];
1082  $ilAccess = $DIC['ilAccess'];
1083 
1084  if ($a_additional && str_ends_with((string) $a_additional, "wsp")) {
1085  ilObjectGUI::_gotoSharedWorkspaceNode((int) $a_target);
1086  }
1087 
1088  // added support for direct download goto links
1089  if ($a_additional && str_ends_with((string) $a_additional, "download")) {
1090  ilObjectGUI::_gotoRepositoryNode($a_target, "sendfile");
1091  }
1092 
1093  // static method, no workspace support yet
1094 
1095  if ($ilAccess->checkAccess("visible", "", $a_target)
1096  || $ilAccess->checkAccess("read", "", $a_target)) {
1097  ilObjectGUI::_gotoRepositoryNode($a_target, Capabilities::INFO_PAGE->value);
1098  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1099  $main_tpl->setOnScreenMessage(
1100  'failure',
1101  sprintf(
1102  $lng->txt("msg_no_perm_read_item"),
1104  ),
1105  true
1106  );
1108  }
1109 
1110  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1111  }
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:33
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
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 378 of file class.ilObjFileGUI.php.

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

382  : void {
383  // abort if form-type is unknown
384  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
385  return;
386  }
387  $title = $form->getTitle();
388  $form->setTitle(''); // see https://mantis.ilias.de/view.php?id=37786
389 
390  $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
391  $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
392 
393  $accordion->addItem($tpl->get(), $form->getHTML());
394  }
addItem(string $a_header, string $a_content, bool $a_force_open=false)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjFileGUI::addLocatorItems ( )
protected

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

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

1116  : void
1117  {
1118  global $DIC;
1119  $ilLocator = $DIC['ilLocator'];
1120 
1121  if (is_object($this->object)) {
1122  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
1123  }
1124  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ addUIFormToAccordion()

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

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

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

361  : void {
362  // abort if form-type is unknown
363  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
364  return;
365  }
366 
367  $inputs = $form->getInputs();
368  // use label of first input as title, because UI Component forms don't support form-titles yet
369  $title = ($inputs === []) ?
370  '' : $inputs[array_key_first($inputs)]->getLabel();
371 
372  $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
373  $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
374 
375  $accordion->addItem($tpl->get(), $this->ui->renderer()->render($form));
376  }
addItem(string $a_header, string $a_content, bool $a_force_open=false)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
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 856 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, null, ILIAS\Repository\object(), renderer(), and ILIAS\Repository\ui().

Referenced by infoScreenForward().

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

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

604  : void
605  {
606  global $DIC;
607  $ilErr = $DIC['ilErr'];
608 
609  if (!$this->capabilities->get(Capabilities::EDIT_SETTINGS)->isUnlocked()) {
610  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"));
611  }
612 
613  $this->initSettingsTab();
614 
615  $form = $this->initPropertiesForm();
616 
617  // $ecs = new ilECSFileSettings($this->object);
618  // $ecs->addSettingsToForm($form, ilObjFile::OBJECT_TYPE); TODO: reintroduce usage of ECS file settings once they have been made compatible with the new ui components
619 
620  $this->tpl->setContent($this->renderer->render($form));
621  }
renderer()
$ilErr
Definition: raiseError.php:33
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ editExternal()

ilObjFileGUI::editExternal ( )
protected

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

References ILIAS\Repository\ctrl().

777  : void
778  {
779  $this->ctrl->redirectToURL(
780  (string) $this->capabilities->get(Capabilities::EDIT_EXTERNAL)->getUri()
781  );
782  }
+ Here is the call graph for this function:

◆ getCreationFormTitle()

ilObjFileGUI::getCreationFormTitle ( )
protected

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

References ILIAS\Repository\lng().

406  : string
407  {
408  return $this->lng->txt('upload_files');
409  }
+ Here is the call graph for this function:

◆ getCtrl()

ilObjFileGUI::getCtrl ( )
protected

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

References ilObject2GUI\$ctrl.

1142  : \ilCtrl
1143  {
1144  return $this->ctrl;
1145  }
Class ilCtrl provides processing control methods.

◆ getFileObj()

ilObjFileGUI::getFileObj ( )
protected
Exceptions
ilFileException

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

References $object.

1150  : ilObjFile
1151  {
1152  if (!$this->object instanceof ilObjFile) {
1153  throw new ilFileException("Error: object is not of type ilObjFile or doesn't exist");
1154  }
1155 
1156  return $this->object;
1157  }
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 1159 of file class.ilObjFileGUI.php.

References $stakeholder.

1160  {
1161  return $this->stakeholder;
1162  }
Class ilObjFileStakeholder.
ResourceStakeholder $stakeholder

◆ getGeneralSettings()

ilObjFileGUI::getGeneralSettings ( )
protected

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

References $general_settings.

1164  : General
1165  {
1166  return $this->general_settings;
1167  }
General $general_settings

◆ getLanguage()

ilObjFileGUI::getLanguage ( )
protected

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

References $lng.

Referenced by initUploadForm().

1169  : \ilLanguage
1170  {
1171  return $this->lng;
1172  }
language handling
+ Here is the caller graph for this function:

◆ getNodeID()

ilObjFileGUI::getNodeID ( )
protected

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

References ilObject2GUI\$node_id.

1174  : int
1175  {
1176  return $this->node_id;
1177  }

◆ getParentId()

◆ getRefinery()

ilObjFileGUI::getRefinery ( )
protected

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

References $refinery.

1180  {
1181  return $this->refinery;
1182  }
Builds data types.
Definition: Factory.php:35
ILIAS Refinery Factory $refinery

◆ getType()

ilObjFileGUI::getType ( )

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

References ilObjFile\OBJECT_TYPE.

Referenced by initUploadForm().

157  : string
158  {
159  return ilObjFile::OBJECT_TYPE;
160  }
const OBJECT_TYPE
+ Here is the caller graph for this function:

◆ getUIFactory()

ilObjFileGUI::getUIFactory ( )
protected

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

References ILIAS\Repository\ui().

1185  {
1186  return $this->ui->factory();
1187  }
+ Here is the call graph for this function:

◆ getUser()

ilObjFileGUI::getUser ( )
protected

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

References ilObject2GUI\$user.

1189  : ilObjUser
1190  {
1191  return $this->user;
1192  }

◆ infoScreenForward()

ilObjFileGUI::infoScreenForward ( )

show information screen

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

793  : void
794  {
795  $this->tabs_gui->activateTab("id_info");
796 
797  if (!$this->capabilities->get(Capabilities::INFO_PAGE)->isUnlocked()) {
798  $GLOBALS['DIC']['ilErr']->raiseError(
799  $this->lng->txt("msg_no_perm_read"),
800  2
801  ); // TODO remove magic number and old ilErr call
802  }
803 
804  // add set completed button, if LP mode is active
805  if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_MANUAL) {
806  if (ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId())) {
807  $label = $this->lng->txt('file_btn_lp_toggle_state_completed');
808  } else {
809  $label = $this->lng->txt('file_btn_lp_toggle_state_not_completed');
810  }
811  $this->toolbar->addComponent(
812  $this->ui->factory()->button()->standard(
813  $label,
814  $this->ctrl->getLinkTarget($this, 'toggleLearningProgress')
815  )
816  );
817  }
818 
819  // Add WOPI editor Button
820  if ($this->capabilities->get(Capabilities::EDIT_EXTERNAL)->isUnlocked()) {
821  $external_editor = $this->ui->factory()
822  ->button()
823  ->standard(
824  $this->lng->txt('open_external_editor'),
825  $this->ctrl->getLinkTargetByClass(
826  \ilWOPIEmbeddedApplicationGUI::class,
828  )
829  );
830  $this->toolbar->addComponent($external_editor);
831  }
832 
833  $info = $this->buildInfoScreen(false);
834  $this->ctrl->forwardCommand($info);
835  }
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
$GLOBALS["DIC"]
Definition: wac.php:53
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 400 of file class.ilObjFileGUI.php.

References initUploadForm().

400  : Standard
401  {
402  return $this->initUploadForm();
403  }
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 1127 of file class.ilObjFileGUI.php.

References null, and ILIAS\Repository\object().

1127  : ?\ilObjectListGUI
1128  {
1129  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1130  if ($lg instanceof ilObjectListGUI && $this->object->hasRating()) {
1131  $lg->enableRating(
1132  true,
1133  null,
1134  false,
1135  [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
1136  );
1137  }
1138 
1139  return $lg;
1140  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ initPropertiesForm()

ilObjFileGUI::initPropertiesForm ( )
protected

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

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

Referenced by edit(), and putObjectInTree().

623  : Standard
624  {
625  $title_and_description = $this->object->getObjectProperties()->getPropertyTitleAndDescription()->toForm(
626  $this->lng,
627  $this->ui->factory()->input()->field(),
629  );
630 
631  $important_info = $this->inputs->field()->markdown(
633  $this->lng->txt('important_info'),
634  $this->lng->txt('important_info_byline')
635  )->withValue(
636  $this->object->getImportantInfo() ?? ""
637  );
638 
639  $on_click_action = $this->inputs->field()->radio(
640  $this->lng->txt('on_click_action')
641  )->withOption(
643  $this->lng->txt('file_action_download'),
644  $this->lng->txt('file_action_download_info'),
645  )->withOption(
647  $this->lng->txt('file_action_show'),
648  $this->lng->txt('file_action_show_info'),
649  )->withValue(
650  (string) $this->object->getOnClickMode()
651  );
652 
653  $input_groups = array_filter([
654  "title_and_description" => $title_and_description,
655  "important_info" => $important_info,
656  "on_click_action" => $on_click_action
657  ], static fn($input): bool => null !== $input);
658 
659  $file_info_section = $this->inputs->field()->section(
660  $input_groups,
661  $this->lng->txt('file_info')
662  );
663 
664  $online_status = $this->object->getObjectProperties()->getPropertyIsOnline()->toForm(
665  $this->lng,
666  $this->ui->factory()->input()->field(),
668  );
669  $availability_section = $this->inputs->field()->section(
670  ["online_status" => $online_status],
671  $this->lng->txt('rep_activation_availability')
672  );
673 
674  $presentation_section = null;
675  if ($this->id_type === self::REPOSITORY_NODE_ID) {
676  $tile_image = $this->object->getObjectProperties()->getPropertyTileImage()->toForm(
677  $this->lng,
678  $this->ui->factory()->input()->field(),
680  );
681  $presentation_section = $this->inputs->field()->section(
682  ["tile_image" => $tile_image],
683  $this->lng->txt('settings_presentation_header')
684  );
685  }
686 
687  $additional_features_section = null;
688  if ($this->id_type === self::REPOSITORY_NODE_ID) {
689  $this->lng->loadLanguageModule('rating');
690 
691  $enable_rating = $this->inputs->field()->checkbox(
692  $this->lng->txt('rating_activate_rating'),
693  $this->lng->txt('rating_activate_rating_info')
694  )->withValue(
695  $this->object->hasRating()
696  );
697  $additional_features_section = $this->inputs->field()->section(
698  ["rating" => $enable_rating],
699  $this->lng->txt('obj_features')
700  );
701  }
702 
703  $inputs = array_filter([
704  "file_info" => $file_info_section,
705  "availability" => $availability_section,
706  "presentation" => $presentation_section,
707  "obj_features" => $additional_features_section
708  ], static fn($input): bool => null !== $input);
709 
710  return $this->inputs->container()->form()->standard(
711  $this->ctrl->getLinkTargetByClass(self::class, 'update'),
712  $inputs
713  );
714  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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:61
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 1056 of file class.ilObjFileGUI.php.

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

Referenced by edit(), and getParentId().

1056  : void
1057  {
1058  $this->tabs_gui->activateTab("settings");
1059  // add subtab for common settings
1060  $this->tabs_gui->addSubTab(
1061  'file_settings',
1062  $this->lng->txt('settings'),
1063  $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT)
1064  );
1065  if (in_array('file', ilAdvancedMDRecord::_getActivatedObjTypes(), true)) {
1066  $this->tabs_gui->addSubTab(
1067  'service_settings',
1068  $this->lng->txt('service_settings'),
1069  $this->ctrl->getLinkTargetByClass(ilFileCommonSettingsGUI::class, ilFileCommonSettingsGUI::CMD_EDIT)
1070  );
1071  }
1072 
1073  $this->tabs_gui->activateSubTab("file_settings");
1074  }
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 411 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().

411  : Standard
412  {
413  $this->getLanguage()->loadLanguageModule('file');
414  $inputs = [];
415 
416  $this->ctrl->setParameterByClass(self::class, 'new_type', $this->getType());
417  $this->ctrl->setParameterByClass(
418  self::class,
419  self::PARAM_UPLOAD_ORIGIN,
420  self::UPLOAD_ORIGIN_STANDARD
421  );
422 
423 
424  $inputs[self::PARAM_FILES] = $this->ui->factory()->input()->field()->file(
425  $this->upload_handler,
426  $this->lng->txt('upload_files'),
427  $this->ui->factory()->input()->field()->group([
428  self::PARAM_TITLE => $this->ui->factory()->input()->field()->text(
429  $this->lng->txt('title')
431  $this->getEmptyStringToNullTransformation()
432  ),
433  self::PARAM_DESCRIPTION => $this->ui->factory()->input()->field()->textarea(
434  $this->lng->txt('description')
436  $this->getEmptyStringToNullTransformation()
437  ),
438  ])
439  )->withMaxFiles(
440  self::UPLOAD_MAX_FILES
441  )->withRequired(true);
442 
443  if ($this->lom_services->copyrightHelper()->isCopyrightSelectionActive()) {
444  $inputs[self::PARAM_COPYRIGHT_ID] = $this->getCopyrightSelectionInput('set_license_for_all_files');
445  }
446 
447  return $this->ui->factory()->input()->container()->form()->standard(
448  $this->ctrl->getFormActionByClass(self::class, self::CMD_UPLOAD_FILES),
449  $inputs
450  )->withSubmitLabel($this->lng->txt('upload_files'));
451  }
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 535 of file class.ilObjFileGUI.php.

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

535  : void
536  {
537  // this is needed to support multi fileuploads in personal and shared resources
538  $backup_node_id = $this->node_id;
539  parent::putObjectInTree($obj, $parent_node_id);
540  $this->node_id = $backup_node_id;
541  }
+ Here is the call graph for this function:

◆ sendFile()

ilObjFileGUI::sendFile ( )

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

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

716  : bool
717  {
718  $hist_entry_id = $this->http->query()->has('hist_id')
719  ? $this->http->query()->retrieve('hist_id', $this->refinery->kindlyTo()->int())
720  : null;
721  try {
722  if (ANONYMOUS_USER_ID === $this->user->getId() && $this->http->query()->has('transaction')) {
723  $this->object->sendFile($hist_entry_id);
724  }
725 
726  if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
727  // Record read event and catchup with write events
729  $this->object->getType(),
730  $this->object->getRefId(),
731  $this->object->getId(),
732  $this->user->getId()
733  );
734  $this->updateLearningProgress();
735 
736  $this->object->sendFile($hist_entry_id);
737  } else {
738  $this->error->raiseError($this->lng->txt("permission_denied"), $this->error->MESSAGE);
739  }
740  } catch (FileNotFoundException $e) {
741  $this->error->raiseError($e->getMessage(), $this->error->MESSAGE);
742  }
743 
744  return true;
745  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 982 of file class.ilObjFileGUI.php.

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

982  : void
983  {
984  global $DIC;
985  $ilHelp = $DIC['ilHelp'];
986  $ilHelp->setScreenIdComponent(ilObjFile::OBJECT_TYPE);
987 
988  $this->ctrl->setParameter($this, "ref_id", $this->node_id);
989 
990  if (($c = $this->capabilities->get(Capabilities::VIEW_EXTERNAL)) && $c->isUnlocked()) {
991  $this->tabs_gui->addTab(
992  "content",
993  $this->lng->txt("content"),
994  $c->getURI()
995  );
996  }
997 
998  if (($c = $this->capabilities->get(Capabilities::MANAGE_VERSIONS)) && $c->isUnlocked()) {
999  $this->tabs_gui->addTab(
1000  "id_versions",
1001  $this->lng->txt(self::CMD_VERSIONS),
1002  $this->ctrl->getLinkTargetByClass(ilFileVersionsGUI::class, ilFileVersionsGUI::CMD_DEFAULT)
1003  );
1004  }
1005 
1006  if (($c = $this->capabilities->get(Capabilities::INFO_PAGE)) && $c->isUnlocked()) {
1007  $this->tabs_gui->addTab(
1008  "id_info",
1009  $this->lng->txt("info_short"),
1010  $this->ctrl->getLinkTargetByClass(["ilobjfilegui", "ilinfoscreengui"], "showSummary")
1011  );
1012  }
1013 
1014  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1015  $this->tabs_gui->addTab(
1016  "settings",
1017  $this->lng->txt("settings"),
1018  $this->ctrl->getLinkTarget($this, self::CMD_EDIT)
1019  );
1020  }
1021 
1022  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1023  $this->tabs_gui->addTab(
1024  'learning_progress',
1025  $this->lng->txt('learning_progress'),
1026  $this->ctrl->getLinkTargetByClass([self::class, 'illearningprogressgui'], '')
1027  );
1028  }
1029 
1030  // meta data
1031  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1032  $mdgui = new ilObjectMetaDataGUI($this->object, null, null, $this->call_by_reference);
1033  $mdtab = $mdgui->getTab();
1034  if ($mdtab) {
1035  $this->tabs_gui->addTab(
1036  "id_meta",
1037  $this->lng->txt("meta_data"),
1038  $mdtab
1039  );
1040  }
1041  }
1042 
1043  // export
1044  if (($c = $this->capabilities->get(Capabilities::EDIT_SETTINGS)) && $c->isUnlocked()) {
1045  $this->tabs_gui->addTab(
1046  "export",
1047  $this->lng->txt("export"),
1048  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1049  );
1050  }
1051 
1052  // will add permission tab if needed
1053  parent::setTabs();
1054  }
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:25
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ showSummary()

ilObjFileGUI::showSummary ( )
Deprecated:
PROXY COMMAND

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

References ILIAS\Repository\ctrl().

750  : void
751  {
752  $this->ctrl->redirectToURL(
753  (string) $this->capabilities->get(Capabilities::INFO_PAGE)->getUri()
754  );
755  }
+ Here is the call graph for this function:

◆ showSummaryForced()

ilObjFileGUI::showSummaryForced ( )

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

References ILIAS\Repository\ctrl().

756  : void
757  {
758  $this->ctrl->redirectToURL(
759  (string) $this->capabilities->get(Capabilities::FORCED_INFO_PAGE)->getUri()
760  );
761  }
+ Here is the call graph for this function:

◆ toggleLearningProgress()

ilObjFileGUI::toggleLearningProgress ( )
protected

Definition at line 837 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(), and ILIAS\Repository\user().

837  : void
838  {
840  $this->user->getId(),
843  'file'
844  );
845 
846  $lp_marks = new ilLPMarks($this->obj_id, $this->user->getId());
847  $lp_marks->setCompleted(!ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId()));
848  $lp_marks->update();
849 
850  ilLPStatusWrapper::_updateStatus($this->obj_id, $this->user->getId());
851 
852  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
853  $this->ctrl->redirect($this, Capabilities::INFO_PAGE->value);
854  }
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='')
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 770 of file class.ilObjFileGUI.php.

References ILIAS\Repository\ctrl().

770  : void
771  {
772  $this->ctrl->redirectToURL(
773  (string) $this->capabilities->get(Capabilities::UNZIP)->getUri()
774  );
775  }
+ Here is the call graph for this function:

◆ updateLearningProgress()

ilObjFileGUI::updateLearningProgress ( )
protected

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

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

Referenced by getParentId(), and sendFile().

144  : void
145  {
146  if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_CONTENT_VISITED) {
148  $this->object->getId(),
149  $this->user->getId(),
150  null,
151  false,
152  true
153  );
154  }
155  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 456 of file class.ilObjFileGUI.php.

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

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

◆ versions()

ilObjFileGUI::versions ( )

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

References ILIAS\Repository\ctrl().

763  : void
764  {
765  $this->ctrl->redirectToURL(
766  (string) $this->capabilities->get(Capabilities::MANAGE_VERSIONS)->getUri()
767  );
768  }
+ Here is the call graph for this function:

◆ viewExternal()

ilObjFileGUI::viewExternal ( )
protected

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

References ILIAS\Repository\ctrl().

783  : void
784  {
785  $this->ctrl->redirectToURL(
786  (string) $this->capabilities->get(Capabilities::VIEW_EXTERNAL)->getUri()
787  );
788  }
+ Here is the call graph for this function:

Field Documentation

◆ $action_repo

ActionDBRepository ilObjFileGUI::$action_repo
private

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

◆ $capabilities

CapabilityCollection ilObjFileGUI::$capabilities
private

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

◆ $data_factory

Factory ilObjFileGUI::$data_factory
protected

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

◆ $file_service_settings

ilFileServicesSettings ilObjFileGUI::$file_service_settings
protected

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

◆ $general_settings

General ilObjFileGUI::$general_settings
protected

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

Referenced by getGeneralSettings().

◆ $http

WrapperFactory ilObjFileGUI::$http
protected

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

◆ $icon_repo

IconDatabaseRepository ilObjFileGUI::$icon_repo
protected

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

◆ $inputs

ILIAS UI Component Input Factory ilObjFileGUI::$inputs
protected

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

Referenced by initPropertiesForm(), and initUploadForm().

◆ $lng

ilLanguage ilObjFileGUI::$lng

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

Referenced by getLanguage().

◆ $log

ilLogger ilObjFileGUI::$log = null
protected

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

◆ $lom_services

LOMServices ilObjFileGUI::$lom_services
protected

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

◆ $obj_service

ilObjectService ilObjFileGUI::$obj_service
protected

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

◆ $object

ilObjFile null ilObjFileGUI::$object = null

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

Referenced by getFileObj(), and getParentId().

◆ $refinery

ILIAS Refinery Factory ilObjFileGUI::$refinery
protected

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

Referenced by getRefinery(), and initPropertiesForm().

◆ $renderer

Renderer ilObjFileGUI::$renderer
protected

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

◆ $request

ServerRequestInterface ilObjFileGUI::$request
protected

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

◆ $stakeholder

ResourceStakeholder ilObjFileGUI::$stakeholder
protected

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

Referenced by getFileStakeholder().

◆ $storage

Services ilObjFileGUI::$storage
protected

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

◆ $ui

UIServices ilObjFileGUI::$ui
protected

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

◆ $upload_handler

UploadHandler ilObjFileGUI::$upload_handler
protected

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

◆ CMD_EDIT

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

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

◆ CMD_SEND_FILE

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

Definition at line 71 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 68 of file class.ilObjFileGUI.php.

◆ PARAM_COPYRIGHT_ID

const ilObjFileGUI::PARAM_COPYRIGHT_ID = "copyright_id"

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

◆ PARAM_DESCRIPTION

const ilObjFileGUI::PARAM_DESCRIPTION = 'description'

◆ PARAM_FILES

const ilObjFileGUI::PARAM_FILES = 'files'

Definition at line 58 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 64 of file class.ilObjFileGUI.php.


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