ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\LegalDocuments\Provide\ProvideHistory Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\Provide\ProvideHistory:

Public Member Functions

 __construct (private readonly string $id, private readonly HistoryRepository $repository, private readonly ProvideDocument $document, private readonly Container $container, ?Closure $create_table_gui=null)
 
 table (object $gui, string $command, string $reset_command, string $auto_complete_command)
 
 acceptDocument (ilObjUser $user, Document $document)
 
 alreadyAccepted (ilObjUser $user, Document $document)
 
 acceptedVersion (ilObjUser $user)
 
 currentDocumentOfAcceptedVersion (ilObjUser $user)
 

Private Attributes

readonly Closure $create_table_gui
 

Detailed Description

Definition at line 36 of file ProvideHistory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Provide\ProvideHistory::__construct ( private readonly string  $id,
private readonly HistoryRepository  $repository,
private readonly ProvideDocument  $document,
private readonly Container  $container,
?Closure  $create_table_gui = null 
)
Parameters
null|Closure(object,string,TableInterface)Table $create_table_gui

Definition at line 44 of file ProvideHistory.php.

50  {
51  $this->create_table_gui = $create_table_gui ?? fn($gui, $command, $t) => new Table($gui, $command, $t);
52  }

Member Function Documentation

◆ acceptDocument()

ILIAS\LegalDocuments\Provide\ProvideHistory::acceptDocument ( ilObjUser  $user,
Document  $document 
)

Definition at line 76 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

76  : void
77  {
78  $this->repository->acceptDocument($user, $document);
79  }
+ Here is the call graph for this function:

◆ acceptedVersion()

ILIAS\LegalDocuments\Provide\ProvideHistory::acceptedVersion ( ilObjUser  $user)
Returns
Result<DocumentContent>

Definition at line 89 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

89  : Result
90  {
91  return $this->repository->acceptedVersion($user);
92  }
+ Here is the call graph for this function:

◆ alreadyAccepted()

ILIAS\LegalDocuments\Provide\ProvideHistory::alreadyAccepted ( ilObjUser  $user,
Document  $document 
)

Definition at line 81 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

81  : bool
82  {
83  return $this->repository->alreadyAccepted($user, $document);
84  }
+ Here is the call graph for this function:

◆ currentDocumentOfAcceptedVersion()

ILIAS\LegalDocuments\Provide\ProvideHistory::currentDocumentOfAcceptedVersion ( ilObjUser  $user)
Returns
Result<Document>

Definition at line 97 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

97  : Result
98  {
99  return $this->repository->currentDocumentOfAcceptedVersion($user);
100  }
+ Here is the call graph for this function:

◆ table()

ILIAS\LegalDocuments\Provide\ProvideHistory::table ( object  $gui,
string  $command,
string  $reset_command,
string  $auto_complete_command 
)

Definition at line 54 of file ProvideHistory.php.

References ILIAS\LegalDocuments\Provide\ProvideHistory\$create_table_gui, ilObjUser\_lookupLogin(), ILIAS\LegalDocuments\Provide\document(), and ILIAS\UI\examples\Deck\repository().

54  : Component
55  {
56  $auto_complete_link = $this->container->ctrl()->getLinkTarget($gui, $auto_complete_command, '', true);
57  $ui = new UI($this->id, $this->container->ui(), $this->container->language());
58  $modal = new DocumentModal($this->container->ui(), $this->document->contentAsComponent(...));
59  $create = fn(string $class, ...$args) => $class === ilObjUser::class && !ilObjUser::_lookupLogin($args[0], 'login') ?
60  null :
61  new $class(...$args);
62 
63  $table = ($this->create_table_gui)($gui, $command, new HistoryTable(
64  $this->repository,
65  $this->document,
66  $reset_command,
67  $auto_complete_link,
68  $ui,
69  $modal,
70  $create
71  ));
72 
73  return $this->container->ui()->factory()->legacy($table->getHTML());
74  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

Field Documentation

◆ $create_table_gui

readonly Closure ILIAS\LegalDocuments\Provide\ProvideHistory::$create_table_gui
private

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