123 : void
124 {
125 $this->
help->setScreenIdComponent(
'cert');
126
127 if (!$this->certificateSettings->get('active', '0')) {
128 $this->
ctrl->redirect($this);
129 }
130
131 $this->template->setPermanentLink('cert', null, 'list');
132
134 $this->db,
135 $this->certificateLogger,
136 $this->
language->txt(
'certificate_no_object_title')
137 );
138
141 $this->
user->getId(),
142 [
143 'order_field' => explode('_', $sorting)[0],
144 'order_direction' => explode('_', $sorting)[1],
145 'language' => $this->
user->getLanguage()
146 ],
147 []
148 );
149
150 $uiComponents = [];
151
152 if (
$data[
'items'] !== []) {
154 $cards = [];
155
156 foreach ($this->sortationOptions as $fieldAndDirection => $lngVariable) {
158 }
159
160 $sortViewControl = $this->uiFactory
161 ->viewControl()
163 ->withTargetURL($this->
ctrl->getLinkTarget($this,
'applySortation'),
'sort_by');
164
165 $uiComponents[] = $sortViewControl;
166
167 foreach (
$data[
'items'] as $certificateData) {
168 $tile_image_identification = $certificateData['tile_image_ident'] ?? '';
169 $imagePath = '';
170 if ($tile_image_identification === '' || $tile_image_identification === '-') {
171 $tile_image_identification = $certificateData['tile_image_path'] ?? '';
172 if ($tile_image_identification !==
'' && $this->
filesystem->has($tile_image_identification)) {
175 );
176 }
177 } else {
178 $tile_image_rid = $this->irss->manage()->find($tile_image_identification);
180 $imagePath = $this->irss->consume()->src($tile_image_rid)->getSrc(true);
181 }
182 }
183
184 if ($imagePath === '') {
186 }
187
188 $cardImage = $this->uiFactory->image()->standard(
189 $imagePath,
190 $certificateData['title']
191 );
192
193 $sections = [];
194
195 if ($certificateData['description'] !== '') {
196 $sections[] = $this->uiFactory->listing()->descriptive([
197 $this->
language->txt(
'cert_description_label') => $certificateData[
'description']
198 ]);
199 }
200
203 $sections[] = $this->uiFactory->listing()->descriptive([
206 )
207 ]);
209
210 $objectTypeIcon = $this->uiFactory
211 ->symbol()
212 ->icon()
213 ->standard($certificateData['obj_type'], $certificateData['obj_type'])
214 ;
215
216 $objectTitle = $certificateData['title'];
218 foreach ($refIds as
$refId) {
219 if ($this->
access->checkAccess(
'read',
'', $refId)) {
220 $objectTitle = $this->uiRenderer->render(
221 $this->uiFactory->link()->standard($objectTitle, ilLink::_getLink(
$refId))
222 );
223
224 break;
225 }
226 }
227
228 $sections[] = $this->uiFactory->listing()->descriptive([$this->
language->txt(
'cert_object_label') => implode(
229 '',
230 [
231 $this->uiRenderer->render($objectTypeIcon),
232 $objectTitle
233 ]
234 )
235 ]);
236
237 $this->
ctrl->setParameter($this,
'certificate_id', $certificateData[
'id']);
238 $downloadHref = $this->
ctrl->getLinkTarget($this,
'download');
239 $this->
ctrl->clearParameters($this);
240 $sections[] = $this->uiFactory->button()->standard('Download', $downloadHref);
241
242 $card = $this->uiFactory
243 ->card()
244 ->standard($certificateData['title'], $cardImage)
245 ->withSections($sections)
246 ;
247
248 $cards[] = $card;
249 }
250
251 $deck = $this->uiFactory->deck($cards)->withSmallCardsSize();
252
253 $uiComponents[] = $this->uiFactory->divider()->horizontal();
254
255 $uiComponents[] = $deck;
256 } else {
257 $this->
template->setOnScreenMessage(
'info', $this->
language->txt(
'cert_currently_no_certs'));
258 }
259
260 $this->template->setContent($this->uiRenderer->render($uiComponents));
261 }
Class ResourceIdentification.
static useRelativeDates()
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static _getAllReferences(int $id)
get all reference ids for object ID
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static signFile(string $path_to_file)