4require_once
"./Services/Object/classes/class.ilObject2GUI.php";
5require_once
"./Modules/File/classes/class.ilObjFile.php";
6require_once
"./Modules/File/classes/class.ilObjFileAccess.php";
37 $next_class = $this->ctrl->getNextClass($this);
38 $cmd = $this->ctrl->getCmd();
40 if($this->id_type == self::WORKSPACE_NODE_ID)
42 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
49 if(IS_PAYMENT_ENABLED)
51 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
52 if(ANONYMOUS_USER_ID ==
$ilUser->getId() && isset(
$_GET[
'transaction']))
54 $transaction =
$_GET[
'transaction'];
55 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
60 ?
$_GET[
'purchasetype'] : NULL) ))
63 $this->tpl->getStandardTemplate();
65 include_once
'./Services/Payment/classes/class.ilShopPurchaseGUI.php';
67 $ret = $this->ctrl->forwardCommand($pp);
71 else if($this->id_type == self::REPOSITORY_NODE_ID
74 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->node_id);
75 $link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
76 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
79 $ilNavigationHistory->addItem($this->node_id,
88 case "ilinfoscreengui":
95 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
98 $ilTabs->activateTab(
"id_meta");
100 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
102 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
103 $md_gui->addObserver($this->
object,
'MDUpdateListener',
'General');
106 $md_gui->addObserver($this->
object,
'MDUpdateListener',
'Technical');
108 $this->ctrl->forwardCommand($md_gui);
112 case 'ilpermissiongui':
113 $ilTabs->activateTab(
"id_permissions");
114 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
116 $ret =& $this->ctrl->forwardCommand($perm_gui);
122 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
124 $ilTabs->activateTab(
"export");
125 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
127 $exp_gui->addFormat(
"xml");
128 $ret = $this->ctrl->forwardCommand($exp_gui);
131 case 'ilobjectcopygui':
132 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
134 $cp->setType(
'file');
135 $this->ctrl->forwardCommand($cp);
139 case "ilworkspaceaccessgui";
140 $ilTabs->activateTab(
"id_permissions");
141 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
143 $this->ctrl->forwardCommand($wspacc);
146 case "ilcommonactiondispatchergui":
147 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
149 $this->ctrl->forwardCommand($gui);
154 if($this->id_type == self::WORKSPACE_NODE_ID)
163 $ilTabs->clearTargets();
164 return parent::executeCommand();
183 if($this->id_type == self::WORKSPACE_NODE_ID)
185 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
188 $this->lng->loadLanguageModule(
"file");
190 $this->ctrl->redirect($this,
"cancel");
195 require_once(
"Services/FileUpload/classes/class.ilFileUploadSettings.php");
207 if($this->id_type != self::WORKSPACE_NODE_ID)
223 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
225 $single_form_gui->setMultipart(
true);
229 $in_title->setInfo($this->lng->txt(
"if_no_title_then_filename"));
232 $single_form_gui->addItem($in_title);
236 $single_form_gui->addItem($in_descr);
240 $in_file->setRequired(
true);
241 $single_form_gui->addItem($in_file);
243 $single_form_gui->addCommandButton(
"save", $this->lng->txt($this->type.
"_add"));
244 $single_form_gui->addCommandButton(
"saveAndMeta", $this->lng->txt(
"file_add_and_metadata"));
245 $single_form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
247 $single_form_gui->setTableWidth(
"600px");
249 $single_form_gui->setTitle($this->lng->txt($this->type.
"_new"));
250 $single_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
252 $this->ctrl->setParameter($this,
"new_type",
"file");
254 $single_form_gui->setFormAction($this->ctrl->getFormAction($this,
"save"));
256 return $single_form_gui;
270 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
275 if ($single_form_gui->checkInput())
277 $title = $single_form_gui->getInput(
"title");
278 $description = $single_form_gui->getInput(
"description");
279 $upload_file = $single_form_gui->getInput(
"upload_file");
281 if (trim($title) ==
"")
283 $title = $upload_file[
"name"];
290 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
292 $title .=
'.'.$fileExtension;
298 include_once(
"./Modules/File/classes/class.ilObjFile.php");
300 $fileObj->setTitle($title);
301 $fileObj->setDescription($description);
302 $fileObj->setFileName($upload_file[
"name"]);
304 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
306 "", $upload_file[
"name"], $upload_file[
"type"]));
307 $fileObj->setFileSize($upload_file[
"size"]);
308 $this->object_id = $fileObj->create();
313 $fileObj->createDirectory();
314 $fileObj->getUploadFile($upload_file[
"tmp_name"],
315 $upload_file[
"name"]);
320 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
326 if ($this->ctrl->getCmd() ==
"saveAndMeta")
328 $this->ctrl->setParameter($this,
"new_type",
"");
329 $target = $this->ctrl->getLinkTargetByClass(array(
"ilobjfilegui",
"ilmdeditorgui"),
"listSection",
"",
false,
false);
334 $this->ctrl->returnToParent($this);
339 $single_form_gui->setValuesByPost();
340 $this->tpl->setContent($single_form_gui->getHTML());
361 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
363 $zip_form_gui->setMultipart(
true);
367 $in_file->setRequired(
true);
368 $in_file->setSuffixes(array(
"zip"));
369 $zip_form_gui->addItem($in_file);
372 $in_str =
new ilCheckboxInputGUI($this->lng->txt(
"take_over_structure"),
"adopt_structure");
373 $in_str->setInfo($this->lng->txt(
"take_over_structure_info"));
374 $zip_form_gui->addItem($in_str);
376 $zip_form_gui->addCommandButton(
"saveUnzip", $this->lng->txt($this->type.
"_add"));
377 $zip_form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
379 $zip_form_gui->setTableWidth(
"600px");
381 $zip_form_gui->setTitle($this->lng->txt(
"header_zip"));
382 $zip_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
384 $this->ctrl->setParameter($this,
"new_type",
"file");
386 $zip_form_gui->setFormAction($this->ctrl->getFormAction($this,
"saveUnzip"));
388 return $zip_form_gui;
402 if ($zip_form_gui->checkInput())
404 $zip_file = $zip_form_gui->getInput(
"zip_file");
405 $adopt_structure = $zip_form_gui->getInput(
"adopt_structure");
407 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
414 if($this->id_type != self::WORKSPACE_NODE_ID)
431 $containerType =
"WorkspaceFolder";
440 $containerType =
"Category";
446 $containerType =
"Folder";
459 $zip_file[
"tmp_name"],
460 ($adopt_structure && $permission),
473 $this->ctrl->returnToParent($this);
477 $zip_form_gui->setValuesByPost();
478 $this->tpl->setContent($zip_form_gui->getHTML());
483 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
497 if(!$form->checkInput())
499 $ilTabs->activateTab(
"settings");
500 $form->setValuesByPost();
501 $this->tpl->setContent($form->getHTML());
505 $data = $form->getInput(
'file');
508 while (substr(
$data[
"name"],-1) ==
'/')
514 $title = $form->getInput(
'title');
515 if(strlen(trim($title)) == 0)
521 $title = $this->
object->checkFileExtension(
$filename,$title);
523 $this->
object->setTitle($title);
525 if (!empty(
$data[
"name"]))
527 switch($form->getInput(
'replace'))
530 $this->
object->deleteVersions();
531 $this->
object->clearDataDirectory();
532 $this->
object->replaceFile(
$data[
'tmp_name'],
$data[
'name']);
535 $this->
object->addFileVersion(
$data[
'tmp_name'],
$data[
'name']);
538 $this->
object->setFileName(
$data[
'name']);
539 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
542 $this->
object->setFileSize(
$data[
'size']);
545 $this->
object->setDescription($form->getInput(
'description'));
546 $this->
object->setRating($form->getInput(
'rating'));
548 $this->
update = $this->
object->update();
551 if (!empty(
$data[
"name"]))
553 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
561 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
563 $ecs->handleSettingsUpdate();
580 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"));
583 $ilTabs->activateTab(
"settings");
588 $val[
'title'] = $this->
object->getTitle();
589 $val[
'description'] = $this->
object->getLongDescription();
590 $val[
'rating'] = $this->
object->hasRating();
591 $form->setValuesByArray($val);
594 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
596 $ecs->addSettingsToForm($form,
'file');
598 $this->tpl->setContent($form->getHTML());
609 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
611 $this->lng->loadLanguageModule(
'file');
614 $form->setFormAction($this->ctrl->getFormAction($this),
'update');
615 $form->setTitle($this->lng->txt(
'file_edit'));
616 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
617 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
620 $title->setValue($this->object->getTitle());
621 $title->setInfo($this->lng->txt(
"if_no_title_then_filename"));
622 $form->addItem($title);
624 $upload_possible =
true;
625 if($this->id_type == self::WORKSPACE_NODE_ID)
627 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
634 $file->setRequired(
false);
636 $form->addItem(
$file);
641 $replace =
new ilRadioOption($this->lng->txt(
'replace_file'),1);
642 $replace->setInfo($this->lng->txt(
'replace_file_info'));
643 $group->addOption($replace);
646 $keep =
new ilRadioOption($this->lng->txt(
'file_new_version'),0);
647 $keep->setInfo($this->lng->txt(
'file_new_version_info'));
648 $group->addOption($keep);
650 $file->addSubItem($group);
655 $file->setValue($this->lng->txt(
"personal_workspace_quota_exceeded_warning"));
656 $form->addItem(
$file);
662 $form->addItem($desc);
664 if($this->id_type == self::REPOSITORY_NODE_ID)
666 $this->lng->loadLanguageModule(
'rating');
668 $rate->setInfo($this->lng->txt(
'rating_activate_rating_info'));
669 $form->addItem($rate);
679 if(ANONYMOUS_USER_ID ==
$ilUser->getId() && isset(
$_GET[
'transaction']) )
681 $this->
object->sendFile(
$_GET[
"hist_id"]);
687 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
691 $this->object->getId(),
$ilUser->getId());
694 $this->
object->sendFile(
$_GET[
"hist_id"]);
698 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
713 $ilTabs->activateTab(
"id_versions");
717 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
721 $versions = $this->
object->getVersions();
724 require_once(
"Modules/File/classes/class.ilFileVersionTableGUI.php");
726 $table->setMaxCount(
sizeof($versions));
727 $table->setData($versions);
729 $this->tpl->setVariable(
"ADM_CONTENT", $table->getHTML());
739 $this->ctrl->setCmd(
"showSummary");
740 $this->ctrl->setCmdClass(
"ilinfoscreengui");
749 global $ilTabs,
$ilErr, $ilToolbar;
751 $ilTabs->activateTab(
"id_info");
755 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
758 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
764 $this->lng->loadLanguageModule(
"file");
767 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
769 $button->setCaption(
"file_download");
770 $button->setPrimary(
true);
773 if ($this->id_type == self::REPOSITORY_NODE_ID)
779 $button->setUrl($this->ctrl->getLinkTarget($this,
"sendfile"));
782 $ilToolbar->addButtonInstance($button);
785 $info->enablePrivateNotes();
793 $info->enableNewsEditing(
false);
797 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
799 if ($enable_internal_rss)
801 $info->setBlockProperty(
"news",
"settings",
true);
802 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
808 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
810 $info->addSection($this->lng->txt(
"file_info"));
811 $info->addProperty($this->lng->txt(
"filename"),
812 $this->object->getFileName());
814 $info->addProperty($this->lng->txt(
"type"),
815 $this->object->guessFileType());
817 $info->addProperty($this->lng->txt(
"size"),
819 $info->addProperty($this->lng->txt(
"version"),
820 $this->object->getVersion());
823 $uploader = $this->
object->getVersions();
824 $uploader = array_shift($uploader);
825 $uploader = $uploader[
"user_id"];
827 $this->lng->loadLanguageModule(
"file");
828 include_once
"Services/User/classes/class.ilUserUtil.php";
832 if ($this->id_type == self::REPOSITORY_NODE_ID && $this->
checkPermissionBool(
"read",
"sendfile"))
834 $tpl =
new ilTemplate(
"tpl.download_link.html",
true,
true,
"Modules/File");
836 $info->addProperty($this->lng->txt(
"download_link"),
$tpl->get());
839 if($this->id_type == self::WORKSPACE_NODE_ID)
841 $info->addProperty($this->lng->txt(
"perma_link"), $this->getPermanentLinkWidget());
845 include_once(
"./Services/Preview/classes/class.ilPreview.php");
846 if (!$this->ctrl->isAsynch() &&
848 $this->checkPermissionBool(
"read"))
850 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
854 switch ($this->id_type)
866 $preview =
new ilPreviewGUI($this->node_id, $context, $this->object->getId(), $this->access_handler);
867 $info->addProperty($this->lng->txt(
"preview"),
$preview->getInlineHTML());
873 $this->ctrl->forwardCommand($info);
880 global $ilTabs,
$lng, $ilHelp;
882 $ilHelp->setScreenIdComponent(
"file");
884 $this->ctrl->setParameter($this,
"ref_id",$this->node_id);
888 $ilTabs->addTab(
"id_info",
889 $lng->txt(
"info_short"),
890 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilegui",
"ilinfoscreengui"),
"showSummary"));
895 $ilTabs->addTab(
"settings",
897 $this->ctrl->getLinkTarget($this,
"edit"));
902 $ilTabs->addTab(
"id_versions",
903 $lng->txt(
"versions"),
904 $this->ctrl->getLinkTarget($this,
"versions"));
910 $ilTabs->addTab(
"id_meta",
911 $lng->txt(
"meta_data"),
912 $this->ctrl->getLinkTargetByClass(array(
'ilobjfilegui',
'ilmdeditorgui'),
'listSection'));
918 $ilTabs->addTab(
"export",
920 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
927 public static function _goto($a_target, $a_additional =
null)
931 if($a_additional && substr($a_additional, -3) ==
"wsp")
933 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
934 $_GET[
"wsp_id"] = $a_target;
935 include(
"ilias.php");
940 if($a_additional && substr($a_additional, -8) ==
"download")
947 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
951 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
968 if (is_object($this->
object))
970 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"", $this->node_id);
981 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
983 $dnd_form_gui->setMultipart(
true);
984 $dnd_form_gui->setHideLabels();
987 include_once(
"Services/Form/classes/class.ilDragDropFileInputGUI.php");
989 $dnd_input->setArchiveSuffixes(array(
"zip"));
990 $dnd_input->setCommandButtonNames(
"uploadFiles",
"cancel");
991 $dnd_form_gui->addItem($dnd_input);
994 $dnd_form_gui->addCommandButton(
"uploadFiles", $this->lng->txt(
"upload_files"));
995 $dnd_form_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
997 $dnd_form_gui->setTableWidth(
"100%");
999 $dnd_form_gui->setTitle($this->lng->txt(
"upload_files_title"));
1000 $dnd_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.gif'), $this->lng->txt(
'obj_file'));
1002 $this->ctrl->setParameter($this,
"new_type",
"file");
1003 $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this,
"uploadFiles"));
1005 return $dnd_form_gui;
1013 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
1015 $response =
new stdClass();
1016 $response->error =
null;
1017 $response->debug =
null;
1022 $after_creation_callback = (int)
$_REQUEST[
"crtcb"];
1023 if($after_creation_callback)
1025 $this->after_creation_callback_objects = array();
1031 if ($dnd_form_gui->checkInput())
1037 $response->error = $this->lng->txt(
"permission_denied");
1042 $fileresult = $this->
handleFileUpload($dnd_form_gui->getInput(
"upload_files"));
1044 $response = (object)array_merge((array)$response, (array)$fileresult);
1049 $response->error = $ex->getMessage() .
" ## " . $ex->getTraceAsString();
1054 $dnd_input = $dnd_form_gui->getItemByPostVar(
"upload_files");
1055 $response->error = $dnd_input->getAlert();
1058 if($after_creation_callback &&
1059 sizeof($this->after_creation_callback_objects))
1061 foreach($this->after_creation_callback_objects as $new_file_obj)
1065 unset($this->after_creation_callback_objects);
1069 header(
'Vary: Accept');
1070 header(
'Content-type: text/plain');
1091 $temp_name = $file_upload[
"tmp_name"];
1100 $response =
new stdClass();
1102 $response->fileSize = intval(
$size);
1103 $response->fileType = $type;
1104 $response->fileUnzipped = $extract;
1105 $response->error =
null;
1111 $adopt_structure = $keep_structure;
1113 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
1120 if($this->id_type != self::WORKSPACE_NODE_ID)
1136 $containerType =
"WorkspaceFolder";
1145 $containerType =
"Category";
1151 $containerType =
"Folder";
1167 ($adopt_structure && $permission),
1175 $response->error = $e->getMessage();
1179 $response->error = $ex->getMessage();
1185 if($this->id_type != self::WORKSPACE_NODE_ID)
1189 if($parent_ref_id != $this->parent_id)
1196 $this->after_creation_callback_objects[] =
$object;
1203 if (trim($title) ==
"")
1212 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
1214 $title .=
'.'.$fileExtension;
1220 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1222 $fileObj->setTitle($title);
1223 $fileObj->setDescription($description);
1226 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
1228 $fileObj->setFileSize(
$size);
1229 $this->object_id = $fileObj->create();
1234 if(is_array($this->after_creation_callback_objects))
1236 $this->after_creation_callback_objects[] = $fileObj;
1240 $fileObj->createDirectory();
1241 $fileObj->raiseUploadError(
false);
1242 $fileObj->getUploadFile($temp_name,
$filename);
1247 require_once(
'./Services/Tracking/classes/class.ilChangeEvent.php');
1260 global $ilTabs, $ilLocator;
1264 $version_ids = isset(
$_GET[
"hist_id"]) ? array(
$_GET[
"hist_id"]) :
$_POST[
"hist_id"];
1266 if (count($version_ids) < 1)
1269 $this->ctrl->redirect($this,
"versions");
1273 $ilTabs->activateTab(
"id_versions");
1276 $versionsToKeep = array_udiff($this->object->getVersions(), $version_ids, array($this,
"compareHistoryIds"));
1277 if (count($versionsToKeep) < 1)
1283 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1285 $conf_gui->setFormAction($this->ctrl->getFormAction($this,
"versions"));
1286 $conf_gui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteFile");
1287 $conf_gui->setConfirm($this->lng->txt(
"confirm"),
"confirmDeleteFile");
1289 $conf_gui->addItem(
"id[]", $this->ref_id, $this->object->getTitle(),
1291 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$this->object->getType()));
1293 $html = $conf_gui->getHTML();
1297 include_once(
"./Modules/File/classes/class.ilFileVersionTableGUI.php");
1300 $versions = $this->
object->getVersions($version_ids);
1303 $table->setMaxCount(
sizeof($versions));
1304 $table->setData($versions);
1306 $html = $table->getHTML();
1309 $this->tpl->setVariable(
'ADM_CONTENT', $html);
1323 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1327 if (count(
$_POST[
"hist_id"]) > 0)
1329 $this->
object->deleteVersions(
$_POST[
"hist_id"]);
1333 $this->ctrl->setParameter($this,
"hist_id",
"");
1334 $this->ctrl->redirect($this,
"versions");
1342 $this->ctrl->redirect($this,
"versions");
1353 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1357 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
1359 $ru->deleteObjects($this->parent_id, array($this->ref_id));
1362 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->parent_id);
1363 $this->ctrl->redirectByClass(
"ilrepositorygui");
1371 $this->ctrl->redirect($this,
"versions");
1384 $v1 = (int)$v1[
"hist_entry_id"];
1385 else if (!is_int($v1))
1389 $v2 = (
int)$v2[
"hist_entry_id"];
1390 else if (!is_int($v2))
1406 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1411 $version_ids = isset(
$_GET[
"hist_id"]) ? array(
$_GET[
"hist_id"]) :
$_POST[
"hist_id"];
1414 if (count($version_ids) != 1)
1417 $this->ctrl->redirect($this,
"versions");
1421 $new_version = $this->
object->rollback($version_ids[0]);
1423 ilUtil::sendSuccess(sprintf($this->lng->txt(
"file_rollback_done"), $new_version[
"rollback_version"]),
true);
1424 $this->ctrl->redirect($this,
"versions");
1429 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1432 if($this->object->hasRating())
1434 $lg->enableRating(
true,
null,
false,
1435 array(
"ilcommonactiondispatchergui",
"ilratinggui"));
_recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
_catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
_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 getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static isUploadPossible($a_additional_size=null)
Export User Interface Class.
static isDragAndDropUploadEnabled()
Gets whether drag and drop file upload is enabled.
Class to report exception.
processZipFile($a_directory, $a_file, $structure, $ref_id=null, $containerType=null, $tree=null, $access_handler=null)
unzips in given directory and processes uploaded zip for use as single files
Class ilFileVersionTableGUI.
static encode($mixed, $suppress_native=false)
static getMimeType($a_file="", $a_filename="", $a_mime="")
Get Mime type.
This class represents a non editable value in a property form.
static _getFileExtension($a_file_name)
Gets the file extension of the specified file name.
static _getPermanentDownloadLink($ref_id)
Gets the permanent download link for the file.
GUI class for file objects.
update()
updates object entry in object_data
handleFileUpload($file_upload)
Handles the upload of a single file and adds it to the parent object.
uploadFiles()
Called after a file was uploaded.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually,...
rollbackVersion()
Performs a rollback with the selected file version.
executeCommand()
execute command
versions()
file versions/history
confirmDeleteFile()
Deletes this file object.
getType()
Functions that must be overwritten.
compareHistoryIds($v1, $v2)
Compares two versions either by passing a history entry or an id.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
initSingleUploadForm()
FORM: Init single upload form.
initMultiUploadForm()
Initializes the upload form for multiple files.
saveUnzip()
saveUnzip object
static _goto($a_target, $a_additional=null)
cancelDeleteFile()
Cancels the file deletion.
infoScreenForward()
show information screen
cancelDeleteVersions()
Cancels the file version deletion.
confirmDeleteVersions()
Deletes the file versions that were confirmed by the user.
deleteVersions()
Displays a confirmation screen with selected file versions that should be deleted.
addLocatorItems()
Functions to be overwritten.
initZipUploadForm($a_mode="create")
FORM: Init zip upload form.
setTabs()
create tabs (repository/workspace switch)
_lookupFileSize($a_id)
Lookups the file size of the file in bytes.
New implementation of ilObjectGUI.
handleAutoRating(ilObject $a_new_obj)
Activate rating automatically if parent container setting.
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()
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.
static handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
After creation callback.
getCreationMode()
get creation mode
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
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)
const TITLE_LENGTH
max length of object title
static _lookupTitle($a_id)
lookup object title
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _readBookingByTransaction($a_transaction)
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
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.
Repository GUI Utilities.
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)
Default behaviour is:
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
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)
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']