ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\Table\EditableDocumentTable Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\Table\EditableDocumentTable:
+ Collaboration diagram for ILIAS\LegalDocuments\Table\EditableDocumentTable:

Public Member Functions

 __construct (private readonly DocumentTable $table, private readonly EditLinks $edit_links)
 
 columns ()
 
 config (TableConfig $config)
 
 rows (TableSelection $select)
 
 row (Document $document, int $sorting)
 
 name ()
 

Private Member Functions

 willShowCriterion ($document)
 
 orderInputGui ($document, $step)
 

Detailed Description

Definition at line 32 of file EditableDocumentTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Table\EditableDocumentTable::__construct ( private readonly DocumentTable  $table,
private readonly EditLinks  $edit_links 
)

Definition at line 34 of file EditableDocumentTable.php.

37  {
38  }

Member Function Documentation

◆ columns()

ILIAS\LegalDocuments\Table\EditableDocumentTable::columns ( )
Returns
array<string, list<string>>

Implements ILIAS\LegalDocuments\Table.

Definition at line 40 of file EditableDocumentTable.php.

40  : array
41  {
42  return [
43  'delete' => [' ', '', '1%', true],
44  ...$this->table->columns(),
45  'actions' => [$this->table->ui()->txt('actions'), '', '10%'],
46  ];
47  }

◆ config()

ILIAS\LegalDocuments\Table\EditableDocumentTable::config ( TableConfig  $config)

Implements ILIAS\LegalDocuments\Table.

Definition at line 49 of file EditableDocumentTable.php.

References ILIAS\LegalDocuments\TableConfig\addCommandButton(), and ILIAS\LegalDocuments\TableConfig\addMultiCommand().

49  : void
50  {
51  $config->addMultiCommand('deleteDocuments', $this->table->ui()->txt('delete'));
52  $config->addCommandButton('saveOrder', $this->table->ui()->txt('sorting_save'));
53  $this->table->config($config);
54  }
+ Here is the call graph for this function:

◆ name()

ILIAS\LegalDocuments\Table\EditableDocumentTable::name ( )

Implements ILIAS\LegalDocuments\Table.

Definition at line 78 of file EditableDocumentTable.php.

78  : string
79  {
80  return self::class;
81  }

◆ orderInputGui()

ILIAS\LegalDocuments\Table\EditableDocumentTable::orderInputGui (   $document,
  $step 
)
private

Definition at line 106 of file EditableDocumentTable.php.

Referenced by ILIAS\LegalDocuments\Table\EditableDocumentTable\row().

106  : Closure
107  {
108  $input = $this->table->orderInputGui($document, $step);
109  $input->setDisabled(false);
110 
111  return $input->render(...);
112  }
+ Here is the caller graph for this function:

◆ row()

ILIAS\LegalDocuments\Table\EditableDocumentTable::row ( Document  $document,
int  $sorting 
)

Definition at line 61 of file EditableDocumentTable.php.

References ilLegacyFormElementsUtil\formCheckbox(), ILIAS\LegalDocuments\Value\Document\id(), and ILIAS\LegalDocuments\Table\EditableDocumentTable\orderInputGui().

Referenced by ILIAS\LegalDocuments\Table\EditableDocumentTable\rows().

61  : array
62  {
63  $link = $this->table->ui()->create()->link()->standard(...);
64 
65  return [
66  'delete' => fn() => ilLegacyFormElementsUtil::formCheckbox(false, 'ids[]', (string) $document->id()),
67  'order' => $this->orderInputGui($document, $sorting),
68  ...array_slice($this->table->row($document, $sorting), 1),
69  'criteria' => $this->table->showCriteria($document, $this->willShowCriterion($document)),
70  'actions' => $this->table->ui()->create()->dropdown()->standard([
71  $link($this->table->ui()->txt('edit'), $this->edit_links->editDocument($document)),
72  $link($this->table->ui()->txt('tbl_docs_action_add_criterion'), $this->edit_links->addCriterion($document)),
73  $link($this->table->ui()->txt('delete'), $this->edit_links->deleteDocument($document)),
74  ]),
75  ];
76  }
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rows()

ILIAS\LegalDocuments\Table\EditableDocumentTable::rows ( TableSelection  $select)
Returns
list<array<string, string|Closure(): string>>

Implements ILIAS\LegalDocuments\Table.

Definition at line 56 of file EditableDocumentTable.php.

References ILIAS\LegalDocuments\Table\EditableDocumentTable\row().

56  : array
57  {
58  return $this->table->mapSelection($this->row(...), $select);
59  }
+ Here is the call graph for this function:

◆ willShowCriterion()

ILIAS\LegalDocuments\Table\EditableDocumentTable::willShowCriterion (   $document)
private

Definition at line 83 of file EditableDocumentTable.php.

83  : Closure
84  {
85  return function (Criterion $criterion) use ($document) {
86  $modal = $this->table->ui()->create()->modal()->interruptive(
87  $this->table->ui()->txt('doc_detach_crit_confirm_title'),
88  $this->table->ui()->txt('doc_sure_detach_crit'),
89  $this->edit_links->deleteCriterion($document, $criterion)
90  );
91 
92  return [
93  $this->table->ui()->create()->legacy('<div style="display: flex">'),
94  $this->table->criterionName($criterion),
95  $this->table->ui()->create()->legacy('&nbsp;'),
96  $modal,
97  $this->table->ui()->create()->dropdown()->standard([
98  $this->table->ui()->create()->link()->standard($this->table->ui()->txt('edit'), $this->edit_links->editCriterion($document, $criterion)),
99  $this->table->ui()->create()->button()->shy($this->table->ui()->txt('delete'), '')->withOnClick($modal->getShowSignal()),
100  ]),
101  $this->table->ui()->create()->legacy('</div>'),
102  ];
103  };
104  }

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