35    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   38        $this->lng = 
$DIC->language();
 
   41        $this->obj_service = 
$DIC->object();
 
   42        $this->lng->loadLanguageModule(
"file");
 
   53        $ilNavigationHistory = 
$DIC[
'ilNavigationHistory'];
 
   54        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   56        $ilTabs = 
$DIC[
'ilTabs'];
 
   59        $next_class = $this->ctrl->getNextClass($this);
 
   60        $cmd = $this->ctrl->getCmd();
 
   63            if ($this->id_type == self::REPOSITORY_NODE_ID
 
   66                $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", $this->node_id);
 
   67                $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"infoScreen");
 
   68                $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
   71                $ilNavigationHistory->addItem(
 
   81        switch ($next_class) {
 
   82            case "ilinfoscreengui":
 
   86            case 'ilobjectmetadatagui':
 
   88                    $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
   91                $ilTabs->activateTab(
"id_meta");
 
   98                $this->ctrl->forwardCommand($md_gui);
 
  102            case 'ilpermissiongui':
 
  103                $ilTabs->activateTab(
"id_permissions");
 
  105                $ret = $this->ctrl->forwardCommand($perm_gui);
 
  109                $ilTabs->activateTab(
"export");
 
  111                $exp_gui->addFormat(
"xml");
 
  112                $ret = $this->ctrl->forwardCommand($exp_gui);
 
  115            case 'ilobjectcopygui':
 
  117                $cp->setType(
'file');
 
  118                $this->ctrl->forwardCommand($cp);
 
  122            case "ilworkspaceaccessgui":
 
  123                $ilTabs->activateTab(
"id_permissions");
 
  125                $this->ctrl->forwardCommand($wspacc);
 
  128            case "ilcommonactiondispatchergui":
 
  130                $this->ctrl->forwardCommand($gui);
 
  133            case "illearningprogressgui":
 
  134                $ilTabs->activateTab(
'learning_progress');
 
  137                    $this->object->getRefId(),
 
  140                $this->ctrl->forwardCommand($new_gui);
 
  141                $this->tabs_gui->setTabActive(
'learning_progress');
 
  143            case strtolower(ilFileVersionsGUI::class):
 
  144                $this->tabs_gui->activateTab(
"id_versions");
 
  147                    $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
 
  153                if ((
int)$this->id_type === self::WORKSPACE_NODE_ID) {
 
  158                        $ilCtrl->setCmd(
"infoScreen");
 
  160                    $ilTabs->clearTargets();
 
  162                    return parent::executeCommand();
 
  165                if (empty($cmd) || $cmd === 
'render') {
 
  195        if ((
int) $this->id_type !== self::WORKSPACE_NODE_ID) {
 
  208    protected function uploadFiles() : void
 
  215        if (!$dnd_form_gui->checkInput()) {
 
  216            $dnd_input = $dnd_form_gui->getItemByPostVar(
"upload_files");
 
  217            $response->error = $dnd_input->getAlert();
 
  229        $upload = 
$DIC->upload();
 
  231        $post = 
$DIC->http()->request()->getParsedBody();
 
  233        array_walk($post, 
function (&$item) {
 
  234            if (is_string($item)) {
 
  239        if (!$upload->hasBeenProcessed()) {
 
  243        $extract = isset($post[
'extract']) ? (bool) $post[
'extract'] : 
false;
 
  244        $keep_structure = isset($post[
'keep_structure']) ? (bool) $post[
'keep_structure'] : 
false;
 
  246        foreach ($upload->getResults() as 
$result) {
 
  253                if ($keep_structure) {
 
  255                        $this->access_handler,
 
  256                        (
int) $this->id_type,
 
  260                        $this->access_handler,
 
  261                        (
int) $this->id_type,
 
  268                (
int) $this->parent_id,
 
  274            $suffixes = array_unique($delegate->getUploadedSuffixes());
 
  277                    $this->lng->txt(
'file_upload_info_file_with_critical_extension'),
 
  293        $ilTabs = 
$DIC[
'ilTabs'];
 
  296        if (!$form->checkInput()) {
 
  297            $ilTabs->activateTab(
"settings");
 
  298            $form->setValuesByPost();
 
  299            $this->tpl->setContent($form->getHTML());
 
  304        $title = $form->getInput(
'title');
 
  307        if (strlen(trim($title)) == 0) {
 
  310            $title = $this->
object->checkFileExtension(
$filename, $title);
 
  313        $this->
object->handleChangedObjectTitle($title);
 
  314        $this->
object->setDescription($form->getInput(
'description'));
 
  315        $this->
object->setRating($form->getInput(
'rating'));
 
  317        $this->
update = $this->
object->update();
 
  318        $this->obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
 
  321        if (!empty(
$data[
"name"])) {
 
  331        $ecs->handleSettingsUpdate();
 
  333        ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"), 
true);
 
  334        ilUtil::redirect($this->ctrl->getLinkTarget($this, self::CMD_EDIT, 
'', 
false, 
false));
 
  344        $ilTabs = 
$DIC[
'ilTabs'];
 
  348            $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"));
 
  351        $ilTabs->activateTab(
"settings");
 
  356        $val[
'title'] = $this->
object->getTitle();
 
  357        $val[
'description'] = $this->
object->getLongDescription();
 
  358        $val[
'rating'] = $this->
object->hasRating();
 
  359        $form->setValuesByArray($val);
 
  362        include_once 
'Modules/File/classes/class.ilECSFileSettings.php';
 
  364        $ecs->addSettingsToForm($form, 
'file');
 
  366        $this->tpl->setContent($form->getHTML());
 
  378        $form->setFormAction($this->ctrl->getFormAction($this, 
'update'));
 
  380        $form->setTitle($this->lng->txt(
'file_edit'));
 
  381        $form->addCommandButton(
'update', $this->lng->txt(
'save'));
 
  382        $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  385        $title->setValue($this->object->getTitle());
 
  386        $title->setInfo($this->lng->txt(
"if_no_title_then_filename"));
 
  387        $form->addItem($title);
 
  389        if ($mode === 
'create') {
 
  392            $file->setRequired(
false);
 
  393            $form->addItem($file);
 
  398            $replace = 
new ilRadioOption($this->lng->txt(
'replace_file'), 1);
 
  399            $replace->setInfo($this->lng->txt(
'replace_file_info'));
 
  400            $group->addOption($replace);
 
  402            $keep = 
new ilRadioOption($this->lng->txt(
'file_new_version'), 0);
 
  403            $keep->setInfo($this->lng->txt(
'file_new_version_info'));
 
  404            $group->addOption($keep);
 
  406            $file->addSubItem($group);
 
  410            $o->setValue($this->lng->txt(
'upload_info_desc'));
 
  415        $form->addItem($desc);
 
  417        if ($this->id_type == self::REPOSITORY_NODE_ID) {
 
  418            $this->lng->loadLanguageModule(
'rating');
 
  420            $rate->setInfo($this->lng->txt(
'rating_activate_rating_info'));
 
  421            $form->addItem($rate);
 
  425        $presentationHeader->setTitle($this->lng->txt(
'settings_presentation_header'));
 
  426        $form->addItem($presentationHeader);
 
  427        $this->obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
 
  438                $a_hist_entry_id = isset(
$_GET[
"hist_id"]) ? 
$_GET[
"hist_id"] : 
null;
 
  439                $this->
object->sendFile($a_hist_entry_id);
 
  444                require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
 
  448                    $this->object->getType(),
 
  449                    $this->object->getRefId(),
 
  450                    $this->object->getId(),
 
  451                    $DIC->user()->getId()
 
  455                require_once 
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
 
  458                $a_hist_entry_id = isset(
$_GET[
"hist_id"]) ? 
$_GET[
"hist_id"] : 
null;
 
  459                $this->
object->sendFile($a_hist_entry_id);
 
  461                $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
 
  464            $this->ilErr->raiseError(
$e->getMessage(), $this->ilErr->MESSAGE);
 
  475        $this->ctrl->redirectByClass(ilFileVersionsGUI::class);
 
  485        $this->ctrl->setCmd(
"showSummary");
 
  486        $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
  496        $ilTabs = 
$DIC[
'ilTabs'];
 
  498        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  500        $ilTabs->activateTab(
"id_info");
 
  503            $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
 
  510            $button->setCaption(
"file_download");
 
  511            $button->setPrimary(
true);
 
  514            if ($this->id_type === self::REPOSITORY_NODE_ID) {
 
  517                $button->setUrl($this->ctrl->getLinkTarget($this, 
"sendfile"));
 
  520            $ilToolbar->addButtonInstance($button);
 
  523        $info->enablePrivateNotes();
 
  530        $info->enableNewsEditing(
false);
 
  533            $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
 
  535            if ($enable_internal_rss) {
 
  536                $info->setBlockProperty(
"news", 
"settings", 
true);
 
  537                $info->setBlockProperty(
"news", 
"public_notifications_option", 
true);
 
  542        $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
 
  545        $info->addSection($this->lng->txt(
"file_info"));
 
  546        $info->addProperty($this->lng->txt(
"filename"), $this->object->getFileName());
 
  547        $info->addProperty($this->lng->txt(
"type"), $this->object->getFileType());
 
  548        $info->addProperty($this->lng->txt(
"resource_id"), $this->object->getResourceId());
 
  549        $info->addProperty($this->lng->txt(
"storage_id"), $this->object->getStorageID());
 
  551        $info->addProperty($this->lng->txt(
"size"),
 
  553        $info->addProperty($this->lng->txt(
"version"), $this->object->getVersion());
 
  555        $version = $this->
object->getVersions([$this->object->getVersion()]);
 
  556        $version = end($version);
 
  562        if ($this->object->getPageCount() > 0) {
 
  563            $info->addProperty($this->lng->txt(
"page_count"), $this->object->getPageCount());
 
  567        $uploader = $this->
object->getVersions();
 
  568        $uploader = array_shift($uploader);
 
  569        $uploader = $uploader[
"user_id"];
 
  571        include_once 
"Services/User/classes/class.ilUserUtil.php";
 
  575        if ($this->id_type == self::REPOSITORY_NODE_ID && $this->
checkPermissionBool(
"read", 
"sendfile")) {
 
  576            $tpl = 
new ilTemplate(
"tpl.download_link.html", 
true, 
true, 
"Modules/File");
 
  578            $info->addProperty($this->lng->txt(
"download_link"), 
$tpl->get());
 
  581        if ($this->id_type == self::WORKSPACE_NODE_ID) {
 
  582            $info->addProperty($this->lng->txt(
"perma_link"), $this->getPermanentLinkWidget());
 
  586        include_once(
"./Services/Preview/classes/class.ilPreview.php");
 
  587        if (!$this->ctrl->isAsynch()
 
  589            && $this->checkPermissionBool(
"read")
 
  591            include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
 
  594            switch ($this->id_type) {
 
  606            $info->addProperty($this->lng->txt(
"preview"), 
$preview->getInlineHTML());
 
  612        $this->ctrl->forwardCommand($info);
 
  619        $ilTabs = 
$DIC[
'ilTabs'];
 
  621        $ilHelp = 
$DIC[
'ilHelp'];
 
  623        $ilHelp->setScreenIdComponent(
"file");
 
  625        $this->ctrl->setParameter($this, 
"ref_id", $this->node_id);
 
  630                $lng->txt(self::CMD_VERSIONS),
 
  638                $lng->txt(
"info_short"),
 
  639                $this->ctrl->getLinkTargetByClass(array(
"ilobjfilegui", 
"ilinfoscreengui"), 
"showSummary")
 
  646                $lng->txt(
"settings"),
 
  647                $this->ctrl->getLinkTarget($this, self::CMD_EDIT)
 
  654                $lng->txt(
'learning_progress'),
 
  655                $this->ctrl->getLinkTargetByClass(array(__CLASS__, 
'illearningprogressgui'), 
'')
 
  662            $mdtab = $mdgui->getTab();
 
  666                    $lng->txt(
"meta_data"),
 
  677                $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
"")
 
  685    public static function _goto($a_target, $a_additional = 
null)
 
  690        $ilAccess = 
$DIC[
'ilAccess'];
 
  692        if ($a_additional && substr($a_additional, -3) == 
"wsp") {
 
  693            $_GET[
"baseClass"] = 
"ilsharedresourceGUI";
 
  694            $_GET[
"wsp_id"] = $a_target;
 
  695            include(
"ilias.php");
 
  700        if ($a_additional && substr($a_additional, -8) == 
"download") {
 
  706        if ($ilAccess->checkAccess(
"visible", 
"", $a_target)
 
  707            || $ilAccess->checkAccess(
"read", 
"", $a_target)
 
  713                    $lng->txt(
"msg_no_perm_read_item"),
 
  729        $ilLocator = 
$DIC[
'ilLocator'];
 
  731        if (is_object($this->
object)) {
 
  732            $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
""), 
"", $this->node_id);
 
  742        include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  744        $dnd_form_gui->setMultipart(
true);
 
  745        $dnd_form_gui->setHideLabels();
 
  748        include_once(
"Services/Form/classes/class.ilDragDropFileInputGUI.php");
 
  750        $dnd_input->setArchiveSuffixes([
"zip"]);
 
  751        $dnd_input->setCommandButtonNames(self::CMD_UPLOAD_FILES, 
"cancel");
 
  752        $dnd_form_gui->addItem($dnd_input);
 
  755        $dnd_form_gui->addCommandButton(self::CMD_UPLOAD_FILES, $this->lng->txt(
"upload_files"));
 
  756        $dnd_form_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
  758        $dnd_form_gui->setTableWidth(
"100%");
 
  760        $dnd_form_gui->setTitle($this->lng->txt(
"upload_files_title"));
 
  763        $this->ctrl->setParameter($this, 
"new_type", 
"file");
 
  764        $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this, self::CMD_UPLOAD_FILES));
 
  766        return $dnd_form_gui;
 
  771        $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
 
  777                [ilCommonActionDispatcherGUI::class, ilRatingGUI::class]
 
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilCountPDFPagesPreProcessors.
@classDescription Date and time handling
Export User Interface Class.
static getValidExtensions()
Valid extensions.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static getLogger($a_component_id)
Get component logger.
This class represents a non editable value in a property form.
static _lookupFileSize($a_id)
static _getPermanentDownloadLink($ref_id)
Gets the permanent download link for the file.
GUI class for file objects.
update()
updates object entry in object_data @access public
initCreationForms($a_new_type)
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
render()
This Method is needed if called from personal resources.
executeCommand()
execute command
getType()
Functions that must be overwritten.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
initMultiUploadForm()
Initializes the upload form for multiple files.
initPropertiesForm($mode="create")
static _goto($a_target, $a_additional=null)
infoScreenForward()
show information screen
edit()
edit object @access public
addLocatorItems()
Functions to be overwritten.
setTabs()
create tabs (repository/workspace switch)
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
Class ilObjFileSingleFileDelegate.
Class ilObjFileUnzipFlatDelegate.
Class ilObjFileUnzipRecursiveDelegate.
Class ilObjFileUploadResponse.
New implementation of ilObjectGUI.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
const WORKSPACE_OBJECT_ID
getAccessHandler()
Get access handler.
prepareOutput($a_show_subobjects=true)
prepare output
getTargetFrame($a_cmd, $a_target_frame="")
get target frame for command (command is method name without "Object", e.g.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getCreationMode()
get creation mode
GUI class for the workflow of copying objects.
initImportForm($a_new_type)
Init object import form.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
addHeaderAction()
Add header action menu.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.