ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilUploadDirFilesTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
16
20 function __construct($a_parent_obj, $a_parent_cmd, $a_files)
21 {
22 global $ilCtrl, $lng, $ilAccess, $lng;
23
24 $mset = new ilSetting("mobs");
25 $this->upload_dir = trim($mset->get("upload_dir"));
26
27//var_dump($_POST);
28 parent::__construct($a_parent_obj, $a_parent_cmd);
29 $this->setData($this->getFiles($a_files));
30 $this->setTitle($lng->txt("mep_upload_dir_files"));
31 $this->setLimit(9999);
32
33 $this->addColumn("", "", "1", true);
34 $this->addColumn($this->lng->txt("mep_file"));
35 $this->setOpenFormTag(false);
36
37 $this->setEnableHeader(true);
38 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
39 $this->setRowTemplate("tpl.upload_dir_files_row.html", "Modules/MediaPool");
40 $this->disable("footer");
41 $this->setEnableTitle(true);
42 $this->setSelectAllCheckbox("file[]");
43
44 $this->addMultiCommand("createMediaFromUploadDir", $lng->txt("mep_create_media_files"));
45 //$this->addCommandButton("", $lng->txt(""));
46 }
47
51 function getFiles($a_files)
52 {
53 $files = array();
54 foreach ($a_files as $f)
55 {
56 if (is_file($this->upload_dir."/".$f))
57 {
58 $files[] = $f;
59 }
60 else if (is_dir($this->upload_dir."/".$f))
61 {
62 $dir = ilUtil::getDir($this->upload_dir."/".$f, true);
63 foreach ($dir as $d)
64 {
65 if ($d["type"] == "file")
66 {
67 $files[] = $f.$d["subdir"]."/".$d["entry"];
68 }
69 }
70 }
71 }
72
73 return $files;
74 }
75
79 protected function fillRow($a_set)
80 {
81 global $lng;
82
83 $this->tpl->setVariable("TXT_FILE", $a_set);
84 $this->tpl->setVariable("VAL_FILE", $a_set);
85 }
86
87}
88?>
ILIAS Setting Class.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setOpenFormTag($a_val)
Set open form tag.
disable($a_module_name)
diesables particular modules of table
__construct($a_parent_obj, $a_parent_cmd, $a_files)
Constructor.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40