ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\components\WOPI\Handler\GetFileInfoResponse Class Reference
+ Inheritance diagram for ILIAS\components\WOPI\Handler\GetFileInfoResponse:
+ Collaboration diagram for ILIAS\components\WOPI\Handler\GetFileInfoResponse:

Public Member Functions

 __construct (Revision $revision, int $current_user_id, bool $editable=false)
 
- Public Member Functions inherited from ILIAS\components\WOPI\Handler\Response
 __construct (private array $data)
 
 jsonSerialize ()
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\components\WOPI\Handler\Response
const BASE_FILE_NAME = 'BaseFileName'
 
const VERSION = 'Version'
 
const OWNER_ID = 'OwnerId'
 
const USER_ID = 'UserId'
 
const SIZE = 'Size'
 
const SUPPORTS_CONTAINERS = 'SupportsContainers'
 
const SUPPORTS_DELETE_FILE = 'SupportsDeleteFile'
 
const SUPPORTS_UPDATE = 'SupportsUpdate'
 
const READ_ONLY = 'ReadOnly'
 
const LAST_MODIFIED_TIME = 'LastModifiedTime'
 
const USER_CAN_ATTEND = 'UserCanAttend'
 
const USER_FRIENDLY_NAME = 'UserFriendlyName'
 
const USER_CAN_WRITE = 'UserCanWrite'
 
const RESTRICTED_WEB_VIEW_ONLY = 'RestrictedWebViewOnly'
 
const USER_CAN_NOT_WRITE_RELATIVE = 'UserCanNotWriteRelative'
 
const POST_MESSAGE_ORIGIN = 'PostMessageOrigin'
 
const CLOSE_BUTTON_CLOSES_WINDOW = 'CloseButtonClosesWindow'
 
const CLOSE_URL = 'CloseUrl'
 
const EDIT_MODE_POST_MESSAGE = 'EditModePostMessage'
 
const EDIT_NOTIFICATION_POST_MESSAGE = 'EditNotificationPostMessage'
 
const CLOSE_POST_MESSAGE = 'ClosePostMessage'
 
const SUPPORTS_LOCKS = 'SupportsLocks'
 
const SUPPORTS_GET_LOCK = 'SupportsGetLock'
 
const USER_CAN_RENAME = 'UserCanRename'
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 29 of file GetFileInfoResponse.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\WOPI\Handler\GetFileInfoResponse::__construct ( Revision  $revision,
int  $current_user_id,
bool  $editable = false 
)

Definition at line 31 of file GetFileInfoResponse.php.

References ILIAS\GlobalScreen\Provider\__construct(), ilObjUser\_lookupName(), ILIAS\ResourceStorage\Revision\Revision\getInformation(), ILIAS\ResourceStorage\Revision\Revision\getOwnerId(), ILIAS\ResourceStorage\Revision\Revision\getTitle(), and ILIAS\ResourceStorage\Revision\Revision\getVersionNumber().

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  }
static _lookupName(int $a_user_id)
lookup user name
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

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