4 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
5 require_once
"./Modules/File/classes/class.ilObjFile.php";
6 require_once
"./Modules/File/classes/class.ilObjFileAccess.php";
32 function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
35 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
53 $next_class = $this->ctrl->getNextClass($this);
54 $cmd = $this->ctrl->getCmd();
56 if($this->id_type == self::WORKSPACE_NODE_ID)
58 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
65 if(IS_PAYMENT_ENABLED)
67 include_once
'./Services/Payment/classes/class.ilPaymentObject.php';
68 if(ANONYMOUS_USER_ID == $ilUser->getId() && isset(
$_GET[
'transaction']))
70 $transaction =
$_GET[
'transaction'];
71 include_once
'./Services/Payment/classes/class.ilPaymentBookings.php';
76 ?
$_GET[
'purchasetype'] : NULL) ))
79 $this->tpl->getStandardTemplate();
81 include_once
'./Services/Payment/classes/class.ilShopPurchaseGUI.php';
83 $ret = $this->ctrl->forwardCommand($pp);
87 else if($this->id_type == self::REPOSITORY_NODE_ID
90 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->node_id);
91 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
92 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
95 $ilNavigationHistory->addItem($this->node_id,
104 case "ilinfoscreengui":
108 case 'ilobjectmetadatagui':
111 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
114 $ilTabs->activateTab(
"id_meta");
116 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
122 $this->ctrl->forwardCommand($md_gui);
126 case 'ilpermissiongui':
127 $ilTabs->activateTab(
"id_permissions");
128 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
130 $ret =& $this->ctrl->forwardCommand($perm_gui);
136 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
138 $ilTabs->activateTab(
"export");
139 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
141 $exp_gui->addFormat(
"xml");
142 $ret = $this->ctrl->forwardCommand($exp_gui);
145 case 'ilobjectcopygui':
146 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
148 $cp->setType(
'file');
149 $this->ctrl->forwardCommand($cp);
153 case "ilworkspaceaccessgui";
154 $ilTabs->activateTab(
"id_permissions");
155 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
157 $this->ctrl->forwardCommand($wspacc);
160 case "ilcommonactiondispatchergui":
161 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
163 $this->ctrl->forwardCommand($gui);
166 case "illearningprogressgui":
167 $ilTabs->activateTab(
'learning_progress');
168 require_once
'Services/Tracking/classes/class.ilLearningProgressGUI.php';
171 $this->object->getRefId(),
172 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId()
174 $this->ctrl->forwardCommand($new_gui);
175 $this->tabs_gui->setTabActive(
'learning_progress');
180 if($this->id_type == self::WORKSPACE_NODE_ID)
187 $ilCtrl->setCmd(
"infoScreen");
189 $ilTabs->clearTargets();
190 return parent::executeCommand();
209 if($this->id_type == self::WORKSPACE_NODE_ID)
211 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
214 $this->lng->loadLanguageModule(
"file");
216 $this->ctrl->redirect($this,
"cancel");
221 require_once(
"Services/FileUpload/classes/class.ilFileUploadSettings.php");
233 if($this->id_type != self::WORKSPACE_NODE_ID)
249 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
251 $single_form_gui->setMultipart(
true);
255 $in_title->
setInfo($this->lng->txt(
"if_no_title_then_filename"));
258 $single_form_gui->addItem($in_title);
262 $single_form_gui->addItem($in_descr);
267 $single_form_gui->addItem($in_file);
269 $single_form_gui->addCommandButton(
"save", $this->lng->txt($this->type.
"_add"));
270 $single_form_gui->addCommandButton(
"saveAndMeta", $this->lng->txt(
"file_add_and_metadata"));
271 $single_form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
273 $single_form_gui->setTableWidth(
"600px");
275 $single_form_gui->setTitle($this->lng->txt($this->type.
"_new"));
276 $single_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
278 $this->ctrl->setParameter($this,
"new_type",
"file");
280 $single_form_gui->setFormAction($this->ctrl->getFormAction($this,
"save"));
282 return $single_form_gui;
296 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
301 if ($single_form_gui->checkInput())
303 $title = $single_form_gui->getInput(
"title");
304 $description = $single_form_gui->getInput(
"description");
305 $upload_file = $single_form_gui->getInput(
"upload_file");
307 if (trim($title) ==
"")
309 $title = $upload_file[
"name"];
316 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
318 $title .=
'.'.$fileExtension;
324 include_once(
"./Modules/File/classes/class.ilObjFile.php");
326 $fileObj->setTitle($title);
327 $fileObj->setDescription($description);
328 $fileObj->setFileName($upload_file[
"name"]);
330 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
332 "", $upload_file[
"name"], $upload_file[
"type"]));
333 $fileObj->setFileSize($upload_file[
"size"]);
334 $this->object_id = $fileObj->create();
339 $fileObj->createDirectory();
340 $fileObj->getUploadFile($upload_file[
"tmp_name"],
341 $upload_file[
"name"]);
346 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
352 if ($this->ctrl->getCmd() ==
"saveAndMeta")
354 $this->ctrl->setParameter($this,
"new_type",
"");
355 $target = $this->ctrl->getLinkTargetByClass(array(
"ilobjectmetadatagui",
"ilmdeditorgui"),
"listSection",
"",
false,
false);
360 $this->ctrl->returnToParent($this);
365 $single_form_gui->setValuesByPost();
366 $this->tpl->setContent($single_form_gui->getHTML());
387 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
389 $zip_form_gui->setMultipart(
true);
394 $in_file->setSuffixes(array(
"zip"));
395 $zip_form_gui->addItem($in_file);
398 $in_str =
new ilCheckboxInputGUI($this->lng->txt(
"take_over_structure"),
"adopt_structure");
399 $in_str->
setInfo($this->lng->txt(
"take_over_structure_info"));
400 $zip_form_gui->addItem($in_str);
402 $zip_form_gui->addCommandButton(
"saveUnzip", $this->lng->txt($this->type.
"_add"));
403 $zip_form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
405 $zip_form_gui->setTableWidth(
"600px");
407 $zip_form_gui->setTitle($this->lng->txt(
"header_zip"));
408 $zip_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
410 $this->ctrl->setParameter($this,
"new_type",
"file");
412 $zip_form_gui->setFormAction($this->ctrl->getFormAction($this,
"saveUnzip"));
414 return $zip_form_gui;
428 if ($zip_form_gui->checkInput())
430 $zip_file = $zip_form_gui->getInput(
"zip_file");
431 $adopt_structure = $zip_form_gui->getInput(
"adopt_structure");
433 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
440 if($this->id_type != self::WORKSPACE_NODE_ID)
457 $containerType =
"WorkspaceFolder";
466 $containerType =
"Category";
472 $containerType =
"Folder";
485 $zip_file[
"tmp_name"],
486 ($adopt_structure && $permission),
499 $this->ctrl->returnToParent($this);
503 $zip_form_gui->setValuesByPost();
504 $this->tpl->setContent($zip_form_gui->getHTML());
509 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
523 if(!$form->checkInput())
525 $ilTabs->activateTab(
"settings");
526 $form->setValuesByPost();
527 $this->tpl->setContent($form->getHTML());
531 $data = $form->getInput(
'file');
534 while (substr(
$data[
"name"],-1) ==
'/')
540 $title = $form->getInput(
'title');
541 if(strlen(trim($title)) == 0)
547 $title = $this->
object->checkFileExtension(
$filename,$title);
549 $this->
object->setTitle($title);
551 if (!empty(
$data[
"name"]))
553 switch($form->getInput(
'replace'))
556 $this->
object->deleteVersions();
557 $this->
object->clearDataDirectory();
558 $this->
object->replaceFile(
$data[
'tmp_name'],
$data[
'name']);
561 $this->
object->addFileVersion(
$data[
'tmp_name'],
$data[
'name']);
564 $this->
object->setFileName(
$data[
'name']);
565 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
568 $this->
object->setFileSize(
$data[
'size']);
571 $this->
object->setDescription($form->getInput(
'description'));
572 $this->
object->setRating($form->getInput(
'rating'));
574 $this->
update = $this->
object->update();
577 if (!empty(
$data[
"name"]))
579 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
587 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
589 $ecs->handleSettingsUpdate();
606 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"));
609 $ilTabs->activateTab(
"settings");
614 $val[
'title'] = $this->
object->getTitle();
615 $val[
'description'] = $this->
object->getLongDescription();
616 $val[
'rating'] = $this->
object->hasRating();
617 $form->setValuesByArray($val);
620 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
622 $ecs->addSettingsToForm($form,
'file');
624 $this->tpl->setContent($form->getHTML());
635 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
637 $this->lng->loadLanguageModule(
'file');
640 $form->setFormAction($this->ctrl->getFormAction($this),
'update');
641 $form->setTitle($this->lng->txt(
'file_edit'));
642 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
643 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
646 $title->
setValue($this->object->getTitle());
647 $title->setInfo($this->lng->txt(
"if_no_title_then_filename"));
648 $form->addItem($title);
650 $upload_possible =
true;
651 if($this->id_type == self::WORKSPACE_NODE_ID)
653 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
660 $file->setRequired(
false);
662 $form->addItem(
$file);
667 $replace =
new ilRadioOption($this->lng->txt(
'replace_file'),1);
668 $replace->
setInfo($this->lng->txt(
'replace_file_info'));
669 $group->addOption($replace);
672 $keep =
new ilRadioOption($this->lng->txt(
'file_new_version'),0);
673 $keep->
setInfo($this->lng->txt(
'file_new_version_info'));
674 $group->addOption($keep);
676 $file->addSubItem($group);
681 $file->setValue($this->lng->txt(
"personal_workspace_quota_exceeded_warning"));
682 $form->addItem(
$file);
688 $form->addItem($desc);
690 if($this->id_type == self::REPOSITORY_NODE_ID)
692 $this->lng->loadLanguageModule(
'rating');
694 $rate->
setInfo($this->lng->txt(
'rating_activate_rating_info'));
695 $form->addItem($rate);
705 if(ANONYMOUS_USER_ID == $ilUser->getId() && isset(
$_GET[
'transaction']) )
707 $this->
object->sendFile(
$_GET[
"hist_id"]);
713 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
717 $this->
object->getId(), $ilUser->getId());
720 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
723 $this->
object->sendFile(
$_GET[
"hist_id"]);
727 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
742 $ilTabs->activateTab(
"id_versions");
746 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
750 $versions = $this->
object->getVersions();
753 require_once(
"Modules/File/classes/class.ilFileVersionTableGUI.php");
755 $table->setMaxCount(
sizeof($versions));
756 $table->setData($versions);
758 $this->tpl->setVariable(
"ADM_CONTENT", $table->getHTML());
768 $this->ctrl->setCmd(
"showSummary");
769 $this->ctrl->setCmdClass(
"ilinfoscreengui");
778 global $ilTabs,
$ilErr, $ilToolbar;
780 $ilTabs->activateTab(
"id_info");
784 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
787 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
793 $this->lng->loadLanguageModule(
"file");
796 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
798 $button->setCaption(
"file_download");
799 $button->setPrimary(
true);
802 if ($this->id_type == self::REPOSITORY_NODE_ID)
808 $button->setUrl($this->ctrl->getLinkTarget($this,
"sendfile"));
811 $ilToolbar->addButtonInstance($button);
814 $info->enablePrivateNotes();
822 $info->enableNewsEditing(
false);
826 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
828 if ($enable_internal_rss)
830 $info->setBlockProperty(
"news",
"settings",
true);
831 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
837 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
839 $info->addSection($this->lng->txt(
"file_info"));
840 $info->addProperty($this->lng->txt(
"filename"),
841 $this->
object->getFileName());
843 $info->addProperty($this->lng->txt(
"type"),
844 $this->
object->guessFileType());
846 $info->addProperty($this->lng->txt(
"size"),
848 $info->addProperty($this->lng->txt(
"version"),
849 $this->
object->getVersion());
852 $uploader = $this->
object->getVersions();
853 $uploader = array_shift($uploader);
854 $uploader = $uploader[
"user_id"];
856 $this->lng->loadLanguageModule(
"file");
857 include_once
"Services/User/classes/class.ilUserUtil.php";
861 if ($this->id_type == self::REPOSITORY_NODE_ID && $this->
checkPermissionBool(
"read",
"sendfile"))
863 $tpl =
new ilTemplate(
"tpl.download_link.html",
true,
true,
"Modules/File");
865 $info->addProperty($this->lng->txt(
"download_link"),
$tpl->get());
868 if($this->id_type == self::WORKSPACE_NODE_ID)
874 include_once(
"./Services/Preview/classes/class.ilPreview.php");
875 if (!$this->ctrl->isAsynch() &&
879 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
883 switch ($this->id_type)
885 case self::WORKSPACE_NODE_ID:
886 case self::WORKSPACE_OBJECT_ID:
896 $info->addProperty($this->lng->txt(
"preview"),
$preview->getInlineHTML());
902 $this->ctrl->forwardCommand(
$info);
909 global $ilTabs,
$lng, $ilHelp;
911 $ilHelp->setScreenIdComponent(
"file");
913 $this->ctrl->setParameter($this,
"ref_id",$this->node_id);
917 $ilTabs->addTab(
"id_info",
918 $lng->txt(
"info_short"),
919 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilegui",
"ilinfoscreengui"),
"showSummary"));
924 $ilTabs->addTab(
"settings",
926 $this->ctrl->getLinkTarget($this,
"edit"));
931 $ilTabs->addTab(
"id_versions",
932 $lng->txt(
"versions"),
933 $this->ctrl->getLinkTarget($this,
"versions"));
936 require_once
'Services/Tracking/classes/class.ilLearningProgressAccess.php';
941 $lng->txt(
'learning_progress'),
942 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
949 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
951 $mdtab = $mdgui->getTab();
954 $ilTabs->addTab(
"id_meta",
955 $lng->txt(
"meta_data"),
963 $ilTabs->addTab(
"export",
965 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
972 public static function _goto($a_target, $a_additional = null)
976 if($a_additional && substr($a_additional, -3) ==
"wsp")
978 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
979 $_GET[
"wsp_id"] = $a_target;
980 include(
"ilias.php");
985 if($a_additional && substr($a_additional, -8) ==
"download")
992 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
993 $ilAccess->checkAccess(
"read",
"", $a_target))
997 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1004 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1014 if (is_object($this->
object))
1016 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
1027 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1029 $dnd_form_gui->setMultipart(
true);
1030 $dnd_form_gui->setHideLabels();
1033 include_once(
"Services/Form/classes/class.ilDragDropFileInputGUI.php");
1036 $dnd_input->setCommandButtonNames(
"uploadFiles",
"cancel");
1037 $dnd_form_gui->addItem($dnd_input);
1040 $dnd_form_gui->addCommandButton(
"uploadFiles", $this->lng->txt(
"upload_files"));
1041 $dnd_form_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1043 $dnd_form_gui->setTableWidth(
"100%");
1045 $dnd_form_gui->setTitle($this->lng->txt(
"upload_files_title"));
1046 $dnd_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.gif'), $this->lng->txt(
'obj_file'));
1048 $this->ctrl->setParameter($this,
"new_type",
"file");
1049 $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this,
"uploadFiles"));
1051 return $dnd_form_gui;
1059 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
1061 $response =
new stdClass();
1062 $response->error = null;
1063 $response->debug = null;
1068 $after_creation_callback = (int)
$_REQUEST[
"crtcb"];
1069 if($after_creation_callback)
1071 $this->after_creation_callback_objects = array();
1077 if ($dnd_form_gui->checkInput())
1083 $response->error = $this->lng->txt(
"permission_denied");
1088 $inp = $dnd_form_gui->getInput(
"upload_files");
1089 $this->log->debug(
"ilObjFileGUI::uploadFiles ".print_r(
$_POST,
true));
1090 $this->log->debug(
"ilObjFileGUI::uploadFiles ".print_r($_FILES,
true));
1093 $response = (object)array_merge((array)$response, (array)$fileresult);
1098 $response->error = $ex->getMessage() .
" ## " . $ex->getTraceAsString();
1103 $dnd_input = $dnd_form_gui->getItemByPostVar(
"upload_files");
1104 $response->error = $dnd_input->getAlert();
1107 if($after_creation_callback &&
1108 sizeof($this->after_creation_callback_objects))
1110 foreach($this->after_creation_callback_objects as $new_file_obj)
1114 unset($this->after_creation_callback_objects);
1118 header(
'Vary: Accept');
1119 header(
'Content-type: text/plain');
1135 require_once(
'./Services/Utilities/classes/class.ilFileUtils.php');
1140 $temp_name = $file_upload[
"tmp_name"];
1149 $response =
new stdClass();
1151 $response->fileSize = intval(
$size);
1152 $response->fileType = $type;
1153 $response->fileUnzipped = $extract;
1154 $response->error = null;
1160 $adopt_structure = $keep_structure;
1162 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
1169 if($this->id_type != self::WORKSPACE_NODE_ID)
1185 $containerType =
"WorkspaceFolder";
1194 $containerType =
"Category";
1200 $containerType =
"Folder";
1216 ($adopt_structure && $permission),
1224 $response->error = $e->getMessage();
1228 $response->error = $ex->getMessage();
1234 if($this->id_type != self::WORKSPACE_NODE_ID)
1238 if($parent_ref_id != $this->parent_id)
1245 $this->after_creation_callback_objects[] =
$object;
1252 if (trim($title) ==
"")
1261 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
1263 $title .=
'.'.$fileExtension;
1269 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1271 $fileObj->setTitle($title);
1272 $fileObj->setDescription($description);
1275 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
1277 $fileObj->setFileSize(
$size);
1278 $this->object_id = $fileObj->create();
1283 if(is_array($this->after_creation_callback_objects))
1285 $this->after_creation_callback_objects[] = $fileObj;
1289 $fileObj->createDirectory();
1290 $fileObj->raiseUploadError(
false);
1291 $fileObj->getUploadFile($temp_name,
$filename,
false);
1296 require_once(
'./Services/Tracking/classes/class.ilChangeEvent.php');
1309 global $ilTabs, $ilLocator;
1313 $version_ids = isset(
$_GET[
"hist_id"]) ? array(
$_GET[
"hist_id"]) :
$_POST[
"hist_id"];
1315 if (count($version_ids) < 1)
1318 $this->ctrl->redirect($this,
"versions");
1322 $ilTabs->activateTab(
"id_versions");
1325 $versionsToKeep = array_udiff($this->object->getVersions(), $version_ids, array($this,
"compareHistoryIds"));
1326 if (count($versionsToKeep) < 1)
1332 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1334 $conf_gui->setFormAction($this->ctrl->getFormAction($this,
"versions"));
1335 $conf_gui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteFile");
1336 $conf_gui->setConfirm($this->lng->txt(
"confirm"),
"confirmDeleteFile");
1338 $conf_gui->addItem(
"id[]", $this->ref_id, $this->object->getTitle(),
1340 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$this->object->getType()));
1342 $html = $conf_gui->getHTML();
1346 include_once(
"./Modules/File/classes/class.ilFileVersionTableGUI.php");
1349 $versions = $this->
object->getVersions($version_ids);
1352 $table->setMaxCount(
sizeof($versions));
1353 $table->setData($versions);
1355 $html = $table->getHTML();
1358 $this->tpl->setVariable(
'ADM_CONTENT',
$html);
1372 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1376 if (count(
$_POST[
"hist_id"]) > 0)
1378 $this->
object->deleteVersions(
$_POST[
"hist_id"]);
1382 $this->ctrl->setParameter($this,
"hist_id",
"");
1383 $this->ctrl->redirect($this,
"versions");
1391 $this->ctrl->redirect($this,
"versions");
1402 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1406 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
1408 $ru->deleteObjects($this->parent_id, array($this->ref_id));
1411 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->parent_id);
1412 $this->ctrl->redirectByClass(
"ilrepositorygui");
1420 $this->ctrl->redirect($this,
"versions");
1433 $v1 = (int)$v1[
"hist_entry_id"];
1434 else if (!is_int($v1))
1438 $v2 = (
int)$v2[
"hist_entry_id"];
1439 else if (!is_int($v2))
1455 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1460 $version_ids = isset(
$_GET[
"hist_id"]) ? array(
$_GET[
"hist_id"]) :
$_POST[
"hist_id"];
1463 if (count($version_ids) != 1)
1466 $this->ctrl->redirect($this,
"versions");
1470 $new_version = $this->
object->rollback($version_ids[0]);
1472 ilUtil::sendSuccess(sprintf($this->lng->txt(
"file_rollback_done"), $new_version[
"rollback_version"]),
true);
1473 $this->ctrl->redirect($this,
"versions");
1478 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1481 if($this->object->hasRating())
1483 $lg->enableRating(
true, null,
false,
1484 array(
"ilcommonactiondispatchergui",
"ilratinggui"));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initSingleUploadForm()
FORM: Init single upload form.
This class represents an option in a radio group.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
infoScreenForward()
show information screen
static _getPermanentDownloadLink($ref_id)
Gets the permanent download link for the file.
handleFileUpload($file_upload)
Handles the upload of a single file and adds it to the parent object.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
New implementation of ilObjectGUI.
rollbackVersion()
Performs a rollback with the selected file version.
GUI class for the workflow of copying objects.
cancelDeleteFile()
Cancels the file deletion.
const TITLE_LENGTH
max length of object title
getAccessHandler()
Get access handler.
static _getFileExtension($a_file_name)
Gets the file extension of the specified file name.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
initZipUploadForm($a_mode="create")
FORM: Init zip upload form.
getPermanentLinkWidget($a_append=null, $a_center=false)
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
fillCloneTemplate($a_tpl_varname, $a_type)
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
setInfo($a_info)
Set Info.
static _goto($a_target, $a_additional=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
compareHistoryIds($v1, $v2)
Compares two versions either by passing a history entry or an id.
static getMimeType($a_file='', $a_filename='', $a_mime='')
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
initImportForm($a_new_type)
Init object import 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)
Default behaviour is:
static encode($mixed, $suppress_native=false)
static hasPreview($a_obj_id, $a_type="")
Determines whether the object with the specified reference id has a preview.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
confirmDeleteFile()
Deletes this file object.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
handleAutoRating(ilObject $a_new_obj)
Repository GUI Utilities.
This class represents a text property in a property form.
static isUploadPossible($a_additional_size=null)
uploadFiles()
Called after a file was uploaded.
saveUnzip()
saveUnzip object
static handleAfterSaveCallback(ilObject $a_obj, $a_callback_ref_id)
After creation callback.
getTargetFrame($a_cmd, $a_target_frame="")
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
_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.
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
static ilTempnam($a_temp_path=null)
Create a temporary file in an ILIAS writable directory.
static _lookupFileSize($a_id)
Lookups the file size of the file in bytes.
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
GUI class for file objects.
const LP_CONTEXT_REPOSITORY
This class represents a text area property in a property form.
confirmDeleteVersions()
Deletes the file versions that were confirmed by the user.
initMultiUploadForm()
Initializes the upload form for multiple files.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getLogger($a_component_id)
Get component logger.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
deleteVersions()
Displays a confirmation screen with selected file versions that should be deleted.
cancelDeleteVersions()
Cancels the file version deletion.
setValue($a_value)
Set Value.
_catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
static redirect($a_script)
http redirect to other script
versions()
file versions/history
addHeaderAction()
Add header action menu.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static _readBookingByTransaction($a_transaction)
Class ilObjUserTrackingGUI.
Class ilFileVersionTableGUI.
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
static getValidFilename($a_filename)
Get valid filename.
_recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static isDragAndDropUploadEnabled()
Gets whether drag and drop file upload is enabled.
update()
updates object entry in object_data
Class to report exception.
Confirmation screen class.