19 declare(strict_types=1);
32 public function getFileInfoForUsers(): array
35 $page_count = $this->
getFileObj()->getPageCount();
36 $page_count = ($page_count !== 0) ? $page_count :
null;
40 if ($preview_renderer->has() && !$this->
getCtrl()->isAsynch()) {
41 $preview = $preview_renderer->getRenderedTriggerComponents(
true);
52 $this->
getLanguage()->txt(
"size") => (string) $data_size,
53 $this->
getLanguage()->txt(
"page_count") => $page_count,
64 public function getFileInfoForAll(): array
67 $version_nr = $this->
getFileObj()->getVersion();
76 $version_uploader =
$version[
"user_id"] ?? -1;
78 $download_link_tpl =
null;
79 if ($this->getAccessHandler()->checkAccessOfUser(
85 $download_link_tpl =
new ilTemplate(
"tpl.download_link.html",
true,
true,
"components/ILIAS/File");
90 $this->
getLanguage()->txt(
"version") => $version_nr,
91 $this->
getLanguage()->txt(
"version_uploaded") => $version_date,
93 $this->
getLanguage()->txt(
"download_link") => $download_link_tpl->get(),
94 $this->
getLanguage()->txt(
"download_link") => $download_link_tpl->get(),
101 public function getFileInfoForAuthorsAndAdmins(): array
103 $amount_of_downloads =
null;
106 $amount_of_downloads = sprintf(
107 $this->
getLanguage()->txt(
"amount_of_downloads_since"),
117 $this->
getLanguage()->txt(
"amount_of_downloads") => $amount_of_downloads
127 public function getAllFileInfoForCurrentUser(): array
130 $access_handler = $this->getAccessHandler();
136 if ($access_handler->checkAccessOfUser(
137 $this->getUser()->getId(),
142 $file_info[
'for_users'] = $this->getFileInfoForUsers();
143 $file_info[
'for_all'] = $this->getFileInfoForAll();
145 if ($access_handler->checkAccessOfUser(
146 $this->getUser()->getId(),
151 $file_info[
'for_authors_and_admins'] = $this->getFileInfoForAuthorsAndAdmins();
157 abstract protected function getAccessHandler();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjFileStakeholder.
This class provides the data size with additional information to remove the work to calculate the siz...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _getPermanentDownloadLink(int $ref_id)
Gets the permanent download link for the file.