4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
20 function __construct($a_parent_obj, $a_parent_cmd, $a_cur_dir,
21 $a_cur_subdir, $a_label_enable =
false,
22 $a_file_labels, $a_label_header =
"", $a_commands = array(),
23 $a_post_dir_path =
false, $a_table_id =
"")
27 $this->
setId($a_table_id);
28 $this->cur_dir = $a_cur_dir;
29 $this->cur_subdir = $a_cur_subdir;
30 $this->label_enable = $a_label_enable;
31 $this->label_header = $a_label_header;
32 $this->file_labels = $a_file_labels;
33 $this->post_dir_path = $a_post_dir_path;
35 parent::__construct($a_parent_obj, $a_parent_cmd);
36 $this->
setTitle($lng->txt(
"cont_files").
" ".$this->cur_subdir);
41 if ($this->label_enable)
43 $this->
addColumn($lng->txt(
"cont_dir_file"),
"name",
"50%");
44 $this->
addColumn($lng->txt(
"cont_size"),
"size",
"20%");
45 $this->
addColumn($this->label_header,
"",
"30%");
49 $this->
addColumn($lng->txt(
"cont_dir_file"),
"name",
"60%");
50 $this->
addColumn($lng->txt(
"cont_size"),
"size",
"40%");
59 "Services/FileSystem");
66 for ($i=0; $i < count($a_commands); $i++)
68 if ($a_commands[
"int"])
71 $a_commands[$i][
"name"]);
82 if ($a_field ==
"size")
104 if (is_dir($this->cur_dir))
110 $entries = array(array(
"type" =>
"dir",
"entry" =>
".."));
114 foreach ($entries as $e)
116 if(($e[
"entry"] ==
".") || ($e[
"entry"] ==
".." && empty($this->cur_subdir)))
120 $cfile = (!empty($this->cur_subdir))
121 ? $this->cur_subdir.
"/".$e[
"entry"]
124 if ($this->label_enable)
126 $label = (is_array($this->file_labels[$cfile]))
127 ? implode($this->file_labels[$cfile],
", ")
131 $pref = ($e[
"type"] ==
"dir")
134 $items[] = array(
"file" => $cfile,
"entry" => $e[
"entry"],
135 "type" => $e[
"type"],
"label" => $label,
"size" => $e[
"size"],
136 "name" => $pref.$e[
"entry"]);
150 if ($a_set[
"entry"] !=
"..")
152 if ($this->post_dir_path)
154 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"file"]);
158 $this->tpl->setVariable(
"CHECKBOX_ID", $a_set[
"entry"]);
163 if ($this->label_enable)
165 $this->tpl->setCurrentBlock(
"Label");
166 $this->tpl->setVariable(
"TXT_LABEL", $a_set[
"label"]);
167 $this->tpl->parseCurrentBlock();
171 if($a_set[
"type"] ==
"dir")
173 $this->tpl->setCurrentBlock(
"FileLink");
174 $ilCtrl->setParameter($this->parent_obj,
"cdir", $this->cur_subdir);
175 $ilCtrl->setParameter($this->parent_obj,
"newdir", $a_set[
"entry"]);
176 $ilCtrl->setParameter($this->parent_obj,
"resetoffset", 1);
177 $this->tpl->setVariable(
"LINK_FILENAME",
178 $ilCtrl->getLinkTarget($this->parent_obj,
"listFiles"));
179 $this->tpl->setVariable(
"TXT_FILENAME", $a_set[
"entry"]);
180 $this->tpl->parseCurrentBlock();
182 $this->tpl->setVariable(
"ICON",
"<img src=\"".
184 $ilCtrl->setParameter($this->parent_obj,
"resetoffset",
"");
188 $this->tpl->setCurrentBlock(
"File");
189 $this->tpl->setVariable(
"TXT_FILENAME2", $a_set[
"entry"]);
190 $this->tpl->parseCurrentBlock();
193 $this->tpl->setVariable(
"TXT_SIZE", $a_set[
"size"]);
195 $ilCtrl->setParameter($this->parent_obj,
"cdir",
$_GET[
"cdir"]);
196 $ilCtrl->setParameter($this->parent_obj,
"newdir",
$_GET[
"newdir"]);
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
fillRow($a_set)
Fill table row.
numericOrdering($a_field)
getOrderDirection()
Get order direction.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct($a_parent_obj, $a_parent_cmd, $a_cur_dir, $a_cur_subdir, $a_label_enable=false, $a_file_labels, $a_label_header="", $a_commands=array(), $a_post_dir_path=false, $a_table_id="")
Constructor.
addMultiCommand($a_cmd, $a_text)
Add Command button.
prepareOutput()
Get data just before output.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
if(!file_exists(getcwd().'/ilias.ini.php')) if(isset( $_GET["client_id"]))
registration confirmation script for ilias
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.
TableGUI class for file system.