ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilPCFileListGUI Class Reference

Class ilPCListGUI. More...

+ Inheritance diagram for ilPCFileListGUI:
+ Collaboration diagram for ilPCFileListGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 execute command More...
 
 insert (?ilPropertyFormGUI $a_form=null)
 insert new file list form More...
 
 selectFile ()
 
 insertFromRepository (string $a_cmd="insert")
 Insert file from repository. More...
 
 insertFromWorkspace (string $a_cmd="insert")
 Insert file from personal workspace. More...
 
 create ()
 create new file list in dom and update page in db More...
 
 afterCreation ()
 
 edit ()
 
 editProperties ()
 edit properties form More...
 
 initEditForm (string $a_mode="edit")
 Init edit form. More...
 
 saveProperties ()
 save table properties in db and return to page edit screen More...
 
 setTabs (bool $a_create=true)
 Set Tabs. More...
 
 addFileItem ()
 Add file item. More...
 
 deleteFileItem ()
 Delete file items from list. More...
 
 confirmDeletionFileItem (string|array $ids=[])
 
 savePositions ()
 Save positions of file items. More...
 
 editStyleClass (string $id)
 
 savePositionsAndClasses ()
 Save positions of file items and style classes. More...
 
 checkStyleSelection ()
 Checks whether style selection shoudl be available or not. More...
 
 newFileItem ()
 New file item (called, if there is no file item in an existing) More...
 
 insertNewFileItem (int $a_file_ref_id=0)
 insert new file item after another item More...
 
 createFileItem ()
 insert new file item More...
 
 setItemTabs (string $a_cmd="")
 output tabs More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Protected Member Functions

 getEditStyleForm (string $id)
 
 saveStyleClass ()
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ILIAS COPage InternalDomainService $domain
 
string $requested_file_ref_id
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilTree $tree
 
ilToolbarGUI $toolbar
 
ilSetting $settings
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
array bool null $updated = null
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

Class ilPCListGUI.

User Interface for LM List Editing

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 28 of file class.ilPCFileListGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCFileListGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Reimplemented from ilPageContentGUI.

Definition at line 38 of file class.ilPCFileListGUI.php.

43 {
44 global $DIC;
45
46 $this->user = $DIC->user();
47 $this->tabs = $DIC->tabs();
48 $this->ctrl = $DIC->ctrl();
49 $this->tpl = $DIC["tpl"];
50 $this->tree = $DIC->repositoryTree();
51 $this->lng = $DIC->language();
52 $this->toolbar = $DIC->toolbar();
53 $this->settings = $DIC->settings();
54 $this->domain = $DIC->copage()->internal()->domain();
55 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
56 $this->setCharacteristics(array("FileListItem" => $this->lng->txt("cont_FileListItem")));
57 $this->requested_file_ref_id = $this->request->getString("file_ref_id");
58 }
setCharacteristics(array $a_chars)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFileItem()

ilPCFileListGUI::addFileItem ( )

Add file item.

This function is called from file list table and calls newItemAfter function.

Definition at line 519 of file class.ilPCFileListGUI.php.

519 : void
520 {
521 $ilCtrl = $this->ctrl;
522
523 $files = $this->content_obj->getFileList();
524
525 if (count($files) >= 1) {
526 $ilCtrl->setParameterByClass(
527 "ilpcfileitemgui",
528 "hier_id",
529 $files[count($files) - 1]["hier_id"]
530 );
531 $ilCtrl->setParameterByClass(
532 "ilpcfileitemgui",
533 "pc_id",
534 $files[count($files) - 1]["pc_id"]
535 );
536 $ilCtrl->redirectByClass("ilpcfileitemgui", "newItemAfter");
537 } else {
538 $ilCtrl->redirect($this, "newFileItem");
539 }
540 }

References $files.

◆ afterCreation()

ilPCFileListGUI::afterCreation ( )

Definition at line 267 of file class.ilPCFileListGUI.php.

267 : void
268 {
269 $this->pg_obj->stripHierIDs();
270 $this->pg_obj->addHierIDs();
271 $this->ctrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
272 $this->ctrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
273 $this->ctrl->redirect($this, "editFiles");
274 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkStyleSelection()

ilPCFileListGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

Definition at line 670 of file class.ilPCFileListGUI.php.

670 : bool
671 {
672 // check whether there is more than one style class
673 $chars = $this->getCharacteristics();
674
675 $classes = $this->content_obj->getAllClasses();
676 if (count($chars) > 1) {
677 return true;
678 }
679 foreach ($classes as $class) {
680 if ($class != "" && $class != "FileListItem") {
681 return true;
682 }
683 }
684 return false;
685 }

◆ confirmDeletionFileItem()

ilPCFileListGUI::confirmDeletionFileItem ( string|array  $ids = [])

Definition at line 556 of file class.ilPCFileListGUI.php.

556 : void
557 {
558 if (is_string($ids)) {
559 $ids = [$ids];
560 }
561 $table = $this->getFileListTable();
562 if (count($ids) === 0) {
563 $ids = $table->getItemIds();
564 }
565
566 if (count($ids) === 0) {
567 $this->ctrl->redirect($this, "editFiles");
568 return;
569 }
570
571 $retrieval = $this->domain->pc()->fileListRetrieval($this->content_obj);
572 $data = $retrieval->getData([]);
573 $items = [];
574 foreach ($data as $row) {
575 if (in_array($row["id"], $ids, true)) {
576 $items[$row["id"]] = $row["file_name"];
577 }
578 }
579
580 $table->renderDeletionConfirmation(
581 $this->lng->txt("delete"),
582 $this->lng->txt("cont_delete_file_item_confirm"),
583 "deleteFileItem",
584 $items
585 );
586 }
$data
Definition: storeScorm.php:45

References $data, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ create()

ilPCFileListGUI::create ( )

create new file list in dom and update page in db

Definition at line 201 of file class.ilPCFileListGUI.php.

201 : void
202 {
203 global $DIC;
204
205 $mode = ($this->requested_file_ref_id != "")
206 ? "select_file"
207 : "create";
208 $form = $this->initEditForm($mode);
209 if (!$form->checkInput()) {
210 $form->setValuesByPost();
211 $this->insert($form);
212 return;
213 }
214
215 // from personal workspace
216 if (substr($this->requested_file_ref_id, 0, 4) == "wsp_") {
217 $fileObj = new ilObjFile(substr($this->requested_file_ref_id, 4), false);
218 }
219 // upload
220 elseif ($this->requested_file_ref_id == "") {
221 $fileObj = new ilObjFile();
222 $fileObj->setType("file");
223 $fileObj->setTitle($_FILES["file"]["name"]);
224 $fileObj->setDescription("");
225 $fileObj->setFileName($_FILES["file"]["name"]);
226 $fileObj->setMode("filelist");
227 $fileObj->create();
228 // upload file to filesystem
229
230 $upload = $DIC->upload();
231 if ($upload->hasBeenProcessed() !== true) {
232 $upload->process();
233 }
234
235 $fileObj->getUploadFile(
236 $_FILES["file"]["tmp_name"],
237 $_FILES["file"]["name"]
238 );
239 }
240 // from repository
241 else {
242 $fileObj = new ilObjFile($this->requested_file_ref_id);
243 }
244 $this->setCurrentTextLang($form->getInput("flst_language"));
245
246 //echo "::".is_object($this->dom).":";
247 $this->content_obj = new ilPCFileList($this->getPage());
248 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
249 $this->content_obj->setListTitle(
250 $form->getInput("flst_title"),
251 $form->getInput("flst_language")
252 );
253 $this->content_obj->appendItem(
254 $fileObj->getId(),
255 $fileObj->getFileName(),
256 $fileObj->getFileType()
257 );
258
259 $this->updated = $this->pg_obj->update();
260 if ($this->updated === true) {
261 $this->afterCreation();
262 } else {
263 $this->insert();
264 }
265 }
Class ilObjFile.
initEditForm(string $a_mode="edit")
Init edit form.
insert(?ilPropertyFormGUI $a_form=null)
insert new file list form
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentTextLang(string $lang_key)

References $DIC.

◆ createFileItem()

ilPCFileListGUI::createFileItem ( )

insert new file item

Definition at line 778 of file class.ilPCFileListGUI.php.

778 : ?ilObjFile
779 {
780 global $DIC;
781
783
784 if ($_FILES["file"]["name"] == "") {
785 throw new ilCOPageFileHandlingException($lng->txt("upload_error_file_not_found"));
786 }
787
788 $form = $this->initEditForm();
789 // see #22541
790 // $form->checkInput();
791
792 $fileObj = new ilObjFile();
793 $fileObj->setType("file");
794 $fileObj->setTitle($_FILES["file"]["name"]);
795 $fileObj->setDescription("");
796 $fileObj->setFileName($_FILES["file"]["name"]);
797 $fileObj->setMode("filelist");
798 $fileObj->create();
799 // upload file to filesystem
800
801 $upload = $DIC->upload();
802 if ($upload->hasBeenProcessed() !== true) {
803 $upload->process();
804 }
805
806 $fileObj->getUploadFile(
807 $_FILES["file"]["tmp_name"],
808 $_FILES["file"]["name"]
809 );
810
811 return $fileObj;
812 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $DIC, and $lng.

◆ deleteFileItem()

ilPCFileListGUI::deleteFileItem ( )

Delete file items from list.

Definition at line 545 of file class.ilPCFileListGUI.php.

545 : void
546 {
547 $table = $this->getFileListTable();
548 $ids = $table->getItemIds();
549 if (count($ids) > 0) {
550 $this->content_obj->deleteFileItems($ids);
551 }
552 $this->updated = $this->pg_obj->update();
553 $this->ctrl->redirect($this, "editFiles");
554 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ edit()

ilPCFileListGUI::edit ( )

Definition at line 276 of file class.ilPCFileListGUI.php.

276 : void
277 {
278 $this->editFiles();
279 }

◆ editProperties()

ilPCFileListGUI::editProperties ( )

edit properties form

Definition at line 284 of file class.ilPCFileListGUI.php.

284 : void
285 {
286 $this->setTabs(false);
287
288 $form = $this->initEditForm();
289 $this->tpl->setContent($form->getHTML());
290 }
setTabs(bool $a_create=true)
Set Tabs.

◆ editStyleClass()

ilPCFileListGUI::editStyleClass ( string  $id)

Definition at line 603 of file class.ilPCFileListGUI.php.

603 : void
604 {
605 $form = $this->getEditStyleForm($id);
607 $this->gui->modal($lng->txt("copg_edit_style_class"))
608 ->form($form)
609 ->send();
610 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and $lng.

◆ executeCommand()

ilPCFileListGUI::executeCommand ( )

execute command

Definition at line 63 of file class.ilPCFileListGUI.php.

63 : void
64 {
65 // get next class that processes or forwards current command
66 $next_class = $this->ctrl->getNextClass($this);
67
68 $this->getCharacteristicsOfCurrentStyle(["flist_li"]); // scorm-2004
69
70 // get current command
71 $cmd = $this->ctrl->getCmd();
72
73 switch ($next_class) {
74 default:
75 $this->$cmd();
76 break;
77 }
78 }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.

References ILIAS\Repository\ctrl(), and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

+ Here is the call graph for this function:

◆ getEditStyleForm()

ilPCFileListGUI::getEditStyleForm ( string  $id)
protected

Definition at line 612 of file class.ilPCFileListGUI.php.

613 {
615 $lng->loadLanguageModule("style");
616 $lng->loadLanguageModule("copg");
617
618 $this->ctrl->setParameterByClass(self::class, "file_item_id", $id);
619 $retrieval = $this->domain->pc()->fileListRetrieval($this->content_obj);
620 $options = $this->getCharacteristics();
621 $data = $retrieval->getData([]);
622 $value = null;
623 foreach ($data as $row) {
624 if ($row["id"] == $id && isset($options[$row["class"]])) {
625 $value = $row["class"];
626 }
627 }
628 return $this->gui->form([self::class], "saveStyleClass")
629 ->select("class", $lng->txt("sty_class"), $options, "", $value)
630 ->required();
631 }
loadLanguageModule(string $a_module)
Load language module.

References $data, $id, $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initEditForm()

ilPCFileListGUI::initEditForm ( string  $a_mode = "edit")

Init edit form.

Definition at line 295 of file class.ilPCFileListGUI.php.

296 {
298 $ilCtrl = $this->ctrl;
299 $ilUser = $this->user;
300
301 $ti = null;
302 $si = null;
303 $form = new ilPropertyFormGUI();
304
305 if ($a_mode != "add_file") {
306 // title
307 $ti = new ilTextInputGUI($lng->txt("title"), "flst_title");
308 $ti->setMaxLength(80);
309 $ti->setSize(40);
310 $form->addItem($ti);
311
312 // language
313 $languages = [];
314 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
315 $languages[$language->value()] = $language->presentableLabel();
316 }
317 $si = new ilSelectInputGUI($lng->txt("language"), "flst_language");
318 $si->setOptions($languages);
319 $form->addItem($si);
320 }
321
322 if (in_array($a_mode, array("create", "add_file"))) {
323 // file
324 $fi = new ilFileInputGUI($lng->txt("file"), "file");
325 $fi->setRequired(true);
326 $form->addItem($fi);
327 } elseif (in_array($a_mode, array("select_file"))) {
328 // file
329 $ne = new ilNonEditableValueGUI($lng->txt("file"), "");
330
331 $file_ref_id = (int) $this->requested_file_ref_id;
332 $fl_wsp_id = $this->request->getInt("fl_wsp_id");
333
334 if ($file_ref_id > 0) {
335 $file_obj = new ilObjFile($file_ref_id);
336 if (is_object($file_obj)) {
337 // ref id as hidden input
338 $hi = new ilHiddenInputGUI("file_ref_id");
339 $hi->setValue($file_ref_id);
340 $form->addItem($hi);
341
342 $ne->setValue($file_obj->getTitle());
343 }
344 } elseif ($fl_wsp_id > 0) {
345 // we need the object id for the instance
346 $tree = new ilWorkspaceTree($ilUser->getId());
347 $node = $tree->getNodeData($fl_wsp_id);
348
349 $file_obj = new ilObjFile($node["obj_id"], false);
350 if (is_object($file_obj)) {
351 // ref id as hidden input
352 $hi = new ilHiddenInputGUI("file_ref_id");
353 $hi->setValue("wsp_" . (int) $node["obj_id"]);
354 $form->addItem($hi);
355
356 $ne->setValue($file_obj->getTitle());
357 }
358 $this->tpl->parseCurrentBlock();
359 }
360
361 $form->addItem($ne);
362 }
363
364
365 switch ($a_mode) {
366 case "edit":
367 $ti->setValue($this->content_obj->getListTitle());
368 $si->setValue($this->content_obj->getLanguage());
369 $form->addCommandButton("saveProperties", $lng->txt("save"));
370 $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
371 $form->setTitle($lng->txt("cont_edit_file_list_properties"));
372 break;
373
374 case "create":
375 case "select_file":
376 if ($this->getCurrentTextLang() != "") {
377 $s_lang = $this->getCurrentTextLang();
378 } else {
379 $s_lang = $ilUser->getLanguage();
380 }
381 $si->setValue($s_lang);
382 $form->addCommandButton("create", $lng->txt("save"));
383 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
384 $form->setTitle($lng->txt("cont_insert_file_list"));
385 break;
386
387 case "add_file":
388 $form->addCommandButton("insertNewFileItem", $lng->txt("save"));
389 $form->addCommandButton("editFiles", $lng->txt("cancel"));
390 $form->setTitle($lng->txt("cont_insert_file_item"));
391 break;
392 }
393
394 $form->setFormAction($ilCtrl->getFormAction($this));
395
396 return $form;
397 }
This class represents a file property in a property form.
This class represents a hidden form property in a property form.
This class represents a non editable value in a property form.
This class represents a property form user interface.
This class represents a selection list property in a property form.
This class represents a text property in a property form.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $lng, ilTree\getNodeData(), and ILIAS\Repository\int().

Referenced by insert(), and selectFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCFileListGUI::insert ( ?ilPropertyFormGUI  $a_form = null)

insert new file list form

Definition at line 83 of file class.ilPCFileListGUI.php.

83 : void
84 {
85 $ilTabs = $this->tabs;
87
88 if (in_array($sub_command, ["insertNew", "insertFromRepository", "insertFromWorkspace"])) {
89 $this->edit_repo->setSubCmd($sub_command);
90 }
91
92 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
93 $sub_command = $this->edit_repo->getSubCmd();
94 }
95
96 switch ($sub_command) {
97 case "insertFromWorkspace":
98 $this->insertFromWorkspace();
99 break;
100
101 case "insertFromRepository":
102 $this->insertFromRepository();
103 break;
104
105 case "selectFile":
106 $this->selectFile();
107 break;
108
109 default:
110 $this->setTabs();
111 $ilTabs->setSubTabActive("cont_new_file");
112
113 $this->displayValidationError();
114
115 if ($a_form != null) {
116 $form = $a_form;
117 } else {
118 $form = $this->initEditForm("create");
119 }
120 $this->tpl->setContent($form->getHTML());
121 break;
122 }
123 }
insertFromWorkspace(string $a_cmd="insert")
Insert file from personal workspace.
insertFromRepository(string $a_cmd="insert")
Insert file from repository.

References ilPageContentGUI\$sub_command, $tabs, ilPageContentGUI\displayValidationError(), initEditForm(), insertFromRepository(), insertFromWorkspace(), selectFile(), and setTabs().

+ Here is the call graph for this function:

◆ insertFromRepository()

ilPCFileListGUI::insertFromRepository ( string  $a_cmd = "insert")

Insert file from repository.

Definition at line 140 of file class.ilPCFileListGUI.php.

140 : void
141 {
142 $ilTabs = $this->tabs;
143 $ilCtrl = $this->ctrl;
145
146 if ($a_cmd == "insert") {
147 $this->setTabs();
148 } else {
149 $this->setItemTabs($a_cmd);
150 }
151
152 $ilTabs->setSubTabActive("cont_file_from_repository");
153 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
154
156 $this,
157 $a_cmd,
158 $this,
159 $a_cmd,
160 "file_ref_id"
161 );
162 if (!$exp->handleCommand()) {
163 $tpl->setContent($exp->getHTML());
164 }
165 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setItemTabs(string $a_cmd="")
output tabs
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References ilPageContentGUI\$ctrl, $tabs, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), setItemTabs(), and setTabs().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromWorkspace()

ilPCFileListGUI::insertFromWorkspace ( string  $a_cmd = "insert")

Insert file from personal workspace.

Definition at line 170 of file class.ilPCFileListGUI.php.

172 : void {
173 $ilTabs = $this->tabs;
174 $ilCtrl = $this->ctrl;
176 $ilUser = $this->user;
177
178 if ($a_cmd == "insert") {
179 $this->setTabs();
180 } else {
181 $this->setItemTabs($a_cmd);
182 }
183
184 $ilTabs->setSubTabActive("cont_file_from_workspace");
185
186 $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, $a_cmd, $this, $a_cmd, "fl_wsp_id");
187 $ilCtrl->setParameter($this, "subCmd", "selectFile");
188 $exp->setCustomLinkTarget($ilCtrl->getLinkTarget($this, $a_cmd));
189 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
190 $exp->setTypeWhiteList(array("wsrt", "wfld", "file"));
191 $exp->setSelectableTypes(array("file"));
192 if ($exp->handleCommand()) {
193 return;
194 }
195 $tpl->setContent($exp->getHTML());
196 }
Explorer for selecting a personal workspace item.

References setTabs().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertNewFileItem()

ilPCFileListGUI::insertNewFileItem ( int  $a_file_ref_id = 0)

insert new file item after another item

Definition at line 737 of file class.ilPCFileListGUI.php.

737 : void
738 {
739 $ilUser = $this->user;
740
741 $fl_wsp_id = $this->request->getInt("fl_wsp_id");
742
743 // from personal workspace
744 if ($fl_wsp_id > 0) {
745 // we need the object id for the instance
746 $tree = new ilWorkspaceTree($ilUser->getId());
747 $node = $tree->getNodeData($fl_wsp_id);
748
749 $file_obj = new ilObjFile($node["obj_id"], false);
750 }
751 // upload
752 elseif ($a_file_ref_id == 0) {
753 $file_obj = $this->createFileItem();
754 }
755 // from repository
756 else {
757 $file_obj = new ilObjFile($a_file_ref_id);
758 }
759 if (is_object($file_obj)) {
760 $this->content_obj->appendItem(
761 $file_obj->getId(),
762 $file_obj->getTitle(),
763 $file_obj->getFileType()
764 );
765 $this->updated = $this->pg_obj->update();
766 if ($this->updated === true) {
767 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
768 $this->ctrl->redirect($this, "editFiles");
769 }
770 }
771
772 $this->newFileItem();
773 }
newFileItem()
New file item (called, if there is no file item in an existing)
createFileItem()
insert new file item

References ILIAS\Repository\ctrl(), and ilTree\getNodeData().

+ Here is the call graph for this function:

◆ newFileItem()

ilPCFileListGUI::newFileItem ( )

New file item (called, if there is no file item in an existing)

Definition at line 696 of file class.ilPCFileListGUI.php.

696 : void
697 {
698 $ilTabs = $this->tabs;
699
701 if (in_array($sub_command, ["insertNew", "insertFromRepository", "insertFromWorkspace"])) {
702 $this->edit_repo->setSubCmd($sub_command);
703 }
704
705 if (($sub_command == "") && $this->edit_repo->getSubCmd() != "") {
706 $sub_command = $this->edit_repo->getSubCmd();
707 }
708
709 switch ($sub_command) {
710 case "insertFromWorkspace":
711 $this->insertFromWorkspace("newFileItem");
712 break;
713
714 case "insertFromRepository":
715 $this->insertFromRepository("newFileItem");
716 break;
717
718 case "selectFile":
719 $this->insertNewFileItem($this->requested_file_ref_id);
720 break;
721
722 default:
723 $this->setItemTabs("newFileItem");
724 $ilTabs->setSubTabActive("cont_new_file");
725
726 $this->displayValidationError();
727
728 $form = $this->initEditForm("add_file");
729 $this->tpl->setContent($form->getHTML());
730 break;
731 }
732 }
insertNewFileItem(int $a_file_ref_id=0)
insert new file item after another item

◆ savePositions()

ilPCFileListGUI::savePositions ( )

Save positions of file items.

Definition at line 591 of file class.ilPCFileListGUI.php.

591 : void
592 {
593 $ilCtrl = $this->ctrl;
594 $table = $this->getFileListTable();
595 $pos = $table->getData();
596 if (is_array($pos) && count($pos) > 0) {
597 $this->content_obj->savePositions($pos);
598 }
599 $this->updated = $this->pg_obj->update();
600 $ilCtrl->redirect($this, "editFiles");
601 }

◆ savePositionsAndClasses()

ilPCFileListGUI::savePositionsAndClasses ( )

Save positions of file items and style classes.

Definition at line 651 of file class.ilPCFileListGUI.php.

651 : void
652 {
653 $ilCtrl = $this->ctrl;
654
655 $pos = $this->request->getIntArray("position");
656 $class = $this->request->getStringArray("class");
657 if (count($pos) > 0) {
658 $this->content_obj->savePositions($pos);
659 }
660 if (count($class) > 0) {
661 $this->content_obj->saveStyleClasses($class);
662 }
663 $this->updated = $this->pg_obj->update();
664 $ilCtrl->redirect($this, "editFiles");
665 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

◆ saveProperties()

ilPCFileListGUI::saveProperties ( )

save table properties in db and return to page edit screen

Definition at line 403 of file class.ilPCFileListGUI.php.

403 : void
404 {
405 $form = $this->initEditForm("edit");
406 $form->checkInput();
407 $this->content_obj->setListTitle(
408 $form->getInput("flst_title"),
409 $form->getInput("flst_language")
410 );
411 $this->updated = $this->pg_obj->update();
412 if ($this->updated === true) {
413 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
414 $this->ctrl->redirect($this, "editProperties");
415 } else {
416 $this->pg_obj->addHierIDs();
417 $this->edit();
418 }
419 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ saveStyleClass()

ilPCFileListGUI::saveStyleClass ( )
protected

Definition at line 633 of file class.ilPCFileListGUI.php.

633 : void
634 {
635 $file_item_id = $this->request->getString("file_item_id");
636 $form = $this->getEditStyleForm($file_item_id);
637 if ($form->isValid()) {
638 $class = $form->getData("class");
639 $this->content_obj->saveStyleClass(
640 $file_item_id,
641 $class
642 );
643 $this->updated = $this->pg_obj->update();
644 $this->ctrl->redirect($this, "editFiles");
645 }
646 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ selectFile()

ilPCFileListGUI::selectFile ( )

Definition at line 125 of file class.ilPCFileListGUI.php.

125 : void
126 {
127 $ilTabs = $this->tabs;
128 $this->setTabs();
129 $ilTabs->setSubTabActive("cont_file_from_repository");
130
131 $this->displayValidationError();
132 $form = $this->initEditForm("select_file");
133
134 $this->tpl->setContent($form->getHTML());
135 }

References $tabs, ilPageContentGUI\displayValidationError(), initEditForm(), and setTabs().

Referenced by insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setItemTabs()

ilPCFileListGUI::setItemTabs ( string  $a_cmd = "")

output tabs

Definition at line 818 of file class.ilPCFileListGUI.php.

818 : void
819 {
820 $ilTabs = $this->tabs;
821 $ilCtrl = $this->ctrl;
823
824 $ilTabs->addTarget(
825 "cont_back",
826 $this->ctrl->getParentReturn($this),
827 "",
828 ""
829 );
830
831 if ($a_cmd != "") {
832 $ilCtrl->setParameter($this, "subCmd", "insertNew");
833 $ilTabs->addSubTabTarget(
834 "cont_new_file",
835 $ilCtrl->getLinkTarget($this, $a_cmd),
836 $a_cmd
837 );
838
839 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
840 $ilTabs->addSubTabTarget(
841 "cont_file_from_repository",
842 $ilCtrl->getLinkTarget($this, $a_cmd),
843 $a_cmd
844 );
845 $ilCtrl->setParameter($this, "subCmd", "");
846
847 if (!$ilSetting->get("disable_personal_workspace") &&
848 !$ilSetting->get("disable_wsp_files")) {
849 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
850 $ilTabs->addSubTabTarget(
851 "cont_file_from_workspace",
852 $ilCtrl->getLinkTarget($this, $a_cmd),
853 $a_cmd
854 );
855 $ilCtrl->setParameter($this, "subCmd", "");
856 }
857 }
858 }
global $ilSetting
Definition: privfeed.php:26

References $ilSetting, $settings, and ILIAS\Repository\ctrl().

Referenced by insertFromRepository().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilPCFileListGUI::setTabs ( bool  $a_create = true)

Set Tabs.

Definition at line 458 of file class.ilPCFileListGUI.php.

458 : void
459 {
460 $ilTabs = $this->tabs;
461 $ilCtrl = $this->ctrl;
464
465 if ($a_create) {
466 $cmd = "insert";
467
468 $ilCtrl->setParameter($this, "subCmd", "insertNew");
469 $ilTabs->addSubTabTarget(
470 "cont_new_file",
471 $ilCtrl->getLinkTarget($this, $cmd),
472 $cmd
473 );
474
475 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
476 $ilTabs->addSubTabTarget(
477 "cont_file_from_repository",
478 $ilCtrl->getLinkTarget($this, $cmd),
479 $cmd
480 );
481 $ilCtrl->setParameter($this, "subCmd", "");
482
483 if (!$ilSetting->get("disable_personal_workspace") &&
484 !$ilSetting->get("disable_wsp_files")) {
485 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
486 $ilTabs->addSubTabTarget(
487 "cont_file_from_workspace",
488 $ilCtrl->getLinkTarget($this, $cmd),
489 $cmd
490 );
491 $ilCtrl->setParameter($this, "subCmd", "");
492 }
493 } else {
494 $ilTabs->setBackTarget(
495 $lng->txt("pg"),
496 $this->ctrl->getParentReturn($this)
497 );
498
499 $ilTabs->addTarget(
500 "cont_ed_edit_files",
501 $ilCtrl->getLinkTarget($this, "editFiles"),
502 "editFiles",
503 get_class($this)
504 );
505
506 $ilTabs->addTarget(
507 "cont_ed_edit_prop",
508 $ilCtrl->getLinkTarget($this, "editProperties"),
509 "editProperties",
510 get_class($this)
511 );
512 }
513 }

References $ilSetting, $lng, and $settings.

Referenced by insert(), insertFromRepository(), insertFromWorkspace(), and selectFile().

+ Here is the caller graph for this function:

Field Documentation

◆ $domain

ILIAS COPage InternalDomainService ilPCFileListGUI::$domain
protected

Definition at line 30 of file class.ilPCFileListGUI.php.

◆ $requested_file_ref_id

string ilPCFileListGUI::$requested_file_ref_id
protected

Definition at line 31 of file class.ilPCFileListGUI.php.

◆ $settings

ilSetting ilPCFileListGUI::$settings
protected

Definition at line 36 of file class.ilPCFileListGUI.php.

◆ $tabs

ilTabsGUI ilPCFileListGUI::$tabs
protected

Definition at line 33 of file class.ilPCFileListGUI.php.

Referenced by insert(), insertFromRepository(), and selectFile().

◆ $toolbar

ilToolbarGUI ilPCFileListGUI::$toolbar
protected

Definition at line 35 of file class.ilPCFileListGUI.php.

◆ $tree

ilTree ilPCFileListGUI::$tree
protected

Definition at line 34 of file class.ilPCFileListGUI.php.

◆ $user

ilObjUser ilPCFileListGUI::$user
protected

Definition at line 32 of file class.ilPCFileListGUI.php.


The documentation for this class was generated from the following file: