ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilFileSystemTableGUI Class Reference
+ Inheritance diagram for ilFileSystemTableGUI:
+ Collaboration diagram for ilFileSystemTableGUI:

Public Member Functions

 __construct (protected ilFileSystemGUI $filesystem_gui, string $a_parent_cmd, string $a_cur_dir, protected string $cur_subdir, protected bool $label_enable, protected array $file_labels=[], protected string $label_header="", ?array $a_commands=[], protected ?bool $post_dir_path=false, ?string $a_table_id="")
 Constructor. More...
 
 numericOrdering (string $a_field)
 
 getEntries ()
 
 addColumns ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 prepareOutput ()
 
 fillRow (array $a_set)
 Fill table row. More...
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

bool $has_multi = false
 
array $row_commands = []
 
string $cur_dir = ''
 
string $relative_cur_dir
 
Filesystem $filesystem
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Member Functions

 isDoubleDotDirectory (array $entry)
 

Private Attributes

Factory $ui_factory
 
Renderer $ui_renderer
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Deprecated:
Will be removed in ILIAS 10.

Use ILIAS ResourceStorageService as replacement.

Definition at line 29 of file class.ilFileSystemTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileSystemTableGUI::__construct ( protected ilFileSystemGUI  $filesystem_gui,
string  $a_parent_cmd,
string  $a_cur_dir,
protected string  $cur_subdir,
protected bool  $label_enable,
protected array  $file_labels = [],
protected string  $label_header = "",
?array  $a_commands = [],
protected ?bool  $post_dir_path = false,
?string  $a_table_id = "" 
)

Constructor.

Definition at line 45 of file class.ilFileSystemTableGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), addColumns(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ILIAS\Repository\filesystem(), ILIAS\Repository\lng(), null, ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setTitle().

56  {
57  global $DIC;
58  $this->setId($a_table_id);
59  $this->ctrl = $DIC->ctrl();
60  $this->lng = $DIC->language();
61  if ($a_cur_dir !== realpath($a_cur_dir)) {
62  throw new \InvalidArgumentException('$a_cur_dir must be a absolute path');
63  }
64  $this->filesystem = LegacyPathHelper::deriveFilesystemFrom($a_cur_dir);
65  $this->relative_cur_dir = LegacyPathHelper::createRelativePath($a_cur_dir);
66  $this->cur_dir = $a_cur_dir;
67  $this->ui_factory = $DIC->ui()->factory();
68  $this->ui_renderer = $DIC->ui()->renderer();
69 
70  parent::__construct($this->filesystem_gui, $a_parent_cmd);
71  $this->setTitle($this->lng->txt("cont_files") . " " . $this->cur_subdir);
72 
73  $this->has_multi = false;
74 
75  foreach ((array) $a_commands as $i => $command) {
76  if (!($command["single"] ?? false)) {
77  // does also handle internal commands
78  $this->addMultiCommand("extCommand_" . $i, $command["name"]);
79  $this->has_multi = true;
80  } else {
81  $this->row_commands[] = [
82  "cmd" => "extCommand_" . $i,
83  "caption" => $command["name"],
84  "allow_dir" => $command["allow_dir"] ?? false,
85  "method" => $command["method"] ?? null,
86  ];
87  }
88  }
89  $this->addColumns();
90 
91  $this->setDefaultOrderField("name");
92  $this->setDefaultOrderDirection("asc");
93 
94  $this->setEnableHeader(true);
95  $this->setFormAction($this->ctrl->getFormAction($this->filesystem_gui));
96  $this->setRowTemplate(
97  "tpl.directory_row.html",
98  "components/ILIAS/Filesystem"
99  );
100  $this->setEnableTitle(true);
101  }
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setId(string $a_val)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
addMultiCommand(string $a_cmd, string $a_text)
setEnableHeader(bool $a_enableheader)
+ Here is the call graph for this function:

Member Function Documentation

◆ addColumns()

ilFileSystemTableGUI::addColumns ( )

Definition at line 182 of file class.ilFileSystemTableGUI.php.

References ilTable2GUI\addColumn(), ILIAS\Repository\lng(), and ilTable2GUI\setSelectAllCheckbox().

Referenced by __construct().

182  : void
183  {
184  if ($this->has_multi) {
185  $this->setSelectAllCheckbox("file[]");
186  $this->addColumn("", "", "1", true);
187  }
188  $this->addColumn("", "", "1", true); // icon
189 
190  $this->addColumn($this->lng->txt("cont_dir_file"), "name");
191  $this->addColumn($this->lng->txt("cont_size"), "size");
192 
193  if ($this->label_enable) {
194  $this->addColumn($this->label_header, "label");
195  }
196 
197  if ($this->row_commands !== []) {
198  $this->addColumn($this->lng->txt("actions"));
199  }
200  }
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilFileSystemTableGUI::fillRow ( array  $a_set)
protected

Fill table row.

Definition at line 211 of file class.ilFileSystemTableGUI.php.

References $url, ilFileSystemGUI\CMD_UNZIP_FILE, ILIAS\Repository\ctrl(), ilUtil\formatSize(), ilUtil\getImagePath(), and isDoubleDotDirectory().

211  : void
212  {
213  $hash = $this->post_dir_path
214  ? md5((string) $a_set["file"])
215  : md5((string) $a_set["entry"]);
216 
217  if ($this->has_multi) {
218  if ($this->isDoubleDotDirectory($a_set)) {
219  $this->tpl->touchBlock('no_checkbox');
220  } else {
221  $this->tpl->setVariable("CHECKBOX_ID", $hash);
222  }
223  }
224 
225  // label
226  if ($this->label_enable) {
227  $this->tpl->setCurrentBlock("Label");
228  $this->tpl->setVariable("TXT_LABEL", $a_set["label"]);
229  $this->tpl->parseCurrentBlock();
230  }
231 
232  $this->ctrl->setParameter($this->parent_obj, "cdir", $this->cur_subdir);
233 
234  if ($a_set["type"] == "dir") {
235  $this->tpl->setCurrentBlock("FileLink");
236  $this->ctrl->setParameter($this->parent_obj, "newdir", $a_set["entry"]);
237  $this->ctrl->setParameter($this->parent_obj, "resetoffset", 1);
238  $this->tpl->setVariable(
239  "LINK_FILENAME",
240  $this->ctrl->getLinkTarget($this->parent_obj, "listFiles")
241  );
242  $this->ctrl->setParameter($this->parent_obj, "newdir", "");
243  $this->tpl->setVariable("TXT_FILENAME", $a_set["entry"]);
244  $this->tpl->parseCurrentBlock();
245 
246  $this->tpl->setVariable(
247  "ICON",
248  "<img src=\"" .
249  ilUtil::getImagePath("standard/icon_cat.svg") . "\">"
250  );
251  $this->ctrl->setParameter($this->parent_obj, "resetoffset", "");
252  } else {
253  $this->tpl->setCurrentBlock("File");
254  $this->tpl->setVariable("TXT_FILENAME2", $this->secure($a_set["entry"]));
255  $this->tpl->parseCurrentBlock();
256  }
257 
258  if ($a_set["type"] != "dir") {
259  $this->tpl->setVariable("TXT_SIZE", ilUtil::formatSize($a_set["size"]));
260  }
261 
262  // single item commands
263  if ($this->row_commands !== [] && !($a_set["type"] === "dir" && $a_set["entry"] === "..")) {
264  $actions = [];
265 
266  foreach ($this->row_commands as $rcom) {
267  if ($rcom["allow_dir"] || $a_set["type"] !== "dir") {
268  $file_path = $this->cur_dir . $a_set['entry'];
269  if (
270  $rcom['method'] !== ilFileSystemGUI::CMD_UNZIP_FILE
271  || ($rcom['method'] === ilFileSystemGUI::CMD_UNZIP_FILE && MimeType::getMimeType($file_path) === "application/zip")
272  ) {
273  $this->ctrl->setParameter($this->parent_obj, "fhsh", $hash);
274  $url = $this->ctrl->getLinkTarget($this->parent_obj, $rcom["cmd"]);
275  $this->ctrl->setParameter($this->parent_obj, "fhsh", "");
276 
277  $actions[] = $this->ui_factory->link()->standard($rcom["caption"], $url);
278  }
279  }
280  }
281 
282  $dropdown = $this->ui_factory->dropdown()->standard($actions);
283  $this->tpl->setVariable("ACTIONS", $this->ui_renderer->render($dropdown));
284  }
285  }
$url
Definition: shib_logout.php:68
static formatSize(int $size, string $a_mode='short', ?ilLanguage $a_lng=null)
Returns the specified file size value in a human friendly form.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ getEntries()

ilFileSystemTableGUI::getEntries ( )
Returns
array<int, array<string, mixed>>

Definition at line 118 of file class.ilFileSystemTableGUI.php.

References Vendor\Package\$e, $path, $relative_cur_dir, ILIAS\Repository\filesystem(), and ilTableGUI\getOrderDirection().

Referenced by prepareOutput().

118  : array
119  {
121  if ($this->filesystem->has($path)) {
122  $entries = [];
123  if ($this->cur_dir !== '') {
124  $entries['..'] = [
125  'order_val' => -1,
126  'order_id' => -1,
127  'entry' => '..',
128  'type' => 'dir',
129  'subdir' => '',
130  'size' => 0
131  ];
132  }
133 
134  foreach ($this->filesystem->listContents($path) as $i => $content) {
135  $basename = basename($content->getPath());
136  $entries[$basename] = [
137  'order_val' => $i,
138  'order_id' => $i,
139  'entry' => $basename,
140  'type' => $content->isDir() ? 'dir' : 'file',
141  'subdir' => '',
142  'size' => $content->isFile() ? $this->filesystem->getSize($content->getPath(), 1)->inBytes() : 0
143  ];
144  }
145  } else {
146  $entries = [["type" => "dir", "entry" => ".."]];
147  }
148  $items = [];
149 
150  foreach ($entries as $e) {
151  if ($e["entry"] === ".") {
152  continue;
153  }
154  if ($e["entry"] === ".." && empty($this->cur_subdir)) {
155  continue;
156  }
157  $cfile = (empty($this->cur_subdir))
158  ? $e["entry"]
159  : $this->cur_subdir . "/" . $e["entry"];
160 
161  if ($this->label_enable) {
162  $label = (isset($this->file_labels[$cfile]) && is_array($this->file_labels[$cfile]))
163  ? implode(", ", $this->file_labels[$cfile])
164  : "";
165  }
166 
167  $pref = ($e["type"] === "dir")
168  ? ($this->getOrderDirection() !== "desc" ? "1_" : "9_")
169  : "5_";
170  $items[] = [
171  "file" => $cfile,
172  "entry" => $e["entry"],
173  "type" => $e["type"],
174  "label" => $label ?? '',
175  "size" => $e["size"] ?? '',
176  "name" => $pref . $e["entry"]
177  ];
178  }
179  return $items;
180  }
$path
Definition: ltiservices.php:29
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDoubleDotDirectory()

ilFileSystemTableGUI::isDoubleDotDirectory ( array  $entry)
private

Definition at line 202 of file class.ilFileSystemTableGUI.php.

Referenced by fillRow().

202  : bool
203  {
204  return $entry['entry'] === '..';
205  }
+ Here is the caller graph for this function:

◆ numericOrdering()

ilFileSystemTableGUI::numericOrdering ( string  $a_field)

Definition at line 104 of file class.ilFileSystemTableGUI.php.

104  : bool
105  {
106  return $a_field === "size";
107  }

◆ prepareOutput()

ilFileSystemTableGUI::prepareOutput ( )
protected

Definition at line 109 of file class.ilFileSystemTableGUI.php.

References ilTable2GUI\determineOffsetAndOrder(), getEntries(), and ilTable2GUI\setData().

109  : void
110  {
111  $this->determineOffsetAndOrder(true);
112  $this->setData($this->getEntries());
113  }
setData(array $a_data)
determineOffsetAndOrder(bool $a_omit_offset=false)
+ Here is the call graph for this function:

Field Documentation

◆ $cur_dir

string ilFileSystemTableGUI::$cur_dir = ''
protected

Definition at line 38 of file class.ilFileSystemTableGUI.php.

◆ $filesystem

Filesystem ilFileSystemTableGUI::$filesystem
protected

Definition at line 40 of file class.ilFileSystemTableGUI.php.

◆ $has_multi

bool ilFileSystemTableGUI::$has_multi = false
protected

Definition at line 36 of file class.ilFileSystemTableGUI.php.

◆ $relative_cur_dir

string ilFileSystemTableGUI::$relative_cur_dir
protected

Definition at line 39 of file class.ilFileSystemTableGUI.php.

Referenced by getEntries().

◆ $row_commands

array ilFileSystemTableGUI::$row_commands = []
protected

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

◆ $ui_factory

Factory ilFileSystemTableGUI::$ui_factory
private

Definition at line 34 of file class.ilFileSystemTableGUI.php.

◆ $ui_renderer

Renderer ilFileSystemTableGUI::$ui_renderer
private

Definition at line 35 of file class.ilFileSystemTableGUI.php.


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