ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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
 
General $general_settings
 
ilFileServicesSettings $file_service_settings
 
IconDatabaseRepository $icon_repo
 
ILIAS UI Component Input Factory $inputs
 
Renderer $renderer
 
ServerRequestInterface $request
 
Factory $data_factory
 
LOMServices $lom_services
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Attributes

CapabilityCollection $capabilities
 
ActionDBRepository $action_repo
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

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

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

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

1084  : void
1085  {
1086  global $DIC;
1087  $main_tpl = $DIC->ui()->mainTemplate();
1088  $ilErr = $DIC['ilErr'];
1089  $lng = $DIC['lng'];
1090  $ilAccess = $DIC['ilAccess'];
1091 
1092  if ($a_additional && str_ends_with((string) $a_additional, "wsp")) {
1093  ilObjectGUI::_gotoSharedWorkspaceNode((int) $a_target);
1094  }
1095 
1096  // added support for direct download goto links
1097  if ($a_additional && str_ends_with((string) $a_additional, "download")) {
1098  ilObjectGUI::_gotoRepositoryNode($a_target, "sendfile");
1099  }
1100 
1101  // static method, no workspace support yet
1102 
1103  if ($ilAccess->checkAccess("visible", "", $a_target)
1104  || $ilAccess->checkAccess("read", "", $a_target)) {
1105  ilObjectGUI::_gotoRepositoryNode($a_target, Capabilities::INFO_PAGE->value);
1106  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1107  $main_tpl->setOnScreenMessage(
1108  'failure',
1109  sprintf(
1110  $lng->txt("msg_no_perm_read_item"),
1112  ),
1113  true
1114  );
1116  }
1117 
1118  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1119  }
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:26
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 385 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().

389  : void {
390  // abort if form-type is unknown
391  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
392  return;
393  }
394  $title = $form->getTitle();
395  $form->setTitle(''); // see https://mantis.ilias.de/view.php?id=37786
396 
397  $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
398  $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
399 
400  $accordion->addItem($tpl->get(), $form->getHTML());
401  }
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 1124 of file class.ilObjFileGUI.php.

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

1124  : void
1125  {
1126  global $DIC;
1127  $ilLocator = $DIC['ilLocator'];
1128 
1129  if (is_object($this->object)) {
1130  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->node_id);
1131  }
1132  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ addUIFormToAccordion()

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

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

368  : void {
369  // abort if form-type is unknown
370  if (!in_array($form_type, [self::CFORM_NEW, self::CFORM_CLONE, self::CFORM_IMPORT], true)) {
371  return;
372  }
373 
374  $inputs = $form->getInputs();
375  // use label of first input as title, because UI Component forms don't support form-titles yet
376  $title = ($inputs === []) ?
377  '' : $inputs[array_key_first($inputs)]->getLabel();
378 
379  $tpl = new ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
380  $tpl->setVariable("TITLE", $this->lng->txt("option") . " " . $form_type . ": " . $title);
381 
382  $accordion->addItem($tpl->get(), $this->ui->renderer()->render($form));
383  }
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 864 of file class.ilObjFileGUI.php.

References $info, 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().

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

◆ edit()

ilObjFileGUI::edit ( )

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

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

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

◆ editExternal()

ilObjFileGUI::editExternal ( )
protected

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

References ILIAS\Repository\ctrl().

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

◆ getCreationFormTitle()

ilObjFileGUI::getCreationFormTitle ( )
protected

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

References ILIAS\Repository\lng().

413  : string
414  {
415  return $this->lng->txt('upload_files');
416  }
+ Here is the call graph for this function:

◆ getCtrl()

ilObjFileGUI::getCtrl ( )
protected

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

References ilObject2GUI\$ctrl.

1150  : \ilCtrl
1151  {
1152  return $this->ctrl;
1153  }
Class ilCtrl provides processing control methods.

◆ getFileObj()

ilObjFileGUI::getFileObj ( )
protected
Exceptions
ilFileException

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

References $object.

1158  : ilObjFile
1159  {
1160  if (!$this->object instanceof ilObjFile) {
1161  throw new ilFileException("Error: object is not of type ilObjFile or doesn't exist");
1162  }
1163 
1164  return $this->object;
1165  }
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 1167 of file class.ilObjFileGUI.php.

References $stakeholder.

1168  {
1169  return $this->stakeholder;
1170  }
Class ilObjFileStakeholder.
ResourceStakeholder $stakeholder

◆ getGeneralSettings()

ilObjFileGUI::getGeneralSettings ( )
protected

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

References $general_settings.

1172  : General
1173  {
1174  return $this->general_settings;
1175  }
General $general_settings

◆ getLanguage()

ilObjFileGUI::getLanguage ( )
protected

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

References $lng.

Referenced by initUploadForm().

1177  : \ilLanguage
1178  {
1179  return $this->lng;
1180  }
language handling
+ Here is the caller graph for this function:

◆ getNodeID()

ilObjFileGUI::getNodeID ( )
protected

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

References ilObject2GUI\$node_id.

1182  : int
1183  {
1184  return $this->node_id;
1185  }

◆ getParentId()

◆ getRefinery()

ilObjFileGUI::getRefinery ( )
protected

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

References $refinery.

1188  {
1189  return $this->refinery;
1190  }
Builds data types.
Definition: Factory.php:35
ILIAS Refinery Factory $refinery

◆ getType()

ilObjFileGUI::getType ( )

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

References ilObjFile\OBJECT_TYPE.

Referenced by initUploadForm().

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

◆ getUIFactory()

ilObjFileGUI::getUIFactory ( )
protected

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

References ILIAS\Repository\ui().

1193  {
1194  return $this->ui->factory();
1195  }
+ Here is the call graph for this function:

◆ getUser()

ilObjFileGUI::getUser ( )
protected

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

References ilObject2GUI\$user.

1197  : ilObjUser
1198  {
1199  return $this->user;
1200  }

◆ infoScreenForward()

ilObjFileGUI::infoScreenForward ( )

show information screen

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

References $GLOBALS, $info, 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().

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

References initUploadForm().

407  : Standard
408  {
409  return $this->initUploadForm();
410  }
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 1135 of file class.ilObjFileGUI.php.

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

1135  : ?\ilObjectListGUI
1136  {
1137  $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1138  if ($lg instanceof ilObjectListGUI && $this->object->hasRating()) {
1139  $lg->enableRating(
1140  true,
1141  null,
1142  false,
1143  [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
1144  );
1145  }
1146 
1147  return $lg;
1148  }
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 631 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().

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

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

Referenced by edit(), and getParentId().

1064  : void
1065  {
1066  $this->tabs_gui->activateTab("settings");
1067  // add subtab for common settings
1068  $this->tabs_gui->addSubTab(
1069  'file_settings',
1070  $this->lng->txt('settings'),
1071  $this->ctrl->getLinkTargetByClass(self::class, self::CMD_EDIT)
1072  );
1073  if (in_array('file', ilAdvancedMDRecord::_getActivatedObjTypes(), true)) {
1074  $this->tabs_gui->addSubTab(
1075  'service_settings',
1076  $this->lng->txt('service_settings'),
1077  $this->ctrl->getLinkTargetByClass(ilFileCommonSettingsGUI::class, ilFileCommonSettingsGUI::CMD_EDIT)
1078  );
1079  }
1080 
1081  $this->tabs_gui->activateSubTab("file_settings");
1082  }
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 418 of file class.ilObjFileGUI.php.

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

Referenced by initCreateForm(), and uploadFiles().

418  : Standard
419  {
420  $this->getLanguage()->loadLanguageModule('file');
421  $inputs = [];
422 
423  $this->ctrl->setParameterByClass(self::class, 'new_type', $this->getType());
424  $this->ctrl->setParameterByClass(
425  self::class,
426  self::PARAM_UPLOAD_ORIGIN,
427  self::UPLOAD_ORIGIN_STANDARD
428  );
429 
430 
431  $inputs[self::PARAM_FILES] = $this->ui->factory()->input()->field()->file(
432  $this->upload_handler,
433  $this->lng->txt('upload_files'),
434  null,
435  $this->ui->factory()->input()->field()->group([
436  self::PARAM_TITLE => $this->ui->factory()->input()->field()->text(
437  $this->lng->txt('title')
439  $this->getEmptyStringToNullTransformation()
440  ),
441  self::PARAM_DESCRIPTION => $this->ui->factory()->input()->field()->textarea(
442  $this->lng->txt('description')
444  $this->getEmptyStringToNullTransformation()
445  ),
446  ])
447  )->withMaxFiles(
448  self::UPLOAD_MAX_FILES
449  )->withRequired(true);
450 
451  if ($this->lom_services->copyrightHelper()->isCopyrightSelectionActive()) {
452  $inputs[self::PARAM_COPYRIGHT_ID] = $this->getCopyrightSelectionInput('set_license_for_all_files');
453  }
454 
455  return $this->ui->factory()->input()->container()->form()->standard(
456  $this->ctrl->getFormActionByClass(self::class, self::CMD_UPLOAD_FILES),
457  $inputs
458  )->withSubmitLabel($this->lng->txt('upload_files'));
459  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 543 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().

543  : void
544  {
545  // this is needed to support multi fileuploads in personal and shared resources
546  $backup_node_id = $this->node_id;
547  parent::putObjectInTree($obj, $parent_node_id);
548  $this->node_id = $backup_node_id;
549  }
+ Here is the call graph for this function:

◆ sendFile()

ilObjFileGUI::sendFile ( )

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

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

724  : bool
725  {
726  $hist_entry_id = $this->request_wrapper->has('hist_id')
727  ? $this->request_wrapper->retrieve('hist_id', $this->refinery->kindlyTo()->int())
728  : null;
729  try {
730  if (ANONYMOUS_USER_ID === $this->user->getId() && $this->request_wrapper->has('transaction')) {
731  $this->object->sendFile($hist_entry_id);
732  }
733 
734  if ($this->capabilities->get(Capabilities::DOWNLOAD)->isUnlocked()) {
735  // Record read event and catchup with write events
737  $this->object->getType(),
738  $this->object->getRefId(),
739  $this->object->getId(),
740  $this->user->getId()
741  );
742  $this->updateLearningProgress();
743 
744  $this->object->sendFile($hist_entry_id);
745  } else {
746  $this->error->raiseError($this->lng->txt("permission_denied"), $this->error->MESSAGE);
747  }
748  } catch (FileNotFoundException $e) {
749  $this->error->raiseError($e->getMessage(), $this->error->MESSAGE);
750  }
751 
752  return true;
753  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 990 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.

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

◆ showSummary()

ilObjFileGUI::showSummary ( )
Deprecated:
PROXY COMMAND

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

References ILIAS\Repository\ctrl().

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

◆ showSummaryForced()

ilObjFileGUI::showSummaryForced ( )

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

References ILIAS\Repository\ctrl().

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

◆ toggleLearningProgress()

ilObjFileGUI::toggleLearningProgress ( )
protected

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

845  : void
846  {
848  $this->user->getId(),
851  'file'
852  );
853 
854  $lp_marks = new ilLPMarks($this->obj_id, $this->user->getId());
855  $lp_marks->setCompleted(!ilLPStatus::_hasUserCompleted($this->object->getId(), $this->user->getId()));
856  $lp_marks->update();
857 
858  ilLPStatusWrapper::_updateStatus($this->obj_id, $this->user->getId());
859 
860  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
861  $this->ctrl->redirect($this, Capabilities::INFO_PAGE->value);
862  }
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 778 of file class.ilObjFileGUI.php.

References ILIAS\Repository\ctrl().

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

◆ updateLearningProgress()

ilObjFileGUI::updateLearningProgress ( )
protected

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

142  : void
143  {
144  if ($this->object->getLPMode() === ilLPObjSettings::LP_MODE_CONTENT_VISITED) {
146  $this->object->getId(),
147  $this->user->getId(),
148  null,
149  false,
150  true
151  );
152  }
153  }
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 464 of file class.ilObjFileGUI.php.

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

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

◆ versions()

ilObjFileGUI::versions ( )

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

References ILIAS\Repository\ctrl().

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

◆ viewExternal()

ilObjFileGUI::viewExternal ( )
protected

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

References ILIAS\Repository\ctrl().

791  : void
792  {
793  $this->ctrl->redirectToURL(
794  (string) $this->capabilities->get(Capabilities::VIEW_EXTERNAL)->getUri()
795  );
796  }
+ 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 73 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().

◆ $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 79 of file class.ilObjFileGUI.php.

Referenced by getLanguage().

◆ $log

ilLogger ilObjFileGUI::$log = null
protected

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

◆ $object

ilObjFile null ilObjFileGUI::$object = null

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

Referenced by getFileObj(), and getParentId().

◆ $refinery

ILIAS Refinery Factory ilObjFileGUI::$refinery
protected

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

Referenced by getFileStakeholder().

◆ $storage

Services ilObjFileGUI::$storage
protected

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

◆ $ui

UIServices ilObjFileGUI::$ui
protected

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

◆ $upload_handler

UploadHandler ilObjFileGUI::$upload_handler
protected

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

◆ CMD_EDIT

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

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

◆ CMD_SEND_FILE

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

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

◆ PARAM_COPYRIGHT_ID

const ilObjFileGUI::PARAM_COPYRIGHT_ID = "copyright_id"

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

◆ PARAM_DESCRIPTION

const ilObjFileGUI::PARAM_DESCRIPTION = 'description'

◆ PARAM_FILES

const ilObjFileGUI::PARAM_FILES = 'files'

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


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