ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
GetFileInfoResponse.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
30{
31 public function __construct(
32 Revision $revision,
33 int $current_user_id,
34 bool $editable = false
35 ) {
36 $URI = new URI(ILIAS_HTTP_PATH);
37 $origin = $URI->getSchema() . '://' . $URI->getHost();
38 $lookup_name = \ilObjUser::_lookupName($current_user_id);
39
40 $title = preg_replace('/\.[^.]*$/', '', $revision->getTitle())
41 . '.' . $revision->getInformation()->getSuffix();
42
44 self::BASE_FILE_NAME => $title,
45 self::VERSION => $revision->getVersionNumber(),
46 self::OWNER_ID => $revision->getOwnerId(),
47 self::USER_ID => $current_user_id,
48 self::SIZE => $revision->getInformation()->getSize(),
49 self::SUPPORTS_CONTAINERS => false,
50 self::SUPPORTS_DELETE_FILE => false,
51 self::SUPPORTS_UPDATE => true,
52 self::READ_ONLY => !$editable,
53 self::RESTRICTED_WEB_VIEW_ONLY => true,
54 self::USER_CAN_WRITE => $editable,
55 self::USER_FRIENDLY_NAME => $lookup_name['firstname'] . ' ' . $lookup_name['lastname'],
56 self::USER_CAN_ATTEND => true,
57 self::LAST_MODIFIED_TIME => $revision->getInformation()->getCreationDate()->format(DATE_ATOM),
58 self::USER_CAN_NOT_WRITE_RELATIVE => true,
59 self::POST_MESSAGE_ORIGIN => $origin,
60 self::CLOSE_BUTTON_CLOSES_WINDOW => false,
61 self::CLOSE_URL => '#',
62 self::EDIT_MODE_POST_MESSAGE => true,
63 self::EDIT_NOTIFICATION_POST_MESSAGE => true,
64 self::CLOSE_POST_MESSAGE => true,
65 self::SUPPORTS_LOCKS => false,
66 self::SUPPORTS_GET_LOCK => false,
67 self::USER_CAN_RENAME => false
68 ]);
69 }
70}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
__construct(Revision $revision, int $current_user_id, bool $editable=false)
static _lookupName(int $a_user_id)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc