24 require_once(
"./Services/COPage/classes/class.ilPCListItem.php");
25 require_once(
"./Services/COPage/classes/class.ilPageContentGUI.php");
55 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
75 include_once(
"./Modules/File/classes/class.ilObjFile.php");
77 $fileObj->setType(
"file");
78 $fileObj->setTitle($_FILES[
"Fobject"][
"name"][
"file"]);
79 $fileObj->setDescription(
"");
80 $fileObj->setFileName($_FILES[
"Fobject"][
"name"][
"file"]);
81 $fileObj->setFileType($_FILES[
"Fobject"][
"type"][
"file"]);
82 $fileObj->setFileSize($_FILES[
"Fobject"][
"size"][
"file"]);
83 $fileObj->setMode(
"filelist");
85 $fileObj->raiseUploadError(
false);
87 $fileObj->createDirectory();
88 $fileObj->getUploadFile($_FILES[
"Fobject"][
"tmp_name"][
"file"],
89 $_FILES[
"Fobject"][
"name"][
"file"]);
91 $this->file_object =& $fileObj;
101 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.file_item_edit.html",
"Services/COPage");
102 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_insert_file_item"));
103 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
108 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"file"));
110 $this->tpl->parseCurrentBlock();
113 $this->tpl->setCurrentBlock(
"commands");
114 $this->tpl->setVariable(
"BTN_NAME",
"insertNewItemAfter");
115 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
116 $this->tpl->parseCurrentBlock();
126 $this->content_obj->newItemAfter($this->file_object->getId(),
127 $this->file_object->getFileName(), $this->file_object->getFileType());
128 $this->updated = $this->pg_obj->update();
129 if ($this->updated ===
true)
131 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
145 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.file_item_edit.html",
"Services/COPage");
146 $this->tpl->setVariable(
"TXT_ACTION", $this->lng->txt(
"cont_insert_file_item"));
147 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
152 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"file"));
154 $this->tpl->parseCurrentBlock();
157 $this->tpl->setCurrentBlock(
"commands");
158 $this->tpl->setVariable(
"BTN_NAME",
"insertNewItemBefore");
159 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
160 $this->tpl->parseCurrentBlock();
170 $this->content_obj->newItemBefore($this->file_object->getId(),
171 $this->file_object->getFileName(), $this->file_object->getFileType());
172 $this->updated = $this->pg_obj->update();
173 if ($this->updated ===
true)
175 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
188 $this->content_obj->deleteItem();
189 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
190 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
198 $this->content_obj->moveItemDown();
199 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
200 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);
208 $this->content_obj->moveItemUp();
209 $_SESSION[
"il_pg_error"] = $this->pg_obj->update();
210 $this->ctrl->returnToParent($this,
"jump".$this->hier_id);