ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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{
19 protected $access;
20
21
25 public function __construct($a_parent_obj, $a_parent_cmd, $a_files)
26 {
27 global $DIC;
28
29 $this->ctrl = $DIC->ctrl();
30 $this->lng = $DIC->language();
31 $this->access = $DIC->access();
32 $ilCtrl = $DIC->ctrl();
33 $lng = $DIC->language();
34 $ilAccess = $DIC->access();
35 $lng = $DIC->language();
36
37 $mset = new ilSetting("mobs");
38 $this->upload_dir = trim($mset->get("upload_dir"));
39
40 //var_dump($_POST);
41 parent::__construct($a_parent_obj, $a_parent_cmd);
42 $this->setData($this->getFiles($a_files));
43 $this->setTitle($lng->txt("mep_upload_dir_files"));
44 $this->setLimit(9999);
45
46 $this->addColumn("", "", "1", true);
47 $this->addColumn($this->lng->txt("mep_file"));
48 $this->setOpenFormTag(false);
49
50 $this->setEnableHeader(true);
51 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
52 $this->setRowTemplate("tpl.upload_dir_files_row.html", "Modules/MediaPool");
53 $this->disable("footer");
54 $this->setEnableTitle(true);
55 $this->setSelectAllCheckbox("file[]");
56
57 $this->addMultiCommand("createMediaFromUploadDir", $lng->txt("mep_create_media_files"));
58 //$this->addCommandButton("", $lng->txt(""));
59 }
60
64 public function getFiles($a_files)
65 {
66 $files = array();
67 foreach ($a_files as $f) {
68 if (is_file($this->upload_dir . "/" . $f)) {
69 $files[] = $f;
70 } elseif (is_dir($this->upload_dir . "/" . $f)) {
71 $dir = ilUtil::getDir($this->upload_dir . "/" . $f, true);
72 foreach ($dir as $d) {
73 if ($d["type"] == "file") {
74 $files[] = $f . $d["subdir"] . "/" . $d["entry"];
75 }
76 }
77 }
78 }
79
80 return $files;
81 }
82
86 protected function fillRow($a_set)
87 {
89
90 $this->tpl->setVariable("TXT_FILE", $a_set);
91 $this->tpl->setVariable("VAL_FILE", $a_set);
92 }
93}
$files
Definition: add-vimline.php:18
An exception for terminatinating execution or to throw for unit testing.
ILIAS Setting Class.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable 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.
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.
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
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7