ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilDclExportGUI.php
Go to the documentation of this file.
1 <?php
2 
20 declare(strict_types=1);
21 
23 {
24  protected function buildExportTableGUI(): ilExportTableGUI
25  {
26  return new ilDclExportTableGUI($this, 'listExportFiles', $this->obj);
27  }
28 
32  public function createExportFile(): void
33  {
34  $format = "";
35  if ($this->http->wrapper()->post()->has('format')) {
36  $format = $this->http->wrapper()->post()->retrieve('format', $this->refinery->kindlyTo()->string());
37  }
38  if ($format === 'xlsx') {
39  $this->checkForExportableFields();
40  $this->checkForAsyncEnabled();
41  }
42 
43  parent::createExportFile();
44  }
45 
49  protected function checkForExportableFields(): bool
50  {
51  foreach ($this->obj->getTables() as $tbl) {
53  foreach ($tbl->getFields() as $field) {
54  if ($field->getExportable()) {
55  return true;
56  }
57  }
58  }
59 
60  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('dcl_no_export_data_available'), true);
61  $this->ctrl->redirect($this, "listExportFiles");
62 
63  return false;
64  }
65 
66  protected function checkForAsyncEnabled(): bool
67  {
68  global $DIC;
69  if ($DIC->settings()->get('soap_user_administration', '0') === '1') {
70  return true;
71  }
72 
73  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('dcl_no_export_async_config'), true);
74  $this->ctrl->redirect($this, "listExportFiles");
75 
76  return false;
77  }
78 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
Export User Interface Class.
static http()
Fetches the global http state from ILIAS.
createExportFile()
overwrite to check if exportable fields are available (for async xls export)