ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilPCFileListGUI Class Reference

Class ilPCListGUI. More...

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

Public Member Functions

 ilPCFileListGUI (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 insert ()
 insert new file list form More...
 
 selectFile ()
 Select file. More...
 
 insertFromRepository ($a_cmd="insert")
 Insert file from repository. More...
 
 insertFromWorkspace ($a_cmd="insert")
 Insert file from personal workspace. More...
 
 create ()
 create new file list in dom and update page in db More...
 
 edit ()
 edit properties form More...
 
 initEditForm ($a_mode="edit")
 Init edit form. More...
 
 saveProperties ()
 save table properties in db and return to page edit screen More...
 
 editFiles ()
 Edit Files. More...
 
 setTabs ($a_create=true)
 Set Tabs. More...
 
 addFileItem ()
 Add file item. More...
 
 deleteFileItem ()
 Delete file items from list. More...
 
 savePositions ()
 Save positions of file items. More...
 
 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 ($a_file_ref_id=0)
 insert new file item after another item More...
 
 createFileItem ()
 insert new file item More...
 
 setItemTabs ($a_cmd="")
 output tabs More...
 
- Public Member Functions inherited from ilPageContentGUI
 ilPageContentGUI ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor @access public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCListGUI.

User Interface for LM List Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ addFileItem()

ilPCFileListGUI::addFileItem ( )

Add file item.

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

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

508 {
509 global $ilCtrl;
510
511 $files = $this->content_obj->getFileList();
512
513 if (count($files) >= 1)
514 {
515 $ilCtrl->setParameterByClass("ilpcfileitemgui", "hier_id",
516 $files[count($files) - 1]["hier_id"]);
517 $ilCtrl->setParameterByClass("ilpcfileitemgui", "pc_id",
518 $files[count($files) - 1]["pc_id"]);
519 $ilCtrl->redirectByClass("ilpcfileitemgui", "newItemAfter");
520 }
521 else
522 {
523 $ilCtrl->redirect($this, "newFileItem");
524 }
525 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl.

◆ checkStyleSelection()

ilPCFileListGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

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

585 {
586 // check whether there is more than one style class
587 $chars = $this->getCharacteristics();
588
589 $classes = $this->content_obj->getAllClasses();
590 if (count($chars) > 1)
591 {
592 return true;
593 }
594 foreach ($classes as $class)
595 {
596 if ($class != "" && $class != "FileListItem")
597 {
598 return true;
599 }
600 }
601 return false;
602 }
getCharacteristics()
Get characteristics.

References ilPageContentGUI\getCharacteristics().

+ 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 241 of file class.ilPCFileListGUI.php.

242 {
243 include_once("./Modules/File/classes/class.ilObjFile.php");
244
245 // from personal workspace
246 if(substr($_POST["file_ref_id"], 0, 4) == "wsp_")
247 {
248 $fileObj = new ilObjFile(substr($_POST["file_ref_id"], 4), false);
249 }
250 // upload
251 else if ($_POST["file_ref_id"] == 0)
252 {
253 $fileObj = new ilObjFile();
254 $fileObj->setType("file");
255 $fileObj->setTitle($_FILES["file"]["name"]);
256 $fileObj->setDescription("");
257 $fileObj->setFileName($_FILES["file"]["name"]);
258 $fileObj->setFileType($_FILES["file"]["type"]);
259 $fileObj->setFileSize($_FILES["file"]["size"]);
260 $fileObj->setMode("filelist");
261 $fileObj->create();
262 // upload file to filesystem
263 $fileObj->createDirectory();
264 $fileObj->raiseUploadError(false);
265 $fileObj->getUploadFile($_FILES["file"]["tmp_name"],
266 $_FILES["file"]["name"]);
267 }
268 // from repository
269 else
270 {
271 $fileObj = new ilObjFile($_POST["file_ref_id"]);
272 }
273 $_SESSION["il_text_lang_".$_GET["ref_id"]] = $_POST["flst_language"];
274
275//echo "::".is_object($this->dom).":";
276 $this->content_obj = new ilPCFileList($this->getPage());
277 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
278 $this->content_obj->setListTitle(ilUtil::stripSlashes($_POST["flst_title"]), $_POST["flst_language"]);
279 $this->content_obj->appendItem($fileObj->getId(), $fileObj->getFileName(),
280 $fileObj->getFileType());
281
282 $this->updated = $this->pg_obj->update();
283 if ($this->updated === true)
284 {
285 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
286 }
287 else
288 {
289 $this->insert();
290 }
291 }
Class ilObjFile.
insert()
insert new file list form
Class ilPCFileList.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

References $_POST, $_SESSION, ilPageContentGUI\getPage(), insert(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ createFileItem()

ilPCFileListGUI::createFileItem ( )

insert new file item

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

712 {
713 global $lng;
714
715 if ($_FILES["file"]["name"] == "")
716 {
717 $_GET["subCmd"] = "-";
718 ilUtil::sendFailure($lng->txt("upload_error_file_not_found"));
719 return false;
720 }
721 include_once("./Modules/File/classes/class.ilObjFile.php");
722 $fileObj = new ilObjFile();
723 $fileObj->setType("file");
724 $fileObj->setTitle($_FILES["file"]["name"]);
725 $fileObj->setDescription("");
726 $fileObj->setFileName($_FILES["file"]["name"]);
727 $fileObj->setFileType($_FILES["file"]["type"]);
728 $fileObj->setFileSize($_FILES["file"]["size"]);
729 $fileObj->setMode("filelist");
730 $fileObj->create();
731 $fileObj->raiseUploadError(false);
732 // upload file to filesystem
733 $fileObj->createDirectory();
734 $fileObj->getUploadFile($_FILES["file"]["tmp_name"],
735 $_FILES["file"]["name"]);
736
737 return $fileObj;
738 }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, ilPageContentGUI\$lng, and ilUtil\sendFailure().

Referenced by insertNewFileItem().

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

◆ deleteFileItem()

ilPCFileListGUI::deleteFileItem ( )

Delete file items from list.

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

531 {
532 global $ilCtrl;
533
534 if (is_array($_POST["fid"]))
535 {
536 $ids = array();
537 foreach($_POST["fid"] as $k => $v)
538 {
539 $ids[] = $k;
540 }
541 $this->content_obj->deleteFileItems($ids);
542 }
543 $this->updated = $this->pg_obj->update();
544 $ilCtrl->redirect($this, "editFiles");
545 }

References $_POST, and $ilCtrl.

◆ edit()

ilPCFileListGUI::edit ( )

edit properties form

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

297 {
298 $this->setTabs(false);
299
300 $form = $this->initEditForm();
301 $this->tpl->setContent($form->getHTML());
302 }
setTabs($a_create=true)
Set Tabs.
initEditForm($a_mode="edit")
Init edit form.

References initEditForm(), and setTabs().

Referenced by saveProperties().

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

◆ editFiles()

ilPCFileListGUI::editFiles ( )

Edit Files.

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

445 {
446 global $tpl, $ilToolbar, $ilCtrl, $lng;
447
448 $this->setTabs(false);
449
450 $ilToolbar->addButton($lng->txt("cont_add_file"),
451 $ilCtrl->getLinkTarget($this, "addFileItem"));
452
453 include_once("./Services/COPage/classes/class.ilPCFileListTableGUI.php");
454 $table_gui = new ilPCFileListTableGUI($this, "editFiles", $this->content_obj);
455 $tpl->setContent($table_gui->getHTML());
456 }
TableGUI class for file list.

References $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, and setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

& ilPCFileListGUI::executeCommand ( )

execute command

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

34 {
35 // get next class that processes or forwards current command
36 $next_class = $this->ctrl->getNextClass($this);
37
38 $this->getCharacteristicsOfCurrentStyle("flist_li"); // scorm-2004
39
40 // get current command
41 $cmd = $this->ctrl->getCmd();
42
43 switch($next_class)
44 {
45 default:
46 $ret =& $this->$cmd();
47 break;
48 }
49
50 return $ret;
51 }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

+ Here is the call graph for this function:

◆ ilPCFileListGUI()

ilPCFileListGUI::ilPCFileListGUI ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor @access public.

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

25 {
26 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
27 $this->setCharacteristics(array("FileListItem" => $this->lng->txt("cont_FileListItem")));
28 }
setCharacteristics($a_chars)
Set Characteristics.

References ilPageContentGUI\setCharacteristics().

+ Here is the call graph for this function:

◆ initEditForm()

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

Init edit form.

Parameters
int$a_modeEdit Mode

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

310 {
311 global $lng, $ilCtrl, $ilUser;
312
313 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
314 $form = new ilPropertyFormGUI();
315
316 if ($a_mode != "add_file")
317 {
318 // title
319 $ti = new ilTextInputGUI($lng->txt("title"), "flst_title");
320 $ti->setMaxLength(80);
321 $ti->setSize(40);
322 $form->addItem($ti);
323
324 // language
325 require_once("Services/MetaData/classes/class.ilMDLanguageItem.php");
327 $si = new ilSelectInputGUI($lng->txt("language"), "flst_language");
328 $si->setOptions($lang);
329 $form->addItem($si);
330 }
331
332 if (in_array($a_mode, array("create", "add_file")))
333 {
334 // file
335 $fi = new ilFileInputGUI($lng->txt("file"), "file");
336 $fi->setRequired(true);
337 $form->addItem($fi);
338 }
339 else if (in_array($a_mode, array("select_file")))
340 {
341 // file
342 $ne = new ilNonEditableValueGUI($lng->txt("file"), "");
343
344 if(isset($_GET["file_ref_id"]))
345 {
346 include_once("./Modules/File/classes/class.ilObjFile.php");
347 $file_obj = new ilObjFile((int) $_GET["file_ref_id"]);
348 if (is_object($file_obj))
349 {
350 // ref id as hidden input
351 $hi = new ilHiddenInputGUI("file_ref_id");
352 $hi->setValue((int) $_GET["file_ref_id"]);
353 $form->addItem($hi);
354
355 $ne->setValue($file_obj->getTitle());
356 }
357 }
358 else if(isset($_GET["fl_wsp_id"]))
359 {
360 // we need the object id for the instance
361 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
362 $tree = new ilWorkspaceTree($ilUser->getId());
363 $node = $tree->getNodeData((int) $_GET["fl_wsp_id"]);
364
365 include_once("./Modules/File/classes/class.ilObjFile.php");
366 $file_obj = new ilObjFile($node["obj_id"], false);
367 if (is_object($file_obj))
368 {
369 // ref id as hidden input
370 $hi = new ilHiddenInputGUI("file_ref_id");
371 $hi->setValue("wsp_".(int) $node["obj_id"]);
372 $form->addItem($hi);
373
374 $ne->setValue($file_obj->getTitle());
375 }
376 $this->tpl->parseCurrentBlock();
377 }
378
379 $form->addItem($ne);
380 }
381
382
383 switch ($a_mode)
384 {
385 case "edit";
386 $ti->setValue($this->content_obj->getListTitle());
387 $si->setValue($this->content_obj->getLanguage());
388 $form->addCommandButton("saveProperties", $lng->txt("save"));
389 $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
390 $form->setTitle($lng->txt("cont_edit_file_list_properties"));
391 break;
392
393 case "create":
394 case "select_file":
395 if ($_SESSION["il_text_lang_".$_GET["ref_id"]] != "")
396 {
397 $s_lang = $_SESSION["il_text_lang_".$_GET["ref_id"]];
398 }
399 else
400 {
401 $s_lang = $ilUser->getLanguage();
402 }
403 $si->setValue($s_lang);
404 $form->addCommandButton("create_flst", $lng->txt("save"));
405 $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
406 $form->setTitle($lng->txt("cont_insert_file_list"));
407 break;
408
409 case "add_file":
410 $form->addCommandButton("insertNewFileItem", $lng->txt("save"));
411 $form->addCommandButton("editFiles", $lng->txt("cancel"));
412 $form->setTitle($lng->txt("cont_insert_file_item"));
413 break;
414 }
415
416 $form->setFormAction($ilCtrl->getFormAction($this));
417
418 return $form;
419 }
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.
Tree handler for personal workspace.
global $ilUser
Definition: imgupload.php:15

References $_GET, $_SESSION, $ilCtrl, $ilUser, $lang, ilPageContentGUI\$lng, $si, and ilMDLanguageItem\_getLanguages().

Referenced by edit(), insert(), newFileItem(), and selectFile().

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

◆ insert()

ilPCFileListGUI::insert ( )

insert new file list form

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

57 {
58 global $ilUser, $ilTabs;
59
60 if ($_GET["subCmd"] == "insertNew")
61 {
62 $_SESSION["cont_file_insert"] = "insertNew";
63 }
64 if ($_GET["subCmd"] == "insertFromRepository")
65 {
66 $_SESSION["cont_file_insert"] = "insertFromRepository";
67 }
68 if ($_GET["subCmd"] == "insertFromWorkspace")
69 {
70 $_SESSION["cont_file_insert"] = "insertFromWorkspace";
71 }
72 if (($_GET["subCmd"] == "") && $_SESSION["cont_file_insert"] != "")
73 {
74 $_GET["subCmd"] = $_SESSION["cont_file_insert"];
75 }
76
77 switch ($_GET["subCmd"])
78 {
79 case "insertFromWorkspace":
80 $this->insertFromWorkspace();
81 break;
82
83 case "insertFromRepository":
84 $this->insertFromRepository();
85 break;
86
87 case "selectFile":
88 $this->selectFile();
89 break;
90
91 default:
92 $this->setTabs();
93 $ilTabs->setSubTabActive("cont_new_file");
94
96
97 $form = $this->initEditForm("create");
98 $this->tpl->setContent($form->getHTML());
99 break;
100 }
101
102 }
insertFromRepository($a_cmd="insert")
Insert file from repository.
insertFromWorkspace($a_cmd="insert")
Insert file from personal workspace.
displayValidationError()
display validation errors

References $_GET, $_SESSION, $ilUser, ilPageContentGUI\displayValidationError(), initEditForm(), insertFromRepository(), insertFromWorkspace(), selectFile(), and setTabs().

Referenced by create().

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

◆ insertFromRepository()

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

Insert file from repository.

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

124 {
125 global $ilTabs, $tree, $ilCtrl, $tpl;
126
127 if ($a_cmd == "insert")
128 {
129 $this->setTabs();
130 }
131 else
132 {
133 $this->setItemTabs($a_cmd);
134 }
135
136 $ilTabs->setSubTabActive("cont_file_from_repository");
137
138 include_once "./Services/COPage/classes/class.ilFileSelectorGUI.php";
139
140 $exp = new ilFileSelectorGUI($this->ctrl->getLinkTarget($this, $a_cmd));
141
142 if ($_GET["expand"] == "")
143 {
144 $expanded = $tree->readRootId();
145 }
146 else
147 {
148 $expanded = $_GET["expand"];
149 }
150 $exp->setExpand($expanded);
151
152 $exp->setTargetGet("sel_id");
153 //$this->ctrl->setParameter($this, "target_type", $a_type);
154 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
155 $exp->setParamsGet($this->ctrl->getParameterArray($this, $a_cmd));
156
157 // filter
158 $exp->setFiltered(true);
159 $exp->setFilterMode(IL_FM_POSITIVE);
160 $exp->addFilter("root");
161 $exp->addFilter("cat");
162 $exp->addFilter("grp");
163 $exp->addFilter("fold");
164 $exp->addFilter("crs");
165 $exp->addFilter("file");
166
167 $sel_types = array('file');
168
169 $exp->setOutput(0);
170
171 $tpl->setContent($exp->getOutput());
172 }
const IL_FM_POSITIVE
Select file for being added into file lists.
setItemTabs($a_cmd="")
output tabs

References $_GET, $ilCtrl, ilPageContentGUI\$tpl, IL_FM_POSITIVE, setItemTabs(), and setTabs().

Referenced by insert(), and newFileItem().

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

◆ insertFromWorkspace()

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

Insert file from personal workspace.

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

178 {
179 global $ilTabs, $tree, $ilCtrl, $tpl, $ilUser;
180
181 if ($a_cmd == "insert")
182 {
183 $this->setTabs();
184 }
185 else
186 {
187 $this->setItemTabs($a_cmd);
188 }
189
190 $ilTabs->setSubTabActive("cont_file_from_workspace");
191
192 // get ws tree
193 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
194 $tree = new ilWorkspaceTree($ilUser->getId());
195
196 // get access handler
197 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
198 $acc_handler = new ilWorkspaceAccessHandler($tree);
199
200 // get es explorer
201 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php");
203 'filelist_wspexpand', $tree, $acc_handler);
204 $exp->setTargetGet('fl_wsp_id');
205 $exp->setFiltered(false);
206 $exp->removeAllFormItemTypes();
207
208 // select link
209 $exp->setTypeClickable("file");
210 $ilCtrl->setParameter($this, "subCmd", "selectFile");
211 $exp->setCustomLinkTarget($ilCtrl->getLinkTarget($this, $a_cmd));
212
213 // filter
214 $exp->setFiltered(true);
215 $exp->setFilterMode(IL_FM_POSITIVE);
216 $exp->addFilter("wsrt");
217 $exp->addFilter("wfld");
218 $exp->addFilter("file");
219
220 // expand link
221 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
222 $exp->setParamsGet($ilCtrl->getParameterArray($this, $a_cmd));
223
224 if($_GET['filelist_wspexpand'] == '')
225 {
226 $expanded = $tree->readRootId();
227 }
228 else
229 {
230 $expanded = $_GET['filelist_wspexpand'];
231 }
232 $exp->setExpand($expanded);
233 $exp->setOutput(0);
234
235 $tpl->setContent($exp->getOutput());
236 }
Access handler for personal workspace.

References $_GET, $ilCtrl, $ilUser, ilPageContentGUI\$tpl, IL_FM_POSITIVE, ilWorkspaceExplorer\SEL_TYPE_RADIO, setItemTabs(), and setTabs().

Referenced by insert(), and newFileItem().

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

◆ insertNewFileItem()

ilPCFileListGUI::insertNewFileItem (   $a_file_ref_id = 0)

insert new file item after another item

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

667 {
668 global $ilUser;
669
670 // from personal workspace
671 if(isset($_GET["fl_wsp_id"]))
672 {
673 // we need the object id for the instance
674 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
675 $tree = new ilWorkspaceTree($ilUser->getId());
676 $node = $tree->getNodeData($_GET["fl_wsp_id"]);
677
678 include_once("./Modules/File/classes/class.ilObjFile.php");
679 $file_obj = new ilObjFile($node["obj_id"], false);
680 }
681 // upload
682 else if ($a_file_ref_id == 0)
683 {
684 $file_obj = $this->createFileItem();
685 }
686 // from repository
687 else
688 {
689 include_once("./Modules/File/classes/class.ilObjFile.php");
690 $file_obj = new ilObjFile($a_file_ref_id);
691 }
692 if (is_object($file_obj))
693 {
694 $this->content_obj->appendItem($file_obj->getId(),
695 $file_obj->getTitle(), $file_obj->getFileType());
696 $this->updated = $this->pg_obj->update();
697 if ($this->updated === true)
698 {
699 //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
700 $this->ctrl->redirect($this, "editFiles");
701 }
702 }
703
704 $_GET["subCmd"] = "-";
705 $this->newFileItem();
706 }
newFileItem()
New file item (called, if there is no file item in an existing)
createFileItem()
insert new file item

References $_GET, $ilUser, createFileItem(), and newFileItem().

Referenced by newFileItem().

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

◆ newFileItem()

ilPCFileListGUI::newFileItem ( )

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

Parameters

return

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

617 {
618 global $ilTabs;
619
620 if ($_GET["subCmd"] == "insertNew")
621 {
622 $_SESSION["cont_file_insert"] = "insertNew";
623 }
624 if ($_GET["subCmd"] == "insertFromRepository")
625 {
626 $_SESSION["cont_file_insert"] = "insertFromRepository";
627 }
628 if ($_GET["subCmd"] == "insertFromWorkspace")
629 {
630 $_SESSION["cont_file_insert"] = "insertFromWorkspace";
631 }
632 if (($_GET["subCmd"] == "") && $_SESSION["cont_file_insert"] != "")
633 {
634 $_GET["subCmd"] = $_SESSION["cont_file_insert"];
635 }
636
637 switch ($_GET["subCmd"])
638 {
639 case "insertFromWorkspace":
640 $this->insertFromWorkspace("newFileItem");
641 break;
642
643 case "insertFromRepository":
644 $this->insertFromRepository("newFileItem");
645 break;
646
647 case "selectFile":
648 $this->insertNewFileItem($_GET["file_ref_id"]);
649 break;
650
651 default:
652 $this->setItemTabs("newFileItem");
653 $ilTabs->setSubTabActive("cont_new_file");
654
655 $this->displayValidationError();
656
657 $form = $this->initEditForm("add_file");
658 $this->tpl->setContent($form->getHTML());
659 break;
660 }
661 }
insertNewFileItem($a_file_ref_id=0)
insert new file item after another item

References $_GET, $_SESSION, ilPageContentGUI\displayValidationError(), initEditForm(), insertFromRepository(), insertFromWorkspace(), insertNewFileItem(), and setItemTabs().

Referenced by insertNewFileItem().

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

◆ savePositions()

ilPCFileListGUI::savePositions ( )

Save positions of file items.

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

551 {
552 global $ilCtrl;
553
554 if (is_array($_POST["position"]))
555 {
556 $this->content_obj->savePositions($_POST["position"]);
557 }
558 $this->updated = $this->pg_obj->update();
559 $ilCtrl->redirect($this, "editFiles");
560 }

References $_POST, and $ilCtrl.

◆ savePositionsAndClasses()

ilPCFileListGUI::savePositionsAndClasses ( )

Save positions of file items and style classes.

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

566 {
567 global $ilCtrl;
568
569 if (is_array($_POST["position"]))
570 {
571 $this->content_obj->savePositions($_POST["position"]);
572 }
573 if (is_array($_POST["class"]))
574 {
575 $this->content_obj->saveStyleClasses($_POST["class"]);
576 }
577 $this->updated = $this->pg_obj->update();
578 $ilCtrl->redirect($this, "editFiles");
579 }

References $_POST, and $ilCtrl.

◆ saveProperties()

ilPCFileListGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

426 {
427 $this->content_obj->setListTitle(ilUtil::stripSlashes($_POST["flst_title"]),
428 ilUtil::stripSlashes($_POST["flst_language"]));
429 $this->updated = $this->pg_obj->update();
430 if ($this->updated === true)
431 {
432 $this->ctrl->returnToParent($this, "jump".$this->hier_id);
433 }
434 else
435 {
436 $this->pg_obj->addHierIDs();
437 $this->edit();
438 }
439 }
edit()
edit properties form

References $_POST, edit(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ selectFile()

ilPCFileListGUI::selectFile ( )

Select file.

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

108 {
109 global $ilTabs, $ilUser;
110
111 $this->setTabs();
112 $ilTabs->setSubTabActive("cont_file_from_repository");
113
114 $this->displayValidationError();
115 $form = $this->initEditForm("select_file");
116
117 $this->tpl->setContent($form->getHTML());
118 }

References $ilUser, 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 (   $a_cmd = "")

output tabs

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

745 {
746 global $ilTabs, $ilCtrl, $ilSetting;
747
748 $ilTabs->addTarget("cont_back",
749 $this->ctrl->getParentReturn($this), "",
750 "");
751
752 if ($a_cmd != "")
753 {
754 $ilCtrl->setParameter($this, "subCmd", "insertNew");
755 $ilTabs->addSubTabTarget("cont_new_file",
756 $ilCtrl->getLinkTarget($this, $a_cmd), $a_cmd);
757
758 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
759 $ilTabs->addSubTabTarget("cont_file_from_repository",
760 $ilCtrl->getLinkTarget($this, $a_cmd), $a_cmd);
761 $ilCtrl->setParameter($this, "subCmd", "");
762
763 if(!$ilSetting->get("disable_personal_workspace") &&
764 !$ilSetting->get("disable_wsp_files"))
765 {
766 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
767 $ilTabs->addSubTabTarget("cont_file_from_workspace",
768 $ilCtrl->getLinkTarget($this, $a_cmd), $a_cmd);
769 $ilCtrl->setParameter($this, "subCmd", "");
770 }
771 }
772 }
global $ilSetting
Definition: privfeed.php:40

References $ilCtrl, and $ilSetting.

Referenced by insertFromRepository(), insertFromWorkspace(), and newFileItem().

+ Here is the caller graph for this function:

◆ setTabs()

ilPCFileListGUI::setTabs (   $a_create = true)

Set Tabs.

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

462 {
463 global $ilTabs, $ilCtrl, $lng, $ilSetting;
464
465 if ($a_create)
466 {
467 $cmd = "insert";
468
469 $ilCtrl->setParameter($this, "subCmd", "insertNew");
470 $ilTabs->addSubTabTarget("cont_new_file",
471 $ilCtrl->getLinkTarget($this, $cmd), $cmd);
472
473 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
474 $ilTabs->addSubTabTarget("cont_file_from_repository",
475 $ilCtrl->getLinkTarget($this, $cmd), $cmd);
476 $ilCtrl->setParameter($this, "subCmd", "");
477
478 if(!$ilSetting->get("disable_personal_workspace") &&
479 !$ilSetting->get("disable_wsp_files"))
480 {
481 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
482 $ilTabs->addSubTabTarget("cont_file_from_workspace",
483 $ilCtrl->getLinkTarget($this, $cmd), $cmd);
484 $ilCtrl->setParameter($this, "subCmd", "");
485 }
486 }
487 else
488 {
489 $ilTabs->setBackTarget($lng->txt("pg"),
490 $this->ctrl->getParentReturn($this));
491
492 $ilTabs->addTarget("cont_ed_edit_files",
493 $ilCtrl->getLinkTarget($this, "editFiles"), "editFiles",
494 get_class($this));
495
496 $ilTabs->addTarget("cont_ed_edit_prop",
497 $ilCtrl->getLinkTarget($this, "edit"), "edit",
498 get_class($this));
499
500 }
501 }

References $cmd, $ilCtrl, $ilSetting, and ilPageContentGUI\$lng.

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

+ Here is the caller graph for this function:

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