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);
47 $next_class = $this->ctrl->getNextClass($this);
48 $cmd = $this->ctrl->getCmd();
50 if($this->id_type == self::WORKSPACE_NODE_ID)
52 include_once
"Services/Form/classes/class.ilFileInputGUI.php";
58 if($this->id_type == self::REPOSITORY_NODE_ID
61 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->node_id);
62 $link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"infoScreen");
63 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
66 $ilNavigationHistory->addItem($this->node_id,
75 case "ilinfoscreengui":
79 case 'ilobjectmetadatagui':
82 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
85 $ilTabs->activateTab(
"id_meta");
87 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
93 $this->ctrl->forwardCommand($md_gui);
97 case 'ilpermissiongui':
98 $ilTabs->activateTab(
"id_permissions");
99 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
101 $ret = $this->ctrl->forwardCommand($perm_gui);
105 $ilTabs->activateTab(
"export");
106 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
108 $exp_gui->addFormat(
"xml");
109 $ret = $this->ctrl->forwardCommand($exp_gui);
112 case 'ilobjectcopygui':
113 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
115 $cp->setType(
'file');
116 $this->ctrl->forwardCommand($cp);
120 case "ilworkspaceaccessgui";
121 $ilTabs->activateTab(
"id_permissions");
122 include_once(
'./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php');
124 $this->ctrl->forwardCommand($wspacc);
127 case "ilcommonactiondispatchergui":
128 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
130 $this->ctrl->forwardCommand($gui);
133 case "illearningprogressgui":
134 $ilTabs->activateTab(
'learning_progress');
135 require_once
'Services/Tracking/classes/class.ilLearningProgressGUI.php';
138 $this->
object->getRefId(),
139 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId()
141 $this->ctrl->forwardCommand($new_gui);
142 $this->tabs_gui->setTabActive(
'learning_progress');
147 if($this->id_type == self::WORKSPACE_NODE_ID)
154 $ilCtrl->setCmd(
"infoScreen");
156 $ilTabs->clearTargets();
157 return parent::executeCommand();
179 if($this->id_type == self::WORKSPACE_NODE_ID)
181 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
184 $this->lng->loadLanguageModule(
"file");
186 $this->ctrl->redirect($this,
"cancel");
191 require_once(
"Services/FileUpload/classes/class.ilFileUploadSettings.php");
203 if($this->id_type != self::WORKSPACE_NODE_ID)
219 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
221 $single_form_gui->setMultipart(
true);
225 $in_title->
setInfo($this->lng->txt(
"if_no_title_then_filename"));
228 $single_form_gui->addItem($in_title);
232 $single_form_gui->addItem($in_descr);
237 $single_form_gui->addItem($in_file);
239 $single_form_gui->addCommandButton(
"save", $this->lng->txt($this->type.
"_add"));
240 $single_form_gui->addCommandButton(
"saveAndMeta", $this->lng->txt(
"file_add_and_metadata"));
241 $single_form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
243 $single_form_gui->setTableWidth(
"600px");
245 $single_form_gui->setTitle($this->lng->txt($this->type.
"_new"));
246 $single_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
248 $this->ctrl->setParameter($this,
"new_type",
"file");
250 $single_form_gui->setFormAction($this->ctrl->getFormAction($this,
"save"));
252 return $single_form_gui;
266 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
271 if ($single_form_gui->checkInput())
273 $title = $single_form_gui->getInput(
"title");
274 $description = $single_form_gui->getInput(
"description");
275 $upload_file = $single_form_gui->getInput(
"upload_file");
279 $title = $upload_file[
"name"];
286 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
288 $title .=
'.'.$fileExtension;
294 include_once(
"./Modules/File/classes/class.ilObjFile.php");
296 $fileObj->setTitle(
$title);
297 $fileObj->setDescription($description);
298 $fileObj->setFileName($upload_file[
"name"]);
300 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
302 "", $upload_file[
"name"], $upload_file[
"type"]));
303 $fileObj->setFileSize($upload_file[
"size"]);
304 $this->object_id = $fileObj->create();
309 $fileObj->createDirectory();
310 $fileObj->getUploadFile($upload_file[
"tmp_name"],
311 $upload_file[
"name"]);
316 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
322 if ($this->ctrl->getCmd() ==
"saveAndMeta")
324 $this->ctrl->setParameter($this,
"new_type",
"");
325 $target = $this->ctrl->getLinkTargetByClass(
array(
"ilobjectmetadatagui",
"ilmdeditorgui"),
"listSection",
"",
false,
false);
330 $this->ctrl->returnToParent($this);
335 $single_form_gui->setValuesByPost();
336 $this->tpl->setContent($single_form_gui->getHTML());
357 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
359 $zip_form_gui->setMultipart(
true);
364 $in_file->setSuffixes(
array(
"zip"));
365 $zip_form_gui->addItem($in_file);
368 $in_str =
new ilCheckboxInputGUI($this->lng->txt(
"take_over_structure"),
"adopt_structure");
369 $in_str->
setInfo($this->lng->txt(
"take_over_structure_info"));
370 $zip_form_gui->addItem($in_str);
372 $zip_form_gui->addCommandButton(
"saveUnzip", $this->lng->txt($this->type.
"_add"));
373 $zip_form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
375 $zip_form_gui->setTableWidth(
"600px");
377 $zip_form_gui->setTitle($this->lng->txt(
"header_zip"));
378 $zip_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.svg'), $this->lng->txt(
'obj_file'));
380 $this->ctrl->setParameter($this,
"new_type",
"file");
382 $zip_form_gui->setFormAction($this->ctrl->getFormAction($this,
"saveUnzip"));
384 return $zip_form_gui;
398 if ($zip_form_gui->checkInput())
400 $zip_file = $zip_form_gui->getInput(
"zip_file");
401 $adopt_structure = $zip_form_gui->getInput(
"adopt_structure");
403 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
410 if($this->id_type != self::WORKSPACE_NODE_ID)
427 $containerType =
"WorkspaceFolder";
436 $containerType =
"Category";
442 $containerType =
"Folder";
455 $zip_file[
"tmp_name"],
456 ($adopt_structure && $permission),
469 $this->ctrl->returnToParent($this);
473 $zip_form_gui->setValuesByPost();
474 $this->tpl->setContent($zip_form_gui->getHTML());
479 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
493 if(!$form->checkInput())
495 $ilTabs->activateTab(
"settings");
496 $form->setValuesByPost();
497 $this->tpl->setContent($form->getHTML());
501 $data = $form->getInput(
'file');
507 $title = $form->getInput(
'title');
508 if(strlen(trim(
$title)) == 0)
516 $this->
object->setTitle(
$title);
518 if (!empty(
$data[
"name"]))
520 switch($form->getInput(
'replace'))
523 $this->
object->deleteVersions();
524 $this->
object->clearDataDirectory();
525 $this->
object->replaceFile(
$data[
'tmp_name'],
$data[
'name']);
528 $this->
object->addFileVersion(
$data[
'tmp_name'],
$data[
'name']);
531 $this->
object->setFileName(
$data[
'name']);
532 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
535 $this->
object->setFileSize(
$data[
'size']);
538 $this->
object->setDescription($form->getInput(
'description'));
539 $this->
object->setRating($form->getInput(
'rating'));
541 $this->
update = $this->
object->update();
544 if (!empty(
$data[
"name"]))
546 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
554 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
556 $ecs->handleSettingsUpdate();
573 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"));
576 $ilTabs->activateTab(
"settings");
581 $val[
'title'] = $this->
object->getTitle();
582 $val[
'description'] = $this->
object->getLongDescription();
583 $val[
'rating'] = $this->
object->hasRating();
584 $form->setValuesByArray($val);
587 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
589 $ecs->addSettingsToForm($form,
'file');
591 $this->tpl->setContent($form->getHTML());
602 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
604 $this->lng->loadLanguageModule(
'file');
607 $form->setFormAction($this->ctrl->getFormAction($this),
'update');
608 $form->setTitle($this->lng->txt(
'file_edit'));
609 $form->addCommandButton(
'update',$this->lng->txt(
'save'));
610 $form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
614 $title->setInfo($this->lng->txt(
"if_no_title_then_filename"));
617 $upload_possible =
true;
618 if($this->id_type == self::WORKSPACE_NODE_ID)
620 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
627 $file->setRequired(
false);
629 $form->addItem(
$file);
634 $replace =
new ilRadioOption($this->lng->txt(
'replace_file'),1);
635 $replace->
setInfo($this->lng->txt(
'replace_file_info'));
636 $group->addOption($replace);
639 $keep =
new ilRadioOption($this->lng->txt(
'file_new_version'),0);
640 $keep->
setInfo($this->lng->txt(
'file_new_version_info'));
641 $group->addOption($keep);
643 $file->addSubItem($group);
648 $file->setValue($this->lng->txt(
"personal_workspace_quota_exceeded_warning"));
649 $form->addItem(
$file);
655 $form->addItem($desc);
657 if($this->id_type == self::REPOSITORY_NODE_ID)
659 $this->lng->loadLanguageModule(
'rating');
661 $rate->
setInfo($this->lng->txt(
'rating_activate_rating_info'));
662 $form->addItem($rate);
672 if(ANONYMOUS_USER_ID == $ilUser->getId() && isset(
$_GET[
'transaction']) )
674 $this->
object->sendFile(
$_GET[
"hist_id"]);
680 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
684 $this->
object->getId(), $ilUser->getId());
687 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
690 $this->
object->sendFile(
$_GET[
"hist_id"]);
694 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
709 $ilTabs->activateTab(
"id_versions");
713 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
717 $versions = $this->
object->getVersions();
720 require_once(
"Modules/File/classes/class.ilFileVersionTableGUI.php");
722 $table->setMaxCount(
sizeof($versions));
723 $table->setData($versions);
725 $this->tpl->setVariable(
"ADM_CONTENT", $table->getHTML());
735 $this->ctrl->setCmd(
"showSummary");
736 $this->ctrl->setCmdClass(
"ilinfoscreengui");
745 global $ilTabs,
$ilErr, $ilToolbar;
747 $ilTabs->activateTab(
"id_info");
751 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
754 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
760 $this->lng->loadLanguageModule(
"file");
763 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
765 $button->setCaption(
"file_download");
766 $button->setPrimary(
true);
769 if ($this->id_type == self::REPOSITORY_NODE_ID)
775 $button->setUrl($this->ctrl->getLinkTarget($this,
"sendfile"));
778 $ilToolbar->addButtonInstance($button);
781 $info->enablePrivateNotes();
789 $info->enableNewsEditing(
false);
793 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
795 if ($enable_internal_rss)
797 $info->setBlockProperty(
"news",
"settings",
true);
798 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
804 $info->addMetaDataSections($this->
object->getId(),0, $this->
object->getType());
806 $info->addSection($this->lng->txt(
"file_info"));
807 $info->addProperty($this->lng->txt(
"filename"),
808 $this->
object->getFileName());
810 $info->addProperty($this->lng->txt(
"type"),
811 $this->
object->guessFileType());
813 $info->addProperty($this->lng->txt(
"size"),
815 $info->addProperty($this->lng->txt(
"version"),
816 $this->
object->getVersion());
819 $uploader = $this->
object->getVersions();
820 $uploader = array_shift($uploader);
821 $uploader = $uploader[
"user_id"];
823 $this->lng->loadLanguageModule(
"file");
824 include_once
"Services/User/classes/class.ilUserUtil.php";
828 if ($this->id_type == self::REPOSITORY_NODE_ID && $this->
checkPermissionBool(
"read",
"sendfile"))
830 $tpl =
new ilTemplate(
"tpl.download_link.html",
true,
true,
"Modules/File");
832 $info->addProperty($this->lng->txt(
"download_link"),
$tpl->get());
835 if($this->id_type == self::WORKSPACE_NODE_ID)
841 include_once(
"./Services/Preview/classes/class.ilPreview.php");
842 if (!$this->ctrl->isAsynch() &&
846 include_once(
"./Services/Preview/classes/class.ilPreviewGUI.php");
850 switch ($this->id_type)
852 case self::WORKSPACE_NODE_ID:
853 case self::WORKSPACE_OBJECT_ID:
863 $info->addProperty($this->lng->txt(
"preview"),
$preview->getInlineHTML());
869 $this->ctrl->forwardCommand(
$info);
876 global $ilTabs,
$lng, $ilHelp;
878 $ilHelp->setScreenIdComponent(
"file");
880 $this->ctrl->setParameter($this,
"ref_id",$this->node_id);
884 $ilTabs->addTab(
"id_info",
885 $lng->txt(
"info_short"),
886 $this->ctrl->getLinkTargetByClass(
array(
"ilobjfilegui",
"ilinfoscreengui"),
"showSummary"));
891 $ilTabs->addTab(
"settings",
893 $this->ctrl->getLinkTarget($this,
"edit"));
898 $ilTabs->addTab(
"id_versions",
899 $lng->txt(
"versions"),
900 $this->ctrl->getLinkTarget($this,
"versions"));
903 require_once
'Services/Tracking/classes/class.ilLearningProgressAccess.php';
908 $lng->txt(
'learning_progress'),
909 $this->ctrl->getLinkTargetByClass(
array(__CLASS__,
'illearningprogressgui'),
'')
916 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
918 $mdtab = $mdgui->getTab();
921 $ilTabs->addTab(
"id_meta",
922 $lng->txt(
"meta_data"),
930 $ilTabs->addTab(
"export",
932 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
939 public static function _goto($a_target, $a_additional = null)
943 if($a_additional && substr($a_additional, -3) ==
"wsp")
945 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
946 $_GET[
"wsp_id"] = $a_target;
947 include(
"ilias.php");
952 if($a_additional && substr($a_additional, -8) ==
"download")
959 if ($ilAccess->checkAccess(
"visible",
"", $a_target) ||
960 $ilAccess->checkAccess(
"read",
"", $a_target))
964 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
971 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
981 if (is_object($this->
object))
983 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
994 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
996 $dnd_form_gui->setMultipart(
true);
997 $dnd_form_gui->setHideLabels();
1000 include_once(
"Services/Form/classes/class.ilDragDropFileInputGUI.php");
1003 $dnd_input->setCommandButtonNames(
"uploadFiles",
"cancel");
1004 $dnd_form_gui->addItem($dnd_input);
1007 $dnd_form_gui->addCommandButton(
"uploadFiles", $this->lng->txt(
"upload_files"));
1008 $dnd_form_gui->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1010 $dnd_form_gui->setTableWidth(
"100%");
1012 $dnd_form_gui->setTitle($this->lng->txt(
"upload_files_title"));
1013 $dnd_form_gui->setTitleIcon(
ilUtil::getImagePath(
'icon_file.gif'), $this->lng->txt(
'obj_file'));
1015 $this->ctrl->setParameter($this,
"new_type",
"file");
1016 $dnd_form_gui->setFormAction($this->ctrl->getFormAction($this,
"uploadFiles"));
1018 return $dnd_form_gui;
1026 include_once(
"./Services/JSON/classes/class.ilJsonUtil.php");
1028 $response =
new stdClass();
1029 $response->error = null;
1030 $response->debug = null;
1035 $after_creation_callback = (int)$_REQUEST[
"crtcb"];
1036 if($after_creation_callback)
1038 $this->after_creation_callback_objects =
array();
1039 unset($_REQUEST[
"crtcb"]);
1044 if ($dnd_form_gui->checkInput())
1050 $response->error = $this->lng->txt(
"permission_denied");
1055 $inp = $dnd_form_gui->getInput(
"upload_files");
1056 $this->log->debug(
"ilObjFileGUI::uploadFiles ".print_r(
$_POST,
true));
1057 $this->log->debug(
"ilObjFileGUI::uploadFiles ".print_r($_FILES,
true));
1065 $response->error = $ex->getMessage() .
" ## " . $ex->getTraceAsString();
1070 $dnd_input = $dnd_form_gui->getItemByPostVar(
"upload_files");
1071 $response->error = $dnd_input->getAlert();
1074 if($after_creation_callback &&
1075 sizeof($this->after_creation_callback_objects))
1077 foreach($this->after_creation_callback_objects as $new_file_obj)
1081 unset($this->after_creation_callback_objects);
1086 header(
'Content-type: text/plain');
1102 require_once(
'./Services/Utilities/classes/class.ilFileUtils.php');
1107 $temp_name = $file_upload[
"tmp_name"];
1116 $response =
new stdClass();
1118 $response->fileSize = intval(
$size);
1119 $response->fileType = $type;
1120 $response->fileUnzipped = $extract;
1121 $response->error = null;
1127 $adopt_structure = $keep_structure;
1129 include_once (
"Services/Utilities/classes/class.ilFileUtils.php");
1136 if($this->id_type != self::WORKSPACE_NODE_ID)
1152 $containerType =
"WorkspaceFolder";
1161 $containerType =
"Category";
1167 $containerType =
"Folder";
1183 ($adopt_structure && $permission),
1191 $response->error = $e->getMessage();
1195 $response->error = $ex->getMessage();
1201 if($this->id_type != self::WORKSPACE_NODE_ID)
1205 if($parent_ref_id != $this->parent_id)
1212 $this->after_creation_callback_objects[] =
$object;
1228 if ($titleExtension != $fileExtension && strlen($fileExtension) > 0)
1230 $title .=
'.'.$fileExtension;
1236 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1238 $fileObj->setTitle(
$title);
1239 $fileObj->setDescription($description);
1242 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
1244 $fileObj->setFileSize(
$size);
1245 $this->object_id = $fileObj->create();
1250 if(is_array($this->after_creation_callback_objects))
1252 $this->after_creation_callback_objects[] = $fileObj;
1256 $fileObj->createDirectory();
1257 $fileObj->raiseUploadError(
false);
1258 $fileObj->getUploadFile($temp_name,
$filename,
false);
1263 require_once(
'./Services/Tracking/classes/class.ilChangeEvent.php');
1276 global $ilTabs, $ilLocator;
1282 if (count($version_ids) < 1)
1285 $this->ctrl->redirect($this,
"versions");
1289 $ilTabs->activateTab(
"id_versions");
1292 $versionsToKeep = array_udiff($this->
object->getVersions(), $version_ids,
array($this,
"compareHistoryIds"));
1293 if (count($versionsToKeep) < 1)
1299 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1301 $conf_gui->setFormAction($this->ctrl->getFormAction($this,
"versions"));
1302 $conf_gui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteFile");
1303 $conf_gui->setConfirm($this->lng->txt(
"confirm"),
"confirmDeleteFile");
1305 $conf_gui->addItem(
"id[]", $this->ref_id, $this->
object->getTitle(),
1307 $this->lng->txt(
"icon").
" ".$this->lng->txt(
"obj_".$this->
object->getType()));
1309 $html = $conf_gui->getHTML();
1313 include_once(
"./Modules/File/classes/class.ilFileVersionTableGUI.php");
1316 $versions = $this->
object->getVersions($version_ids);
1319 $table->setMaxCount(
sizeof($versions));
1320 $table->setData($versions);
1322 $html = $table->getHTML();
1325 $this->tpl->setVariable(
'ADM_CONTENT',
$html);
1339 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1343 if (count(
$_POST[
"hist_id"]) > 0)
1345 $this->
object->deleteVersions(
$_POST[
"hist_id"]);
1349 $this->ctrl->setParameter($this,
"hist_id",
"");
1350 $this->ctrl->redirect($this,
"versions");
1358 $this->ctrl->redirect($this,
"versions");
1369 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1373 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
1375 $ru->deleteObjects($this->parent_id,
array($this->ref_id));
1378 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->parent_id);
1379 $this->ctrl->redirectByClass(
"ilrepositorygui");
1387 $this->ctrl->redirect($this,
"versions");
1400 $v1 = (int)$v1[
"hist_entry_id"];
1401 else if (!is_int($v1))
1405 $v2 = (
int)$v2[
"hist_entry_id"];
1406 else if (!is_int($v2))
1422 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"), $this->ilErr->MESSAGE);
1430 if (count($version_ids) != 1)
1433 $this->ctrl->redirect($this,
"versions");
1437 $new_version = $this->
object->rollback($version_ids[0]);
1439 ilUtil::sendSuccess(sprintf($this->lng->txt(
"file_rollback_done"), $new_version[
"rollback_version"]),
true);
1440 $this->ctrl->redirect($this,
"versions");
1445 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
1448 if($this->
object->hasRating())
1450 $lg->enableRating(
true, null,
false,
1451 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.
initCreationForms($a_new_type)
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.
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
initZipUploadForm($a_mode="create")
FORM: Init zip upload form.
getPermanentLinkWidget($a_append=null, $a_center=false)
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 _catchupWriteEvents($obj_id, $usr_id, $timestamp=null)
Catches up with all write events which occured before the specified timestamp.
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 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 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.
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.
getTargetFrame($a_cmd, $a_target_frame="")
Add a drawing to the header
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.
Create styles array
The data for the language used.
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 ...
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.
Create new PHPExcel object
obj_idprivate
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.
prepareOutput($a_show_subobjects=true)
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(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
deleteVersions()
Displays a confirmation screen with selected file versions that should be deleted.
cancelDeleteVersions()
Cancels the file version deletion.
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
Class ilObjUserTrackingGUI.
Class ilFileVersionTableGUI.
static getValidFilename($a_filename)
Get valid filename.
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.