ILIAS  release_7 Revision v7.30-3-g800a261c036
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
39 $import_directory_factory = new ilImportDirectoryFactory();
40 $mob_import_directory = $import_directory_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
41 $this->upload_dir = $mob_import_directory->getAbsolutePath();
42
43 //var_dump($_POST);
44 parent::__construct($a_parent_obj, $a_parent_cmd);
45 $this->setData($this->getFiles($a_files));
46 $this->setTitle($lng->txt("mep_upload_dir_files"));
47 $this->setLimit(9999);
48
49 $this->addColumn("", "", "1", true);
50 $this->addColumn($this->lng->txt("mep_file"));
51 $this->setOpenFormTag(false);
52
53 $this->setEnableHeader(true);
54 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
55 $this->setRowTemplate("tpl.upload_dir_files_row.html", "Modules/MediaPool");
56 $this->disable("footer");
57 $this->setEnableTitle(true);
58 $this->setSelectAllCheckbox("file[]");
59
60 $this->addMultiCommand("createMediaFromUploadDir", $lng->txt("mep_create_media_files"));
61 //$this->addCommandButton("", $lng->txt(""));
62 }
63
67 public function getFiles($a_files)
68 {
69 $files = array();
70 foreach ($a_files as $f) {
71 if (is_file($this->upload_dir . "/" . $f)) {
72 $files[] = $f;
73 } elseif (is_dir($this->upload_dir . "/" . $f)) {
74 $dir = ilUtil::getDir($this->upload_dir . "/" . $f, true);
75 foreach ($dir as $d) {
76 if ($d["type"] == "file") {
77 $files[] = $f . $d["subdir"] . "/" . $d["entry"];
78 }
79 }
80 }
81 }
82
83 return $files;
84 }
85
89 protected function fillRow($a_set)
90 {
92
93 $this->tpl->setVariable("TXT_FILE", $a_set);
94 $this->tpl->setVariable("VAL_FILE", $a_set);
95 }
96}
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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 $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc