ILIAS  release_7 Revision v7.30-3-g800a261c036
ilPCFileListGUI Class Reference

Class ilPCListGUI. More...

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

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 insert ($a_form=null)
 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...
 
 afterCreation ()
 After creation processing. 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
 __construct ($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...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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...
 

Protected Attributes

 $user
 
 $tabs
 
 $tree
 
 $toolbar
 
 $settings
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $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
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 
- 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.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

50 {
51 global $DIC;
52
53 $this->user = $DIC->user();
54 $this->tabs = $DIC->tabs();
55 $this->ctrl = $DIC->ctrl();
56 $this->tpl = $DIC["tpl"];
57 $this->tree = $DIC->repositoryTree();
58 $this->lng = $DIC->language();
59 $this->toolbar = $DIC->toolbar();
60 $this->settings = $DIC->settings();
61 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
62 $this->setCharacteristics(array("FileListItem" => $this->lng->txt("cont_FileListItem")));
63 }
user()
Definition: user.php:4
setCharacteristics($a_chars)
Set Characteristics.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilPageContentGUI\setCharacteristics(), settings(), and 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 523 of file class.ilPCFileListGUI.php.

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

References ilPageContentGUI\$ctrl.

◆ afterCreation()

ilPCFileListGUI::afterCreation ( )

After creation processing.

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

293 {
294 $this->pg_obj->stripHierIDs();
295 $this->pg_obj->addHierIDs();
296 $this->ctrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
297 $this->ctrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
298 $this->ctrl->redirect($this, "editFiles");
299 }

Referenced by create().

+ Here is the caller graph for this function:

◆ checkStyleSelection()

ilPCFileListGUI::checkStyleSelection ( )

Checks whether style selection shoudl be available or not.

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

599 {
600 // check whether there is more than one style class
601 $chars = $this->getCharacteristics();
602
603 $classes = $this->content_obj->getAllClasses();
604 if (count($chars) > 1) {
605 return true;
606 }
607 foreach ($classes as $class) {
608 if ($class != "" && $class != "FileListItem") {
609 return true;
610 }
611 }
612 return false;
613 }
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 220 of file class.ilPCFileListGUI.php.

221 {
222 global $DIC;
223
224 include_once("./Modules/File/classes/class.ilObjFile.php");
225
226 $mode = ($_POST["file_ref_id"] != "")
227 ? "select_file"
228 : "create";
229 $form = $this->initEditForm($mode);
230 if (!$form->checkInput()) {
231 $form->setValuesByPost();
232 $this->insert($form);
233 return;
234 }
235
236 // from personal workspace
237 if (substr($_POST["file_ref_id"], 0, 4) == "wsp_") {
238 $fileObj = new ilObjFile(substr($_POST["file_ref_id"], 4), false);
239 }
240 // upload
241 elseif ($_POST["file_ref_id"] == 0) {
242 $fileObj = new ilObjFile();
243 $fileObj->setType("file");
244 $fileObj->setTitle($_FILES["file"]["name"]);
245 $fileObj->setDescription("");
246 $fileObj->setFileName($_FILES["file"]["name"]);
247 $fileObj->setFileType($_FILES["file"]["type"]);
248 $fileObj->setFileSize($_FILES["file"]["size"]);
249 $fileObj->setMode("filelist");
250 $fileObj->create();
251 // upload file to filesystem
252 $fileObj->createDirectory();
253 $fileObj->raiseUploadError(false);
254
255 $upload = $DIC->upload();
256 if ($upload->hasBeenProcessed() !== true) {
257 $upload->process();
258 }
259
260 $fileObj->getUploadFile(
261 $_FILES["file"]["tmp_name"],
262 $_FILES["file"]["name"]
263 );
264 }
265 // from repository
266 else {
267 $fileObj = new ilObjFile($_POST["file_ref_id"]);
268 }
269 $_SESSION["il_text_lang_" . $_GET["ref_id"]] = $_POST["flst_language"];
270
271 //echo "::".is_object($this->dom).":";
272 $this->content_obj = new ilPCFileList($this->getPage());
273 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
274 $this->content_obj->setListTitle(ilUtil::stripSlashes($_POST["flst_title"]), $_POST["flst_language"]);
275 $this->content_obj->appendItem(
276 $fileObj->getId(),
277 $fileObj->getFileName(),
278 $fileObj->getFileType()
279 );
280
281 $this->updated = $this->pg_obj->update();
282 if ($this->updated === true) {
283 $this->afterCreation();
284 } else {
285 $this->insert();
286 }
287 }
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
Class ilObjFile.
insert($a_form=null)
insert new file list form
afterCreation()
After creation processing.
initEditForm($a_mode="edit")
Init edit form.
Class ilPCFileList.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_GET, $_POST, $_SESSION, $DIC, afterCreation(), ilPageContentGUI\getPage(), initEditForm(), insert(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ createFileItem()

ilPCFileListGUI::createFileItem ( )

insert new file item

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

716 {
717 global $DIC;
718
720
721 if ($_FILES["file"]["name"] == "") {
722 $_GET["subCmd"] = "-";
723 ilUtil::sendFailure($lng->txt("upload_error_file_not_found"));
724 return false;
725 }
726
727 $form = $this->initEditForm();
728 // see #22541
729 // $form->checkInput();
730
731 include_once("./Modules/File/classes/class.ilObjFile.php");
732 $fileObj = new ilObjFile();
733 $fileObj->setType("file");
734 $fileObj->setTitle($_FILES["file"]["name"]);
735 $fileObj->setDescription("");
736 $fileObj->setFileName($_FILES["file"]["name"]);
737 $fileObj->setFileType($_FILES["file"]["type"]);
738 $fileObj->setFileSize($_FILES["file"]["size"]);
739 $fileObj->setMode("filelist");
740 $fileObj->create();
741 // upload file to filesystem
742 $fileObj->createDirectory();
743
744 $upload = $DIC->upload();
745 if ($upload->hasBeenProcessed() !== true) {
746 $upload->process();
747 }
748
749 $fileObj->getUploadFile(
750 $_FILES["file"]["tmp_name"],
751 $_FILES["file"]["name"]
752 );
753
754 return $fileObj;
755 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, $DIC, ilPageContentGUI\$lng, initEditForm(), 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 549 of file class.ilPCFileListGUI.php.

550 {
551 $ilCtrl = $this->ctrl;
552
553 if (is_array($_POST["fid"])) {
554 $ids = array();
555 foreach ($_POST["fid"] as $k => $v) {
556 $ids[] = $k;
557 }
558 $this->content_obj->deleteFileItems($ids);
559 }
560 $this->updated = $this->pg_obj->update();
561 $ilCtrl->redirect($this, "editFiles");
562 }

References $_POST, and ilPageContentGUI\$ctrl.

◆ edit()

ilPCFileListGUI::edit ( )

edit properties form

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

305 {
306 $this->setTabs(false);
307
308 $form = $this->initEditForm();
309 $this->tpl->setContent($form->getHTML());
310 }
setTabs($a_create=true)
Set Tabs.

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

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilPCFileListGUI::executeCommand ( )

execute command

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

69 {
70 // get next class that processes or forwards current command
71 $next_class = $this->ctrl->getNextClass($this);
72
73 $this->getCharacteristicsOfCurrentStyle("flist_li"); // scorm-2004
74
75 // get current command
76 $cmd = $this->ctrl->getCmd();
77
78 switch ($next_class) {
79 default:
80 $ret = $this->$cmd();
81 break;
82 }
83
84 return $ret;
85 }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$ret
Definition: parser.php:6

References $ret, and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

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

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

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

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

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

◆ insert()

ilPCFileListGUI::insert (   $a_form = null)

insert new file list form

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

91 {
93 $ilTabs = $this->tabs;
94
95 if ($_GET["subCmd"] == "insertNew") {
96 $_SESSION["cont_file_insert"] = "insertNew";
97 }
98 if ($_GET["subCmd"] == "insertFromRepository") {
99 $_SESSION["cont_file_insert"] = "insertFromRepository";
100 }
101 if ($_GET["subCmd"] == "insertFromWorkspace") {
102 $_SESSION["cont_file_insert"] = "insertFromWorkspace";
103 }
104 if (($_GET["subCmd"] == "") && $_SESSION["cont_file_insert"] != "") {
105 $_GET["subCmd"] = $_SESSION["cont_file_insert"];
106 }
107
108 switch ($_GET["subCmd"]) {
109 case "insertFromWorkspace":
110 $this->insertFromWorkspace();
111 break;
112
113 case "insertFromRepository":
114 $this->insertFromRepository();
115 break;
116
117 case "selectFile":
118 $this->selectFile();
119 break;
120
121 default:
122 $this->setTabs();
123 $ilTabs->setSubTabActive("cont_new_file");
124
125 $this->displayValidationError();
126
127 if ($a_form != null) {
128 $form = $a_form;
129 } else {
130 $form = $this->initEditForm("create");
131 }
132 $this->tpl->setContent($form->getHTML());
133 break;
134 }
135 }
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, $tabs, $user, 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 157 of file class.ilPCFileListGUI.php.

158 {
159 $ilTabs = $this->tabs;
160 $ilCtrl = $this->ctrl;
162
163 if ($a_cmd == "insert") {
164 $this->setTabs();
165 } else {
166 $this->setItemTabs($a_cmd);
167 }
168
169 $ilTabs->setSubTabActive("cont_file_from_repository");
170 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
171
172 include_once("./Services/COPage/classes/class.ilPCFileItemFileSelectorGUI.php");
174 $this,
175 $a_cmd,
176 $this,
177 $a_cmd,
178 "file_ref_id"
179 );
180 if (!$exp->handleCommand()) {
181 $tpl->setContent($exp->getHTML());
182 }
183 }
setItemTabs($a_cmd="")
output tabs

References ilPageContentGUI\$ctrl, $tabs, ilPageContentGUI\$tpl, 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 188 of file class.ilPCFileListGUI.php.

189 {
190 $ilTabs = $this->tabs;
192 $ilCtrl = $this->ctrl;
195
196 if ($a_cmd == "insert") {
197 $this->setTabs();
198 } else {
199 $this->setItemTabs($a_cmd);
200 }
201
202 $ilTabs->setSubTabActive("cont_file_from_workspace");
203
204 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
205 $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, $a_cmd, $this, $a_cmd, "fl_wsp_id");
206 $ilCtrl->setParameter($this, "subCmd", "selectFile");
207 $exp->setCustomLinkTarget($ilCtrl->getLinkTarget($this, $a_cmd));
208 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
209 $exp->setTypeWhiteList(array("wsrt", "wfld", "file"));
210 $exp->setSelectableTypes(array("file"));
211 if ($exp->handleCommand()) {
212 return;
213 }
214 $tpl->setContent($exp->getHTML());
215 }
Explorer for selecting a personal workspace item.

References ilPageContentGUI\$ctrl, $ilUser, $tabs, ilPageContentGUI\$tpl, $tree, $user, 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 672 of file class.ilPCFileListGUI.php.

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

References $_GET, $ilUser, $tree, $user, 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 627 of file class.ilPCFileListGUI.php.

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

References $_GET, $_SESSION, $tabs, 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 567 of file class.ilPCFileListGUI.php.

568 {
569 $ilCtrl = $this->ctrl;
570
571 if (is_array($_POST["position"])) {
572 $this->content_obj->savePositions($_POST["position"]);
573 }
574 $this->updated = $this->pg_obj->update();
575 $ilCtrl->redirect($this, "editFiles");
576 }

References $_POST, and ilPageContentGUI\$ctrl.

◆ savePositionsAndClasses()

ilPCFileListGUI::savePositionsAndClasses ( )

Save positions of file items and style classes.

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

582 {
583 $ilCtrl = $this->ctrl;
584
585 if (is_array($_POST["position"])) {
586 $this->content_obj->savePositions($_POST["position"]);
587 }
588 if (is_array($_POST["class"])) {
589 $this->content_obj->saveStyleClasses($_POST["class"]);
590 }
591 $this->updated = $this->pg_obj->update();
592 $ilCtrl->redirect($this, "editFiles");
593 }

References $_POST, and ilPageContentGUI\$ctrl.

◆ saveProperties()

ilPCFileListGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

423 {
424 $this->content_obj->setListTitle(
425 ilUtil::stripSlashes($_POST["flst_title"]),
426 ilUtil::stripSlashes($_POST["flst_language"])
427 );
428 $this->updated = $this->pg_obj->update();
429 if ($this->updated === true) {
430 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
431 } else {
432 $this->pg_obj->addHierIDs();
433 $this->edit();
434 }
435 }
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 140 of file class.ilPCFileListGUI.php.

141 {
142 $ilTabs = $this->tabs;
144
145 $this->setTabs();
146 $ilTabs->setSubTabActive("cont_file_from_repository");
147
148 $this->displayValidationError();
149 $form = $this->initEditForm("select_file");
150
151 $this->tpl->setContent($form->getHTML());
152 }

References $ilUser, $tabs, $user, 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 761 of file class.ilPCFileListGUI.php.

762 {
763 $ilTabs = $this->tabs;
764 $ilCtrl = $this->ctrl;
766
767 $ilTabs->addTarget(
768 "cont_back",
769 $this->ctrl->getParentReturn($this),
770 "",
771 ""
772 );
773
774 if ($a_cmd != "") {
775 $ilCtrl->setParameter($this, "subCmd", "insertNew");
776 $ilTabs->addSubTabTarget(
777 "cont_new_file",
778 $ilCtrl->getLinkTarget($this, $a_cmd),
779 $a_cmd
780 );
781
782 $ilCtrl->setParameter($this, "subCmd", "insertFromRepository");
783 $ilTabs->addSubTabTarget(
784 "cont_file_from_repository",
785 $ilCtrl->getLinkTarget($this, $a_cmd),
786 $a_cmd
787 );
788 $ilCtrl->setParameter($this, "subCmd", "");
789
790 if (!$ilSetting->get("disable_personal_workspace") &&
791 !$ilSetting->get("disable_wsp_files")) {
792 $ilCtrl->setParameter($this, "subCmd", "insertFromWorkspace");
793 $ilTabs->addSubTabTarget(
794 "cont_file_from_workspace",
795 $ilCtrl->getLinkTarget($this, $a_cmd),
796 $a_cmd
797 );
798 $ilCtrl->setParameter($this, "subCmd", "");
799 }
800 }
801 }
global $ilSetting
Definition: privfeed.php:17

References ilPageContentGUI\$ctrl, $ilSetting, $settings, and $tabs.

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

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

References ilPageContentGUI\$ctrl, $ilSetting, ilPageContentGUI\$lng, $settings, and $tabs.

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

+ Here is the caller graph for this function:

Field Documentation

◆ $settings

ilPCFileListGUI::$settings
protected

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

Referenced by setItemTabs(), and setTabs().

◆ $tabs

ilPCFileListGUI::$tabs
protected

◆ $toolbar

ilPCFileListGUI::$toolbar
protected

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

Referenced by editFiles().

◆ $tree

ilPCFileListGUI::$tree
protected

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

Referenced by initEditForm(), insertFromWorkspace(), and insertNewFileItem().

◆ $user

ilPCFileListGUI::$user
protected

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