41 $this->
lng = $DIC->language();
42 $this->
tabs = $DIC->tabs();
43 $this->
ctrl = $DIC->ctrl();
44 $this->
user = $DIC->user();
45 $this->tpl = $DIC[
"tpl"];
46 $this->tree = $DIC->repositoryTree();
54 $next_class = $this->
ctrl->getNextClass($this);
57 $cmd = $this->
ctrl->getCmd();
58 switch ($next_class) {
72 if ($_FILES[
"file"][
"name"] ==
"") {
80 $fileObj->setType(
"file");
81 $fileObj->setTitle($_FILES[
"file"][
"name"]);
82 $fileObj->setDescription(
"");
83 $fileObj->setFileName($_FILES[
"file"][
"name"]);
84 $fileObj->setMode(
"filelist");
88 $upload = $DIC->upload();
89 if ($upload->hasBeenProcessed() !==
true) {
92 $fileObj->getUploadFile(
93 $_FILES[
"file"][
"tmp_name"],
94 $_FILES[
"file"][
"name"]
97 $this->file_object = $fileObj;
111 if (in_array(
$sub_command, [
"insertNew",
"insertFromRepository",
"insertFromWorkspace"])) {
115 if ((
$sub_command ==
"") && $this->edit_repo->getSubCmd() !=
"") {
120 case "insertFromWorkspace":
124 case "insertFromRepository":
130 $this->request->getInt(
"file_ref_id")
135 $this->
setTabs(
"newItemAfter");
136 $ilTabs->setSubTabActive(
"cont_new_file");
140 $this->tpl->setContent($form->getHTML());
161 $form->addCommandButton(
"insertNewItemBefore",
$lng->
txt(
"save"));
163 $form->addCommandButton(
"insertNewItemAfter",
$lng->
txt(
"save"));
165 $form->addCommandButton(
"cancelAddFile",
$lng->
txt(
"cancel"));
167 $form->setTitle(
$lng->
txt(
"cont_insert_file_item"));
169 $form->setFormAction($ilCtrl->getFormAction($this));
185 $ilTabs->setSubTabActive(
"cont_file_from_repository");
186 $ilCtrl->setParameter($this,
"subCmd",
"insertFromRepository");
195 if (!$exp->handleCommand()) {
210 $ilTabs->setSubTabActive(
"cont_file_from_workspace");
213 $ilCtrl->setParameter($this,
"subCmd",
"selectFile");
215 $ilCtrl->setParameter($this,
"subCmd",
"insertFromWorkspace");
216 $exp->setTypeWhiteList(array(
"wsrt",
"wfld",
"file"));
217 $exp->setSelectableTypes(array(
"file"));
218 if ($exp->handleCommand()) {
231 $fl_wsp_id = $this->request->getInt(
"fl_wsp_id");
234 if ($fl_wsp_id > 0) {
239 $this->file_object =
new ilObjFile($node[
"obj_id"],
false);
240 } elseif ($a_file_ref_id == 0) {
243 $this->file_object =
new ilObjFile($a_file_ref_id);
246 $this->content_obj->newItemAfter(
247 $this->file_object->getId(),
248 $this->file_object->getFileName(),
249 $this->file_object->getFileType()
251 $this->updated = $this->pg_obj->update();
252 if ($this->updated ===
true) {
253 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
269 if (in_array(
$sub_command, [
"insertNew",
"insertFromRepository",
"insertFromWorkspace"])) {
273 if ((
$sub_command ==
"") && $this->edit_repo->getSubCmd() !=
"") {
278 case "insertFromWorkspace":
282 case "insertFromRepository":
288 $this->request->getInt(
"file_ref_id")
293 $this->
setTabs(
"newItemBefore");
294 $ilTabs->setSubTabActive(
"cont_new_file");
298 $this->tpl->setContent($form->getHTML());
311 $fl_wsp_id = $this->request->getInt(
"fl_wsp_id");
312 if ($fl_wsp_id > 0) {
317 $this->file_object =
new ilObjFile($node[
"obj_id"],
false);
318 } elseif ($a_file_ref_id == 0) {
321 $this->file_object =
new ilObjFile($a_file_ref_id);
324 $this->content_obj->newItemBefore(
325 $this->file_object->getId(),
326 $this->file_object->getTitle(),
327 $this->file_object->getFileType()
329 $this->updated = $this->pg_obj->update();
330 if ($this->updated ===
true) {
331 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
343 $this->content_obj->deleteItem();
350 public function setTabs(
string $a_cmd =
""): void
358 $this->
ctrl->getParentReturn($this),
364 $ilCtrl->setParameter($this,
"subCmd",
"insertNew");
365 $ilTabs->addSubTabTarget(
367 $ilCtrl->getLinkTarget($this, $a_cmd),
371 $ilCtrl->setParameter($this,
"subCmd",
"insertFromRepository");
372 $ilTabs->addSubTabTarget(
373 "cont_file_from_repository",
374 $ilCtrl->getLinkTarget($this, $a_cmd),
377 $ilCtrl->setParameter($this,
"subCmd",
"");
379 if (!
$ilSetting->get(
"disable_personal_workspace") &&
381 $ilCtrl->setParameter($this,
"subCmd",
"insertFromWorkspace");
382 $ilTabs->addSubTabTarget(
383 "cont_file_from_workspace",
384 $ilCtrl->getLinkTarget($this, $a_cmd),
387 $ilCtrl->setParameter($this,
"subCmd",
"");
397 $this->content_obj->moveItemDown();
406 $this->content_obj->moveItemUp();
415 $this->
ctrl->returnToParent($this,
"jump" . $this->hier_id);
deleteItem()
delete a list item
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
insertFromWorkspace(string $a_cmd="insert")
Insert file from personal workspace.
moveItemUp()
move list item up
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
insertNewItemAfter(int $a_file_ref_id=0)
insert new file item after another item
newItemBefore()
insert new list item before current one
setTabs(string $a_cmd="")
output tabs
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
moveItemDown()
move list item down
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
Explorer for selecting a personal workspace item.
ilGlobalTemplateInterface $tpl
newFileItem()
insert new file item
insertNewItemBefore(int $a_file_ref_id=0)
insert new list item before current one
cancelAddFile()
Cancel adding a file.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
setCustomLinkTarget(string $a_val)
initAddFileForm(bool $a_before=true)
Init add file form.
__construct(Container $dic, ilPlugin $plugin)
newItemAfter()
insert new list item after current one
insertFromRepository(string $a_cmd)
Insert file from repository.